π File detail
utils/todo/types.ts
π§© .tsπ 19 linesπΎ 602 bytesπ text
β Back to All Filesπ― Use case
This file lives under βutils/β, which covers cross-cutting helpers (shell, tempfiles, settings, messages, process input, β¦). On the API surface it exposes TodoItemSchema, TodoItem, TodoListSchema, and TodoList β mainly types, interfaces, or factory objects. Dependencies touch schema validation. It composes internal code from lazySchema (relative imports).
Generated from folder role, exports, dependency roots, and inline comments β not hand-reviewed for every path.
π§ Inline summary
import { z } from 'zod/v4' import { lazySchema } from '../lazySchema.js' const TodoStatusSchema = lazySchema(() => z.enum(['pending', 'in_progress', 'completed']),
π€ Exports (heuristic)
TodoItemSchemaTodoItemTodoListSchemaTodoList
π External import roots
Package roots from from "β¦" (relative paths omitted).
zod
π₯οΈ Source preview
import { z } from 'zod/v4'
import { lazySchema } from '../lazySchema.js'
const TodoStatusSchema = lazySchema(() =>
z.enum(['pending', 'in_progress', 'completed']),
)
export const TodoItemSchema = lazySchema(() =>
z.object({
content: z.string().min(1, 'Content cannot be empty'),
status: TodoStatusSchema(),
activeForm: z.string().min(1, 'Active form cannot be empty'),
}),
)
export type TodoItem = z.infer<ReturnType<typeof TodoItemSchema>>
export const TodoListSchema = lazySchema(() => z.array(TodoItemSchema()))
export type TodoList = z.infer<ReturnType<typeof TodoListSchema>>