mirror of
https://github.com/algora-io/tv.git
synced 2024-12-06 01:03:34 +02:00
446efb3c62
* use typescript * fix typing issues * update tailwind config * upgrade deps * update comment
26 lines
643 B
TypeScript
26 lines
643 B
TypeScript
import { type Channel } from "phoenix";
|
|
import { type LiveSocket } from "phoenix_live_view";
|
|
|
|
interface PhxEvent extends Event {
|
|
target: Element;
|
|
detail: Record<string, any>;
|
|
}
|
|
|
|
type PhxEventKey = `js:${string}` | `phx:${string}`;
|
|
|
|
declare global {
|
|
interface Window {
|
|
liveSocket: LiveSocket;
|
|
userToken?: string;
|
|
channel?: Channel;
|
|
addEventListener<K extends keyof WindowEventMap | PhxEventKey>(
|
|
type: K,
|
|
listener: (
|
|
this: Window,
|
|
ev: K extends keyof WindowEventMap ? WindowEventMap[K] : PhxEvent
|
|
) => any,
|
|
options?: boolean | AddEventListenerOptions | undefined
|
|
): void;
|
|
}
|
|
}
|