/** * Global actions that can be dispatched to reset/clear app state. * Using actions() creates type-safe action creators with .match() for use with ctx.on() */ export declare const globalActions: import("./actions").InferActionCreators<{ /** Reset all app state */ resetAll: true; /** User logged out - clear sensitive data */ logout: true; }, "global">; /** * Represents a single todo item from the API. */ export interface Todo { /** User ID that owns this todo */ userId: number; /** Unique identifier */ id: number; /** Todo title/description */ title: string; /** Whether the todo is completed */ completed: boolean; } /** * Shape of the todo model state. */ export interface TodoState { /** List of todo items */ items: Todo[]; /** Whether an async operation is in progress */ loading: boolean; /** Error message from the last failed operation, or null */ error: string | null; } /** * API service interface for todo operations. */ interface ApiService { /** Fetches a list of todos from the server */ getTodos(): Promise; /** Creates a new todo on the server */ addTodo(title: string): Promise; } /** * Todo API module - provides HTTP operations for todos. * * Uses JSONPlaceholder as a mock API for demonstration. * This module can be overridden in tests with a mock implementation. * * @example * ```ts * // Override in tests * appDomain.override(TodoApiModule, module("mock-api", () => ({ * getTodos: async () => [], * addTodo: async (t) => ({ ... }) * }))); * ``` */ export declare const TodoApiModule: import("..").ModuleDef; /** * Root domain for the todo application. * * The domain acts as a container for: * - Models (state containers with bound methods) * - Modules (injectable services) * - Action dispatching and routing * * Note: Domain dispatch accepts AnyAction - type safety comes from action creators. */ export declare const appDomain: import("..").Domain; /** * Todo Model - state container with bound action and thunk methods. * * Actions mutate state (wrapped with Immer internally if needed): * - setLoading(): Mark loading state * - setItems(items): Set the todo list * - setError(error): Set error message * - add(title): Add a new todo locally * - addItem(item): Add a fetched todo * - toggle(id): Toggle todo completion * - remove(id): Remove a todo * - reset(): Reset to initial state * * Thunks handle async operations: * - fetchTodos(): Fetch todos from API * - addTodo(title): Create a todo via API */ export declare const todoModel: import("..").ModelWithMethods TodoState; setItems: (state: TodoState, items: Todo[]) => TodoState; setError: (state: TodoState, error: string) => TodoState; add: (state: TodoState, title: string) => TodoState; addItem: (state: TodoState, item: Todo) => TodoState; toggle: (state: TodoState, id: number) => TodoState; remove: (state: TodoState, id: number) => TodoState; reset: (state: TodoState) => TodoState; }, { fetchTodos: () => Promise; addTodo: (title: string) => Promise<{ id: number; /** User ID that owns this todo */ userId: number; /** Todo title/description */ title: string; /** Whether the todo is completed */ completed: boolean; }>; }>; import { Action } from "../types"; export declare function handleAction(action: Action): void; export {}; //# sourceMappingURL=typeCheck.d.ts.map