/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ /** * Formatting for injected constraints — one place that turns a * contract-variant value into the words a chip renders, shared by the * judgement facet and the journal. * * A constraint is `variant(leverCase, payload)`, a value of the solution's * contract `C`, and the contract case's East type says how its payload * prints: an op variant (`atMost 36`), a struct * (`person Patel · from Mar 12 · to Mar 15`), or a bare value. Nothing is * read off a value's JavaScript shape. The lever's display label comes from * the decision's `levers` when available, falling back to the contract case * name. */ import { type ValueTypeOf, type variant } from '@elaraai/east'; import type { LeverType } from '@elaraai/e3-ui/internal'; import { type Formatters } from '@elaraai/east-ui-components'; import type { ConstraintContract } from './contract.js'; type LeverValue = ValueTypeOf; /** Words for the well-known bounded-op case names. */ export declare const OP_WORDS: Record; /** * The lever's display words plus the formatted payload. Dispatch is * type-directed: the contract — walked off the judgements binding, as the * lever editor's — gives the payload's East type, and the value's shape is * never guessed. Without the contract (its binding not yet registered) the * chip names the lever alone. * * @param constraint - The injected constraint, a value of the contract `C` * @param contract - The solution's constraint contract * @param levers - The decision's levers, for the display label * @param words - The formatters dates and numbers print through (#850); the * runtime locale's when omitted * @returns The chip's lever, op and value words */ export declare function formatConstraint(constraint: variant, contract: ConstraintContract | undefined, levers?: readonly LeverValue[], words?: Formatters): { lever: string; op: string; value: string; }; export {}; //# sourceMappingURL=constraint-format.d.ts.map