UNPKG

rwsdk

Version:

Build fast, server-driven webapps on Cloudflare with SSR, RSC, and realtime

15 lines (14 loc) 878 B
import type { RequestInfo } from "../runtime/requestInfo/types"; import { SyncedStateServer } from "./SyncedStateServer.mjs"; export { SyncedStateServer }; export type SyncedStateRouteOptions = { basePath?: string; durableObjectName?: string; }; /** * Registers routes that forward sync state requests to the configured Durable Object namespace. * @param getNamespace Function that returns the Durable Object namespace from the Worker env. * @param options Optional overrides for base path and object name. * @returns Router entries for the sync state API. */ export declare const syncedStateRoutes: (getNamespace: (env: Cloudflare.Env) => DurableObjectNamespace<SyncedStateServer>, options?: SyncedStateRouteOptions) => import("../runtime/lib/router.js").RouteDefinition<`/${string}`, RequestInfo<any, import("../runtime/requestInfo/types").DefaultAppContext>>[];