@cloudflare/workers-types 3.7.0 → 3.7.1
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/index.d.ts +20 -0
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1959,3 +1959,23 @@ declare type PagesFunction<
|
|
|
1959
1959
|
Params extends string = any,
|
|
1960
1960
|
Data extends Record<string, unknown> = Record<string, unknown>
|
|
1961
1961
|
> = (context: EventContext<Env, Params, Data>) => Response | Promise<Response>;
|
|
1962
|
+
|
|
1963
|
+
type EventPluginContext<Env, P extends string, Data, PluginArgs> = {
|
|
1964
|
+
request: Request;
|
|
1965
|
+
functionPath: string;
|
|
1966
|
+
waitUntil: (promise: Promise<any>) => void;
|
|
1967
|
+
next: (input?: Request | string, init?: RequestInit) => Promise<Response>;
|
|
1968
|
+
env: Env & { ASSETS: { fetch: typeof fetch } };
|
|
1969
|
+
params: Params<P>;
|
|
1970
|
+
data: Data;
|
|
1971
|
+
pluginArgs: PluginArgs;
|
|
1972
|
+
};
|
|
1973
|
+
|
|
1974
|
+
declare type PagesPluginFunction<
|
|
1975
|
+
Env = unknown,
|
|
1976
|
+
Params extends string = any,
|
|
1977
|
+
Data extends Record<string, unknown> = Record<string, unknown>,
|
|
1978
|
+
PluginArgs = unknown
|
|
1979
|
+
> = (
|
|
1980
|
+
context: EventPluginContext<Env, Params, Data, PluginArgs>
|
|
1981
|
+
) => Response | Promise<Response>;
|