The open source coding agent.
TypeScript
Share: fix types
Frank72d10a08237e
diff --git a/app/packages/function/src/api.ts b/app/packages/function/src/api.tsindex d08eedb4a8a..2c84cd4f91c 100644--- a/app/packages/function/src/api.ts+++ b/app/packages/function/src/api.ts@@ -1,20 +1,16 @@import { DurableObject } from "cloudflare:workers"-import {- DurableObjectNamespace,- ExecutionContext,-} from "@cloudflare/workers-types"import { createHash } from "node:crypto"import path from "node:path"import { Resource } from "sst"type Bindings = {- SYNC_SERVER: DurableObjectNamespace<WebSocketHibernationServer>+ SYNC_SERVER: DurableObjectNamespace}export class SyncServer extends DurableObject {private files: Map<string, string> = new Map()- constructor(ctx, env) {+ constructor(ctx: DurableObjectState, env: Bindings) {super(ctx, env)this.ctx.blockConcurrencyWhile(async () => {this.files = await this.ctx.storage.list()@@ -38,10 +34,7 @@ export class SyncServer extends DurableObject {})}- async webSocketMessage(ws, message) {- if (message === "load_history") {- }- }+ async webSocketMessage(ws, message) {}async webSocketClose(ws, code, reason, wasClean) {ws.close(code, "Durable Object is closing WebSocket")diff --git a/app/packages/function/tsconfig.json b/app/packages/function/tsconfig.jsonindex f66a7be0cd4..0faf16aab7a 100644--- a/app/packages/function/tsconfig.json+++ b/app/packages/function/tsconfig.json@@ -3,6 +3,7 @@"extends": "@tsconfig/node22/tsconfig.json","compilerOptions": {"module": "ESNext",- "moduleResolution": "bundler"+ "moduleResolution": "bundler",+ "types": ["@cloudflare/workers-types", "node"]}}