import { default as Compiler } from '../../../compiler/index'; import { Filepath, SettingName } from '../../types'; import { Column, Note, Table, TableGroup, TokenPosition } from '../../types/schemaJson'; import { ElementDeclarationNode, SyntaxNode } from '../../types/nodes'; import { NodeSymbol, SymbolKind, MetadataTargetKind } from '../../types/symbol'; export type MetadataTarget = Table | TableGroup | Note | Column; /** * Specs for builtin metadata (table's note, tablegroup's color, .etc) for different element types. Does 2 things: * - `validate`: Validating if the metadata value is syntactically correct * - `assign`: Write the metadata value to the element builtin props (e.g. write `table.note` instead of `table.metadata`) */ interface MetadataField { /** Check if the metadata value is syntactically correct */ isValidBuiltinFieldValue(node?: SyntaxNode): boolean; message: string; /** Write the metadata value to the element builtin props (e.g. write to `table.note`) */ assignBuiltinField(element: Partial, value: string, token: TokenPosition): void; } export type MetadataFieldRegistry = Record>; type NameWithSymbolKind = { name: string; symbolKind: SymbolKind; }; /** @internal Exported for testing only. */ export declare function mapNamePartToSymbolKind(nameParts: string[], targetKind: MetadataTargetKind): NameWithSymbolKind[]; export declare function resolveMetadataTarget(compiler: Compiler, metadataNode: ElementDeclarationNode): NodeSymbol | undefined; /** Merge every custom-metadata block, reachable from the current program, targeting element to it's `metadata` and other builtin (note/headercolor/...) fields */ export declare function attachCustomMetadata(compiler: Compiler, targetElement: Partial, targetSymbol: NodeSymbol, fieldsRegistry: MetadataFieldRegistry, filepath: Filepath): void; export {};