@shockpkg/core
Version:
shockpkg core
1 lines • 966 B
Source Map (JSON)
{"version":3,"file":"types.mjs","names":[],"sources":["../src/types.ts"],"sourcesContent":["import {ReadableStream} from 'node:stream/web';\n\nexport interface IFetchRequestHeaders {\n\t[header: string]: string;\n}\n\nexport interface IFetchRequestInit {\n\t/**\n\t * Request headers.\n\t */\n\theaders?: {[header: string]: string};\n}\n\nexport interface IFetchResponseHeaders {\n\t/**\n\t * Get header case-insensitive.\n\t */\n\tget(header: string): string | null;\n}\n\nexport interface IFetchResponse {\n\t/**\n\t * Response status code.\n\t */\n\tstatus: number;\n\n\t/**\n\t * Response headers.\n\t */\n\theaders: IFetchResponseHeaders;\n\n\t/**\n\t * Response body as a readable stream.\n\t */\n\tbody: ReadableStream | NodeJS.ReadableStream;\n\n\t/**\n\t * Response body as text.\n\t */\n\ttext: () => Promise<string>;\n}\n\nexport type IFetch = (\n\turl: string,\n\tinit?: IFetchRequestInit\n) => Promise<IFetchResponse>;\n"],"mappings":"","ignoreList":[]}