mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-21 12:41:20 -08:00
feat: add danmuku plugin documentation and i18n setup guide
- Created a new documentation file for the danmuku plugin with code examples. - Added comprehensive language settings documentation, including default languages, importing languages, adding new languages, and modifying existing languages. - Updated the i18n setup guide to reflect changes in language handling and provide code snippets for implementation.
This commit is contained in:
1 parent
ea34eda07b
commit
8b32f050a0
42 files changed
+82
-88
No files matched your search
Vendored
+13
-16
@@ -640,11 +640,11 @@ export interface Option {
|
||||
/**
|
||||
* Other video attribute
|
||||
*/
|
||||
moreVideoAttr?: Partial<{
|
||||
[key in keyof HTMLVideoElement as HTMLVideoElement[key] extends (...args: unknown[]) => unknown
|
||||
moreVideoAttr?: Partial<Readonly<{
|
||||
[K in keyof HTMLVideoElement as HTMLVideoElement[K] extends (...args: unknown[]) => unknown
|
||||
? never
|
||||
: key]: HTMLVideoElement[key]
|
||||
}>
|
||||
: K]: HTMLVideoElement[K]
|
||||
}>>
|
||||
|
||||
/**
|
||||
* Custom i18n
|
||||
@@ -1153,8 +1153,8 @@ export default class Artplayer extends Player {
|
||||
static readonly build: string
|
||||
static readonly config: Config
|
||||
static readonly utils: Utils
|
||||
static readonly scheme: Record<keyof Option, any>
|
||||
static readonly Emitter: new (...args: any[]) => any
|
||||
static readonly scheme: Record<keyof Option, unknown>
|
||||
static readonly Emitter: new (...args: unknown[]) => unknown
|
||||
static readonly validator: <T extends object>(option: T, scheme: object) => T
|
||||
static readonly kindOf: (item: unknown) => string
|
||||
static readonly html: Artplayer['template']['html']
|
||||
@@ -1211,24 +1211,22 @@ export default class Artplayer extends Player {
|
||||
torrent?: unknown
|
||||
|
||||
on<T extends keyof Events>(name: T, fn: (...args: Events[T]) => unknown, ctx?: object): this
|
||||
on(name: string, fn: (...args: any[]) => unknown, ctx?: object): this
|
||||
on(name: string, fn: (...args: unknown[]) => unknown, ctx?: object): this
|
||||
|
||||
once<T extends keyof Events>(name: T, fn: (...args: Events[T]) => unknown, ctx?: object): this
|
||||
once(name: string, fn: (...args: any[]) => unknown, ctx?: object): this
|
||||
once(name: string, fn: (...args: unknown[]) => unknown, ctx?: object): this
|
||||
|
||||
emit<T extends keyof Events>(name: T, ...args: Events[T]): this
|
||||
emit(name: string, ...args: any[]): this
|
||||
emit(name: string, ...args: unknown[]): this
|
||||
|
||||
off<T extends keyof Events>(name: T, callback?: (...args: Events[T]) => unknown): this
|
||||
off(name: string, callback?: (...args: any[]) => unknown): this
|
||||
off(name: string, callback?: (...args: unknown[]) => unknown): this
|
||||
|
||||
query: Artplayer['template']['query']
|
||||
proxy: Artplayer['events']['proxy']
|
||||
video: Artplayer['template']['$video']
|
||||
|
||||
e: {
|
||||
[K in keyof Events]?: { fn: (...args: Events[K]) => any, ctx: unknown }[]
|
||||
}
|
||||
e: { [K in keyof Events]?: { fn: (...args: Events[K]) => unknown, ctx: unknown }[] }
|
||||
|
||||
destroy(removeHtml?: boolean): void
|
||||
|
||||
@@ -1307,10 +1305,9 @@ export default class Artplayer extends Player {
|
||||
|
||||
readonly plugins: {
|
||||
add: (
|
||||
plugin: (this: Artplayer, art: Artplayer) => any | Promise<any>,
|
||||
plugin: (this: Artplayer, art: Artplayer) => unknown | Promise<unknown>,
|
||||
) => Promise<Artplayer['plugins']> | Artplayer['plugins']
|
||||
[pluginName: string]: any
|
||||
}
|
||||
} & Record<string, unknown>
|
||||
}
|
||||
|
||||
export = Artplayer;
|
||||
|
||||
Reference in new issue
Block a user