@react-router/dev 0.0.0-experimental-f7761f1cd → 0.0.0-experimental-63fd291ad

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.
@@ -0,0 +1,24 @@
1
+ import { UNSAFE_MiddlewareEnabled, RouterContextProvider, AppLoadContext } from 'react-router';
2
+ import { Plugin } from 'vite';
3
+ import { PlatformProxy, GetPlatformProxyOptions } from 'wrangler';
4
+
5
+ type MaybePromise<T> = T | Promise<T>;
6
+ type CfProperties = Record<string, unknown>;
7
+ type LoadContext<Env, Cf extends CfProperties> = {
8
+ cloudflare: Omit<PlatformProxy<Env, Cf>, "dispose">;
9
+ };
10
+ type GetLoadContext<Env, Cf extends CfProperties> = (args: {
11
+ request: Request;
12
+ context: LoadContext<Env, Cf>;
13
+ }) => UNSAFE_MiddlewareEnabled extends true ? MaybePromise<RouterContextProvider> : MaybePromise<AppLoadContext>;
14
+ /**
15
+ * Vite plugin that provides [Node proxies to local workerd
16
+ * bindings](https://developers.cloudflare.com/workers/wrangler/api/#getplatformproxy)
17
+ * to `context.cloudflare` in your server loaders and server actions during
18
+ * development.
19
+ */
20
+ declare const cloudflareDevProxyVitePlugin: <Env, Cf extends CfProperties>(options?: {
21
+ getLoadContext?: GetLoadContext<Env, Cf>;
22
+ } & GetPlatformProxyOptions) => Plugin;
23
+
24
+ export { cloudflareDevProxyVitePlugin as cloudflareDevProxy };