char/avril

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

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

Charlotte Somport http extension to typescript495c9a5

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