import type { LifecycleStatus, ProjectionQuery } from '../projection.js'; /** * The fields a `ProjectionQuery` is edited through, and the translation * between them and the wire shape. * * The panel that used to own them is gone: a query is edited in the canvas * column's bottom panel now (#248), where the match count, the excluded list * and the document a query resolves to sit beside the fields instead of * overlaying the diagram they narrow. The fields themselves did not change, so * they live here and `query-panel.tsx` composes them. */ /** * The form's own shape, not the wire shape: every one of the 13 query * dimensions is always present here (arrays default empty, single-choice * fields default to `''`), so every field is a controlled input with no * `undefined` to special-case. Composing back to `ProjectionQuery` — where an * empty array or an unset choice must be *absent*, never `[]` or `''` (the * schema's `minItems: 1` on the array fields rejects an empty array outright) * — happens once, at the point this leaves the form. */ export interface QueryFields { readonly subjects: readonly string[]; readonly documents: readonly string[]; readonly kinds: readonly string[]; readonly layers: readonly string[]; readonly statuses: readonly LifecycleStatus[]; readonly excludeStatuses: readonly LifecycleStatus[]; readonly states: readonly string[]; readonly owners: readonly string[]; readonly constraints: readonly string[]; readonly relationshipKinds: readonly string[]; readonly kindMatching: '' | 'exact' | 'descendants'; readonly relationships: '' | 'between' | 'connected' | 'none'; readonly isolatedConcepts: '' | 'include' | 'exclude'; } export declare const EMPTY_FIELDS: QueryFields; export declare const queryToFields: (query: ProjectionQuery | null) => QueryFields; /** Every populated field, and nothing else — an empty array or an unset * single-choice field is never sent, since `minItems: 1` on the schema's * array properties makes `[]` itself invalid. */ export declare const composeQuery: (fields: QueryFields) => ProjectionQuery; export type PresentationFlag = 'showLifecycle' | 'showEvidence' | 'showOwnership' | 'showResponsibility' | 'showKindLabels' | 'showNudges'; /** The checkbox's onChange handler, extracted so it is directly testable in * isolation from rendering: it calls `onTogglePresentation` and nothing * else — never `composeQuery`/`scheduleApply`. These flags are presentation * state, not one of the 13 `ProjectionQuery` dimensions, so toggling one * must never compose a query or arm the debounced apply. */ export declare const presentationToggleHandler: (onTogglePresentation: (flag: PresentationFlag, value: boolean) => void, flag: PresentationFlag) => (value: boolean) => void; /** * All 13 `ProjectionQuery` dimensions as one always-valid-by-construction * grid. A malformed value (an unrecognised layer, say) is caught by the same * Ajv validation every other browser input goes through and surfaces through * `Faults` — this component adds no validation of its own. */ export declare function QueryFacets({ fields, onChange, }: { readonly fields: QueryFields; readonly onChange: (key: K, value: QueryFields[K]) => void; }): import("react").JSX.Element; /** * The badge toggles and the kind-label toggle. Presentation, not query: they * are written into the view document's `presentation` and never composed into * a `ProjectionQuery`, which is why they take their own handler rather than * sharing `onChange`. */ export declare function PresentationToggles({ showLifecycle, showEvidence, showOwnership, showResponsibility, showKindLabels, showNudges, onTogglePresentation, }: { readonly showLifecycle: boolean; readonly showEvidence: boolean; readonly showOwnership: boolean; readonly showResponsibility: boolean; readonly showKindLabels: boolean; readonly showNudges: boolean; readonly onTogglePresentation: (flag: PresentationFlag, value: boolean) => void; }): import("react").JSX.Element;