πŸ“„ 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)

  • TodoItemSchema
  • TodoItem
  • TodoListSchema
  • TodoList

πŸ“š 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>>