import { BlockColumnLinks, BlockOutput, ColumnLink } from '@platforma-sdk/model'; /** * Which way a link goes: `usedBy` — another block's args reference an output of this block; * `uses` — this block's args reference an output of another block. */ export type LinkSide = "usedBy" | "uses"; /** * What one other block uses of one output, or what this block uses of one output of another * block. All references of that block to the output that pick values are merged into one row, * with their distinct picked values and the check that needs attention most; its use of the * output as a whole is a row of its own. */ export type LinkRow = Pick & { key: string; /** The other block: the one using this block's output, or the one producing the output. */ blockId: string; /** The output. Its name is not meant for reading, so it is shown only as a hint. */ column: BlockOutput; }; /** The links of one side. */ export type LinkSection = { side: LinkSide; rows: LinkRow[]; }; /** * A line about links that need attention: the other block's name, then a space and `text`. The * name is kept apart so it can be shown as a way to open that block. A line is about one link, * about every link to that block whose output is not exported and has no known label: such * outputs have no name a reader can tell apart, or about every link to a block that has not been * run yet: they all wait for its run. `outputs` names the outputs the line is about, * for a hint. */ export type LinkIssue = { key: string; blockId: string; text: string; outputs: string[]; }; /** The links of one side that need attention, shown as its {@link ALERTS} entry says. */ export type LinkAlert = { side: LinkSide; issues: LinkIssue[]; }; /** * How the alert of each side shows. `error` on the `uses` side: this block cannot run against * the links. `warn` on the `usedBy` side: the other blocks are the ones to fix, by getting the * data back here or by being reconfigured; `hint` says so. */ export declare const ALERTS: { readonly uses: { readonly type: "error"; readonly label: "Links to blocks this block takes data from are broken"; readonly hint: null; }; readonly usedBy: { readonly type: "warn"; readonly label: "Some blocks are missing data from this block"; readonly hint: string; }; }; /** The links of both sides: `usedBy`, then `uses`. */ export declare function linkSections(links: Pick): LinkSection[]; /** * One alert per side whose links need attention, in the order of the sections: * - `uses` — an output this block uses is not available or lacks picked values; * - `usedBy` — another block uses an output this block does not export, or picked values this * block's output lacks. The links are checked against this block's last run, as the hint says. */ export declare function linkAlerts(sections: LinkSection[]): LinkAlert[]; /** The label of a block, or a short form of its id when it has no label. */ export declare function blockName(labels: Record, blockId: string): string; /** * Why a selected column or column value is missing. `source`: the block meant to provide it, and * what went wrong, as a sentence that follows the block's name. `waiting`: its column is provided, * while other inputs of the block are not, and the options of one input may be made from another. * `name`: what the selection is called — the picked value, or the label of a column selected as a * whole; `null` when the column has no known label. */ export type MissingValueCause = { type: "source"; name: string | null; blockId: string; text: string; } | { type: "waiting"; name: string | null; text: string; }; /** * Why `value` is missing from its options, by the dependencies of the block: a column value id, * or a column — as an id or a ref. When its column is provided, with the value, while other * inputs of the block are not, the block offers it once they are: the options of one input may * be made from another. `undefined` for any other value, and for one whose column has nothing * wrong with it while every other input is provided too. */ export declare function describeMissingValue(dependencies: readonly ColumnLink[], value: unknown): MissingValueCause | undefined; //# sourceMappingURL=columnLinkViews.d.ts.map