char/avril

(wip) why'd you have to go and make things so complicaaaaated?

git clone https://git.t4t.associates/char/avril

Charlotte Somport websocket extension to typescriptec3de1c

main
835 B17 linesraw
1declare module "ext:core/ops" {
2  export type WebSocketEvent =
3    | { kind: "open"; protocol: string }
4    | { kind: "text"; data: string }
5    | { kind: "binary"; data: Uint8Array<ArrayBuffer> }
6    | { kind: "error"; message: string }
7    | { kind: "closing" }
8    | { kind: "close"; clean: boolean; code: number; reason: string };
9  export function op_ws_create(args: [url: string, protocols: string[], userAgent: string]): number;
10  export function op_ws_send(
11    args: [id: number, text: boolean, bytes: Uint8Array<ArrayBuffer> | null],
12  ): Promise<boolean>;
13  export function op_ws_close(args: [id: number, code: number | null, reason: string | null]): null;
14  export function op_ws_fail(id: number): null;
15  export function op_ws_retire(id: number): null;
16  export function op_ws_wait(id: number): Promise<WebSocketEvent>;
17}