UNPKG

1.9 kBTypeScriptView Raw
1/**
2 * Copyright (C) 2016-2019 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";
18/**
19 * Indicates that an object of a particular type should be suppressed from the
20 * XML output.
21 *
22 * See the `typeHandlers` property in {@link IOptions} for more details.
23 */
24export declare class Absent {
25 private static _instance;
26 private constructor();
27 /**
28 * Returns the sole instance of Absent.
29 */
30 static get instance(): Absent;
31}
32/**
33 * Converts the specified object to XML and adds the XML representation to the
34 * specified XmlDocument object using the specified options.
35 *
36 * This function does not add a root element. In addition, it does not add an
37 * XML declaration or DTD, and the associated options in {@link IOptions} are
38 * ignored. If desired, these must be added manually.
39 */
40export declare function parseToExistingElement(element: XmlElement<unknown>, object: unknown, options?: IOptions): void;
41/**
42 * Returns a XML string representation of the specified object using the
43 * specified options.
44 *
45 * `root` is the name of the root XML element. When the object is converted
46 * to XML, it will be a child of this root element.
47 */
48export declare function parse(root: string, object: unknown, options?: IOptions): string;