import { RpgServerEngine } from '../RpgServerEngine'; import { RpgPublicationOptions } from './publication-coordinator'; export { RpgPublicationDurableObject } from './publication-coordinator'; export type { RpgPublicationOptions } from './publication-coordinator'; export { prepareRpgPublication } from './publication'; export type { RpgPublicationBucket, RpgPublicationHead, RpgPublicationManifest, RpgPublicationMap, RpgPublicationShared, } from './publication'; /** Bindings and static values available to an RPGJS Cloudflare Worker. */ export type RpgServerWorkerEnv = Record; interface RpgDurableObject { fetch(request: Request): Promise; alarm(): Promise; } declare const RpgDurableObjectBase: new (state: unknown, env: RpgServerWorkerEnv) => RpgDurableObject; /** * Durable Object entry point used by an RPGJS Cloudflare Worker deployment. * * Export this class from the Worker module under the binding configured in * `createRpgServerWorker`. */ export declare class RpgServerDurableObject extends RpgDurableObjectBase { } /** Options used to create an RPGJS Cloudflare Worker room router. */ export interface CreateRpgServerWorkerOptions { /** Durable Object binding that owns RPGJS room instances. */ binding: string; /** URL prefix used for room routes. */ partiesPath?: string; /** Additional room constructors exposed beside the main RPGJS server. */ rooms?: Record; /** Static values merged into each RPGJS room environment. */ env?: Record; /** Reject map administration requests when the secret is absent. @default true */ requireMapUpdateToken?: boolean; /** Enable private R2 versions and per-project activation/propagation. See the versioned publication guide. */ publication?: RpgPublicationOptions; } /** RPGJS server constructor accepted by the Cloudflare Worker adapter. */ export type RpgServerWorkerConstructor = new (room: unknown) => RpgServerEngine; /** * Create a Cloudflare Worker that routes RPGJS rooms through the RPGJS room adapter. * Gameplay maps are initialized through authenticated map administration, or * hydrated from private R2 artifacts when versioned publication is enabled. */ export declare function createRpgServerWorker(serverModule: RpgServerWorkerConstructor, options: CreateRpgServerWorkerOptions): { fetch(request: Request, env: RpgServerWorkerEnv, ctx: unknown): Promise; };