/** * GPT-Vis Syntax Parser * * Parses a markdown-like syntax for visualization configurations. * * Syntax rules: * - `vis [chartType]` - Defines the chart type (required first line) * - `data` - Starts a data array section * - ` - key value` - Array item with key-value pairs * - ` - value` - Simple array item (for flat arrays like histogram data) * - ` - "value with spaces"` - Quoted string item; single or double quotes both supported. * Quotes are required when the value contains spaces; optional otherwise. * Quoted values are never coerced to numbers or booleans. * - `key: value` or `key value` - Top-level key-value pair * - `style` - Starts a style object section * - `palette` inside `style` uses array syntax with dash-prefixed items * - `children` - Nested array for hierarchical data (mind-map, treemap, etc.) * * @example * ``` * vis pie * data * - category 分类一 * value 27 * - category 分类二 * value 25 * innerRadius: 0.6 * style * backgroundColor #333 * palette * - #ff5a5f * - #1fb6ff * - #13ce66 * ``` * * @example Simple array (histogram) * ``` * vis histogram * data * - 78 * - 88 * - 60 * binNumber 5 * ``` * * @example Quoted string values (values containing spaces) * ``` * vis dual-axes * categories * - "North America" * - '东南 亚' * - 欧洲 * ``` * * @example Hierarchical data (mind-map) * ``` * vis mind-map * data * - name 项目计划 * children * - name 研究阶段 * children * - name 市场调研 * - name 技术可行性分析 * - name 开发阶段 * ``` */ /** * Parsed chart configuration result */ export interface ParsedConfig { type: string; [key: string]: unknown; } /** * Parse the visualization syntax string into a configuration object */ export declare function parse(syntax: string): ParsedConfig; /** * Check if a val is a valid visualization syntax */ export declare function isVisSyntax(input: any): boolean;