interface DurableObject {
    alarm?(): void | Promise<void>;
    fetch(request): Response | Promise<Response>;
    webSocketClose?(ws, code, reason, wasClean): void | Promise<void>;
    webSocketError?(ws, error): void | Promise<void>;
    webSocketMessage?(ws, message): void | Promise<void>;
}

Methods

  • Returns void | Promise<void>

  • Parameters

    • ws: WebSocket
    • code: number
    • reason: string
    • wasClean: boolean

    Returns void | Promise<void>

  • Parameters

    Returns void | Promise<void>

  • Parameters

    Returns void | Promise<void>