UNPKG

ts-simple-ast

Version:

TypeScript compiler wrapper for AST navigation and code generation.

67 lines (66 loc) 1.55 kB
import * as ts from "typescript"; /** String characters */ export declare enum StringChar { /** Double quote */ DoubleQuote = "\"", /** Single quote */ SingleQuote = "'", } /** 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; /** String char */ stringChar: StringChar; } /** * Holds the manipulation settings. */ export declare class ManipulationSettingsContainer { private readonly settings; /** * Gets the string character. */ getStringChar(): StringChar; /** * 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; }