/** * A declaration field, read. * * Every field of `meta` and of every declaration in `outputs` holds either a * value or the reference `{ "input": key }`, and the reference is how a tunable * colour, a tunable pane range or a tunable band opacity reaches a declaration * that is otherwise fixed before the first bar. The engine resolves those once * at load, against the settings the host handed it; this module resolves the * same fields against the settings the chart currently holds, which is what a * descriptor built once and restyled many times needs. * * The lookup is a parameter rather than a settings object because converting one * stored setting into a value is the input table's job, not this module's, and * passing it in is what keeps the two from having to import each other. */ import type { Field, InputReference } from '../../core/emit/index.js'; import type { ColourValue, Value } from '../../core/engine/index.js'; /** What a field's `{ "input": key }` form is resolved through. */ export type InputLookup = (key: string) => Value; export declare function isReference(field: Field): field is InputReference; /** A field as a value, with any input reference resolved. */ export declare function fieldOf(field: Field, lookup: InputLookup): Value; /** A field that holds a colour, or nothing when it holds none. */ export declare function colourField(field: Field, lookup: InputLookup): ColourValue | undefined; export declare function numberField(field: Field, lookup: InputLookup, fallback: number): number; export declare function stringField(field: Field, lookup: InputLookup, fallback: string): string; export declare function boolField(field: Field, lookup: InputLookup): boolean | undefined; /** A field that holds `[min, max]`, or nothing when it holds no such pair. */ export declare function rangeField(field: Field, lookup: InputLookup): { readonly min: number; readonly max: number; } | null; //# sourceMappingURL=fields.d.ts.map