UNPKG

typedraft

Version:

TypeDraft is a superset of typescript with built-in support for DSL extension and literate programming.

24 lines (23 loc) 902 B
import { FunctionDeclaration, Statement } from "@babel/types"; import { Binding, NodePath } from "@babel/traverse"; import { IDSL } from "../core/transcriber"; export interface ILocalContext { ToStatements: () => Array<Statement>; } export declare class LocalContext { m_Binding: Binding; /** * binding is used to find all references to this context, thus we can replace them with resolved statements */ constructor(binding: Binding); get m_Path(): NodePath<FunctionDeclaration>; get m_Code(): FunctionDeclaration; get m_Refs(): NodePath<import("@babel/types").Node>[]; get m_Name(): any; /** * The context itself does nothing but expresses our intention. If it's used with a DSL, we can resolve it to get the "real" statements. */ Resolve(dsl: IDSL): void; ToStatements(): Statement[]; GetDSLName(): string; }