@odata2ts/odata2ts
Version:
Flexible generator to produce various TypeScript artefacts (from simple model interfaces to complete odata clients) from OData metadata files
47 lines (46 loc) • 1.44 kB
TypeScript
import { BaseFormatter } from "./BaseFormatter.js";
export declare class PrettierFormatter extends BaseFormatter {
/**
* Prettier options found in the project.
*
* @private
* @type {prettier.Options}
* @memberof PrettierFormatter
*/
private options;
/**
* Initializes the formatter.
*
* @returns {Promise<PrettierFormatter>} Initialized formatter
* @memberof PrettierFormatter
*/
init(): Promise<PrettierFormatter>;
/**
* Formats a given source code.
*
* @abstract
* @param {string} source Source code to format
* @returns {string} Formatted source code
* @memberof Formatter
*/
format(source: string): Promise<string>;
/**
* Converts prettier indentation config to ts-morph settings.
*
* @private
* @param {boolean | undefined} useTabs Flag, whether to use tabs or not
* @param {number | undefined} tabWidth Width of a simulated tab, each number represents a space
* @returns {IndentationText} Converted indentation text
* @memberof PrettierFormatter
*/
private convertIndentation;
/**
* Converts prettier newline config to ts-morph settings.
*
* @private
* @param {string | undefined} eol prettier end-of-line config
* @returns {NewLineKind | undefined} Converted new line kind
* @memberof PrettierFormatter
*/
private convertNewline;
}