char/avril

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

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

Charlotte Somport fetch extension to typescriptf2c35fd

main
990 B26 linesraw
1declare module "ext:core/ops" {
2  export type FetchMetadata = [
3    status: number,
4    statusText: string,
5    headers: [name: string, value: string][],
6    url: string,
7    redirected: boolean,
8    abandonedUpload: boolean,
9  ];
10  export type FetchSendArgs = [
11    id: number,
12    url: string,
13    method: string,
14    headers: [name: string, value: string][],
15    bytes: Uint8Array<ArrayBuffer> | null,
16    streaming: boolean,
17    redirect: "follow" | "error" | "manual",
18  ];
19  export function op_fetch_base(): string;
20  export function op_fetch_create(unit: null): number;
21  export function op_fetch_cancel(id: number): null;
22  export function op_fetch_send(args: FetchSendArgs): Promise<FetchMetadata>;
23  export function op_fetch_read(id: number): Promise<Uint8Array<ArrayBuffer> | null>;
24  export function op_fetch_read_all(id: number): Promise<Uint8Array<ArrayBuffer>>;
25  export function op_fetch_write(args: [id: number, bytes: Uint8Array<ArrayBuffer> | null]): Promise<boolean>;
26}