mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-11 13:56:15 -08:00
chore: Update Artplayer option type imports and usage
This commit is contained in:
1 parent
ab109a1acd
commit
8366b0673a
4 files changed
+20
-10
No files matched your search
@@ -251,13 +251,12 @@ art.current = new Artplayer();
|
||||
|
||||
### Option
|
||||
|
||||
you can also separately import the type for options
|
||||
You can also use the option type
|
||||
|
||||
```ts{2,4}
|
||||
```ts{3}
|
||||
import Artplayer from 'artplayer';
|
||||
import { type Option } from 'artplayer/types/option';
|
||||
|
||||
const option: Option = {
|
||||
const option: Artplayer['Option'] = {
|
||||
container: '.artplayer-app',
|
||||
url: './assets/sample/video.mp4',
|
||||
};
|
||||
|
||||
@@ -254,13 +254,12 @@ art.current = new Artplayer();
|
||||
|
||||
### Option
|
||||
|
||||
你也可以单独导入选项的类型
|
||||
你也可以使用选项的类型
|
||||
|
||||
```ts{2,4}
|
||||
```ts{3}
|
||||
import Artplayer from 'artplayer';
|
||||
import { type Option } from 'artplayer/types/option';
|
||||
|
||||
const option: Option = {
|
||||
const option: Artplayer['Option'] = {
|
||||
container: '.artplayer-app',
|
||||
url: './assets/sample/video.mp4',
|
||||
};
|
||||
|
||||
+13
@@ -16,6 +16,19 @@ export as namespace Artplayer;
|
||||
declare class Artplayer extends Player {
|
||||
constructor(option: Option, readyCallback?: (this: Artplayer, art: Artplayer) => unknown);
|
||||
|
||||
get Config(): Config;
|
||||
get Events(): Events;
|
||||
get Utils(): Utils;
|
||||
get Player(): Player;
|
||||
get Option(): Option;
|
||||
get Subtitle(): Subtitle;
|
||||
get Icons(): Icons;
|
||||
get Template(): Template;
|
||||
get I18n(): I18n;
|
||||
get Setting(): Setting;
|
||||
get SettingOption(): SettingOption;
|
||||
get Component(): Component;
|
||||
|
||||
static readonly instances: Artplayer[];
|
||||
static readonly version: string;
|
||||
static readonly env: string;
|
||||
|
||||
+1
-2
@@ -1,7 +1,6 @@
|
||||
import Artplayer from '../packages/artplayer';
|
||||
import { type Option } from '../packages/artplayer/types/option';
|
||||
|
||||
const option: Option = {
|
||||
const option: Artplayer['Option'] = {
|
||||
container: '.artplayer-app',
|
||||
url: './assets/sample/video.mp4',
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user