/** * Component properties: the kit's *other* kind of variation, and how a code * knob reaches one. * * Not every knob the kit models is an axis. A button's icon, a rail's menu, a * sheet's drag handle are COMPONENT PROPERTIES: a switch on the node rather * than a variant beside it. That distinction matters twice over. * * **Reading a miss.** "No counterpart in the kit" is true of a badge's digit * count in a way it is not true of a bottom bar's FAB. The FAB is right there — * it just is not addressable, because `GET /v1/images` renders a node at its * property DEFAULTS and a reference is a node id with nowhere to hang an * override. Calling both "absent" hides which ones are an authoring gap and * which are a limit of what a reference can express. * * **Reading a match.** Those defaults are applied whether or not anyone chose * them. A set whose `Show icon` defaults to true draws an icon in every render * made from it, so a label-only sticker is compared against an icon'd reference * and the width divergence that follows is an artefact, not a finding. * * {@link resolvePropertyInstance} is the way out of the second problem: a * visible instance somebody already configured at the wanted vector is a * renderable node id for a point in property space no definition can express. */ import type { KitProperty, KitPropertyValue, KitSet, VariantSeed } from "./types.js"; import { type Vocabulary } from "./vocabulary.js"; /** A property the knob matched, carried with its name so it can be set. */ export interface MatchedProperty { name: string; type: KitProperty["type"]; default: KitPropertyValue; } /** * The kit properties a knob names, or `undefined` when it names none. * * Returns a LIST rather than a single property, and a tie is not ambiguity to * break: one knob genuinely spanning several properties — a count over * `Show 1st/2nd/3rd trailing action` — is the finding, and naming one of the * three would misreport a family of switches as a single switch. */ export declare function matchProperty(properties: Record | undefined, knob: string, vocabulary?: Vocabulary): MatchedProperty[] | undefined; /** * The properties a seed names — through its declaration when it carries one, through the alias * tables otherwise. * * A declared name is matched **exactly** (up to case and punctuation), unlike a knob key, whose * whole difficulty is that it is not the kit's word. {@link matchProperty}'s partial-word search * would accept `kitAxis: "focus"` for `Show focus indicator`, which is the sort of near-miss a * declaration exists to rule out: the author is asserting the kit's own name, so a name the set * does not publish must find nothing rather than something adjacent. */ export declare function matchSeedProperty(properties: Record | undefined, seed: VariantSeed, vocabulary?: Vocabulary): MatchedProperty[] | undefined; /** * Translate one catalog seed into the value of a kit component property, or * `undefined` when the seed has no lossless representation as one. * * Boolean and text properties have a lossless representation. Instance swaps * and slots do not: `leading=icon` says what the content *means*, not which * component id supplies it, so those stay unpairable rather than guessing. * * @param peers the other properties this same seed matched — a count knob * drives a family of ordinal switches together, and a text property's * meaning depends on whether a sibling visibility switch is off. */ export declare function seededPropertyValue(property: MatchedProperty, seed: VariantSeed, peers: MatchedProperty[]): KitPropertyValue | undefined; /** What a property-shaped variant resolved to: a node, and the vector it renders at. */ export interface PropertyInstanceHit { nodeId: string; properties: Record; } /** * Resolve a property-shaped variant to a visible instance already configured * that way in the kit. * * Pure over the committed index, so false booleans, text values and * multi-switch counts can be pinned in tests without a live kit file. * * The match is on the **whole** property vector — every property the set * declares, seeded ones overridden and the rest at their defaults — because a * partial match would return an instance that differs in some property nobody * asked about, which is the very failure this exists to prevent. * * @param componentId the variant definition the instance must be *of*. An * instance of a sibling variant carries the right property vector on the * wrong component. * @returns `undefined` when any seed has no property representation, when none * of the seeds names a property at all, or when no instance matches. All * three mean "unpaired", which is the honest answer. */ export declare function resolvePropertyInstance(set: Pick | undefined, componentId: string, seeds: VariantSeed | VariantSeed[], vocabulary?: Vocabulary): PropertyInstanceHit | undefined; //# sourceMappingURL=seeded-properties.d.ts.map