@hpcc-js/observablehq-compiler
Version:
hpcc-js - ObservableHQ Compiler (unoffical)
27 lines (26 loc) • 959 B
TypeScript
import { Statement, ModuleDeclaration, Expression as ExpressionBase, Node } from "acorn";
import { ancestor, RecursiveVisitors, AncestorVisitors } from "acorn-walk";
export interface MutableExpression extends Node {
type: "MutableExpression";
}
export interface ViewExpression extends Node {
type: "ViewExpression";
}
export type Expression = ExpressionBase | MutableExpression | ViewExpression;
export declare function parseModule(input: any, { globals }?: {
globals: any;
}): any;
export interface Cell extends Node {
type: "Cell";
id: Expression;
text: string;
body?: Statement | ModuleDeclaration | Expression;
references: unknown[];
async: boolean;
generator: boolean;
strict: boolean;
}
export declare function splitModule(input: string): Cell[];
export { type Node, ancestor, type AncestorVisitors };
export declare function parseCell(input: string): Cell;
export declare const walk: RecursiveVisitors<any>;