@craftercms/studio-ui
Version:
Services, components, models & utils to build CrafterCMS authoring extensions.
51 lines (49 loc) • 2.67 kB
TypeScript
/*
* Copyright (C) 2007-2022 Crafter Software Corporation. All Rights Reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3 as published by
* the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { X2jOptions } from 'fast-xml-parser';
export declare function fromString(xml: string): XMLDocument;
export declare function serialize(doc: Node): string;
interface BeautifyOptions {
tabWidth: number;
printWidth: number;
xmlWhitespaceSensitivity: 'ignore' | 'strict';
xmlSelfClosingSpace: boolean;
}
export declare function beautify(xml: string): Promise<string>;
export declare function beautify(xml: string, options: Partial<BeautifyOptions>): Promise<string>;
interface GetInnerHtmlOptions {
trim: boolean;
applyLegacyUnescaping: boolean;
}
export declare function getInnerHtml(element: Element): string;
export declare function getInnerHtml(element: Element, options: Partial<GetInnerHtmlOptions>): string;
export declare function getInnerHtmlNumber(element: Element, parser?: typeof parseInt): number;
export declare function extractLocalizedElements(nodes: Array<Element> | NodeListOf<Element>): any;
export declare function commentless(xml: string): string;
export declare function findDocumentElement(element: Element): Element & XMLDocument;
export declare function createElements(element: Element, data: object): void;
export declare function wrapElementInAuxDocument(element: Element): XMLDocument;
export declare function newXMLDocument(rootTagName?: string): XMLDocument;
export declare function createElement(tagName: string): Element;
export declare function createElement(tagName: string, options: ElementCreationOptions): Element;
export declare function deserialize(xml: string): any;
export declare function deserialize(xml: Node): any;
export declare function deserialize(xml: string, options: Partial<X2jOptions>): any;
export declare function deserialize(xml: Node, options: Partial<X2jOptions>): any;
export declare function cdataWrap(value: string): string;
export declare function parseValidateDocument(content: string): XMLDocument | string;
export declare const entityEncodingTagValueProcessor: (tag: any, value: any) => any;
export {};