declare module "ext:core/ops" { export type HttpAddress = | { transport: "tcp"; hostname: string; port: number } | { transport: "unix"; path: string | null }; export type HttpListener = [id: number, address: HttpAddress]; export type HttpRequestMetadata = [ id: number, method: string, url: string, headers: [name: string, value: string][], hasBody: boolean, remote: HttpAddress, ]; export function op_http_listen(address: HttpAddress & { __proto__?: null }): HttpListener; export function op_http_cli_listen(unit: null): HttpListener; export function op_http_next(id: number): Promise; export function op_http_finished(id: number): Promise; export function op_http_stop(args: [id: number, force: boolean]): null; export function op_http_read(id: number): Promise | null>; export function op_http_respond( args: [ id: number, status: number, headers: [name: string, value: string][], bytes: Uint8Array | null, streaming: boolean, ], ): boolean; export function op_http_write(args: [id: number, bytes: Uint8Array | null]): Promise; export function op_http_wait(id: number): Promise; export function op_http_upgrade( args: [id: number, protocol: string | null], ): [socket: number, headers: [name: string, value: string][]]; export function op_http_cancel(id: number): null; }