char/avril
(wip) why'd you have to go and make things so complicaaaaated?
git clone https://git.t4t.associates/char/avril
495c9a5
main
1declare module"ext:core/ops" { 2export type HttpAddress = 3| { transport :"tcp" ; hostname :string ; port :number } 4| { transport :"unix" ; path :string | null }; 5export type HttpListener = [ id :number , address :HttpAddress ]; 6export type HttpRequestMetadata = [ 7id :number , 8method :string , 9url :string , 10headers :[ name :string , value :string ][], 11hasBody :boolean , 12remote :HttpAddress , 13]; 14export function op_http_listen ( address :HttpAddress & { __proto__ ?:null }) :HttpListener ; 15export function op_http_cli_listen ( unit :null ) :HttpListener ; 16export function op_http_next ( id :number ) :Promise < HttpRequestMetadata | null >; 17export function op_http_finished ( id :number ) :Promise < null >; 18export function op_http_stop ( args :[ id :number , force :boolean ]) :null ; 19export function op_http_read ( id :number ) :Promise < Uint8Array < ArrayBuffer > | null >; 20export function op_http_respond ( 21args :[ 22id :number , 23status :number , 24headers :[ name :string , value :string ][], 25bytes :Uint8Array < ArrayBuffer > | null , 26streaming :boolean , 27], 28) :boolean ; 29export function op_http_write ( args :[ id :number , bytes :Uint8Array < ArrayBuffer > | null ]) :Promise < boolean >; 30export function op_http_wait ( id :number ) :Promise < boolean >; 31export function op_http_upgrade ( 32args :[ id :number , protocol :string | null ], 33) :[ socket :number , headers :[ name :string , value :string ][]]; 34export function op_http_cancel ( id :number ) :null ; 35}