UNPKG

ts-simple-ast

Version:

TypeScript compiler wrapper for AST navigation and code generation.

61 lines (60 loc) 1.48 kB
import * as ts from "typescript"; import { QuoteType } from "./compiler"; /** Kinds of new lines */ export declare enum NewLineKind { /** Line feed */ LineFeed = "\n", /** Carriage return and line feed */ CarriageReturnLineFeed = "\r\n", } /** Kinds of indentation */ export declare enum IndentationText { /** Two spaces */ TwoSpaces = " ", /** Four spaces */ FourSpaces = " ", /** Eight spaces */ EightSpaces = " ", /** Tab */ Tab = "\t", } /** * Manipulation settings. */ export interface ManipulationSettings { /** Indentation text */ indentationText: IndentationText; /** New line kind */ newLineKind: NewLineKind; /** Script target. */ scriptTarget: ts.ScriptTarget; /** Quote type used for string literals. */ quoteType: QuoteType; } /** * Holds the manipulation settings. */ export declare class ManipulationSettingsContainer { private readonly settings; /** * Gets the quote type used for string literals. */ getQuoteType(): QuoteType; /** * Gets the new line kind. */ getNewLineKind(): NewLineKind; /** * Gets the indentation text; */ getIndentationText(): IndentationText; /** * Gets the script target. */ getScriptTarget(): ts.ScriptTarget; /** * Sets one or all of the settings. * @param settings - Settings to set. */ set(settings: Partial<ManipulationSettings>): void; }