mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-25 16:11:20 -08:00
refactor(core): [CORE-21] generate compatible public and editor declarations
This commit is contained in:
1 parent
ee895a558f
commit
faaa3e8c2d
123 files changed
+31305
-1712
No files matched your search
@@ -0,0 +1,13 @@
|
||||
export type PluginFactory<Host, Result = unknown> = (this: Host, art: Host) => Result
|
||||
|
||||
export type PluginRegistration<Result, Registry>
|
||||
= unknown extends Result ? Registry | Promise<Registry>
|
||||
: Result extends Promise<unknown> ? Promise<Registry> : Registry
|
||||
|
||||
/** The same registry is returned immediately or after its Promise factory settles. */
|
||||
export interface Plugins<Host> {
|
||||
art: Host
|
||||
id: number
|
||||
add: <Result>(plugin: PluginFactory<Host, Result>) => PluginRegistration<Result, this>
|
||||
next: (plugin: PluginFactory<Host>, result: unknown) => this
|
||||
}
|
||||
Reference in new issue
Block a user