better-call 0.0.0-experimental.01ff4b77
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +265 -0
- package/dist/capability.cjs +417 -0
- package/dist/capability.cjs.map +1 -0
- package/dist/capability.d.cts +189 -0
- package/dist/capability.d.mts +189 -0
- package/dist/capability.mjs +401 -0
- package/dist/capability.mjs.map +1 -0
- package/dist/error.cjs +76 -0
- package/dist/error.cjs.map +1 -0
- package/dist/error.d.cts +51 -0
- package/dist/error.d.mts +51 -0
- package/dist/error.mjs +72 -0
- package/dist/error.mjs.map +1 -0
- package/dist/fn.cjs +350 -0
- package/dist/fn.cjs.map +1 -0
- package/dist/fn.d.cts +378 -0
- package/dist/fn.d.mts +378 -0
- package/dist/fn.mjs +350 -0
- package/dist/fn.mjs.map +1 -0
- package/dist/index.cjs +43 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +50 -0
- package/dist/index.d.mts +50 -0
- package/dist/index.mjs +24 -0
- package/dist/index.mjs.map +1 -0
- package/dist/module.cjs +176 -0
- package/dist/module.cjs.map +1 -0
- package/dist/module.d.cts +283 -0
- package/dist/module.d.mts +283 -0
- package/dist/module.mjs +166 -0
- package/dist/module.mjs.map +1 -0
- package/dist/plugins/db.cjs +24 -0
- package/dist/plugins/db.cjs.map +1 -0
- package/dist/plugins/db.d.cts +18 -0
- package/dist/plugins/db.d.mts +18 -0
- package/dist/plugins/db.mjs +19 -0
- package/dist/plugins/db.mjs.map +1 -0
- package/dist/plugins/http/attrs.cjs +91 -0
- package/dist/plugins/http/attrs.cjs.map +1 -0
- package/dist/plugins/http/attrs.d.cts +26 -0
- package/dist/plugins/http/attrs.d.mts +26 -0
- package/dist/plugins/http/attrs.mjs +87 -0
- package/dist/plugins/http/attrs.mjs.map +1 -0
- package/dist/plugins/http/cookie.cjs +117 -0
- package/dist/plugins/http/cookie.cjs.map +1 -0
- package/dist/plugins/http/cookie.d.cts +637 -0
- package/dist/plugins/http/cookie.d.mts +637 -0
- package/dist/plugins/http/cookie.mjs +113 -0
- package/dist/plugins/http/cookie.mjs.map +1 -0
- package/dist/plugins/http/error.cjs +39 -0
- package/dist/plugins/http/error.cjs.map +1 -0
- package/dist/plugins/http/error.d.cts +38 -0
- package/dist/plugins/http/error.d.mts +38 -0
- package/dist/plugins/http/error.mjs +35 -0
- package/dist/plugins/http/error.mjs.map +1 -0
- package/dist/plugins/http/handle.cjs +73 -0
- package/dist/plugins/http/handle.cjs.map +1 -0
- package/dist/plugins/http/handle.d.cts +955 -0
- package/dist/plugins/http/handle.d.mts +955 -0
- package/dist/plugins/http/handle.mjs +72 -0
- package/dist/plugins/http/handle.mjs.map +1 -0
- package/dist/plugins/http/redirect.cjs +82 -0
- package/dist/plugins/http/redirect.cjs.map +1 -0
- package/dist/plugins/http/redirect.d.cts +67 -0
- package/dist/plugins/http/redirect.d.mts +67 -0
- package/dist/plugins/http/redirect.mjs +79 -0
- package/dist/plugins/http/redirect.mjs.map +1 -0
- package/dist/plugins/http/request.cjs +63 -0
- package/dist/plugins/http/request.cjs.map +1 -0
- package/dist/plugins/http/request.d.cts +142 -0
- package/dist/plugins/http/request.d.mts +142 -0
- package/dist/plugins/http/request.mjs +61 -0
- package/dist/plugins/http/request.mjs.map +1 -0
- package/dist/plugins/http/response.cjs +13 -0
- package/dist/plugins/http/response.cjs.map +1 -0
- package/dist/plugins/http/response.d.cts +18 -0
- package/dist/plugins/http/response.d.mts +18 -0
- package/dist/plugins/http/response.mjs +13 -0
- package/dist/plugins/http/response.mjs.map +1 -0
- package/dist/plugins/http.cjs +64 -0
- package/dist/plugins/http.cjs.map +1 -0
- package/dist/plugins/http.d.cts +945 -0
- package/dist/plugins/http.d.mts +945 -0
- package/dist/plugins/http.mjs +37 -0
- package/dist/plugins/http.mjs.map +1 -0
- package/dist/plugins/read-only.cjs +19 -0
- package/dist/plugins/read-only.cjs.map +1 -0
- package/dist/plugins/read-only.d.cts +17 -0
- package/dist/plugins/read-only.d.mts +17 -0
- package/dist/plugins/read-only.mjs +19 -0
- package/dist/plugins/read-only.mjs.map +1 -0
- package/dist/schema.cjs +245 -0
- package/dist/schema.cjs.map +1 -0
- package/dist/schema.d.cts +411 -0
- package/dist/schema.d.mts +411 -0
- package/dist/schema.mjs +235 -0
- package/dist/schema.mjs.map +1 -0
- package/dist/scope.d.cts +31 -0
- package/dist/scope.d.mts +31 -0
- package/dist/storage.cjs +308 -0
- package/dist/storage.cjs.map +1 -0
- package/dist/storage.d.cts +220 -0
- package/dist/storage.d.mts +220 -0
- package/dist/storage.mjs +302 -0
- package/dist/storage.mjs.map +1 -0
- package/dist/types.d.cts +8 -0
- package/dist/types.d.mts +8 -0
- package/dist/var.cjs +186 -0
- package/dist/var.cjs.map +1 -0
- package/dist/var.d.cts +46 -0
- package/dist/var.d.mts +46 -0
- package/dist/var.mjs +177 -0
- package/dist/var.mjs.map +1 -0
- package/package.json +114 -0
|
@@ -0,0 +1,955 @@
|
|
|
1
|
+
import { TypeDefination } from "../../schema.mjs";
|
|
2
|
+
import { ScopeOf } from "../../scope.mjs";
|
|
3
|
+
import { ApplyOns, Module, ModuleFns } from "../../module.mjs";
|
|
4
|
+
import { Context, Fn, FnDefination } from "../../fn.mjs";
|
|
5
|
+
import { VarDefination } from "../../var.mjs";
|
|
6
|
+
import { HttpResponse } from "./response.mjs";
|
|
7
|
+
import { HttpRequest } from "./request.mjs";
|
|
8
|
+
//#region src/plugins/http/handle.d.ts
|
|
9
|
+
declare const base: {
|
|
10
|
+
req: VarDefination<"req", HttpRequest | null, undefined, never>;
|
|
11
|
+
res: VarDefination<"res", HttpResponse | null, undefined, never>;
|
|
12
|
+
fromRequest: FnDefination<{
|
|
13
|
+
readonly request: Request;
|
|
14
|
+
}, Promise<{
|
|
15
|
+
method: string;
|
|
16
|
+
path: string;
|
|
17
|
+
}>, "http.from_request", {
|
|
18
|
+
readonly request: TypeDefination<Request, Request, never>;
|
|
19
|
+
}, readonly ["req"], {}, {
|
|
20
|
+
res?: ({
|
|
21
|
+
headers: {
|
|
22
|
+
append: (name: string, value: string) => void;
|
|
23
|
+
delete: (name: string) => void;
|
|
24
|
+
get: (name: string) => string | null;
|
|
25
|
+
getSetCookie: () => string[];
|
|
26
|
+
has: (name: string) => boolean;
|
|
27
|
+
set: (name: string, value: string) => void;
|
|
28
|
+
forEach: (callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any) => void;
|
|
29
|
+
entries: () => HeadersIterator<[string, string]>;
|
|
30
|
+
keys: () => HeadersIterator<string>;
|
|
31
|
+
values: () => HeadersIterator<string>;
|
|
32
|
+
[Symbol.iterator]: () => HeadersIterator<[string, string]>;
|
|
33
|
+
};
|
|
34
|
+
status?: number | undefined;
|
|
35
|
+
statusText?: string | undefined;
|
|
36
|
+
} & HttpResponse) | null | undefined;
|
|
37
|
+
req?: ({
|
|
38
|
+
raw: {
|
|
39
|
+
readonly cache: RequestCache;
|
|
40
|
+
readonly credentials: RequestCredentials;
|
|
41
|
+
readonly destination: RequestDestination;
|
|
42
|
+
readonly headers: {
|
|
43
|
+
append: (name: string, value: string) => void;
|
|
44
|
+
delete: (name: string) => void;
|
|
45
|
+
get: (name: string) => string | null;
|
|
46
|
+
getSetCookie: () => string[];
|
|
47
|
+
has: (name: string) => boolean;
|
|
48
|
+
set: (name: string, value: string) => void;
|
|
49
|
+
forEach: (callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any) => void;
|
|
50
|
+
entries: () => HeadersIterator<[string, string]>;
|
|
51
|
+
keys: () => HeadersIterator<string>;
|
|
52
|
+
values: () => HeadersIterator<string>;
|
|
53
|
+
[Symbol.iterator]: () => HeadersIterator<[string, string]>;
|
|
54
|
+
};
|
|
55
|
+
readonly integrity: string;
|
|
56
|
+
readonly keepalive: boolean;
|
|
57
|
+
readonly method: string;
|
|
58
|
+
readonly mode: RequestMode;
|
|
59
|
+
readonly redirect: RequestRedirect;
|
|
60
|
+
readonly referrer: string;
|
|
61
|
+
readonly referrerPolicy: ReferrerPolicy;
|
|
62
|
+
readonly signal: {
|
|
63
|
+
readonly aborted: boolean;
|
|
64
|
+
onabort: ((this: AbortSignal, ev: Event) => any) | null;
|
|
65
|
+
readonly reason: any;
|
|
66
|
+
throwIfAborted: () => void;
|
|
67
|
+
addEventListener: {
|
|
68
|
+
<K extends keyof AbortSignalEventMap>(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
69
|
+
(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
70
|
+
};
|
|
71
|
+
removeEventListener: {
|
|
72
|
+
<K extends keyof AbortSignalEventMap>(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
73
|
+
(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
74
|
+
};
|
|
75
|
+
dispatchEvent: (event: Event) => boolean;
|
|
76
|
+
};
|
|
77
|
+
readonly url: string;
|
|
78
|
+
clone: () => Request;
|
|
79
|
+
readonly body: {
|
|
80
|
+
readonly locked: boolean;
|
|
81
|
+
cancel: (reason?: any) => Promise<void>;
|
|
82
|
+
getReader: {
|
|
83
|
+
(options: {
|
|
84
|
+
mode: "byob";
|
|
85
|
+
}): ReadableStreamBYOBReader;
|
|
86
|
+
(): ReadableStreamDefaultReader<Uint8Array<ArrayBuffer>>;
|
|
87
|
+
(options?: ReadableStreamGetReaderOptions): ReadableStreamReader<Uint8Array<ArrayBuffer>>;
|
|
88
|
+
};
|
|
89
|
+
pipeThrough: <T>(transform: ReadableWritablePair<T, Uint8Array<ArrayBuffer>>, options?: StreamPipeOptions) => ReadableStream<T>;
|
|
90
|
+
pipeTo: (destination: WritableStream<Uint8Array<ArrayBuffer>>, options?: StreamPipeOptions) => Promise<void>;
|
|
91
|
+
tee: () => [ReadableStream<Uint8Array<ArrayBuffer>>, ReadableStream<Uint8Array<ArrayBuffer>>];
|
|
92
|
+
values: (options?: ReadableStreamIteratorOptions) => ReadableStreamAsyncIterator<Uint8Array<ArrayBuffer>>;
|
|
93
|
+
[Symbol.asyncIterator]: (options?: ReadableStreamIteratorOptions) => ReadableStreamAsyncIterator<Uint8Array<ArrayBuffer>>;
|
|
94
|
+
} | null;
|
|
95
|
+
readonly bodyUsed: boolean;
|
|
96
|
+
arrayBuffer: () => Promise<ArrayBuffer>;
|
|
97
|
+
blob: () => Promise<Blob>;
|
|
98
|
+
bytes: () => Promise<Uint8Array<ArrayBuffer>>;
|
|
99
|
+
formData: () => Promise<FormData>;
|
|
100
|
+
json: () => Promise<any>;
|
|
101
|
+
text: () => Promise<string>;
|
|
102
|
+
};
|
|
103
|
+
method: string;
|
|
104
|
+
path: string;
|
|
105
|
+
headers: {
|
|
106
|
+
append: (name: string, value: string) => void;
|
|
107
|
+
delete: (name: string) => void;
|
|
108
|
+
get: (name: string) => string | null;
|
|
109
|
+
getSetCookie: () => string[];
|
|
110
|
+
has: (name: string) => boolean;
|
|
111
|
+
set: (name: string, value: string) => void;
|
|
112
|
+
forEach: (callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any) => void;
|
|
113
|
+
entries: () => HeadersIterator<[string, string]>;
|
|
114
|
+
keys: () => HeadersIterator<string>;
|
|
115
|
+
values: () => HeadersIterator<string>;
|
|
116
|
+
[Symbol.iterator]: () => HeadersIterator<[string, string]>;
|
|
117
|
+
};
|
|
118
|
+
query: {
|
|
119
|
+
[x: string]: string | string[];
|
|
120
|
+
};
|
|
121
|
+
cookies: {
|
|
122
|
+
[x: string]: string;
|
|
123
|
+
};
|
|
124
|
+
body: unknown;
|
|
125
|
+
} & HttpRequest) | null | undefined;
|
|
126
|
+
}, unknown>;
|
|
127
|
+
redirect: FnDefination<{
|
|
128
|
+
readonly url: string;
|
|
129
|
+
readonly status?: number | undefined;
|
|
130
|
+
}, never, "http.redirect", {
|
|
131
|
+
readonly url: TypeDefination<string, string, never>;
|
|
132
|
+
readonly status: TypeDefination<number, number, number>;
|
|
133
|
+
}, readonly [], {}, {
|
|
134
|
+
res?: ({
|
|
135
|
+
headers: {
|
|
136
|
+
append: (name: string, value: string) => void;
|
|
137
|
+
delete: (name: string) => void;
|
|
138
|
+
get: (name: string) => string | null;
|
|
139
|
+
getSetCookie: () => string[];
|
|
140
|
+
has: (name: string) => boolean;
|
|
141
|
+
set: (name: string, value: string) => void;
|
|
142
|
+
forEach: (callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any) => void;
|
|
143
|
+
entries: () => HeadersIterator<[string, string]>;
|
|
144
|
+
keys: () => HeadersIterator<string>;
|
|
145
|
+
values: () => HeadersIterator<string>;
|
|
146
|
+
[Symbol.iterator]: () => HeadersIterator<[string, string]>;
|
|
147
|
+
};
|
|
148
|
+
status?: number | undefined;
|
|
149
|
+
statusText?: string | undefined;
|
|
150
|
+
} & HttpResponse) | null | undefined;
|
|
151
|
+
}, unknown>;
|
|
152
|
+
getCookie: FnDefination<{
|
|
153
|
+
[x: number]: string;
|
|
154
|
+
0: string;
|
|
155
|
+
length: 1;
|
|
156
|
+
toString: () => string;
|
|
157
|
+
toLocaleString: {
|
|
158
|
+
(): string;
|
|
159
|
+
(locales: string | string[], options?: Intl.NumberFormatOptions & Intl.DateTimeFormatOptions): string;
|
|
160
|
+
};
|
|
161
|
+
pop: () => string | undefined;
|
|
162
|
+
push: (...items: string[]) => number;
|
|
163
|
+
concat: {
|
|
164
|
+
(...items: ConcatArray<string>[]): string[];
|
|
165
|
+
(...items: (string | ConcatArray<string>)[]): string[];
|
|
166
|
+
};
|
|
167
|
+
join: (separator?: string) => string;
|
|
168
|
+
reverse: () => string[];
|
|
169
|
+
shift: () => string | undefined;
|
|
170
|
+
slice: (start?: number, end?: number) => string[];
|
|
171
|
+
sort: (compareFn?: ((a: string, b: string) => number) | undefined) => [string] & {};
|
|
172
|
+
splice: {
|
|
173
|
+
(start: number, deleteCount?: number): string[];
|
|
174
|
+
(start: number, deleteCount: number, ...items: string[]): string[];
|
|
175
|
+
};
|
|
176
|
+
unshift: (...items: string[]) => number;
|
|
177
|
+
indexOf: (searchElement: string, fromIndex?: number) => number;
|
|
178
|
+
lastIndexOf: (searchElement: string, fromIndex?: number) => number;
|
|
179
|
+
every: {
|
|
180
|
+
<S extends string>(predicate: (value: string, index: number, array: string[]) => value is S, thisArg?: any): this is S[];
|
|
181
|
+
(predicate: (value: string, index: number, array: string[]) => unknown, thisArg?: any): boolean;
|
|
182
|
+
};
|
|
183
|
+
some: (predicate: (value: string, index: number, array: string[]) => unknown, thisArg?: any) => boolean;
|
|
184
|
+
forEach: (callbackfn: (value: string, index: number, array: string[]) => void, thisArg?: any) => void;
|
|
185
|
+
map: <U>(callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[];
|
|
186
|
+
filter: {
|
|
187
|
+
<S extends string>(predicate: (value: string, index: number, array: string[]) => value is S, thisArg?: any): S[];
|
|
188
|
+
(predicate: (value: string, index: number, array: string[]) => unknown, thisArg?: any): string[];
|
|
189
|
+
};
|
|
190
|
+
reduce: {
|
|
191
|
+
(callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string): string;
|
|
192
|
+
(callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue: string): string;
|
|
193
|
+
<U>(callbackfn: (previousValue: U, currentValue: string, currentIndex: number, array: string[]) => U, initialValue: U): U;
|
|
194
|
+
};
|
|
195
|
+
reduceRight: {
|
|
196
|
+
(callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string): string;
|
|
197
|
+
(callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue: string): string;
|
|
198
|
+
<U>(callbackfn: (previousValue: U, currentValue: string, currentIndex: number, array: string[]) => U, initialValue: U): U;
|
|
199
|
+
};
|
|
200
|
+
find: {
|
|
201
|
+
<S extends string>(predicate: (value: string, index: number, obj: string[]) => value is S, thisArg?: any): S | undefined;
|
|
202
|
+
(predicate: (value: string, index: number, obj: string[]) => unknown, thisArg?: any): string | undefined;
|
|
203
|
+
};
|
|
204
|
+
findIndex: (predicate: (value: string, index: number, obj: string[]) => unknown, thisArg?: any) => number;
|
|
205
|
+
fill: (value: string, start?: number, end?: number) => [string] & {};
|
|
206
|
+
copyWithin: (target: number, start: number, end?: number) => [string] & {};
|
|
207
|
+
entries: () => ArrayIterator<[number, string]>;
|
|
208
|
+
keys: () => ArrayIterator<number>;
|
|
209
|
+
values: () => ArrayIterator<string>;
|
|
210
|
+
includes: (searchElement: string, fromIndex?: number) => boolean;
|
|
211
|
+
flatMap: <U, This = undefined>(callback: (this: This, value: string, index: number, array: string[]) => U | readonly U[], thisArg?: This | undefined) => U[];
|
|
212
|
+
flat: <A, D extends number = 1>(this: A, depth?: D | undefined) => FlatArray<A, D>[];
|
|
213
|
+
at: (index: number) => string | undefined;
|
|
214
|
+
findLast: {
|
|
215
|
+
<S extends string>(predicate: (value: string, index: number, array: string[]) => value is S, thisArg?: any): S | undefined;
|
|
216
|
+
(predicate: (value: string, index: number, array: string[]) => unknown, thisArg?: any): string | undefined;
|
|
217
|
+
};
|
|
218
|
+
findLastIndex: (predicate: (value: string, index: number, array: string[]) => unknown, thisArg?: any) => number;
|
|
219
|
+
toReversed: () => string[];
|
|
220
|
+
toSorted: (compareFn?: ((a: string, b: string) => number) | undefined) => string[];
|
|
221
|
+
toSpliced: {
|
|
222
|
+
(start: number, deleteCount: number, ...items: string[]): string[];
|
|
223
|
+
(start: number, deleteCount?: number): string[];
|
|
224
|
+
};
|
|
225
|
+
with: (index: number, value: string) => string[];
|
|
226
|
+
[Symbol.iterator]: () => ArrayIterator<string>;
|
|
227
|
+
readonly [Symbol.unscopables]: {
|
|
228
|
+
[x: number]: boolean | undefined;
|
|
229
|
+
length?: boolean | undefined;
|
|
230
|
+
toString?: boolean | undefined;
|
|
231
|
+
toLocaleString?: boolean | undefined;
|
|
232
|
+
pop?: boolean | undefined;
|
|
233
|
+
push?: boolean | undefined;
|
|
234
|
+
concat?: boolean | undefined;
|
|
235
|
+
join?: boolean | undefined;
|
|
236
|
+
reverse?: boolean | undefined;
|
|
237
|
+
shift?: boolean | undefined;
|
|
238
|
+
slice?: boolean | undefined;
|
|
239
|
+
sort?: boolean | undefined;
|
|
240
|
+
splice?: boolean | undefined;
|
|
241
|
+
unshift?: boolean | undefined;
|
|
242
|
+
indexOf?: boolean | undefined;
|
|
243
|
+
lastIndexOf?: boolean | undefined;
|
|
244
|
+
every?: boolean | undefined;
|
|
245
|
+
some?: boolean | undefined;
|
|
246
|
+
forEach?: boolean | undefined;
|
|
247
|
+
map?: boolean | undefined;
|
|
248
|
+
filter?: boolean | undefined;
|
|
249
|
+
reduce?: boolean | undefined;
|
|
250
|
+
reduceRight?: boolean | undefined;
|
|
251
|
+
find?: boolean | undefined;
|
|
252
|
+
findIndex?: boolean | undefined;
|
|
253
|
+
fill?: boolean | undefined;
|
|
254
|
+
copyWithin?: boolean | undefined;
|
|
255
|
+
entries?: boolean | undefined;
|
|
256
|
+
keys?: boolean | undefined;
|
|
257
|
+
values?: boolean | undefined;
|
|
258
|
+
includes?: boolean | undefined;
|
|
259
|
+
flatMap?: boolean | undefined;
|
|
260
|
+
flat?: boolean | undefined;
|
|
261
|
+
at?: boolean | undefined;
|
|
262
|
+
findLast?: boolean | undefined;
|
|
263
|
+
findLastIndex?: boolean | undefined;
|
|
264
|
+
toReversed?: boolean | undefined;
|
|
265
|
+
toSorted?: boolean | undefined;
|
|
266
|
+
toSpliced?: boolean | undefined;
|
|
267
|
+
with?: boolean | undefined;
|
|
268
|
+
[Symbol.iterator]?: boolean | undefined;
|
|
269
|
+
readonly [Symbol.unscopables]?: boolean | undefined;
|
|
270
|
+
};
|
|
271
|
+
}, string | null, "cookie.get", readonly [TypeDefination<string, string, never>], readonly [], {}, {
|
|
272
|
+
res?: ({
|
|
273
|
+
headers: {
|
|
274
|
+
append: (name: string, value: string) => void;
|
|
275
|
+
delete: (name: string) => void;
|
|
276
|
+
get: (name: string) => string | null;
|
|
277
|
+
getSetCookie: () => string[];
|
|
278
|
+
has: (name: string) => boolean;
|
|
279
|
+
set: (name: string, value: string) => void;
|
|
280
|
+
forEach: (callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any) => void;
|
|
281
|
+
entries: () => HeadersIterator<[string, string]>;
|
|
282
|
+
keys: () => HeadersIterator<string>;
|
|
283
|
+
values: () => HeadersIterator<string>;
|
|
284
|
+
[Symbol.iterator]: () => HeadersIterator<[string, string]>;
|
|
285
|
+
};
|
|
286
|
+
status?: number | undefined;
|
|
287
|
+
statusText?: string | undefined;
|
|
288
|
+
} & HttpResponse) | null | undefined;
|
|
289
|
+
req?: ({
|
|
290
|
+
raw: {
|
|
291
|
+
readonly cache: RequestCache;
|
|
292
|
+
readonly credentials: RequestCredentials;
|
|
293
|
+
readonly destination: RequestDestination;
|
|
294
|
+
readonly headers: {
|
|
295
|
+
append: (name: string, value: string) => void;
|
|
296
|
+
delete: (name: string) => void;
|
|
297
|
+
get: (name: string) => string | null;
|
|
298
|
+
getSetCookie: () => string[];
|
|
299
|
+
has: (name: string) => boolean;
|
|
300
|
+
set: (name: string, value: string) => void;
|
|
301
|
+
forEach: (callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any) => void;
|
|
302
|
+
entries: () => HeadersIterator<[string, string]>;
|
|
303
|
+
keys: () => HeadersIterator<string>;
|
|
304
|
+
values: () => HeadersIterator<string>;
|
|
305
|
+
[Symbol.iterator]: () => HeadersIterator<[string, string]>;
|
|
306
|
+
};
|
|
307
|
+
readonly integrity: string;
|
|
308
|
+
readonly keepalive: boolean;
|
|
309
|
+
readonly method: string;
|
|
310
|
+
readonly mode: RequestMode;
|
|
311
|
+
readonly redirect: RequestRedirect;
|
|
312
|
+
readonly referrer: string;
|
|
313
|
+
readonly referrerPolicy: ReferrerPolicy;
|
|
314
|
+
readonly signal: {
|
|
315
|
+
readonly aborted: boolean;
|
|
316
|
+
onabort: ((this: AbortSignal, ev: Event) => any) | null;
|
|
317
|
+
readonly reason: any;
|
|
318
|
+
throwIfAborted: () => void;
|
|
319
|
+
addEventListener: {
|
|
320
|
+
<K extends keyof AbortSignalEventMap>(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
321
|
+
(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
322
|
+
};
|
|
323
|
+
removeEventListener: {
|
|
324
|
+
<K extends keyof AbortSignalEventMap>(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
325
|
+
(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
326
|
+
};
|
|
327
|
+
dispatchEvent: (event: Event) => boolean;
|
|
328
|
+
};
|
|
329
|
+
readonly url: string;
|
|
330
|
+
clone: () => Request;
|
|
331
|
+
readonly body: {
|
|
332
|
+
readonly locked: boolean;
|
|
333
|
+
cancel: (reason?: any) => Promise<void>;
|
|
334
|
+
getReader: {
|
|
335
|
+
(options: {
|
|
336
|
+
mode: "byob";
|
|
337
|
+
}): ReadableStreamBYOBReader;
|
|
338
|
+
(): ReadableStreamDefaultReader<Uint8Array<ArrayBuffer>>;
|
|
339
|
+
(options?: ReadableStreamGetReaderOptions): ReadableStreamReader<Uint8Array<ArrayBuffer>>;
|
|
340
|
+
};
|
|
341
|
+
pipeThrough: <T>(transform: ReadableWritablePair<T, Uint8Array<ArrayBuffer>>, options?: StreamPipeOptions) => ReadableStream<T>;
|
|
342
|
+
pipeTo: (destination: WritableStream<Uint8Array<ArrayBuffer>>, options?: StreamPipeOptions) => Promise<void>;
|
|
343
|
+
tee: () => [ReadableStream<Uint8Array<ArrayBuffer>>, ReadableStream<Uint8Array<ArrayBuffer>>];
|
|
344
|
+
values: (options?: ReadableStreamIteratorOptions) => ReadableStreamAsyncIterator<Uint8Array<ArrayBuffer>>;
|
|
345
|
+
[Symbol.asyncIterator]: (options?: ReadableStreamIteratorOptions) => ReadableStreamAsyncIterator<Uint8Array<ArrayBuffer>>;
|
|
346
|
+
} | null;
|
|
347
|
+
readonly bodyUsed: boolean;
|
|
348
|
+
arrayBuffer: () => Promise<ArrayBuffer>;
|
|
349
|
+
blob: () => Promise<Blob>;
|
|
350
|
+
bytes: () => Promise<Uint8Array<ArrayBuffer>>;
|
|
351
|
+
formData: () => Promise<FormData>;
|
|
352
|
+
json: () => Promise<any>;
|
|
353
|
+
text: () => Promise<string>;
|
|
354
|
+
};
|
|
355
|
+
method: string;
|
|
356
|
+
path: string;
|
|
357
|
+
headers: {
|
|
358
|
+
append: (name: string, value: string) => void;
|
|
359
|
+
delete: (name: string) => void;
|
|
360
|
+
get: (name: string) => string | null;
|
|
361
|
+
getSetCookie: () => string[];
|
|
362
|
+
has: (name: string) => boolean;
|
|
363
|
+
set: (name: string, value: string) => void;
|
|
364
|
+
forEach: (callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any) => void;
|
|
365
|
+
entries: () => HeadersIterator<[string, string]>;
|
|
366
|
+
keys: () => HeadersIterator<string>;
|
|
367
|
+
values: () => HeadersIterator<string>;
|
|
368
|
+
[Symbol.iterator]: () => HeadersIterator<[string, string]>;
|
|
369
|
+
};
|
|
370
|
+
query: {
|
|
371
|
+
[x: string]: string | string[];
|
|
372
|
+
};
|
|
373
|
+
cookies: {
|
|
374
|
+
[x: string]: string;
|
|
375
|
+
};
|
|
376
|
+
body: unknown;
|
|
377
|
+
} & HttpRequest) | null | undefined;
|
|
378
|
+
cookieOptions?: ({
|
|
379
|
+
maxAge?: number | null | undefined;
|
|
380
|
+
expires?: Date | null | undefined;
|
|
381
|
+
path?: string | null | undefined;
|
|
382
|
+
domain?: string | null | undefined;
|
|
383
|
+
secure?: boolean | null | undefined;
|
|
384
|
+
httpOnly?: boolean | null | undefined;
|
|
385
|
+
sameSite?: "strict" | "none" | "lax" | null | undefined;
|
|
386
|
+
} & {
|
|
387
|
+
maxAge?: number | null | undefined;
|
|
388
|
+
expires?: Date | null | undefined;
|
|
389
|
+
path?: string | null | undefined;
|
|
390
|
+
domain?: string | null | undefined;
|
|
391
|
+
secure?: boolean | null | undefined;
|
|
392
|
+
httpOnly?: boolean | null | undefined;
|
|
393
|
+
sameSite?: "strict" | "none" | "lax" | null | undefined;
|
|
394
|
+
}) | undefined;
|
|
395
|
+
}, unknown>;
|
|
396
|
+
setCookie: FnDefination<{
|
|
397
|
+
readonly name: string;
|
|
398
|
+
readonly value: string;
|
|
399
|
+
readonly options?: {
|
|
400
|
+
maxAge?: number | null | undefined;
|
|
401
|
+
expires?: Date | null | undefined;
|
|
402
|
+
path?: string | null | undefined;
|
|
403
|
+
domain?: string | null | undefined;
|
|
404
|
+
secure?: boolean | null | undefined;
|
|
405
|
+
httpOnly?: boolean | null | undefined;
|
|
406
|
+
sameSite?: "strict" | "none" | "lax" | null | undefined;
|
|
407
|
+
} | null | undefined;
|
|
408
|
+
}, {
|
|
409
|
+
set: boolean;
|
|
410
|
+
}, "cookie.set", {
|
|
411
|
+
readonly name: TypeDefination<string, string, never>;
|
|
412
|
+
readonly value: TypeDefination<string, string, never>;
|
|
413
|
+
readonly options: TypeDefination<{
|
|
414
|
+
maxAge?: number | null | undefined;
|
|
415
|
+
expires?: Date | null | undefined;
|
|
416
|
+
path?: string | null | undefined;
|
|
417
|
+
domain?: string | null | undefined;
|
|
418
|
+
secure?: boolean | null | undefined;
|
|
419
|
+
httpOnly?: boolean | null | undefined;
|
|
420
|
+
sameSite?: "strict" | "none" | "lax" | null | undefined;
|
|
421
|
+
}, {
|
|
422
|
+
maxAge?: number | null | undefined;
|
|
423
|
+
expires?: Date | null | undefined;
|
|
424
|
+
path?: string | null | undefined;
|
|
425
|
+
domain?: string | null | undefined;
|
|
426
|
+
secure?: boolean | null | undefined;
|
|
427
|
+
httpOnly?: boolean | null | undefined;
|
|
428
|
+
sameSite?: "strict" | "none" | "lax" | null | undefined;
|
|
429
|
+
} | null | undefined, undefined>;
|
|
430
|
+
}, readonly [], {}, {
|
|
431
|
+
res?: ({
|
|
432
|
+
headers: {
|
|
433
|
+
append: (name: string, value: string) => void;
|
|
434
|
+
delete: (name: string) => void;
|
|
435
|
+
get: (name: string) => string | null;
|
|
436
|
+
getSetCookie: () => string[];
|
|
437
|
+
has: (name: string) => boolean;
|
|
438
|
+
set: (name: string, value: string) => void;
|
|
439
|
+
forEach: (callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any) => void;
|
|
440
|
+
entries: () => HeadersIterator<[string, string]>;
|
|
441
|
+
keys: () => HeadersIterator<string>;
|
|
442
|
+
values: () => HeadersIterator<string>;
|
|
443
|
+
[Symbol.iterator]: () => HeadersIterator<[string, string]>;
|
|
444
|
+
};
|
|
445
|
+
status?: number | undefined;
|
|
446
|
+
statusText?: string | undefined;
|
|
447
|
+
} & HttpResponse) | null | undefined;
|
|
448
|
+
req?: ({
|
|
449
|
+
raw: {
|
|
450
|
+
readonly cache: RequestCache;
|
|
451
|
+
readonly credentials: RequestCredentials;
|
|
452
|
+
readonly destination: RequestDestination;
|
|
453
|
+
readonly headers: {
|
|
454
|
+
append: (name: string, value: string) => void;
|
|
455
|
+
delete: (name: string) => void;
|
|
456
|
+
get: (name: string) => string | null;
|
|
457
|
+
getSetCookie: () => string[];
|
|
458
|
+
has: (name: string) => boolean;
|
|
459
|
+
set: (name: string, value: string) => void;
|
|
460
|
+
forEach: (callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any) => void;
|
|
461
|
+
entries: () => HeadersIterator<[string, string]>;
|
|
462
|
+
keys: () => HeadersIterator<string>;
|
|
463
|
+
values: () => HeadersIterator<string>;
|
|
464
|
+
[Symbol.iterator]: () => HeadersIterator<[string, string]>;
|
|
465
|
+
};
|
|
466
|
+
readonly integrity: string;
|
|
467
|
+
readonly keepalive: boolean;
|
|
468
|
+
readonly method: string;
|
|
469
|
+
readonly mode: RequestMode;
|
|
470
|
+
readonly redirect: RequestRedirect;
|
|
471
|
+
readonly referrer: string;
|
|
472
|
+
readonly referrerPolicy: ReferrerPolicy;
|
|
473
|
+
readonly signal: {
|
|
474
|
+
readonly aborted: boolean;
|
|
475
|
+
onabort: ((this: AbortSignal, ev: Event) => any) | null;
|
|
476
|
+
readonly reason: any;
|
|
477
|
+
throwIfAborted: () => void;
|
|
478
|
+
addEventListener: {
|
|
479
|
+
<K extends keyof AbortSignalEventMap>(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
480
|
+
(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
481
|
+
};
|
|
482
|
+
removeEventListener: {
|
|
483
|
+
<K extends keyof AbortSignalEventMap>(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
484
|
+
(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
485
|
+
};
|
|
486
|
+
dispatchEvent: (event: Event) => boolean;
|
|
487
|
+
};
|
|
488
|
+
readonly url: string;
|
|
489
|
+
clone: () => Request;
|
|
490
|
+
readonly body: {
|
|
491
|
+
readonly locked: boolean;
|
|
492
|
+
cancel: (reason?: any) => Promise<void>;
|
|
493
|
+
getReader: {
|
|
494
|
+
(options: {
|
|
495
|
+
mode: "byob";
|
|
496
|
+
}): ReadableStreamBYOBReader;
|
|
497
|
+
(): ReadableStreamDefaultReader<Uint8Array<ArrayBuffer>>;
|
|
498
|
+
(options?: ReadableStreamGetReaderOptions): ReadableStreamReader<Uint8Array<ArrayBuffer>>;
|
|
499
|
+
};
|
|
500
|
+
pipeThrough: <T>(transform: ReadableWritablePair<T, Uint8Array<ArrayBuffer>>, options?: StreamPipeOptions) => ReadableStream<T>;
|
|
501
|
+
pipeTo: (destination: WritableStream<Uint8Array<ArrayBuffer>>, options?: StreamPipeOptions) => Promise<void>;
|
|
502
|
+
tee: () => [ReadableStream<Uint8Array<ArrayBuffer>>, ReadableStream<Uint8Array<ArrayBuffer>>];
|
|
503
|
+
values: (options?: ReadableStreamIteratorOptions) => ReadableStreamAsyncIterator<Uint8Array<ArrayBuffer>>;
|
|
504
|
+
[Symbol.asyncIterator]: (options?: ReadableStreamIteratorOptions) => ReadableStreamAsyncIterator<Uint8Array<ArrayBuffer>>;
|
|
505
|
+
} | null;
|
|
506
|
+
readonly bodyUsed: boolean;
|
|
507
|
+
arrayBuffer: () => Promise<ArrayBuffer>;
|
|
508
|
+
blob: () => Promise<Blob>;
|
|
509
|
+
bytes: () => Promise<Uint8Array<ArrayBuffer>>;
|
|
510
|
+
formData: () => Promise<FormData>;
|
|
511
|
+
json: () => Promise<any>;
|
|
512
|
+
text: () => Promise<string>;
|
|
513
|
+
};
|
|
514
|
+
method: string;
|
|
515
|
+
path: string;
|
|
516
|
+
headers: {
|
|
517
|
+
append: (name: string, value: string) => void;
|
|
518
|
+
delete: (name: string) => void;
|
|
519
|
+
get: (name: string) => string | null;
|
|
520
|
+
getSetCookie: () => string[];
|
|
521
|
+
has: (name: string) => boolean;
|
|
522
|
+
set: (name: string, value: string) => void;
|
|
523
|
+
forEach: (callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any) => void;
|
|
524
|
+
entries: () => HeadersIterator<[string, string]>;
|
|
525
|
+
keys: () => HeadersIterator<string>;
|
|
526
|
+
values: () => HeadersIterator<string>;
|
|
527
|
+
[Symbol.iterator]: () => HeadersIterator<[string, string]>;
|
|
528
|
+
};
|
|
529
|
+
query: {
|
|
530
|
+
[x: string]: string | string[];
|
|
531
|
+
};
|
|
532
|
+
cookies: {
|
|
533
|
+
[x: string]: string;
|
|
534
|
+
};
|
|
535
|
+
body: unknown;
|
|
536
|
+
} & HttpRequest) | null | undefined;
|
|
537
|
+
cookieOptions?: ({
|
|
538
|
+
maxAge?: number | null | undefined;
|
|
539
|
+
expires?: Date | null | undefined;
|
|
540
|
+
path?: string | null | undefined;
|
|
541
|
+
domain?: string | null | undefined;
|
|
542
|
+
secure?: boolean | null | undefined;
|
|
543
|
+
httpOnly?: boolean | null | undefined;
|
|
544
|
+
sameSite?: "strict" | "none" | "lax" | null | undefined;
|
|
545
|
+
} & {
|
|
546
|
+
maxAge?: number | null | undefined;
|
|
547
|
+
expires?: Date | null | undefined;
|
|
548
|
+
path?: string | null | undefined;
|
|
549
|
+
domain?: string | null | undefined;
|
|
550
|
+
secure?: boolean | null | undefined;
|
|
551
|
+
httpOnly?: boolean | null | undefined;
|
|
552
|
+
sameSite?: "strict" | "none" | "lax" | null | undefined;
|
|
553
|
+
}) | undefined;
|
|
554
|
+
}, unknown>;
|
|
555
|
+
deleteCookie: FnDefination<{
|
|
556
|
+
readonly name: string;
|
|
557
|
+
readonly options?: {
|
|
558
|
+
maxAge?: number | null | undefined;
|
|
559
|
+
expires?: Date | null | undefined;
|
|
560
|
+
path?: string | null | undefined;
|
|
561
|
+
domain?: string | null | undefined;
|
|
562
|
+
secure?: boolean | null | undefined;
|
|
563
|
+
httpOnly?: boolean | null | undefined;
|
|
564
|
+
sameSite?: "strict" | "none" | "lax" | null | undefined;
|
|
565
|
+
} | null | undefined;
|
|
566
|
+
}, {
|
|
567
|
+
set: boolean;
|
|
568
|
+
}, "cookie.delete", {
|
|
569
|
+
readonly name: TypeDefination<string, string, never>;
|
|
570
|
+
readonly options: TypeDefination<{
|
|
571
|
+
maxAge?: number | null | undefined;
|
|
572
|
+
expires?: Date | null | undefined;
|
|
573
|
+
path?: string | null | undefined;
|
|
574
|
+
domain?: string | null | undefined;
|
|
575
|
+
secure?: boolean | null | undefined;
|
|
576
|
+
httpOnly?: boolean | null | undefined;
|
|
577
|
+
sameSite?: "strict" | "none" | "lax" | null | undefined;
|
|
578
|
+
}, {
|
|
579
|
+
maxAge?: number | null | undefined;
|
|
580
|
+
expires?: Date | null | undefined;
|
|
581
|
+
path?: string | null | undefined;
|
|
582
|
+
domain?: string | null | undefined;
|
|
583
|
+
secure?: boolean | null | undefined;
|
|
584
|
+
httpOnly?: boolean | null | undefined;
|
|
585
|
+
sameSite?: "strict" | "none" | "lax" | null | undefined;
|
|
586
|
+
} | null | undefined, undefined>;
|
|
587
|
+
}, readonly [], {}, {
|
|
588
|
+
res?: ({
|
|
589
|
+
headers: {
|
|
590
|
+
append: (name: string, value: string) => void;
|
|
591
|
+
delete: (name: string) => void;
|
|
592
|
+
get: (name: string) => string | null;
|
|
593
|
+
getSetCookie: () => string[];
|
|
594
|
+
has: (name: string) => boolean;
|
|
595
|
+
set: (name: string, value: string) => void;
|
|
596
|
+
forEach: (callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any) => void;
|
|
597
|
+
entries: () => HeadersIterator<[string, string]>;
|
|
598
|
+
keys: () => HeadersIterator<string>;
|
|
599
|
+
values: () => HeadersIterator<string>;
|
|
600
|
+
[Symbol.iterator]: () => HeadersIterator<[string, string]>;
|
|
601
|
+
};
|
|
602
|
+
status?: number | undefined;
|
|
603
|
+
statusText?: string | undefined;
|
|
604
|
+
} & HttpResponse) | null | undefined;
|
|
605
|
+
req?: ({
|
|
606
|
+
raw: {
|
|
607
|
+
readonly cache: RequestCache;
|
|
608
|
+
readonly credentials: RequestCredentials;
|
|
609
|
+
readonly destination: RequestDestination;
|
|
610
|
+
readonly headers: {
|
|
611
|
+
append: (name: string, value: string) => void;
|
|
612
|
+
delete: (name: string) => void;
|
|
613
|
+
get: (name: string) => string | null;
|
|
614
|
+
getSetCookie: () => string[];
|
|
615
|
+
has: (name: string) => boolean;
|
|
616
|
+
set: (name: string, value: string) => void;
|
|
617
|
+
forEach: (callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any) => void;
|
|
618
|
+
entries: () => HeadersIterator<[string, string]>;
|
|
619
|
+
keys: () => HeadersIterator<string>;
|
|
620
|
+
values: () => HeadersIterator<string>;
|
|
621
|
+
[Symbol.iterator]: () => HeadersIterator<[string, string]>;
|
|
622
|
+
};
|
|
623
|
+
readonly integrity: string;
|
|
624
|
+
readonly keepalive: boolean;
|
|
625
|
+
readonly method: string;
|
|
626
|
+
readonly mode: RequestMode;
|
|
627
|
+
readonly redirect: RequestRedirect;
|
|
628
|
+
readonly referrer: string;
|
|
629
|
+
readonly referrerPolicy: ReferrerPolicy;
|
|
630
|
+
readonly signal: {
|
|
631
|
+
readonly aborted: boolean;
|
|
632
|
+
onabort: ((this: AbortSignal, ev: Event) => any) | null;
|
|
633
|
+
readonly reason: any;
|
|
634
|
+
throwIfAborted: () => void;
|
|
635
|
+
addEventListener: {
|
|
636
|
+
<K extends keyof AbortSignalEventMap>(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
637
|
+
(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
638
|
+
};
|
|
639
|
+
removeEventListener: {
|
|
640
|
+
<K extends keyof AbortSignalEventMap>(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
641
|
+
(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
642
|
+
};
|
|
643
|
+
dispatchEvent: (event: Event) => boolean;
|
|
644
|
+
};
|
|
645
|
+
readonly url: string;
|
|
646
|
+
clone: () => Request;
|
|
647
|
+
readonly body: {
|
|
648
|
+
readonly locked: boolean;
|
|
649
|
+
cancel: (reason?: any) => Promise<void>;
|
|
650
|
+
getReader: {
|
|
651
|
+
(options: {
|
|
652
|
+
mode: "byob";
|
|
653
|
+
}): ReadableStreamBYOBReader;
|
|
654
|
+
(): ReadableStreamDefaultReader<Uint8Array<ArrayBuffer>>;
|
|
655
|
+
(options?: ReadableStreamGetReaderOptions): ReadableStreamReader<Uint8Array<ArrayBuffer>>;
|
|
656
|
+
};
|
|
657
|
+
pipeThrough: <T>(transform: ReadableWritablePair<T, Uint8Array<ArrayBuffer>>, options?: StreamPipeOptions) => ReadableStream<T>;
|
|
658
|
+
pipeTo: (destination: WritableStream<Uint8Array<ArrayBuffer>>, options?: StreamPipeOptions) => Promise<void>;
|
|
659
|
+
tee: () => [ReadableStream<Uint8Array<ArrayBuffer>>, ReadableStream<Uint8Array<ArrayBuffer>>];
|
|
660
|
+
values: (options?: ReadableStreamIteratorOptions) => ReadableStreamAsyncIterator<Uint8Array<ArrayBuffer>>;
|
|
661
|
+
[Symbol.asyncIterator]: (options?: ReadableStreamIteratorOptions) => ReadableStreamAsyncIterator<Uint8Array<ArrayBuffer>>;
|
|
662
|
+
} | null;
|
|
663
|
+
readonly bodyUsed: boolean;
|
|
664
|
+
arrayBuffer: () => Promise<ArrayBuffer>;
|
|
665
|
+
blob: () => Promise<Blob>;
|
|
666
|
+
bytes: () => Promise<Uint8Array<ArrayBuffer>>;
|
|
667
|
+
formData: () => Promise<FormData>;
|
|
668
|
+
json: () => Promise<any>;
|
|
669
|
+
text: () => Promise<string>;
|
|
670
|
+
};
|
|
671
|
+
method: string;
|
|
672
|
+
path: string;
|
|
673
|
+
headers: {
|
|
674
|
+
append: (name: string, value: string) => void;
|
|
675
|
+
delete: (name: string) => void;
|
|
676
|
+
get: (name: string) => string | null;
|
|
677
|
+
getSetCookie: () => string[];
|
|
678
|
+
has: (name: string) => boolean;
|
|
679
|
+
set: (name: string, value: string) => void;
|
|
680
|
+
forEach: (callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any) => void;
|
|
681
|
+
entries: () => HeadersIterator<[string, string]>;
|
|
682
|
+
keys: () => HeadersIterator<string>;
|
|
683
|
+
values: () => HeadersIterator<string>;
|
|
684
|
+
[Symbol.iterator]: () => HeadersIterator<[string, string]>;
|
|
685
|
+
};
|
|
686
|
+
query: {
|
|
687
|
+
[x: string]: string | string[];
|
|
688
|
+
};
|
|
689
|
+
cookies: {
|
|
690
|
+
[x: string]: string;
|
|
691
|
+
};
|
|
692
|
+
body: unknown;
|
|
693
|
+
} & HttpRequest) | null | undefined;
|
|
694
|
+
cookieOptions?: ({
|
|
695
|
+
maxAge?: number | null | undefined;
|
|
696
|
+
expires?: Date | null | undefined;
|
|
697
|
+
path?: string | null | undefined;
|
|
698
|
+
domain?: string | null | undefined;
|
|
699
|
+
secure?: boolean | null | undefined;
|
|
700
|
+
httpOnly?: boolean | null | undefined;
|
|
701
|
+
sameSite?: "strict" | "none" | "lax" | null | undefined;
|
|
702
|
+
} & {
|
|
703
|
+
maxAge?: number | null | undefined;
|
|
704
|
+
expires?: Date | null | undefined;
|
|
705
|
+
path?: string | null | undefined;
|
|
706
|
+
domain?: string | null | undefined;
|
|
707
|
+
secure?: boolean | null | undefined;
|
|
708
|
+
httpOnly?: boolean | null | undefined;
|
|
709
|
+
sameSite?: "strict" | "none" | "lax" | null | undefined;
|
|
710
|
+
}) | undefined;
|
|
711
|
+
readonly setCookie?: ((input: {
|
|
712
|
+
readonly name: string;
|
|
713
|
+
readonly value: string;
|
|
714
|
+
readonly options?: {
|
|
715
|
+
maxAge?: number | null | undefined;
|
|
716
|
+
expires?: Date | null | undefined;
|
|
717
|
+
path?: string | null | undefined;
|
|
718
|
+
domain?: string | null | undefined;
|
|
719
|
+
secure?: boolean | null | undefined;
|
|
720
|
+
httpOnly?: boolean | null | undefined;
|
|
721
|
+
sameSite?: "strict" | "none" | "lax" | null | undefined;
|
|
722
|
+
} | null | undefined;
|
|
723
|
+
}) => {
|
|
724
|
+
set: boolean;
|
|
725
|
+
}) | undefined;
|
|
726
|
+
}, unknown>;
|
|
727
|
+
cookieOptions: VarDefination<"cookieOptions", {
|
|
728
|
+
maxAge?: number | null | undefined;
|
|
729
|
+
expires?: Date | null | undefined;
|
|
730
|
+
path?: string | null | undefined;
|
|
731
|
+
domain?: string | null | undefined;
|
|
732
|
+
secure?: boolean | null | undefined;
|
|
733
|
+
httpOnly?: boolean | null | undefined;
|
|
734
|
+
sameSite?: "strict" | "none" | "lax" | null | undefined;
|
|
735
|
+
}, TypeDefination<{
|
|
736
|
+
maxAge?: number | null | undefined;
|
|
737
|
+
expires?: Date | null | undefined;
|
|
738
|
+
path?: string | null | undefined;
|
|
739
|
+
domain?: string | null | undefined;
|
|
740
|
+
secure?: boolean | null | undefined;
|
|
741
|
+
httpOnly?: boolean | null | undefined;
|
|
742
|
+
sameSite?: "strict" | "none" | "lax" | null | undefined;
|
|
743
|
+
}, {
|
|
744
|
+
maxAge?: number | null | undefined;
|
|
745
|
+
expires?: Date | null | undefined;
|
|
746
|
+
path?: string | null | undefined;
|
|
747
|
+
domain?: string | null | undefined;
|
|
748
|
+
secure?: boolean | null | undefined;
|
|
749
|
+
httpOnly?: boolean | null | undefined;
|
|
750
|
+
sameSite?: "strict" | "none" | "lax" | null | undefined;
|
|
751
|
+
}, never>, never>;
|
|
752
|
+
};
|
|
753
|
+
type EdgeModules<PL extends readonly Module[]> = readonly [typeof base, ...PL];
|
|
754
|
+
/** Context `run` receives: HTTP base plus anything in `options.use`. */
|
|
755
|
+
type CreateHandlerContext<PL extends readonly Module[] = readonly []> = Context<{
|
|
756
|
+
request: Request;
|
|
757
|
+
}, ScopeOf<EdgeModules<PL>>, never, ApplyOns<ModuleFns<EdgeModules<PL>>, EdgeModules<PL>>, Fn>;
|
|
758
|
+
/**
|
|
759
|
+
* Mounted web edge: seed `req`/`res` from `request`, run `run` in the
|
|
760
|
+
* same scope, and turn {@link Redirect} into a 3xx Response.
|
|
761
|
+
*
|
|
762
|
+
* @example
|
|
763
|
+
* ```ts
|
|
764
|
+
* return c.handler({
|
|
765
|
+
* request: c.input.request,
|
|
766
|
+
* run: (ctx) => {
|
|
767
|
+
* ctx.redirect({ url: "/dashboard" });
|
|
768
|
+
* },
|
|
769
|
+
* });
|
|
770
|
+
* ```
|
|
771
|
+
*/
|
|
772
|
+
declare const handler: FnDefination<{
|
|
773
|
+
readonly request: Request;
|
|
774
|
+
readonly run: (c: any) => unknown | Promise<unknown>;
|
|
775
|
+
}, Promise<Response>, "http.handler", {
|
|
776
|
+
readonly request: TypeDefination<Request, Request, never>;
|
|
777
|
+
readonly run: TypeDefination<(c: any) => unknown | Promise<unknown>, (c: any) => unknown | Promise<unknown>, never>;
|
|
778
|
+
}, readonly [], {}, {
|
|
779
|
+
res?: ({
|
|
780
|
+
headers: {
|
|
781
|
+
append: (name: string, value: string) => void;
|
|
782
|
+
delete: (name: string) => void;
|
|
783
|
+
get: (name: string) => string | null;
|
|
784
|
+
getSetCookie: () => string[];
|
|
785
|
+
has: (name: string) => boolean;
|
|
786
|
+
set: (name: string, value: string) => void;
|
|
787
|
+
forEach: (callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any) => void;
|
|
788
|
+
entries: () => HeadersIterator<[string, string]>;
|
|
789
|
+
keys: () => HeadersIterator<string>;
|
|
790
|
+
values: () => HeadersIterator<string>;
|
|
791
|
+
[Symbol.iterator]: () => HeadersIterator<[string, string]>;
|
|
792
|
+
};
|
|
793
|
+
status?: number | undefined;
|
|
794
|
+
statusText?: string | undefined;
|
|
795
|
+
} & HttpResponse) | null | undefined;
|
|
796
|
+
req?: ({
|
|
797
|
+
raw: {
|
|
798
|
+
readonly cache: RequestCache;
|
|
799
|
+
readonly credentials: RequestCredentials;
|
|
800
|
+
readonly destination: RequestDestination;
|
|
801
|
+
readonly headers: {
|
|
802
|
+
append: (name: string, value: string) => void;
|
|
803
|
+
delete: (name: string) => void;
|
|
804
|
+
get: (name: string) => string | null;
|
|
805
|
+
getSetCookie: () => string[];
|
|
806
|
+
has: (name: string) => boolean;
|
|
807
|
+
set: (name: string, value: string) => void;
|
|
808
|
+
forEach: (callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any) => void;
|
|
809
|
+
entries: () => HeadersIterator<[string, string]>;
|
|
810
|
+
keys: () => HeadersIterator<string>;
|
|
811
|
+
values: () => HeadersIterator<string>;
|
|
812
|
+
[Symbol.iterator]: () => HeadersIterator<[string, string]>;
|
|
813
|
+
};
|
|
814
|
+
readonly integrity: string;
|
|
815
|
+
readonly keepalive: boolean;
|
|
816
|
+
readonly method: string;
|
|
817
|
+
readonly mode: RequestMode;
|
|
818
|
+
readonly redirect: RequestRedirect;
|
|
819
|
+
readonly referrer: string;
|
|
820
|
+
readonly referrerPolicy: ReferrerPolicy;
|
|
821
|
+
readonly signal: {
|
|
822
|
+
readonly aborted: boolean;
|
|
823
|
+
onabort: ((this: AbortSignal, ev: Event) => any) | null;
|
|
824
|
+
readonly reason: any;
|
|
825
|
+
throwIfAborted: () => void;
|
|
826
|
+
addEventListener: {
|
|
827
|
+
<K extends keyof AbortSignalEventMap>(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
828
|
+
(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
829
|
+
};
|
|
830
|
+
removeEventListener: {
|
|
831
|
+
<K extends keyof AbortSignalEventMap>(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
832
|
+
(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
833
|
+
};
|
|
834
|
+
dispatchEvent: (event: Event) => boolean;
|
|
835
|
+
};
|
|
836
|
+
readonly url: string;
|
|
837
|
+
clone: () => Request;
|
|
838
|
+
readonly body: {
|
|
839
|
+
readonly locked: boolean;
|
|
840
|
+
cancel: (reason?: any) => Promise<void>;
|
|
841
|
+
getReader: {
|
|
842
|
+
(options: {
|
|
843
|
+
mode: "byob";
|
|
844
|
+
}): ReadableStreamBYOBReader;
|
|
845
|
+
(): ReadableStreamDefaultReader<Uint8Array<ArrayBuffer>>;
|
|
846
|
+
(options?: ReadableStreamGetReaderOptions): ReadableStreamReader<Uint8Array<ArrayBuffer>>;
|
|
847
|
+
};
|
|
848
|
+
pipeThrough: <T>(transform: ReadableWritablePair<T, Uint8Array<ArrayBuffer>>, options?: StreamPipeOptions) => ReadableStream<T>;
|
|
849
|
+
pipeTo: (destination: WritableStream<Uint8Array<ArrayBuffer>>, options?: StreamPipeOptions) => Promise<void>;
|
|
850
|
+
tee: () => [ReadableStream<Uint8Array<ArrayBuffer>>, ReadableStream<Uint8Array<ArrayBuffer>>];
|
|
851
|
+
values: (options?: ReadableStreamIteratorOptions) => ReadableStreamAsyncIterator<Uint8Array<ArrayBuffer>>;
|
|
852
|
+
[Symbol.asyncIterator]: (options?: ReadableStreamIteratorOptions) => ReadableStreamAsyncIterator<Uint8Array<ArrayBuffer>>;
|
|
853
|
+
} | null;
|
|
854
|
+
readonly bodyUsed: boolean;
|
|
855
|
+
arrayBuffer: () => Promise<ArrayBuffer>;
|
|
856
|
+
blob: () => Promise<Blob>;
|
|
857
|
+
bytes: () => Promise<Uint8Array<ArrayBuffer>>;
|
|
858
|
+
formData: () => Promise<FormData>;
|
|
859
|
+
json: () => Promise<any>;
|
|
860
|
+
text: () => Promise<string>;
|
|
861
|
+
};
|
|
862
|
+
method: string;
|
|
863
|
+
path: string;
|
|
864
|
+
headers: {
|
|
865
|
+
append: (name: string, value: string) => void;
|
|
866
|
+
delete: (name: string) => void;
|
|
867
|
+
get: (name: string) => string | null;
|
|
868
|
+
getSetCookie: () => string[];
|
|
869
|
+
has: (name: string) => boolean;
|
|
870
|
+
set: (name: string, value: string) => void;
|
|
871
|
+
forEach: (callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any) => void;
|
|
872
|
+
entries: () => HeadersIterator<[string, string]>;
|
|
873
|
+
keys: () => HeadersIterator<string>;
|
|
874
|
+
values: () => HeadersIterator<string>;
|
|
875
|
+
[Symbol.iterator]: () => HeadersIterator<[string, string]>;
|
|
876
|
+
};
|
|
877
|
+
query: {
|
|
878
|
+
[x: string]: string | string[];
|
|
879
|
+
};
|
|
880
|
+
cookies: {
|
|
881
|
+
[x: string]: string;
|
|
882
|
+
};
|
|
883
|
+
body: unknown;
|
|
884
|
+
} & HttpRequest) | null | undefined;
|
|
885
|
+
cookieOptions?: ({
|
|
886
|
+
maxAge?: number | null | undefined;
|
|
887
|
+
expires?: Date | null | undefined;
|
|
888
|
+
path?: string | null | undefined;
|
|
889
|
+
domain?: string | null | undefined;
|
|
890
|
+
secure?: boolean | null | undefined;
|
|
891
|
+
httpOnly?: boolean | null | undefined;
|
|
892
|
+
sameSite?: "strict" | "none" | "lax" | null | undefined;
|
|
893
|
+
} & {
|
|
894
|
+
maxAge?: number | null | undefined;
|
|
895
|
+
expires?: Date | null | undefined;
|
|
896
|
+
path?: string | null | undefined;
|
|
897
|
+
domain?: string | null | undefined;
|
|
898
|
+
secure?: boolean | null | undefined;
|
|
899
|
+
httpOnly?: boolean | null | undefined;
|
|
900
|
+
sameSite?: "strict" | "none" | "lax" | null | undefined;
|
|
901
|
+
}) | undefined;
|
|
902
|
+
fromRequest?: ((input: {
|
|
903
|
+
readonly request: Request;
|
|
904
|
+
}) => Promise<{
|
|
905
|
+
method: string;
|
|
906
|
+
path: string;
|
|
907
|
+
}>) | undefined;
|
|
908
|
+
redirect?: ((input: {
|
|
909
|
+
readonly url: string;
|
|
910
|
+
readonly status?: number | undefined;
|
|
911
|
+
}) => never) | undefined;
|
|
912
|
+
getCookie?: ((...args: string[]) => string | null) | undefined;
|
|
913
|
+
setCookie?: ((input: {
|
|
914
|
+
readonly name: string;
|
|
915
|
+
readonly value: string;
|
|
916
|
+
readonly options?: {
|
|
917
|
+
maxAge?: number | null | undefined;
|
|
918
|
+
expires?: Date | null | undefined;
|
|
919
|
+
path?: string | null | undefined;
|
|
920
|
+
domain?: string | null | undefined;
|
|
921
|
+
secure?: boolean | null | undefined;
|
|
922
|
+
httpOnly?: boolean | null | undefined;
|
|
923
|
+
sameSite?: "strict" | "none" | "lax" | null | undefined;
|
|
924
|
+
} | null | undefined;
|
|
925
|
+
}) => {
|
|
926
|
+
set: boolean;
|
|
927
|
+
}) | undefined;
|
|
928
|
+
deleteCookie?: ((input: {
|
|
929
|
+
readonly name: string;
|
|
930
|
+
readonly options?: {
|
|
931
|
+
maxAge?: number | null | undefined;
|
|
932
|
+
expires?: Date | null | undefined;
|
|
933
|
+
path?: string | null | undefined;
|
|
934
|
+
domain?: string | null | undefined;
|
|
935
|
+
secure?: boolean | null | undefined;
|
|
936
|
+
httpOnly?: boolean | null | undefined;
|
|
937
|
+
sameSite?: "strict" | "none" | "lax" | null | undefined;
|
|
938
|
+
} | null | undefined;
|
|
939
|
+
}) => {
|
|
940
|
+
set: boolean;
|
|
941
|
+
}) | undefined;
|
|
942
|
+
}, unknown>;
|
|
943
|
+
type CreateHandlerOptions<PL extends readonly Module[] = readonly []> = {
|
|
944
|
+
/** Extra modules mounted onto the same `c` that `run` receives. */
|
|
945
|
+
use?: PL;
|
|
946
|
+
};
|
|
947
|
+
/**
|
|
948
|
+
* Fetch adapter: `(request) => Response`. Modules in `options.use` are
|
|
949
|
+
* mounted on the same context as `req` / `res` / `redirect`, so
|
|
950
|
+
* `createHandler((c) => c.whoami(), { use: [{ whoami }] })` works.
|
|
951
|
+
*/
|
|
952
|
+
declare function createHandler<const PL extends readonly Module[] = readonly [], R = unknown>(run: (c: CreateHandlerContext<PL>) => R | Promise<R>, options?: CreateHandlerOptions<PL>): (request: Request) => Promise<Response>;
|
|
953
|
+
//#endregion
|
|
954
|
+
export { CreateHandlerContext, CreateHandlerOptions, createHandler, handler };
|
|
955
|
+
//# sourceMappingURL=handle.d.mts.map
|