UNPKG

@struktoai/mirage-core

Version:

A Unified Virtual Filesystem For AI Agents

22 lines • 1.28 kB
import type { ParseScope } from './parse/scope.ts'; import { type TSNodeLike } from './types.ts'; /** Render a portable definition without keeping its parsed tree. */ export declare function storedFunctionText(name: string, source: string, parser?: ParseScope, aliases?: ReadonlyMap<string, string>): string; /** * A function as `declare -f` and `type` print it. bash prints its own * rendering of the parsed definition, not the text that was typed: a * body of statements one per line with four-space indents, * `;` between them, `elif` as an `if` nested in `else`, redirects respelled * after the words (`>&2` is `1>&2`), `$'...'` decoded into single quotes, * every substitution's command printed the same way, and each alias it read * the definition with expanded. Mirrors Python's function_text. */ export declare function functionText(name: string, body: readonly TSNodeLike[], aliases?: Aliases | null): string; /** The aliases a body was read with, and the parser that reads an expansion again. */ declare class Aliases { readonly values: ReadonlyMap<string, string>; readonly parse: (line: string) => TSNodeLike; constructor(values: ReadonlyMap<string, string>, parse: (line: string) => TSNodeLike); } export {}; //# sourceMappingURL=printer.d.ts.map