import { Items, Substitution, SourceMap, TemplateFunction, Token, SpanIndex, TokenBase, Pos } from '../syntax/index.js'; import { SyndicateParser } from './grammar.js'; export declare function stripShebang(items: Items): Items; export type ModuleType = 'es6' | 'require' | 'global' | 'none'; export type ErrorSink = (message: string, start: Pos | undefined, end: Pos | undefined) => void; export interface CompileOptions { source: string; name?: string; runtime?: string; module?: ModuleType; typescript?: boolean; emitError: ErrorSink; } export interface CompilerOutput { text: string; map: SourceMap; targetToSourceMap: SpanIndex; sourceToTargetMap: SpanIndex; } export declare class ExpansionContext { readonly parser: SyndicateParser; readonly moduleType: ModuleType; readonly typescript: boolean; readonly errorEmitter: ErrorSink; nextIdNumber: number; constructor(moduleType: ModuleType, typescript: boolean, errorEmitter: ErrorSink); quasiRandomId(): string; argDecl(t: TemplateFunction, name: Substitution, type: Substitution): Items; emitError(m: string, loc: TokenBase): void; } export declare function expand(tree: Items, ctx: ExpansionContext): Items; export declare function compile(options: CompileOptions): CompilerOutput;