Move EmitTextWriter to types.ts
This commit is contained in:
parent
f0563ac287
commit
64ff691a2e
2 changed files with 21 additions and 24 deletions
|
@ -3915,13 +3915,9 @@
|
|||
printNode(hint: EmitHint, node: Node, sourceFile: SourceFile): string;
|
||||
printFile(sourceFile: SourceFile): string;
|
||||
printBundle(bundle: Bundle): string;
|
||||
}
|
||||
|
||||
/*@internal*/
|
||||
export interface Printer {
|
||||
writeNode(hint: EmitHint, node: Node, sourceFile: SourceFile, writer: EmitTextWriter): void;
|
||||
writeFile(sourceFile: SourceFile, writer: EmitTextWriter): void;
|
||||
writeBundle(bundle: Bundle, writer: EmitTextWriter): void;
|
||||
/*@internal*/ writeNode(hint: EmitHint, node: Node, sourceFile: SourceFile, writer: EmitTextWriter): void;
|
||||
/*@internal*/ writeFile(sourceFile: SourceFile, writer: EmitTextWriter): void;
|
||||
/*@internal*/ writeBundle(bundle: Bundle, writer: EmitTextWriter): void;
|
||||
}
|
||||
|
||||
export interface PrintHandlers {
|
||||
|
@ -3944,6 +3940,24 @@
|
|||
/*@internal*/ extendedDiagnostics?: boolean;
|
||||
}
|
||||
|
||||
/*@internal*/
|
||||
export interface EmitTextWriter {
|
||||
write(s: string): void;
|
||||
writeTextOfNode(text: string, node: Node): void;
|
||||
writeLine(): void;
|
||||
increaseIndent(): void;
|
||||
decreaseIndent(): void;
|
||||
getText(): string;
|
||||
rawWrite(s: string): void;
|
||||
writeLiteral(s: string): void;
|
||||
getTextPos(): number;
|
||||
getLine(): number;
|
||||
getColumn(): number;
|
||||
getIndent(): number;
|
||||
isAtStartOfLine(): boolean;
|
||||
reset(): void;
|
||||
}
|
||||
|
||||
export interface TextSpan {
|
||||
start: number;
|
||||
length: number;
|
||||
|
|
|
@ -2439,23 +2439,6 @@ namespace ts {
|
|||
s;
|
||||
}
|
||||
|
||||
export interface EmitTextWriter {
|
||||
write(s: string): void;
|
||||
writeTextOfNode(text: string, node: Node): void;
|
||||
writeLine(): void;
|
||||
increaseIndent(): void;
|
||||
decreaseIndent(): void;
|
||||
getText(): string;
|
||||
rawWrite(s: string): void;
|
||||
writeLiteral(s: string): void;
|
||||
getTextPos(): number;
|
||||
getLine(): number;
|
||||
getColumn(): number;
|
||||
getIndent(): number;
|
||||
isAtStartOfLine(): boolean;
|
||||
reset(): void;
|
||||
}
|
||||
|
||||
const indentStrings: string[] = ["", " "];
|
||||
export function getIndentString(level: number) {
|
||||
if (indentStrings[level] === undefined) {
|
||||
|
|
Loading…
Reference in a new issue