UNPKG

1.36 kBTypeScriptView Raw
1type UndiciHeadersInit = string[][] | Record<string, string | readonly string[]> | Headers;
2type UndiciBodyInit = ArrayBuffer | AsyncIterable<Uint8Array> | Blob | FormData | Iterable<Uint8Array> | ArrayBufferView | URLSearchParams | null | string;
3type UndiciRequestRedirect = 'error' | 'follow' | 'manual';
4type UndiciRequestCredentials = 'omit' | 'include' | 'same-origin';
5type UndiciReferrerPolicy = '' | 'no-referrer' | 'no-referrer-when-downgrade' | 'origin' | 'origin-when-cross-origin' | 'same-origin' | 'strict-origin' | 'strict-origin-when-cross-origin' | 'unsafe-url';
6type UndiciRequestMode = 'cors' | 'navigate' | 'no-cors' | 'same-origin';
7type UndiciRequestInit = {
8 method?: string;
9 keepalive?: boolean;
10 headers?: UndiciHeadersInit;
11 body?: UndiciBodyInit;
12 redirect?: UndiciRequestRedirect;
13 integrity?: string;
14 signal?: AbortSignal | undefined;
15 credentials?: UndiciRequestCredentials;
16 mode?: UndiciRequestMode;
17 referrer?: string;
18 referrerPolicy?: UndiciReferrerPolicy;
19 window?: undefined;
20 dispatcher?: unknown;
21 duplex?: unknown;
22};
23type CombinedRequestInit = globalThis.RequestInit & UndiciRequestInit;
24export type RequestInitRegistry = {
25 [K in keyof CombinedRequestInit]-?: true;
26};
27export type KyRequest<T = unknown> = {
28 json: <J = T>() => Promise<J>;
29} & Request;
30export {};