|
| 1 | +import type { FormattingOptions } from './FormattingOptions'; |
| 2 | +export declare class Formatter { |
| 3 | + /** |
| 4 | + * Construct a new formatter. The options provided here will be normalized exactly once, |
| 5 | + * and stored on the formatter instance. |
| 6 | + */ |
| 7 | + constructor(formattingOptions?: FormattingOptions); |
| 8 | + /** |
| 9 | + * The formatting options provided in the constructor. Can be undefined if none were provided |
| 10 | + */ |
| 11 | + formattingOptions?: FormattingOptions; |
| 12 | + /** |
| 13 | + * The default number of spaces when indenting with spaces |
| 14 | + */ |
| 15 | + static DEFAULT_INDENT_SPACE_COUNT: number; |
| 16 | + private formatters; |
| 17 | + /** |
| 18 | + * Format the given input. |
| 19 | + * @param inputText the text to format |
| 20 | + * @param formattingOptions options specifying formatting preferences |
| 21 | + */ |
| 22 | + format(inputText: string, formattingOptions?: FormattingOptions): string; |
| 23 | + /** |
| 24 | + * Format the given input and return the formatted text as well as a source map |
| 25 | + * @param inputText the text to format |
| 26 | + * @param sourcePath the path to the file being formatted (used for sourcemap generator) |
| 27 | + * @param formattingOptions options specifying formatting preferences |
| 28 | + * @returns an object with property `code` holding the formatted code, and `map` holding the source map. |
| 29 | + */ |
| 30 | + formatWithSourceMap(inputText: string, sourcePath: string, formattingOptions?: FormattingOptions): import("source-map").CodeWithSourceMap; |
| 31 | + /** |
| 32 | + * Format the given input. |
| 33 | + * @param inputText the text to format |
| 34 | + * @param formattingOptions options specifying formatting preferences |
| 35 | + */ |
| 36 | + getFormattedTokens(inputText: string, formattingOptions?: FormattingOptions): import("brighterscript").Token[]; |
| 37 | + /** |
| 38 | + * Convert the character at the specified index to upper case |
| 39 | + * @deprecated |
| 40 | + */ |
| 41 | + upperCaseLetter: (text: string, index: number) => string; |
| 42 | +} |
0 commit comments