UNPKG

1.82 kBTypeScriptView Raw
1import * as ts from 'typescript';
2import { FileCache } from './util/file-cache';
3import { BuildContext, ChangedFile } from './util/interfaces';
4export declare function transpile(context: BuildContext): Promise<void>;
5export declare function transpileUpdate(changedFiles: ChangedFile[], context: BuildContext): Promise<void>;
6/**
7 * The full TS build for all app files.
8 */
9export declare function transpileWorker(context: BuildContext, workerConfig: TranspileWorkerConfig): Promise<{}>;
10export declare function canRunTranspileUpdate(event: string, filePath: string, context: BuildContext): boolean;
11export declare function transpileDiagnosticsOnly(context: BuildContext): Promise<{}>;
12export interface TranspileWorkerMessage {
13 rootDir?: string;
14 buildDir?: string;
15 configFile?: string;
16 transpileSuccess?: boolean;
17}
18export declare function getTsConfigAsync(context: BuildContext, tsConfigPath?: string): Promise<TsConfig>;
19export declare function getTsConfig(context: BuildContext, tsConfigPath?: string): TsConfig;
20export declare function transpileTsString(context: BuildContext, filePath: string, stringToTranspile: string): ts.TranspileOutput;
21export declare function transformSource(filePath: string, input: string): string;
22export declare function copyOriginalSourceFiles(fileCache: FileCache): void;
23export declare function resetSourceFiles(fileCache: FileCache): void;
24export declare const inMemoryFileCopySuffix = "original";
25export declare function getTsConfigPath(context: BuildContext): string;
26export interface TsConfig {
27 options: ts.CompilerOptions;
28 fileNames: string[];
29 raw: any;
30}
31export interface TranspileWorkerConfig {
32 configFile: string;
33 writeInMemory: boolean;
34 sourceMaps: boolean;
35 cache: boolean;
36 inlineTemplate: boolean;
37 useTransforms: boolean;
38}