UNPKG

@hpcc-js/observablehq-compiler

Version:
42 lines (41 loc) 1.08 kB
export interface ParsedCell { type: "import" | "viewof" | "mutable" | "variable" | "identifier"; } export interface ParsedImportCell extends ParsedCell { type: "import"; src: string; specifiers: { view: boolean; name: string; alias?: string; }[]; injections: { name: string; alias: string; }[]; } export interface ParsedVariable extends ParsedCell { type: "variable"; id?: string; inputs: string[]; func: any; } export interface ParsedViewCell extends ParsedCell { type: "viewof"; variable: ParsedVariable; variableValue: ParsedVariable; } interface ParsedMutableCell extends ParsedCell { type: "mutable"; initial: ParsedVariable; variable: ParsedVariable; variableValue: ParsedVariable; } interface ParsedVariableCell extends ParsedCell { type: "variable"; id: string; inputs: string[]; func: any; } export declare function parseCell(cellStr: string, baseUrl: string): ParsedImportCell | ParsedViewCell | ParsedMutableCell | ParsedVariableCell; export {};