diff --git a/docs/assets/ts/artplayer.d.ts b/docs/assets/ts/artplayer.d.ts index 7145c8b89..b058c0052 100644 --- a/docs/assets/ts/artplayer.d.ts +++ b/docs/assets/ts/artplayer.d.ts @@ -547,7 +547,7 @@ declare class Player { } declare class Artplayer extends Player { - constructor(option: Option, readyCallback: (this: Artplayer) => void); + constructor(option: Option, readyCallback?: (this: Artplayer) => void); static instances: Artplayer[]; static version: string; diff --git a/packages/artplayer/types/artplayer.d.ts b/packages/artplayer/types/artplayer.d.ts index 7145c8b89..b058c0052 100644 --- a/packages/artplayer/types/artplayer.d.ts +++ b/packages/artplayer/types/artplayer.d.ts @@ -547,7 +547,7 @@ declare class Player { } declare class Artplayer extends Player { - constructor(option: Option, readyCallback: (this: Artplayer) => void); + constructor(option: Option, readyCallback?: (this: Artplayer) => void); static instances: Artplayer[]; static version: string; diff --git a/test/types.test.ts b/test/types.test.ts new file mode 100644 index 000000000..c8a90d6c7 --- /dev/null +++ b/test/types.test.ts @@ -0,0 +1,6 @@ +import Artplayer from '../packages/artplayer/types/artplayer'; + +const art = new Artplayer({ + container: '.artplayer-app', + url: './assets/sample/video.mp4', +});