better-call 0.2.11 → 0.2.13-beta.2
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/README.md +2 -384
- package/dist/client.cjs +8 -33
- package/dist/client.d.cts +7 -5
- package/dist/client.d.mts +42 -0
- package/dist/client.d.ts +7 -5
- package/dist/client.mjs +12 -0
- package/dist/index.cjs +269 -704
- package/dist/index.d.cts +7 -119
- package/dist/index.d.mts +15 -0
- package/dist/index.d.ts +7 -119
- package/dist/index.mjs +646 -0
- package/dist/shared/better-call.342be6c5.d.cts +342 -0
- package/dist/shared/better-call.342be6c5.d.mts +342 -0
- package/dist/shared/better-call.342be6c5.d.ts +342 -0
- package/package.json +22 -21
- package/dist/client.cjs.map +0 -1
- package/dist/client.js +0 -14
- package/dist/client.js.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.js +0 -1065
- package/dist/index.js.map +0 -1
- package/dist/router-DIrNt-mY.d.cts +0 -337
- package/dist/router-DIrNt-mY.d.ts +0 -337
package/dist/index.d.cts
CHANGED
|
@@ -1,127 +1,15 @@
|
|
|
1
|
-
import { E as
|
|
2
|
-
export {
|
|
3
|
-
import {
|
|
1
|
+
import { E as EndpointOptions, a as EndpointResponse, b as Endpoint, c as EndpointContext, C as CookiePrefixOptions, d as CookieOptions } from './shared/better-call.342be6c5.cjs';
|
|
2
|
+
export { i as Context, o as Cookie, p as CookieConstraint, H as HasRequiredKeys, l as InferResponse, I as Input, h as IsEmptyObject, J as JSONResponse, P as Prettify, g as RequiredKeysOf, R as Router, S as SignedCookie, U as UnionToIntersection, e as createEndpoint, k as createGetHeader, m as createJSON, f as createRouter, j as createSetHeader, n as fromError, q as parse, s as parseSigned, r as runValidation, t as serialize, u as serializeSigned } from './shared/better-call.342be6c5.cjs';
|
|
3
|
+
import { BufferSource } from 'stream/web';
|
|
4
4
|
import 'zod';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
*/
|
|
10
|
-
throwOnError?: boolean;
|
|
11
|
-
}
|
|
12
|
-
declare function createEndpointCreator<E extends {
|
|
13
|
-
use?: Endpoint[];
|
|
14
|
-
}>(opts?: E): <Path extends string, Opts extends EndpointOptions, R extends EndpointResponse>(path: Path, options: Opts, handler: (ctx: Prettify<Context<Path, Opts> & InferUse<Opts["use"]> & InferUse<E["use"]> & Omit<ContextTools, "_flag">>) => Promise<R>) => {
|
|
15
|
-
<C extends HasRequiredKeys<Context<Path, Opts>> extends true ? [Context<Path, Opts>] : [(Context<Path, Opts> | undefined)?]>(...ctx: C): Promise<C extends [{
|
|
16
|
-
asResponse: true;
|
|
17
|
-
}] ? Response : R extends {
|
|
18
|
-
_flag: "json";
|
|
19
|
-
} ? R extends {
|
|
20
|
-
body: infer B;
|
|
21
|
-
} ? B : null : Awaited<R>>;
|
|
22
|
-
path: Path;
|
|
23
|
-
options: Opts;
|
|
24
|
-
method: Method | Method[];
|
|
25
|
-
headers: Headers;
|
|
26
|
-
};
|
|
27
|
-
declare function createEndpoint<Path extends string, Opts extends EndpointOptions, R extends EndpointResponse>(path: Path, options: Opts, handler: Handler<Path, Opts, R>): {
|
|
28
|
-
<C extends HasRequiredKeys<Context<Path, Opts>> extends true ? [Context<Path, Opts>] : [Context<Path, Opts>?]>(...ctx: C): Promise<C extends [{
|
|
29
|
-
asResponse: true;
|
|
30
|
-
}] ? Response : R extends {
|
|
31
|
-
_flag: "json";
|
|
32
|
-
} ? R extends {
|
|
33
|
-
body: infer B;
|
|
34
|
-
} ? B : null : Awaited<R>>;
|
|
35
|
-
path: Path;
|
|
36
|
-
options: Opts;
|
|
37
|
-
method: Method | Method[];
|
|
38
|
-
headers: Headers;
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
type MiddlewareHandler<Opts extends EndpointOptions, R extends EndpointResponse, Extra extends Record<string, any> = {}> = (ctx: Prettify<InferBody<Opts> & InferRequest<Opts> & InferHeaders<Opts> & {
|
|
42
|
-
params?: Record<string, string>;
|
|
43
|
-
query?: Record<string, string>;
|
|
44
|
-
} & ContextTools> & Extra) => Promise<R>;
|
|
45
|
-
declare function createMiddleware<Opts extends EndpointOptions, R extends EndpointResponse>(optionsOrHandler: MiddlewareHandler<Opts, R>): Endpoint<Handler<string, Opts, R>, Opts>;
|
|
46
|
-
declare function createMiddleware<Opts extends Omit<EndpointOptions, "method">, R extends EndpointResponse>(optionsOrHandler: Opts, handler: MiddlewareHandler<Opts & {
|
|
47
|
-
method: "*";
|
|
48
|
-
}, R>): Endpoint<Handler<string, Opts & {
|
|
49
|
-
method: "*";
|
|
50
|
-
}, R>, Opts & {
|
|
51
|
-
method: "*";
|
|
52
|
-
}>;
|
|
53
|
-
declare const createMiddlewareCreator: <E extends {
|
|
54
|
-
use?: Endpoint[];
|
|
55
|
-
}>(opts?: E) => {
|
|
56
|
-
<Opts extends EndpointOptions, R extends EndpointResponse>(optionsOrHandler: (ctx: InferBody<Opts, Opts["body"] & (undefined extends InferUseOptions<Opts>["body"] ? {} : InferUseOptions<Opts>["body"])> & InferUse<E["use"]> & InferRequest<Opts, Opts["requireRequest"]> & InferHeaders<Opts, Opts["requireHeaders"]> & {
|
|
57
|
-
params?: Record<string, string>;
|
|
58
|
-
query?: Record<string, string>;
|
|
59
|
-
} & ContextTools extends infer T ? { [key in keyof T]: (InferBody<Opts, Opts["body"] & (undefined extends InferUseOptions<Opts>["body"] ? {} : InferUseOptions<Opts>["body"])> & InferUse<E["use"]> & InferRequest<Opts, Opts["requireRequest"]> & InferHeaders<Opts, Opts["requireHeaders"]> & {
|
|
60
|
-
params?: Record<string, string>;
|
|
61
|
-
query?: Record<string, string>;
|
|
62
|
-
} & ContextTools)[key]; } : never) => Promise<R>): Endpoint<Handler<string, Opts, R>, Opts>;
|
|
63
|
-
<Opts extends Omit<EndpointOptions, "method">, R_1 extends EndpointResponse>(optionsOrHandler: Opts, handler: (ctx: InferBody<Opts & {
|
|
64
|
-
method: "*";
|
|
65
|
-
}, (Opts & {
|
|
66
|
-
method: "*";
|
|
67
|
-
})["body"] & (undefined extends InferUseOptions<Opts & {
|
|
68
|
-
method: "*";
|
|
69
|
-
}>["body"] ? {} : InferUseOptions<Opts & {
|
|
70
|
-
method: "*";
|
|
71
|
-
}>["body"])> & InferUse<E["use"]> & InferRequest<Opts & {
|
|
72
|
-
method: "*";
|
|
73
|
-
}, (Opts & {
|
|
74
|
-
method: "*";
|
|
75
|
-
})["requireRequest"]> & InferHeaders<Opts & {
|
|
76
|
-
method: "*";
|
|
77
|
-
}, (Opts & {
|
|
78
|
-
method: "*";
|
|
79
|
-
})["requireHeaders"]> & {
|
|
80
|
-
params?: Record<string, string>;
|
|
81
|
-
query?: Record<string, string>;
|
|
82
|
-
} & ContextTools extends infer T ? { [key in keyof T]: (InferBody<Opts & {
|
|
83
|
-
method: "*";
|
|
84
|
-
}, (Opts & {
|
|
85
|
-
method: "*";
|
|
86
|
-
})["body"] & (undefined extends InferUseOptions<Opts & {
|
|
87
|
-
method: "*";
|
|
88
|
-
}>["body"] ? {} : InferUseOptions<Opts & {
|
|
89
|
-
method: "*";
|
|
90
|
-
}>["body"])> & InferUse<E["use"]> & InferRequest<Opts & {
|
|
91
|
-
method: "*";
|
|
92
|
-
}, (Opts & {
|
|
93
|
-
method: "*";
|
|
94
|
-
})["requireRequest"]> & InferHeaders<Opts & {
|
|
95
|
-
method: "*";
|
|
96
|
-
}, (Opts & {
|
|
97
|
-
method: "*";
|
|
98
|
-
})["requireHeaders"]> & {
|
|
99
|
-
params?: Record<string, string>;
|
|
100
|
-
query?: Record<string, string>;
|
|
101
|
-
} & ContextTools)[key]; } : never) => Promise<R_1>): Endpoint<Handler<string, Opts & {
|
|
102
|
-
method: "*";
|
|
103
|
-
}, R_1>, Opts & {
|
|
104
|
-
method: "*";
|
|
105
|
-
}>;
|
|
106
|
-
};
|
|
107
|
-
type Middleware<Opts extends EndpointOptions = EndpointOptions, R extends EndpointResponse = EndpointResponse> = (opts: Opts, handler: (ctx: {
|
|
108
|
-
body?: InferBody<Opts>;
|
|
109
|
-
params?: Record<string, string>;
|
|
110
|
-
query?: Record<string, string>;
|
|
111
|
-
}) => Promise<R>) => Endpoint;
|
|
112
|
-
|
|
113
|
-
declare function getRequest({ request, base, bodySizeLimit, }: {
|
|
114
|
-
base: string;
|
|
115
|
-
bodySizeLimit?: number;
|
|
116
|
-
request: IncomingMessage;
|
|
117
|
-
}): Request;
|
|
118
|
-
declare function setResponse(res: ServerResponse, response: Response): Promise<void>;
|
|
119
|
-
|
|
120
|
-
declare function toNodeHandler(handler: Router["handler"]): (req: IncomingMessage, res: ServerResponse) => Promise<void>;
|
|
6
|
+
type MiddlewareHandler<Options extends EndpointOptions, R extends EndpointResponse> = (context: EndpointContext<any, Options>) => Promise<R>;
|
|
7
|
+
declare function createMiddleware<Opts extends EndpointOptions, R extends EndpointResponse>(optionsOrHandler: MiddlewareHandler<Opts, R>): Endpoint<MiddlewareHandler<Opts, R>, Opts>;
|
|
8
|
+
declare function createMiddleware<Opts extends EndpointOptions, R extends EndpointResponse>(optionsOrHandler: Opts, handler: MiddlewareHandler<Opts, R>): Endpoint<MiddlewareHandler<Opts, R>, Opts>;
|
|
121
9
|
|
|
122
10
|
declare const getCookie: (cookie: string, key: string, prefix?: CookiePrefixOptions) => string | undefined;
|
|
123
11
|
declare const setCookie: (header: Headers, name: string, value: string, opt?: CookieOptions) => void;
|
|
124
12
|
declare const setSignedCookie: (header: Headers, name: string, value: string, secret: string | BufferSource, opt?: CookieOptions) => Promise<void>;
|
|
125
13
|
declare const getSignedCookie: (header: Headers, secret: string, key: string, prefix?: CookiePrefixOptions) => Promise<string | false | undefined>;
|
|
126
14
|
|
|
127
|
-
export {
|
|
15
|
+
export { CookieOptions, CookiePrefixOptions, Endpoint, EndpointContext, EndpointResponse, createMiddleware, getCookie, getSignedCookie, setCookie, setSignedCookie };
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { E as EndpointOptions, a as EndpointResponse, b as Endpoint, c as EndpointContext, C as CookiePrefixOptions, d as CookieOptions } from './shared/better-call.342be6c5.mjs';
|
|
2
|
+
export { i as Context, o as Cookie, p as CookieConstraint, H as HasRequiredKeys, l as InferResponse, I as Input, h as IsEmptyObject, J as JSONResponse, P as Prettify, g as RequiredKeysOf, R as Router, S as SignedCookie, U as UnionToIntersection, e as createEndpoint, k as createGetHeader, m as createJSON, f as createRouter, j as createSetHeader, n as fromError, q as parse, s as parseSigned, r as runValidation, t as serialize, u as serializeSigned } from './shared/better-call.342be6c5.mjs';
|
|
3
|
+
import { BufferSource } from 'stream/web';
|
|
4
|
+
import 'zod';
|
|
5
|
+
|
|
6
|
+
type MiddlewareHandler<Options extends EndpointOptions, R extends EndpointResponse> = (context: EndpointContext<any, Options>) => Promise<R>;
|
|
7
|
+
declare function createMiddleware<Opts extends EndpointOptions, R extends EndpointResponse>(optionsOrHandler: MiddlewareHandler<Opts, R>): Endpoint<MiddlewareHandler<Opts, R>, Opts>;
|
|
8
|
+
declare function createMiddleware<Opts extends EndpointOptions, R extends EndpointResponse>(optionsOrHandler: Opts, handler: MiddlewareHandler<Opts, R>): Endpoint<MiddlewareHandler<Opts, R>, Opts>;
|
|
9
|
+
|
|
10
|
+
declare const getCookie: (cookie: string, key: string, prefix?: CookiePrefixOptions) => string | undefined;
|
|
11
|
+
declare const setCookie: (header: Headers, name: string, value: string, opt?: CookieOptions) => void;
|
|
12
|
+
declare const setSignedCookie: (header: Headers, name: string, value: string, secret: string | BufferSource, opt?: CookieOptions) => Promise<void>;
|
|
13
|
+
declare const getSignedCookie: (header: Headers, secret: string, key: string, prefix?: CookiePrefixOptions) => Promise<string | false | undefined>;
|
|
14
|
+
|
|
15
|
+
export { CookieOptions, CookiePrefixOptions, Endpoint, EndpointContext, EndpointResponse, createMiddleware, getCookie, getSignedCookie, setCookie, setSignedCookie };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,127 +1,15 @@
|
|
|
1
|
-
import { E as
|
|
2
|
-
export {
|
|
3
|
-
import {
|
|
1
|
+
import { E as EndpointOptions, a as EndpointResponse, b as Endpoint, c as EndpointContext, C as CookiePrefixOptions, d as CookieOptions } from './shared/better-call.342be6c5.js';
|
|
2
|
+
export { i as Context, o as Cookie, p as CookieConstraint, H as HasRequiredKeys, l as InferResponse, I as Input, h as IsEmptyObject, J as JSONResponse, P as Prettify, g as RequiredKeysOf, R as Router, S as SignedCookie, U as UnionToIntersection, e as createEndpoint, k as createGetHeader, m as createJSON, f as createRouter, j as createSetHeader, n as fromError, q as parse, s as parseSigned, r as runValidation, t as serialize, u as serializeSigned } from './shared/better-call.342be6c5.js';
|
|
3
|
+
import { BufferSource } from 'stream/web';
|
|
4
4
|
import 'zod';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
*/
|
|
10
|
-
throwOnError?: boolean;
|
|
11
|
-
}
|
|
12
|
-
declare function createEndpointCreator<E extends {
|
|
13
|
-
use?: Endpoint[];
|
|
14
|
-
}>(opts?: E): <Path extends string, Opts extends EndpointOptions, R extends EndpointResponse>(path: Path, options: Opts, handler: (ctx: Prettify<Context<Path, Opts> & InferUse<Opts["use"]> & InferUse<E["use"]> & Omit<ContextTools, "_flag">>) => Promise<R>) => {
|
|
15
|
-
<C extends HasRequiredKeys<Context<Path, Opts>> extends true ? [Context<Path, Opts>] : [(Context<Path, Opts> | undefined)?]>(...ctx: C): Promise<C extends [{
|
|
16
|
-
asResponse: true;
|
|
17
|
-
}] ? Response : R extends {
|
|
18
|
-
_flag: "json";
|
|
19
|
-
} ? R extends {
|
|
20
|
-
body: infer B;
|
|
21
|
-
} ? B : null : Awaited<R>>;
|
|
22
|
-
path: Path;
|
|
23
|
-
options: Opts;
|
|
24
|
-
method: Method | Method[];
|
|
25
|
-
headers: Headers;
|
|
26
|
-
};
|
|
27
|
-
declare function createEndpoint<Path extends string, Opts extends EndpointOptions, R extends EndpointResponse>(path: Path, options: Opts, handler: Handler<Path, Opts, R>): {
|
|
28
|
-
<C extends HasRequiredKeys<Context<Path, Opts>> extends true ? [Context<Path, Opts>] : [Context<Path, Opts>?]>(...ctx: C): Promise<C extends [{
|
|
29
|
-
asResponse: true;
|
|
30
|
-
}] ? Response : R extends {
|
|
31
|
-
_flag: "json";
|
|
32
|
-
} ? R extends {
|
|
33
|
-
body: infer B;
|
|
34
|
-
} ? B : null : Awaited<R>>;
|
|
35
|
-
path: Path;
|
|
36
|
-
options: Opts;
|
|
37
|
-
method: Method | Method[];
|
|
38
|
-
headers: Headers;
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
type MiddlewareHandler<Opts extends EndpointOptions, R extends EndpointResponse, Extra extends Record<string, any> = {}> = (ctx: Prettify<InferBody<Opts> & InferRequest<Opts> & InferHeaders<Opts> & {
|
|
42
|
-
params?: Record<string, string>;
|
|
43
|
-
query?: Record<string, string>;
|
|
44
|
-
} & ContextTools> & Extra) => Promise<R>;
|
|
45
|
-
declare function createMiddleware<Opts extends EndpointOptions, R extends EndpointResponse>(optionsOrHandler: MiddlewareHandler<Opts, R>): Endpoint<Handler<string, Opts, R>, Opts>;
|
|
46
|
-
declare function createMiddleware<Opts extends Omit<EndpointOptions, "method">, R extends EndpointResponse>(optionsOrHandler: Opts, handler: MiddlewareHandler<Opts & {
|
|
47
|
-
method: "*";
|
|
48
|
-
}, R>): Endpoint<Handler<string, Opts & {
|
|
49
|
-
method: "*";
|
|
50
|
-
}, R>, Opts & {
|
|
51
|
-
method: "*";
|
|
52
|
-
}>;
|
|
53
|
-
declare const createMiddlewareCreator: <E extends {
|
|
54
|
-
use?: Endpoint[];
|
|
55
|
-
}>(opts?: E) => {
|
|
56
|
-
<Opts extends EndpointOptions, R extends EndpointResponse>(optionsOrHandler: (ctx: InferBody<Opts, Opts["body"] & (undefined extends InferUseOptions<Opts>["body"] ? {} : InferUseOptions<Opts>["body"])> & InferUse<E["use"]> & InferRequest<Opts, Opts["requireRequest"]> & InferHeaders<Opts, Opts["requireHeaders"]> & {
|
|
57
|
-
params?: Record<string, string>;
|
|
58
|
-
query?: Record<string, string>;
|
|
59
|
-
} & ContextTools extends infer T ? { [key in keyof T]: (InferBody<Opts, Opts["body"] & (undefined extends InferUseOptions<Opts>["body"] ? {} : InferUseOptions<Opts>["body"])> & InferUse<E["use"]> & InferRequest<Opts, Opts["requireRequest"]> & InferHeaders<Opts, Opts["requireHeaders"]> & {
|
|
60
|
-
params?: Record<string, string>;
|
|
61
|
-
query?: Record<string, string>;
|
|
62
|
-
} & ContextTools)[key]; } : never) => Promise<R>): Endpoint<Handler<string, Opts, R>, Opts>;
|
|
63
|
-
<Opts extends Omit<EndpointOptions, "method">, R_1 extends EndpointResponse>(optionsOrHandler: Opts, handler: (ctx: InferBody<Opts & {
|
|
64
|
-
method: "*";
|
|
65
|
-
}, (Opts & {
|
|
66
|
-
method: "*";
|
|
67
|
-
})["body"] & (undefined extends InferUseOptions<Opts & {
|
|
68
|
-
method: "*";
|
|
69
|
-
}>["body"] ? {} : InferUseOptions<Opts & {
|
|
70
|
-
method: "*";
|
|
71
|
-
}>["body"])> & InferUse<E["use"]> & InferRequest<Opts & {
|
|
72
|
-
method: "*";
|
|
73
|
-
}, (Opts & {
|
|
74
|
-
method: "*";
|
|
75
|
-
})["requireRequest"]> & InferHeaders<Opts & {
|
|
76
|
-
method: "*";
|
|
77
|
-
}, (Opts & {
|
|
78
|
-
method: "*";
|
|
79
|
-
})["requireHeaders"]> & {
|
|
80
|
-
params?: Record<string, string>;
|
|
81
|
-
query?: Record<string, string>;
|
|
82
|
-
} & ContextTools extends infer T ? { [key in keyof T]: (InferBody<Opts & {
|
|
83
|
-
method: "*";
|
|
84
|
-
}, (Opts & {
|
|
85
|
-
method: "*";
|
|
86
|
-
})["body"] & (undefined extends InferUseOptions<Opts & {
|
|
87
|
-
method: "*";
|
|
88
|
-
}>["body"] ? {} : InferUseOptions<Opts & {
|
|
89
|
-
method: "*";
|
|
90
|
-
}>["body"])> & InferUse<E["use"]> & InferRequest<Opts & {
|
|
91
|
-
method: "*";
|
|
92
|
-
}, (Opts & {
|
|
93
|
-
method: "*";
|
|
94
|
-
})["requireRequest"]> & InferHeaders<Opts & {
|
|
95
|
-
method: "*";
|
|
96
|
-
}, (Opts & {
|
|
97
|
-
method: "*";
|
|
98
|
-
})["requireHeaders"]> & {
|
|
99
|
-
params?: Record<string, string>;
|
|
100
|
-
query?: Record<string, string>;
|
|
101
|
-
} & ContextTools)[key]; } : never) => Promise<R_1>): Endpoint<Handler<string, Opts & {
|
|
102
|
-
method: "*";
|
|
103
|
-
}, R_1>, Opts & {
|
|
104
|
-
method: "*";
|
|
105
|
-
}>;
|
|
106
|
-
};
|
|
107
|
-
type Middleware<Opts extends EndpointOptions = EndpointOptions, R extends EndpointResponse = EndpointResponse> = (opts: Opts, handler: (ctx: {
|
|
108
|
-
body?: InferBody<Opts>;
|
|
109
|
-
params?: Record<string, string>;
|
|
110
|
-
query?: Record<string, string>;
|
|
111
|
-
}) => Promise<R>) => Endpoint;
|
|
112
|
-
|
|
113
|
-
declare function getRequest({ request, base, bodySizeLimit, }: {
|
|
114
|
-
base: string;
|
|
115
|
-
bodySizeLimit?: number;
|
|
116
|
-
request: IncomingMessage;
|
|
117
|
-
}): Request;
|
|
118
|
-
declare function setResponse(res: ServerResponse, response: Response): Promise<void>;
|
|
119
|
-
|
|
120
|
-
declare function toNodeHandler(handler: Router["handler"]): (req: IncomingMessage, res: ServerResponse) => Promise<void>;
|
|
6
|
+
type MiddlewareHandler<Options extends EndpointOptions, R extends EndpointResponse> = (context: EndpointContext<any, Options>) => Promise<R>;
|
|
7
|
+
declare function createMiddleware<Opts extends EndpointOptions, R extends EndpointResponse>(optionsOrHandler: MiddlewareHandler<Opts, R>): Endpoint<MiddlewareHandler<Opts, R>, Opts>;
|
|
8
|
+
declare function createMiddleware<Opts extends EndpointOptions, R extends EndpointResponse>(optionsOrHandler: Opts, handler: MiddlewareHandler<Opts, R>): Endpoint<MiddlewareHandler<Opts, R>, Opts>;
|
|
121
9
|
|
|
122
10
|
declare const getCookie: (cookie: string, key: string, prefix?: CookiePrefixOptions) => string | undefined;
|
|
123
11
|
declare const setCookie: (header: Headers, name: string, value: string, opt?: CookieOptions) => void;
|
|
124
12
|
declare const setSignedCookie: (header: Headers, name: string, value: string, secret: string | BufferSource, opt?: CookieOptions) => Promise<void>;
|
|
125
13
|
declare const getSignedCookie: (header: Headers, secret: string, key: string, prefix?: CookiePrefixOptions) => Promise<string | false | undefined>;
|
|
126
14
|
|
|
127
|
-
export {
|
|
15
|
+
export { CookieOptions, CookiePrefixOptions, Endpoint, EndpointContext, EndpointResponse, createMiddleware, getCookie, getSignedCookie, setCookie, setSignedCookie };
|