Skip to content

Commit 8366b06

Browse files
committedMay 27, 2024·
chore: Update Artplayer option type imports and usage
1 parent ab109a1 commit 8366b06

File tree

4 files changed

+20
-10
lines changed

4 files changed

+20
-10
lines changed
 

‎packages/artplayer-vitepress/docs/en/index.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -251,13 +251,12 @@ art.current = new Artplayer();
251251

252252
### Option
253253

254-
you can also separately import the type for options
254+
You can also use the option type
255255

256-
```ts{2,4}
256+
```ts{3}
257257
import Artplayer from 'artplayer';
258-
import { type Option } from 'artplayer/types/option';
259258
260-
const option: Option = {
259+
const option: Artplayer['Option'] = {
261260
container: '.artplayer-app',
262261
url: './assets/sample/video.mp4',
263262
};

‎packages/artplayer-vitepress/docs/index.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -254,13 +254,12 @@ art.current = new Artplayer();
254254

255255
### Option
256256

257-
你也可以单独导入选项的类型
257+
你也可以使用选项的类型
258258

259-
```ts{2,4}
259+
```ts{3}
260260
import Artplayer from 'artplayer';
261-
import { type Option } from 'artplayer/types/option';
262261
263-
const option: Option = {
262+
const option: Artplayer['Option'] = {
264263
container: '.artplayer-app',
265264
url: './assets/sample/video.mp4',
266265
};

‎packages/artplayer/types/artplayer.d.ts

+13
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,19 @@ export as namespace Artplayer;
1616
declare class Artplayer extends Player {
1717
constructor(option: Option, readyCallback?: (this: Artplayer, art: Artplayer) => unknown);
1818

19+
get Config(): Config;
20+
get Events(): Events;
21+
get Utils(): Utils;
22+
get Player(): Player;
23+
get Option(): Option;
24+
get Subtitle(): Subtitle;
25+
get Icons(): Icons;
26+
get Template(): Template;
27+
get I18n(): I18n;
28+
get Setting(): Setting;
29+
get SettingOption(): SettingOption;
30+
get Component(): Component;
31+
1932
static readonly instances: Artplayer[];
2033
static readonly version: string;
2134
static readonly env: string;

‎test/types.test.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import Artplayer from '../packages/artplayer';
2-
import { type Option } from '../packages/artplayer/types/option';
32

4-
const option: Option = {
3+
const option: Artplayer['Option'] = {
54
container: '.artplayer-app',
65
url: './assets/sample/video.mp4',
76
};

0 commit comments

Comments
 (0)
Please sign in to comment.