@redwoodjs/sdk
Version:
A full-stack webapp toolkit designed for TypeScript, Vite, and React Server Components
30 lines (29 loc) • 917 B
TypeScript
import { DurableObject } from "cloudflare:workers";
interface ClientInfo {
url: string;
clientId: string;
cookieHeaders: string;
}
export declare class RealtimeDurableObject extends DurableObject {
state: DurableObjectState;
env: Env;
storage: DurableObjectStorage;
clientInfoCache: Map<string, ClientInfo>;
constructor(state: DurableObjectState, env: Env);
fetch(request: Request): Promise<Response>;
private createClientInfo;
private storeClientInfo;
private getClientInfo;
private handleWebSocket;
webSocketMessage(ws: WebSocket, data: ArrayBuffer): Promise<void>;
private streamResponse;
private handleAction;
private determineSockets;
render({ include, exclude, }?: {
include?: string[];
exclude?: string[];
}): Promise<void>;
private removeClientInfo;
webSocketClose(ws: WebSocket): Promise<void>;
}
export {};