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" { 2import type { FileReply } from "ext:file/errors.js" ; 3 4export type HttpFilePrepared = [ status :number , headers :[ name :string , value :string ][], id :number | null ]; 5 6export type HttpFileRead = [ bytes :Uint8Array < ArrayBuffer >, done :boolean ]; 7 8export function op_http_file_handle ( args :[ id :number , consume :boolean ]) :FileReply < number >; 9export function op_http_serve_file ( 10args :[ 11method :string , 12requestHeaders :[ name :string , value :string ][], 13source :string | number , 14extraHeaders :[ name :string , value :string ][], 15], 16) :Promise < FileReply < HttpFilePrepared >>; 17export function op_http_file_read ( id :number ) :Promise < FileReply < HttpFileRead >>; 18export function op_http_file_close ( id :number ) :null ; 19export function op_http_respond_file ( 20args :[ id :number , status :number , headers :[ name :string , value :string ][], fileId :number ], 21) :boolean ; 22}