import { variant, ValueTypeOf } from '@elaraai/east'; import { PlatformFunction } from '@elaraai/east/internal'; import { DiffBindingType, DecisionHandleType, DecisionHandleRefType, CommitStateType, JudgementInputType, DecisionConstraintType, VerdictType, AnswerLiteral } from '@elaraai/e3-ui/internal'; import { buildSliceHandle } from '@elaraai/east-ui-components'; import { Decision } from './types.js'; type DiffBindingValue = ValueTypeOf; /** JS-side shape of a decoded {@link DecisionHandleType} value. */ export type DecisionHandleValue = ValueTypeOf; /** JS-side shape of a decoded {@link DecisionHandleRefType} payload value — * the binding descriptors an extension payload carries. */ export type DecisionHandleRefValue = ValueTypeOf; /** JS-side shape of one staged judgement. */ export type Judgement = ValueTypeOf; /** JS-side shape of the derived commit gate. */ export type CommitState = ValueTypeOf; /** JS-side shape of a verdict value. */ export type Verdict = ValueTypeOf; /** JS-side shape of one typed constraint (a contract-variant value — the * default contract's shape stands in for any solution contract here). */ export type ConstraintValue = ValueTypeOf; /** The UI-state key holding a handle's case selection — derived from the * bound source paths so it is stable across reloads without anyone naming * it. Shared by the platform impl (reads/writes) and the React hook * (subscription). */ export declare function deriveSelectionKey(decisions: readonly DiffBindingValue[]): string; /** * The canonical slice config over the fixed `DecisionType` — kind / title / * value filterable, kind + title searchable. Decoded form (plain JS * accessors); also what the queue's narrowing matches against. */ export declare const DECISION_SLICE_CONFIG: { fields: Map; rangeFieldId: variant<"none", null>; searchFieldIds: string[]; breakdownFieldIds: never[]; }; /** The `decision_bind` implementation. Registered on module load. */ export declare const DecisionBindPlatform: PlatformFunction[]; export interface UseDecisionHandleResult { /** The visible queue (union of every bound view). `null` until the * bindings' types are registered and readable. */ decisions: Decision[] | null; /** The selected case id, or `null` when no case is open. */ selected: string | null; /** Resolved cases (judgements carrying a verdict), newest first; `null` * while the bindings aren't readable. */ journal: Judgement[] | null; /** The staged judgement for a case (a fresh empty one when nothing is * staged yet); `null` while the bindings aren't readable. */ judgementFor: (caseId: string) => Judgement | null; /** The derived commit gate for a case; `null` while unreadable. */ commitStateFor: (caseId: string) => CommitState | null; select: (caseId: string) => void; clearSelection: () => void; /** Probe edit — routed to the owning view's patch overlay by `id`. */ update: (next: Decision) => void; /** Record the response to one judgement prompt (by prompt id). */ answer: (caseId: string, promptId: string, response: AnswerLiteral) => void; addKnowledge: (caseId: string, text: string) => void; /** Stage a typed constraint (a contract-variant value; upserts by case name). */ inject: (caseId: string, constraint: ConstraintValue) => void; /** Commit a verdict: judgement write + removal through the owning patch * + selection clear. */ resolve: (caseId: string, verdict: Verdict) => void; /** The handle-owned slice over the queue (closures; key derived from the * bound source paths). `null` until the bindings are readable. */ slice: ReturnType | null; } /** * Resolve a {@link DecisionHandleRefType} payload value into live reads + * stable writers. The hook reconstructs the handle from its descriptors * (the same construction the platform impl performs) and adds store * subscriptions so the surface re-renders when any bound value or the * selection changes. */ export declare function useDecisionHandle(ref: DecisionHandleRefValue | null): UseDecisionHandleResult; export {}; //# sourceMappingURL=handle-runtime.d.ts.map