Download src/utils/todo/types.ts from chenbhao/codev: direct link, hf CLI and curl.
- Browser
- Download file 602 Bytes
-
https://huggingface.co/chenbhao/codev/resolve/afbc7edaae4e6bb0102ba024b49ce8be89d2264c/src/utils/todo/types.ts
- Command line
-
hf download hf://chenbhao/codev@afbc7edaae4e6bb0102ba024b49ce8be89d2264c/src/utils/todo/types.ts
-
curl -L -o types.ts https://huggingface.co/chenbhao/codev/resolve/afbc7edaae4e6bb0102ba024b49ce8be89d2264c/src/utils/todo/types.ts
602 Bytes
| 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>> | |