import type { TaskEditorAbout, TaskEditorDraftState, TaskEditorFieldPatch, TaskEditorOption, TaskEditorPatient, TaskEditorProps, TaskEditorStatus, TaskEditorTask, TaskEditorTaskType } from './task-editor'; /** The "unset" value of the operator and assignee selects. */ export declare const NONE = "none"; export interface TaskEditorFields { date: Date | undefined; time: { hours: number; minutes: number; }; note: string; /** `NONE` until an operator is chosen. */ operatorId: string; /** '' until something chooses one. Read through `chosenTypeId`. */ typeId: string; /** The practice user, not the operator. `NONE` is nobody. */ assigneeId: string; about: TaskEditorAbout; patientId: string; /** A real id from the host list, never a typed name. */ companyId: string; } interface UiState { showError: boolean; saving: boolean; saveError: string | undefined; done: boolean; confirmedDone: boolean; donePending: boolean; doneError: string | undefined; deleting: boolean; deleteError: string | undefined; confirmDeleteOpen: boolean; /** A save or delete landed: the form stops writing until a new session. */ accepted: boolean; } export declare function aboutOf(task: { patientId?: string; companyId?: string; operatorId?: string; }): TaskEditorAbout; export interface UseTaskEditorFormOptions { mode: 'create' | 'edit'; taskId: string | undefined; initialDate: Date | undefined; /** Panel: always. Subview: while `open`. A false-to-true change starts a * fresh session. */ active: boolean; taskTypes: ReadonlyArray; assignees: ReadonlyArray; companies: ReadonlyArray; operators: ReadonlyArray; patients: ReadonlyArray; /** Names the host's search has returned, by id: a patient picked from * search stays nameable, and settable by the agent. */ searchedPatients: ReadonlyMap; resolvePatientLabel: TaskEditorProps['resolvePatientLabel']; loadTask: TaskEditorProps['loadTask']; onCreateTask: TaskEditorProps['onCreateTask']; onUpdateTask: TaskEditorProps['onUpdateTask']; onDeleteTask: TaskEditorProps['onDeleteTask']; onSetTaskDone: TaskEditorProps['onSetTaskDone']; onSaved: TaskEditorProps['onSaved']; onDeleted: TaskEditorProps['onDeleted']; readOnly: boolean; /** The privacy notice covers an existing task: nothing loads. */ withheld: boolean; /** The patient shows as the mask, so none may be picked. */ maskPatient: boolean; /** Shown when a rejection carries no message of its own. */ fallbackError: string; } export declare function useTaskEditorForm({ mode, taskId, initialDate, active, taskTypes, assignees, companies, operators, patients, searchedPatients, resolvePatientLabel, loadTask, onCreateTask, onUpdateTask, onDeleteTask, onSetTaskDone, onSaved, onDeleted, readOnly, withheld, maskPatient, fallbackError, }: UseTaskEditorFormOptions): { status: TaskEditorStatus; loadError: string | undefined; retry: () => void; fields: TaskEditorFields; patchFields: (next: Partial) => void; stored: TaskEditorTask | undefined; chosenTypeId: string; canSave: boolean; /** What the agent's `canSave` reports: the button's rule plus the * status, the seam and a save that has not landed yet. */ agentCanSave: boolean; showSave: boolean; showDelete: boolean; showDone: boolean; ui: UiState; patchUi: (next: Partial) => void; /** True once a save or delete landed in this session. */ isAccepted: () => boolean; /** A save or delete is in flight: closing now would lose its outcome. */ isBusy: () => boolean; submit: () => Promise; setDone: (next: boolean) => Promise; remove: () => Promise; applyPatch: (patch: TaskEditorFieldPatch) => void; draftState: () => TaskEditorDraftState; }; export type TaskEditorForm = ReturnType; export {}; //# sourceMappingURL=use-task-editor-form.d.ts.map