deno.land / x / esm@v135_2 / packages / esm-worker / types / index.d.ts

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
declare global { interface Env { ESM_ORIGIN?: string; ESM_TOKEN?: string; NPM_REGISTRY?: string; NPM_TOKEN?: string; }}
export type HttpMetadata = { contentType: string; buildId?: string; dts?: string;};
// compatibility with Cloudflare KVexport interface WorkerStorageKV { getWithMetadata( key: string, type: "stream", ): Promise< { value: ReadableStream | null; metadata: HttpMetadata | null } >; put( key: string, value: string | ArrayBufferLike | ArrayBuffer | ReadableStream, options?: { metadata?: HttpMetadata | null }, ): Promise<void>;}
// compatibility with Cloudflare R2export interface WorkerStorage { get(key: string): Promise< { body: ReadableStream<Uint8Array>; httpMetadata?: HttpMetadata; customMetadata?: Record<string, string>; } | null >; put( key: string, value: ArrayBufferLike | ArrayBuffer | ReadableStream, options?: { httpMetadata?: HttpMetadata; customMetadata?: Record<string, string>; }, ): Promise<void>;}
export const version: string;export const targets: Set<string>;export const getBuildTargetFromUA: (ua: string | null) => string;export const checkPreflight: (req: Request) => Response | undefined;export const corsHeaders: () => Headers;export const redirect: (url: URL | string, status: 301 | 302, cacheMaxAge?: number) => Response;export const hashText: (text: string) => Promise<string>;
export function withESMWorker(middleware?: Middleware): { fetch: ( req: Request, env: Env, context: { waitUntil(promise: Promise<any>): void }, ) => Promise<Response>;};
export type Context<Data = Record<string, any>> = { cache: Cache; data: Data; url: URL; waitUntil(promise: Promise<any>): void; withCache( fetcher: () => Promise<Response> | Response, options?: { varyUA: boolean }, ): Promise<Response>;};
export interface Middleware { (req: Request, env: Env, ctx: Context): Response | void | Promise<Response | void>;}
export type PackageInfo = { name: string; version: string; main?: string; types?: string; typings?: string;};
export type PackageRegistryInfo = { name: string; versions: Record<string, any>; "dist-tags": Record<string, string>;};
esm

Version Info

Tagged at
a year ago