ngx-i18nsupport-lib
Version:
A Typescript library to work with Angular generated i18n files (xliff, xmb)
40 lines (39 loc) • 1.5 kB
TypeScript
/**
* Options used to control the formatting
*/
export interface XmlSerializerOptions {
beautify?: boolean;
indentString?: string;
mixedContentElements?: string[];
}
export declare class XmlSerializer {
constructor();
/**
* Serialze xml document to string.
* @param document the document
* @param options can be used to activate beautifying.
*/
serializeToString(document: Document, options?: XmlSerializerOptions): string;
/**
* Main format method that does all the work.
* Outputs a node to the outputbuffer.
* @param node the node to be formatted.
* @param options
* @param buf outputbuffer, new output will be appended to this array.
* @param indentLevel Lever of indentation for formatted output.
* @param partOfMixedContent true, if node is a subelement of an element containind mixed content.
* @param visibleNamespaces
*/
private doSerializeToString(node, options, buf, indentLevel, partOfMixedContent, visibleNamespaces);
private needNamespaceDefine(node, visibleNamespaces);
private _xmlEncoder(c);
private outputIndented(options, buf, indentLevel, ...outputParts);
private indentationString(options, indentLevel);
/**
* Test, wether tagName is an element containing mixed content.
* @param tagName
* @param options
*/
private isMixedContentElement(tagName, options);
private containsOnlyWhiteSpace(text);
}