UNPKG

userdo

Version:

A Durable Object base class for building applications on Cloudflare Workers.

40 lines (39 loc) 1.09 kB
import { UserDO, type Env, type Table } from 'userdo'; import { z } from 'zod'; declare const TaskSchema: z.ZodObject<{ title: z.ZodString; description: z.ZodString; completed: z.ZodBoolean; createdAt: z.ZodString; }, "strip", z.ZodTypeAny, { createdAt: string; description: string; title: string; completed: boolean; }, { createdAt: string; description: string; title: string; completed: boolean; }>; type Task = z.infer<typeof TaskSchema>; export declare class TaskAppDO extends UserDO { tasks: Table<Task>; constructor(state: DurableObjectState, env: Env); createTask(title: string, description: string): Promise<any>; getTasks(): Promise<any>; updateTask(id: string, updates: Partial<Task>): Promise<{ ok: boolean; }>; deleteTask(id: string): Promise<{ ok: boolean; }>; toggleTask(id: string): Promise<{ ok: boolean; }>; } export { TaskAppDO as UserDO }; declare const _default: { fetch(request: Request, env: any, ctx: any): Promise<Response>; }; export default _default;