@live-html-editor/browser
Version:
An ideal html-editor for development purposes. It has a NEAT output + capability to save directly from browser into your sources
30 lines (29 loc) • 1.15 kB
TypeScript
import { WrapStyle } from '@live-html-editor/text-wrap';
/**
* @author [S. Mahdi Mir-Ismaili](https://mirismaili.github.io)
* Created on 1398/2/5 (2019/4/25).
*/
export declare class BeautifyHtml implements CodeStyle {
private static readonly BLOCKS;
private readonly wrapper;
readonly tabLength: number;
readonly indent: string;
readonly continuationIndent: string;
readonly keepIntentsOnEmptyLines: boolean;
readonly emptyLinesBetweenBlocks: number;
readonly wrapOn: number;
constructor(codeStyle?: CodeStyle);
beautify(element: HTMLElement): string;
/**
* @param element - Must a block element like `<div>`, `<p>`, `<h1>` (not inline like `<b>`, `<i>`, `<a>`).
* See {@link #BLOCKS} variable.
* @param parentIndents - Set to `null` if you want to beautify `innerHTML` only.
*/
beautifyR(element: HTMLElement, parentIndents: string | null): string;
}
export interface CodeStyle extends WrapStyle {
indent: string;
keepIntentsOnEmptyLines: boolean;
emptyLinesBetweenBlocks: number;
}
export declare const DEF_CODE_STYLE: CodeStyle;