UNPKG

@hpcc-js/observablehq-compiler

Version:
27 lines (26 loc) 959 B
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>;