/** * Helpers shared by the engineering widgets: data-field mapping for the blocks * that read rows (kanban, log-viewer), scalar rows for the filter contract, and * the copyable code panel the api-endpoint block draws with core code markup. */ import type { DataRow, DataScalar } from '../../data/dataset-types.js'; import { type DiagnosticBag } from '../../diagnostics.js'; import type { IrNode } from '../../ir.js'; import { type JsonValue } from '../../json.js'; import type { PropSchema } from '../../registry/prop-schema.js'; /** * A `fields` prop that maps each part of a rendered item to a dataset field. * An omitted part reads the field of the same name. */ export declare function fieldMapProp(parts: readonly string[], description: string): PropSchema; /** The dataset field each part reads: the authored mapping, else the part's own name. */ export declare function fieldMap(node: IrNode, parts: readonly string[]): Record; /** * True when the author bound data, whether or not the binding resolved: a * failed binding has already been reported under one of the binding keys. */ export declare function bindsData(node: IrNode, bag: DiagnosticBag): boolean; /** * Check that a block takes its items from exactly one source: the inline list * prop or a data binding. Returns false when it reported a problem. */ export declare function checkItemSource(node: IrNode, bag: DiagnosticBag, listKey: string, noun: string): boolean; /** * Report every mapped field the bound rows do not have. `required` parts are * always checked; optional parts only when the author mapped them explicitly, * so a dataset without, say, an `owner` field simply shows no owner. */ export declare function checkMappedFields(node: IrNode, bag: DiagnosticBag, parts: readonly string[], required: readonly string[]): boolean; /** A row's value for a mapped part, or null when the row lacks the field. */ export declare function partValue(row: DataRow, field: string | undefined): DataScalar; /** Display text for a bound scalar; empty for null so optional parts drop out. */ export declare function partText(value: DataScalar): string; /** The scalar fields of an authored item, as the row the filter contract carries. */ export declare function scalarRow(item: Record): DataRow; /** * A copy target id for a piece of a block. Node ids never contain a dot, so a * dotted suffix cannot collide with any authored or derived node id. */ export declare function partId(node: IrNode, part: string): string; /** The core code block's Copy button, aimed at one element. */ export declare function copyButton(target: string, label: string): string; /** A code panel in the core code block's markup, with its own copy target. */ export declare function codePanel(target: string, label: string, language: string, code: string): string; //# sourceMappingURL=engineering-helpers.d.ts.map