import Indentation from './Indentation.js'; /** Whitespace modifiers to be used with add() method */ export declare enum WS { SPACE = 0,// Adds single space NO_SPACE = 1,// Removes preceding horizontal whitespace (if any) NO_NEWLINE = 2,// Removes all preceding whitespace (whether horizontal or vertical) NEWLINE = 3,// Adds single newline (and removes any preceding whitespace) MANDATORY_NEWLINE = 4,// Adds single newline that can't be removed by NO_NEWLINE INDENT = 5,// Adds indentation (as much as needed for current indentation level) SINGLE_INDENT = 6 } export type LayoutItem = WS.SPACE | WS.SINGLE_INDENT | WS.NEWLINE | WS.MANDATORY_NEWLINE | string; /** * API for constructing SQL string (especially the whitespace part). * * It hides the internal implementation. * Originally it used plain string concatenation, which was expensive. * Now it's storing items to array and builds the string only in the end. */ export default class Layout { indentation: Indentation; private items; constructor(indentation: Indentation); /** * Appends token strings and whitespace modifications to SQL string. */ add(...items: (WS | string)[]): void; private trimHorizontalWhitespace; private trimWhitespace; private addNewline; private addIndentation; /** * Returns the final SQL string. */ toString(): string; /** * Returns the internal layout data */ getLayoutItems(): LayoutItem[]; private itemToString; }