@nevware21/tripwire - v0.1.8
    Preparing search index...

    Interface ICompileProvider

    Abstraction over TypeScript compilation and transpilation so that the default TypeScript provider can be swapped for a custom one (e.g. esbuild, swc, babel).

    0.2.0

    interface ICompileProvider {
        compile(projectPath: string, cwd: string): void;
        registerHook(
            projectPath: string,
            cwd: string,
            checkDiagnostics?: boolean,
            tsconfigOverrides?: { [key: string]: any },
            hookOptions?: ICompileHookOptions,
        ): void;
        transpile(
            filePath: string,
            source: string,
            cwd: string,
            generateMap?: boolean,
            projectPath?: string,
        ): string;
    }
    Index
    • Compiles the TypeScript project at the specified path.

      Parameters

      • projectPath: string

        The path to the TypeScript project.

      • cwd: string

        The current working directory.

      Returns void

    • Registers a hook for the TypeScript project at the specified path.

      Parameters

      • projectPath: string

        The path to the TypeScript project.

      • cwd: string

        The current working directory.

      • OptionalcheckDiagnostics: boolean

        Optional flag requesting that the hook validate the project (equivalent to a tsc --noEmit pass) and throw if it has type errors, instead of the caller running that check separately.

      • OptionaltsconfigOverrides: { [key: string]: any }

        Optional compiler options that override whatever the loaded project file (projectPath) specifies for those same keys.

      • OptionalhookOptions: ICompileHookOptions

      Returns void

    • Transpiles the specified TypeScript file.

      Parameters

      • filePath: string

        The path to the TypeScript file.

      • source: string

        The source code of the TypeScript file.

      • cwd: string

        The current working directory.

      • OptionalgenerateMap: boolean

        Optional flag to indicate if a source map should be generated.

      • OptionalprojectPath: string

        Optional TypeScript project file to use for program-aware transpilation.

      Returns string

      The transpiled JavaScript code.