eject/wish player

This commit is contained in:
2023-07-01 17:58:17 +01:00
parent 05bf4cbfa6
commit cbc49a0def
9 changed files with 1769 additions and 3937 deletions

32
src/wish/events.ts Normal file
View File

@ -0,0 +1,32 @@
interface StateEventMap {
log: CustomEvent<LogEvent>;
status: CustomEvent<StatusEvent>;
}
interface StateEventTarget extends EventTarget {
addEventListener<K extends keyof StateEventMap>(
type: K,
listener: (ev: StateEventMap[K]) => void,
options?: boolean | AddEventListenerOptions
): void;
addEventListener(
type: string,
callback: EventListenerOrEventListenerObject | null,
options?: EventListenerOptions | boolean
): void;
}
export const TypedEventTarget = EventTarget as {
new (): StateEventTarget;
prototype: StateEventTarget;
};
export interface LogEvent {
message: string;
}
export interface StatusEvent {
status: Status;
}
export type Status = "connected" | "disconnected";