/** * Shared pieces for the evidence widgets: number formatting for measured * values, and reading a block's rows either from an authored list or from its * bound data through a `fields` mapping. */ import { type MaterializedData } from '../../data/dataset-types.js'; import { type FormatSpec } from '../../data/format-value.js'; import type { IrNode } from '../../ir.js'; import { type JsonValue } from '../../json.js'; import type { CheckContext } from '../../registry/block-module.js'; import type { PropSchema } from '../../registry/prop-schema.js'; /** * `FORMAT_FIELDS` without defaults, for an item that overrides the block's * format: an absent field must read as "inherit", not as the default. */ export declare const FORMAT_OVERRIDE_FIELDS: Record; /** The format fields set on a props record (block or item). */ export declare function formatSpecOf(source: Record): FormatSpec; /** * Format a measured number. These widgets only hold numbers, so the `text` * format (the schema default) reads as `number`: grouped digits, trimmed * decimals and no floating-point noise. */ export declare function formatMeasure(value: number, spec: FormatSpec): string; /** A `fields` prop: which data field feeds each logical column. */ export declare function fieldMap(node: IrNode, defaults: Record): Record; /** * Report every mapped field the data does not have. `optional` keys are only * checked when the author named them explicitly. */ export declare function checkFieldMap(node: IrNode, data: MaterializedData, map: Record, optional: readonly string[], bag: CheckContext['bag']): boolean; /** One data row projected through a field map; absent fields read as null. */ export declare function projectRow(row: MaterializedData['rows'][number], map: Record): Record; /** * Whether normalization already reported a problem with the block's data * binding, so a check does not add a second error for the same cause. */ export declare function dataBindingFailed(node: IrNode, bag: CheckContext['bag']): boolean; //# sourceMappingURL=evidence-helpers.d.ts.map