UNPKG

2.02 kBTypeScriptView Raw
1/**
2 * Copyright (C) 2016-2020 Michael Kourlas
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16import { XmlElement } from "xmlcreate";
17import { IOptions } from "./options";
18export { IOptions, IDeclarationOptions, IDtdOptions, IFormatOptions, ITypeHandlers, IWrapHandlers, } from "./options";
19/**
20 * Indicates that an object of a particular type should be suppressed from the
21 * XML output.
22 *
23 * See the `typeHandlers` property in {@link IOptions} for more details.
24 */
25export declare class Absent {
26 private static _instance;
27 private constructor();
28 /**
29 * Returns the sole instance of Absent.
30 */
31 static get instance(): Absent;
32}
33/**
34 * Converts the specified object to XML and adds the XML representation to the
35 * specified XmlElement object using the specified options.
36 *
37 * This function does not add a root element. In addition, it does not add an
38 * XML declaration or DTD, and the associated options in {@link IOptions} are
39 * ignored. If desired, these must be added manually.
40 */
41export declare function parseToExistingElement(element: XmlElement<unknown>, object: unknown, options?: IOptions): void;
42/**
43 * Returns a XML string representation of the specified object using the
44 * specified options.
45 *
46 * `root` is the name of the root XML element. When the object is converted
47 * to XML, it will be a child of this root element.
48 */
49export declare function parse(root: string, object: unknown, options?: IOptions): string;