mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-27 17:51: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,57 @@
|
||||
export interface Config {
|
||||
properties: string[]
|
||||
methods: string[]
|
||||
events: string[]
|
||||
prototypes: string[]
|
||||
}
|
||||
|
||||
export type Disposer = () => void
|
||||
export type Listener = EventListenerOrEventListenerObject | null
|
||||
|
||||
export interface EventRegistry {
|
||||
destroyEvents: Set<Disposer>
|
||||
proxy: {
|
||||
(target: EventTarget, name: string, callback: Listener, option?: boolean | AddEventListenerOptions | null): Disposer
|
||||
(target: EventTarget, name: string[], callback: Listener, option?: boolean | AddEventListenerOptions | null): Disposer[]
|
||||
(target: EventTarget, name: string | string[], callback: Listener, option?: boolean | AddEventListenerOptions | null): Disposer | Disposer[]
|
||||
}
|
||||
hover: (target: EventTarget, mouseenter?: (event: Event) => unknown, mouseleave?: (event: Event) => unknown) => void
|
||||
remove: (dispose: Disposer) => void
|
||||
destroy: () => void
|
||||
bindGlobalEvents: (source?: { window?: Window, document?: Document }) => void
|
||||
}
|
||||
|
||||
export interface Storage {
|
||||
name: string
|
||||
settings: Record<PropertyKey, unknown>
|
||||
get: (key?: PropertyKey) => unknown
|
||||
set: (key: PropertyKey, value: unknown) => void
|
||||
del: (key: PropertyKey) => void
|
||||
clear: () => void
|
||||
}
|
||||
|
||||
export type Dictionary = Record<string, string | undefined>
|
||||
export type Languages = Record<string, Dictionary | undefined>
|
||||
|
||||
export interface I18n<Host> {
|
||||
art: Host
|
||||
languages: Languages
|
||||
language: Dictionary
|
||||
init: () => void
|
||||
get: (key: string) => string
|
||||
update: (value: Languages) => void
|
||||
}
|
||||
|
||||
export type HotkeyCallback<Host> = (this: Host, event: KeyboardEvent) => unknown
|
||||
|
||||
export interface Hotkey<Host> {
|
||||
art: Host
|
||||
keys: Record<string, HotkeyCallback<Host>[]>
|
||||
init: () => void
|
||||
add: (key: string, callback: HotkeyCallback<Host>) => this
|
||||
remove: (key: string, callback: HotkeyCallback<Host>) => this
|
||||
}
|
||||
|
||||
export type ValidatorPath = (string | number)[]
|
||||
export type Validator = (value: unknown, type: string, paths: ValidatorPath) => unknown
|
||||
export type Scheme = string | Validator | Scheme[] | { [key: string]: Scheme }
|
||||
Reference in new issue
Block a user