ttsc
Version:
General-purpose TypeScript-Go compiler, runtime, plugin host, and LSP host.
27 lines (26 loc) • 1.29 kB
TypeScript
import type { ITtscCompilerContext } from "../../structures/ITtscCompilerContext";
import type { ITtscCompilerTransformation } from "../../structures/ITtscCompilerTransformation";
import type { TtscBuildResult } from "../../structures/internal/TtscBuildResult";
/**
* Transform a project and capture TypeScript source output in memory.
*
* When no plugins are configured the fast path spawns the native ttsc compiler
* host (`cmd/ttsc api-transform`) which returns a JSON map of transformed
* TypeScript sources. When plugins are present:
*
* 1. Check-stage plugins run first and abort on failure.
* 2. If there are no transform-stage plugins the host is used as the transformer.
* 3. If transform plugins exist they are dispatched through the shared-host binary
* with linked plugins passed via `TTSC_LINKED_PLUGINS_JSON`.
*
* @returns A `{ result, typescript }` pair where `typescript` maps output paths
* to their transformed TypeScript source text.
*/
export declare function transformProjectInMemory(options: ITtscCompilerContext): {
dependencies?: Record<string, string[]>;
dependenciesComplete?: string[];
graph?: ITtscCompilerTransformation.IReferenceGraph;
result: TtscBuildResult;
typescript: Record<string, string>;
volatile?: string[];
};