/// import * as ts from 'typescript'; import { type TSConfigJSON } from 'types-tsconfig'; /** Compilation Output Cache. */ export type Cache = Map; /** Pipeline Handlers Typing. */ export type Pipeline = (input: string) => string; /** Compilation Options Interface. */ export interface IOptions

{ pipeline?: P extends string ? P : P | P[]; outDir?: string; rootPath?: string; codegen?: boolean; extension?: `.${string}`; ignore?: string | string[]; } /** Helper Compilation Interceptor. */ export declare class Interceptor { /** The current output cache instance. */ readonly cache: Cache; /** The underlying interceptor options. */ private m_options; /** Returns a bound interception handler. */ get handler(): (filePath: string, data: string, _: boolean, onError?: ((message: string) => void) | undefined) => void; /** Gets the underlying pipeline instance. */ get pipeline(): Pipeline[]; /** * Constructs a simple interceptor instance. * @param options Options to use. */ constructor(options?: Omit); /** * Coordinates handling transformation of incoming requests. * @param filePath File to check. * @param data Data to transform. * @param _ [Ignored parameter] * @param onError Error handler. */ transform(filePath: string, data: string, _: boolean, onError?: (message: string) => void): void; /** * Checks if a file-path is valid for compilation. * @param filePath File to assert. */ private m_compilable; } /** * Compiles a given Typescript project. * @param source Configuration source. * @param options Compilation options. */ export declare const project: (source?: string | Program.IConfig, options?: IOptions) => Cache; /** Program Generation Functionality. */ export declare namespace Program { /** "tsconfig.json" Interface. */ interface IConfig extends TSConfigJSON { } /** * Attempts to create a valid Typescript program for compilation. * @param source Source configuration. * @param options Program options. */ const create: (source?: string | IConfig, options?: Pick) => ts.Program; } export declare namespace Program.IConfig { /** * Coordinates resolving configuration details. * @param basePath Base program path. * @param source Source file location. */ const resolve: (basePath: string, source?: string) => IConfig; }