char/avril
(wip) why'd you have to go and make things so complicaaaaated?
git clone https://git.t4t.associates/char/avril
ec3de1c
main
1declare module"ext:core/ops" { 2export 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 }; 9export function op_ws_create ( args :[ url :string , protocols :string [], userAgent :string ]) :number ; 10export function op_ws_send ( 11args :[ id :number , text :boolean , bytes :Uint8Array < ArrayBuffer > | null ], 12) :Promise < boolean >; 13export function op_ws_close ( args :[ id :number , code :number | null , reason :string | null ]) :null ; 14export function op_ws_fail ( id :number ) :null ; 15export function op_ws_retire ( id :number ) :null ; 16export function op_ws_wait ( id :number ) :Promise < WebSocketEvent >; 17}