Separate namespace declarations in builder of intenal and exported interfaces and functions
This commit is contained in:
parent
4bb4711eff
commit
8ac01d76f5
1 changed files with 28 additions and 27 deletions
|
@ -18,7 +18,34 @@ namespace ts {
|
||||||
text: string;
|
text: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* @internal */
|
export function getFileEmitOutput(program: Program, sourceFile: SourceFile, emitOnlyDtsFiles: boolean, isDetailed: boolean,
|
||||||
|
cancellationToken?: CancellationToken, customTransformers?: CustomTransformers): EmitOutput | EmitOutputDetailed {
|
||||||
|
const outputFiles: OutputFile[] = [];
|
||||||
|
let emittedSourceFiles: SourceFile[];
|
||||||
|
const emitResult = program.emit(sourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers);
|
||||||
|
if (!isDetailed) {
|
||||||
|
return { outputFiles, emitSkipped: emitResult.emitSkipped };
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
outputFiles,
|
||||||
|
emitSkipped: emitResult.emitSkipped,
|
||||||
|
diagnostics: emitResult.diagnostics,
|
||||||
|
sourceMaps: emitResult.sourceMaps,
|
||||||
|
emittedSourceFiles
|
||||||
|
};
|
||||||
|
|
||||||
|
function writeFile(fileName: string, text: string, writeByteOrderMark: boolean, _onError: (message: string) => void, sourceFiles: SourceFile[]) {
|
||||||
|
outputFiles.push({ name: fileName, writeByteOrderMark, text });
|
||||||
|
if (isDetailed) {
|
||||||
|
emittedSourceFiles = addRange(emittedSourceFiles, sourceFiles);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* @internal */
|
||||||
|
namespace ts {
|
||||||
export interface Builder {
|
export interface Builder {
|
||||||
/**
|
/**
|
||||||
* Call this to feed new program
|
* Call this to feed new program
|
||||||
|
@ -60,38 +87,12 @@ namespace ts {
|
||||||
getFilesAffectedByUpdatedShape(program: Program, sourceFile: SourceFile, singleFileResult: string[]): string[];
|
getFilesAffectedByUpdatedShape(program: Program, sourceFile: SourceFile, singleFileResult: string[]): string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getFileEmitOutput(program: Program, sourceFile: SourceFile, emitOnlyDtsFiles: boolean, isDetailed: boolean,
|
|
||||||
cancellationToken?: CancellationToken, customTransformers?: CustomTransformers): EmitOutput | EmitOutputDetailed {
|
|
||||||
const outputFiles: OutputFile[] = [];
|
|
||||||
let emittedSourceFiles: SourceFile[];
|
|
||||||
const emitResult = program.emit(sourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers);
|
|
||||||
if (!isDetailed) {
|
|
||||||
return { outputFiles, emitSkipped: emitResult.emitSkipped };
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
outputFiles,
|
|
||||||
emitSkipped: emitResult.emitSkipped,
|
|
||||||
diagnostics: emitResult.diagnostics,
|
|
||||||
sourceMaps: emitResult.sourceMaps,
|
|
||||||
emittedSourceFiles
|
|
||||||
};
|
|
||||||
|
|
||||||
function writeFile(fileName: string, text: string, writeByteOrderMark: boolean, _onError: (message: string) => void, sourceFiles: SourceFile[]) {
|
|
||||||
outputFiles.push({ name: fileName, writeByteOrderMark, text });
|
|
||||||
if (isDetailed) {
|
|
||||||
emittedSourceFiles = addRange(emittedSourceFiles, sourceFiles);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
interface FileInfo {
|
interface FileInfo {
|
||||||
fileName: string;
|
fileName: string;
|
||||||
version: string;
|
version: string;
|
||||||
signature: string;
|
signature: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* @internal */
|
|
||||||
export function createBuilder(
|
export function createBuilder(
|
||||||
getCanonicalFileName: (fileName: string) => string,
|
getCanonicalFileName: (fileName: string) => string,
|
||||||
getEmitOutput: (program: Program, sourceFile: SourceFile, emitOnlyDtsFiles: boolean, isDetailed: boolean) => EmitOutput | EmitOutputDetailed,
|
getEmitOutput: (program: Program, sourceFile: SourceFile, emitOnlyDtsFiles: boolean, isDetailed: boolean) => EmitOutput | EmitOutputDetailed,
|
||||||
|
|
Loading…
Reference in a new issue