UNPKG

sfcc-dts

Version:

> High quality Salesforce Commerce Cloud type definitions. A dw-api-types "done right"

1,364 lines (1,335 loc) 2.68 MB
/** * represents an error during pipelet execution */ declare const PIPELET_ERROR: number; /** * represents the next pipelet to fire */ declare const PIPELET_NEXT: number; /** * Provides access to the SlotContent object. Available only in ISML * templates that are defined as the Slot's template. For example, * <isprint value="${slotcontent.callout}"> will print out the callout message * of the active Slot. */ declare const slotcontent: any; /** * Provides access to WSDL definition files in a Cartridge's webreferences * folder. For example, webreferences.mywebservice loads the * mywebservice.wsdl file and returns an instance of dw.rpc.WebReference. * The WebReference instance enables you to access the actual web service * via the WebReference.getDefaultService() method. */ declare const webreferences: any; /** * Provides access to WSDL definition files in a Cartridge's webreferences2 * folder. For example, webreferences2.mywebservice loads the * mywebservice.wsdl file and returns an instance of dw.ws.WebReference2. * The WebReference2 instance enables you to access the actual web service * via the WebReference2.getDefaultService() method. */ declare const webreferences2: any; /** * The current customer or null if this request is not associated with any customer. */ declare const customer: dw.customer.Customer; /** * The current request. */ declare const request: dw.system.Request; /** * The current response. */ declare const response: dw.system.Response; /** * The current session. */ declare const session: dw.system.Session; /** * The method tests, whether the given object is empty. The interpretation * of empty is the following. * - null is always empty * - undefined is always empty * - a string with zero length is empty * - an array with no elements is empty * - a collection with no elements is empty * @param obj the object to be thested * @return true if the object is interpreted as being empty */ declare function empty(obj: any): boolean; /** * Import the specified class and make it * available at the top level. It's equivalent in effect to the * Java import declaration. * @param classPath the fully qualified class path. */ declare function importClass(classPath: any): void; /** * Import all the classes in the specified package * available at the top level. It's equivalent in effect to the * Java import declaration. * @param packagePath the fully qualified package path. */ declare function importPackage(packagePath: any): void; /** * Imports all functions from the specified script. Variables are not imported * from the script and must be accessed through helper functions. * * The script path has the following syntax: [cartridgename:]scriptname, where * cartridgename identifies a cartridge where the script file is located. If * cartridgename is omitted the script file is loaded from the same cartridge * in which the importing component is located. * * Examples: * importScript( 'example.ds' ) imports the script file example.ds from the same cartridge * importScript( 'abc:example.ds' ) imports the script file example.ds from the cartridge 'abc' * @param scriptPath the path to the script. */ declare function importScript(scriptPath: string): void; /** * Determines whether the specified string is a valid name for an * XML element or attribute. * @param name the String specified * @return True if the string is a valid name */ declare function isXMLName(name: string): boolean; /** * Formats and prints the message using the specified params and returns * the formatted message. The format message is a Java MessageFormat * expression. Printing happens in the script log output. * @param msg the message to format. * @param params one, or multiple parameters that are used to format the message. */ declare function trace(msg: string, ...params: any[]): void; /** * This error indicates an exceptional outcome of some business logic. Instances of * this exception in general provide additional information about the reason of this case. * See the actual type referred by the type property for the description of the properties * with this additional information. * <br><br> * Limitation: The sub classes of this APIException shown in this documentation actually do not exist. * All instances are of type APIException, but with different property sets as listed in the sub classes. * <br><br> * The APIException is always related to a systems internal Java exception. The class provides * access to some more details about this internal Java exception. */ declare class APIException extends Error { /** * If the exception is associated with a root cause, the property * contains the full name of the associated Java exception. */ causeFullName: string; /** * If the exception is associated with a root cause, the property * contains the message of the associated Java exception. */ causeMessage: string; /** * If the exception is associated with a root cause, the property * contains the simplified name of the associated Java exception. */ causeName: string; /** * The full name of the underlying Java exception. */ javaFullName: string; /** * The message of the underlying Java exception. */ javaMessage: string; /** * The simplified name of the underlying Java exception. */ javaName: string; /** * The name of the actual APIException type, without the package name. */ type: string; } /** * Represents a conversion error. */ declare class ConversionError extends Error { /** * Constructs the error. * */ constructor(); /** * Constructs the error with the * specified message. * @param msg the conversion error message. */ constructor(msg: string); } /** * This isn't a built-in type. It describes the properties an object must have in order * to work as an iterator since ECMAScript 2015. */ declare class ES6Iterator { private constructor(); /** * Returns an iterator result object. * * An iterator result object can have two properties: done and value. * If done is false or undefined, then the value property contains an iterator value. * The value property may not be present if the value would be undefined. * * After a call that returns a result where done equals * true, all subsequent calls must also return done as true. * */ next(): any; } /** * This error indicates an RPC related error in the system. The Fault * is always related to a systems internal Java exception. The class provides * access to some more details about this internal Java exception. In particular * it provides details about the error send from the remote system. */ declare class Fault extends Error { /** * If the exception is associated with a root cause, the property * contains the full name of the associated Java exception. */ causeFullName: string; /** * If the exception is associated with a root cause, the property * contains the message of the associated Java exception. */ causeMessage: string; /** * If the exception is associated with a root cause, the property * contains the simplified name of the associated Java exception. */ causeName: string; /** * Provides some information on who cause the fault along the message * path. */ faultActor: string; /** * An identifier for the specific fault. */ faultCode: string; /** * More detailed information about the fault. */ faultDetail: string; /** * A human readable description for the fault. */ faultString: string; /** * The full name of the underlying Java exception. */ javaFullName: string; /** * The message of the underlying Java exception. */ javaMessage: string; /** * The simplified name of the underlying Java exception. */ javaName: string; constructor(); } /** * A generator is a special type of function that works as a factory for * iterators and it allows you to define an iterative algorithm by writing a * single function which can maintain its own state. A function becomes a * generator if it contains one or more <b>yield</b> statements. * * When a generator function is called, the body of the function does not * execute straight away; instead, it returns a generator-iterator object. * Each call to the generator-iterator's next() method will execute the * body of the function up to the next <b>yield</b> statement and return its result. * When either the end of the function or a return statement is reached, * a StopIteration exception is thrown. * * For example, the following fib() function is a Fibonacci number generator, * that returns the generator when it encounters the <b>yield</b> statement: * <pre> <code> * function fib() { * var fibNum = 0, j = 1; * while (true) { * <b><i>yield</i></b> fibNum; * var t = fibNum; * fibNum = j; * j += t; * } * } * </code> * </pre> * * To use the generator, simply call the next() method to access the values * returned by the function: * <pre> <code> * var gen = fib(); * for (var i = 0; i &lt; 10; i++) { * document.write(<b><i>gen.next()</i></b> " "); * } * </code> * </pre> */ declare class Generator { constructor(); /** * Closes the iteration of the generator. Any finally clauses active in * the generator function are run. If a finally clause throws any * exception other than StopIteration, the exception is propagated to * the caller of the close() method. * */ close(): void; /** * Resumes the iteration of the generator by continuing the function * at the statement after the yield statement. This function throws a * StopIterator exception when there are no additional iterative steps. * * @return the result of resuming the iterative algorithm or a StopIterator exception if the sequence is exhausted. */ next(): any; /** * Allows you to control the resumption of the iterative algorithm. Once a * generator has been started by calling its next() method, you can use * send() and pass a specific value that will be treated as the result * of the last yield. The generator will then return the operand of the * subsequent yield. * * You can't start a generator at an arbitrary point; you must start * it with next() before you can send() it a specific value. Note that * calling send(undefined) is equivalent to calling next(). However, * starting a newborn generator with any value other than 'undefined' when * calling send() will result in a TypeError exception. * @param value the value to use. */ send(value: any): any; } /** * This error indicates an I/O related error in the system. The IOError * is always related to a systems internal Java exception. The class provides * access to some more details about this internal Java exception. */ declare class IOError extends Error { /** * If the exception is associated with a root cause, the property * contains the full name of the associated Java exception. */ causeFullName: string; /** * If the exception is associated with a root cause, the property * contains the message of the associated Java exception. */ causeMessage: string; /** * If the exception is associated with a root cause, the property * contains the simplified name of the associated Java exception. */ causeName: string; /** * The full name of the underlying Java exception. */ javaFullName: string; /** * The message of the underlying Java exception. */ javaMessage: string; /** * The simplified name of the underlying Java exception. */ javaName: string; constructor(); } /** * Represents the an internal error. */ declare class InternalError extends Error { /** * Constructs the error. * */ constructor(); /** * Constructs the error with the * specified message. * @param msg the internal error message. */ constructor(msg: string); } /** * CommonJS modules are JavaScript files that are loaded using the <a href="class_TopLevel_global.html#TopLevel_global_require_String_DetailAnchor"> require(String)</a> * function. This function returns a module object, which wraps the script code from the file. Within a module * implementation, the module object can be accessed via the <a href="class_TopLevel_global.html#TopLevel_global_module_DetailAnchor"> module</a> variable. * <p> * A module has a unique absolute id. The same module may be resolved by <a href="class_TopLevel_global.html#TopLevel_global_require_String_DetailAnchor"> require(String)</a> * for different path arguments, like relative paths (starting with "./" or "../"), or absolute paths. See the * documentation of require for more details about the lookup procedure. * </p> * <p> * Every module object has an <a href="class_TopLevel_Module.html#TopLevel_Module_exports_DetailAnchor">exports</a> property which can be used by the module implementation to expose its * public functions or properties. Only functions and properties that are explicitly exported are accessible from other * modules, all others are private and not visible. For convenience, the global <a href="class_TopLevel_global.html#TopLevel_global_exports_DetailAnchor"> exports</a> variable * is by default also initialized with the <a href="class_TopLevel_Module.html#TopLevel_Module_exports_DetailAnchor"> module.exports</a> property of the current module. * </p> * In the most simple case, module elements can be exposed by adding them to the exports object, like: * * <pre> // Greeting.js * exports.sayHello = function() { * return 'Hello World!'; * }; * </pre> * * This is equivalent to: * * <pre> // Greeting.js * module.exports.sayHello = function() { * return 'Hello World!'; * }; * </pre> * * With the above implementation, a caller (for example another module in the same directory) could call the module * function like this: * * <pre> var message = require('./Greeting').sayHello(); * </pre> * * It is also possible to replace the whole module exports object with a completely different value, for example with a * function: * * <pre> // Greeting.js * module.exports = function sayHello() { * return 'Hi!'; * } * </pre> * * Now the result of require would be a function, which can be invoked directly like: * * <pre> var message = require('./Greeting')(); * </pre> * * This construction can be used for exporting constructor functions, so that a module becomes something like a class: * * <pre> // Greeting.js * function Greeting() * { * this.message = 'Hi!'; * } * * Greeting.prototype.getMessage = function() { * return this.message; * } * * module.exports = Greeting; * </pre> * * which would be used like: * * <pre> var Greeting = require('./Greeting'); * var m = new Greeting().getMessage(); * </pre> */ declare class NodeModule { /** * The name of the cartridge which contains the module. */ cartridge: string; /** * The exports of the module. */ exports: any; /** * The absolute, normalized id of the module, which uniquely identifies it. A call to the * global.require(String) function with this id would resolve this module. */ id: string; /** * The module (if exists) that is overridden by this module. The super module would have the same path as the * current module but its code location would be checked later in the lookup sequence. This property is useful to * reuse functionality implemented in overridden modules. */ superModule: NodeModule; private constructor(); } /** * Namespace objects represent XML namespaces and provide an * association between a namespace prefix and a Unique Resource * Identifier (URI). The prefix is either the undefined value * or a string value that may be used to reference the namespace * within the lexical representation of an XML value. When an * XML object containing a namespace with an undefined prefix is * encoded as XML by the method toXMLString(), the implementation * will automatically generate a prefix. * The URI is a string value used to uniquely identify the namespace. */ declare class Namespace { /** * The prefix of the Namespace object. */ readonly prefix: string; /** * The Uniform Resource Identifier (URI) of the Namespace object. */ readonly uri: string; /** * Constructs a simple namespace where the * uri and prefix properties are set to an empty string. * A namespace with URI set to the empty string represents no namespace. * No namespace is used in XML objects to explicitly specify * that a name is not inside a namespace and may never be * associated with a prefix other than the empty string. * */ constructor(); /** * Constructs a Namespace object and assigns values to the * uri and prefix properties based on the type * of uriValue. If uriValue is a * Namespace object, a copy of the Namespace is constructed. * If uriValue is a QName object, the uri property is * set to the QName object's uri property. * Otherwise, uriValue is converted into a string and * assigned to the uri property. * @param uriValue the value to use when constructing the Namespace. */ constructor(uriValue: any); /** * Constructs a Namespace object and assigns values to the * uri and prefix properties. * * The value of the prefixValue parameter is assigned to the * prefix property in the following manner: * * If undefined is passed, prefix is set to undefined. * If the argument is a valid XML name, it is converted * to a string and assigned to the prefix property. * If the argument is not a valid XML name, the prefix * property is set to undefined. * * The value of the uriValue parameter is assigned * to the uri property in the following manner: * * If a QName object is passed for the uriValue parameter, * the uri property is set to the value of the QName object's uri property. * If a QName object is not passed for the uriValue parameter, * the uriValue parameter is converted to a string and assigned to the uri property. * @param prefixValue the prefix value to use when constructing the Namespace. * @param uriValue the value to use when constructing the Namespace. */ constructor(prefixValue: any, uriValue: any); /** * Returns the prefix of the Namespace object. * * @return the prefix of the Namespace object. */ getPrefix(): string; /** * Returns the Uniform Resource Identifier (URI) of the Namespace object. * * @return the Uniform Resource Identifier (URI) of the Namespace object. */ getUri(): string; /** * Returns a string representation of this Namespace object. * * @return a string representation of this Namespace object. */ toString(): string; } /** * QName objects are used to represent qualified names of XML * elements and attributes. Each QName object has a local name * of type string and a namespace URI of type string or null. * When the namespace URI is null, this qualified name matches * any namespace. * * If the QName of an XML element is specified without identifying a * namespace (i.e., as an unqualified identifier), the uri property * of the associated QName will be set to the in-scope default * namespace. If the QName of an XML attribute is * specified without identifying a namespace, the uri property of * the associated QName will be the empty string representing no namespace. */ declare class QName { /** * The local name of the QName object. */ readonly localName: string; /** * The Uniform Resource Identifier (URI) of the QName object. */ readonly uri: string; /** * Constructs a QName object where localName * is set to an empty String. * */ constructor(); /** * Constructs a QName object that is a copy of the specified * qname. If the argument is not * a QName object, the argument is converted to a string and assigned * to the localName property of the new QName instance. * @param qname the QName from which this QName will be constructed. */ constructor(qname: QName); /** * Creates a QName object with a uri from a Namespace object and * a localName from a QName object. If either argument is not * the expected data type, the argument is converted to a string * and assigned to the corresponding property of the new QName object. * @param uri a Namespace object from which to copy the uri value. An argument of any other type is converted to a string. * @param localName a QName object from which to copy the localName value. An argument of any other type is converted to a string. */ constructor(uri: Namespace, localName: QName); /** * Returns the local name of the QName object. * * @return the local name of the QName object. */ getLocalName(): string; /** * Returns the Uniform Resource Identifier (URI) of the QName object. * * @return the Uniform Resource Identifier (URI) of the QName object. */ getUri(): string; /** * Returns a string composed of the URI, and the local name for the QName * object, separated by "::". The format depends on the uri property of * the QName object: * If uri == "" * toString returns localName * else if uri == null * toString returns *::localName * else * toString returns uri::localNam * * @return a string composed of the URI, and the local name for the QName object, separated by "::". */ toString(): string; } /** * A special type of exception that is thrown when an Iterator or Generator * sequence is exhausted. */ declare class StopIteration { constructor(); } /** * This error indicates an error in the system, which doesn't fall into * any of the other error categories like for example IOError. The SystemError * is always related to a systems internal Java exception. The class provides * access to some more details about this internal Java exception. */ declare class SystemError extends Error { /** * If the exception is associated with a root cause, the property * contains the full name of the associated Java exception. */ causeFullName: string; /** * If the exception is associated with a root cause, the property * contains the message of the associated Java exception. */ causeMessage: string; /** * If the exception is associated with a root cause, the property * contains the simplified name of the associated Java exception. */ causeName: string; /** * The full name of the underlying Java exception. */ javaFullName: string; /** * The message of the underlying Java exception. */ javaMessage: string; /** * The simplified name of the underlying Java exception. */ javaName: string; constructor(); } /** * The XML object contains functions and properties for working with XML * instances. The XML object implements the powerful XML-handling standards * defined in the ECMA-357 specification (known as "E4X"). * <p> * Use the toXMLString() method to return a string representation of the XML * object regardless of whether the XML object has simple content or complex * content. * </p><p> * Do not create large XML objects in memory to avoid out-of-memory conditions. * When dealing with XML streams use <a href="class_dw_io_XMLStreamReader.html">XMLStreamReader</a> and * <a href="class_dw_io_XMLStreamWriter.html">XMLStreamWriter</a>. The following example shows how: * * </p><pre> var id : String = "p42"; * var pname : String = "a product"; * * // use E4X syntax * var product : XML = * &lt;product id={id}&gt; * &lt;name&gt;{pname}&lt;/name&gt; * &lt;shortdesc&gt;&lt;/shortdesc&gt; * &lt;/product&gt;; * * product.shortdesc = "a fine product"; * product.longdesc = "this is a fine product"; * * var xmlString = product.toXMLString(); * * fileWriter.write(xmlString); * </pre> * * <p> * * The code above will write the following to file: * * </p><p> * * </p><pre> &lt;product id="p42"&gt; * &lt;name&gt;a product&lt;/name&gt; * &lt;shortdesc&gt;a fine product&lt;/shortdesc&gt; * &lt;longdesc&gt;this is a fine product&lt;/longdesc&gt; * &lt;/product&gt; * </pre> * * <p> * * Do not create large XML objects in memory to avoid out-of-memory conditions. * When dealing with XML streams use <a href="class_dw_io_XMLStreamReader.html">XMLStreamReader</a> and * <a href="class_dw_io_XMLStreamWriter.html">XMLStreamWriter</a>.</p> */ declare class XML { /** * Returns the value associated with the key or null */ [name: string]: any; /** * The ignoreComments property determines whether or not XML comments are * ignored when XML objects parse the source XML data. */ static ignoreComments: boolean; /** * The ignoreProcessingInstructions property determines whether or not XML * processing instructions are ignored when XML objects parse the source XML data. */ static ignoreProcessingInstructions: boolean; /** * The ignoreWhitespace property determines whether or not white space * characters at the beginning and end of text nodes are ignored during parsing. */ static ignoreWhitespace: boolean; /** * The prettyIndent property determines the amount of indentation applied by * the toString() and toXMLString() methods when the XML.prettyPrinting * property is set to true. */ static prettyIndent: number; /** * The prettyPrinting property determines whether the toString() and toXMLString() * methods normalize white space characters between some tags. */ static prettyPrinting: boolean; /** * Creates a new XML object. * */ constructor(); /** * Creates a new XML object. * You must use the constructor to create an XML object before you * call any of the methods of the XML class. * Use the toXMLString() method to return a string representation * of the XML object regardless of whether the XML object has simple * content or complex content. * @param value any Object that can be converted to XML via the top-level XML() function. */ constructor(value: any); /** * Adds a namespace to the set of in-scope namespaces for the XML object. * If the namespace already exists in the in-scope namespaces for the XML * object, then the prefix of the existing namespace is set to undefined. * If ns is a Namespace instance, it is used directly. * However, if ns is a QName instance, the input parameter's URI is used * to create a new namespace. If ns is not a Namespace or QName instance, * ns is converted to a String and a namespace is created from the String. * @param ns the namespace to add to the XML object. * @return a new XML object, with the namespace added. */ addNamespace(ns: any): XML; /** * Appends the specified child to the end of the object's properties. * child should be a XML object, an XMLList object or any other * data type that will then be converted to a String. * @param child the object to append to this XML object. * @return the XML object with the child appended. */ appendChild(child: any): XML; /** * Returns the attribute associated with this XML object that * is identified by the specified name. * @param attributeName the name of the attribute. * @return the value of the attribute as either an XMLList or an empty XMLList */ attribute(attributeName: string): XMLList; /** * Returns an XMList of the attributes in this XML Object. * * @return an XMList of the attributes in this XML Object. */ attributes(): XMLList; /** * Returns the children of the XML object based on the specified * property name. * @param propertyName the property name representing the children of this XML object. * @return an XMLList of children that match the property name parameter. */ child(propertyName: any): XMLList; /** * Identifies the zero-based index of this XML object within * the context of its parent, or -1 if this object has no parent. * * @return the index of this XML object in the context of its parent, or -1 if this object has no parent. */ childIndex(): number; /** * Returns an XMLList containing the children of this XML object, maintaing * the sequence in which they appear. * * @return an XMLList containing the children of this XML object. */ children(): XMLList; /** * Returns the properties of the XML object that contain comments. * * @return properties of the XML object that contain comments. */ comments(): XMLList; /** * Returns true if this XML object contains the specified * XML object, false otherwise. * @param value the object to locate in this XML object. * @return true if this XML object contains the specified XML object, false otherwise. */ contains(value: XML): boolean; /** * Returns a copy of the this XML object including * duplicate copies of the entire tree of nodes. * The copied XML object has no parent. * * @return the copy of the object. */ copy(): XML; /** * Returns a new Object with the following properties set to the default values: * ignoreComments, ignoreProcessingInstructions, ignoreWhitespace, prettyIndent, * and prettyPrinting. The default values are as follows: * * ignoreComments = true * ignoreProcessingInstructions = true * ignoreWhitespace = true * prettyIndent = 2 * prettyPrinting = true * * * Be aware that this method does not apply the settings to an existing instance * of an XML object. Instead, this method returns an Object containing the * default settings. * * @return an Object with properties set to the default settings. */ static defaultSettings(): any; /** * Returns all descendents of the XML object. * * @return a list of all descendents of the XML object. */ descendants(): XMLList; /** * Returns all descendents of the XML object that * have the specified name parameter. To return all descendents, * use * as the name parameter. * @param name the name of the element to match. To return all descendents, use * as the name parameter. * @return a list of all descendents constrained by the name parameter. */ descendants(name: string): XMLList; /** * Returns a list of all of the elements of the XML object. * */ elements(): XMLList; /** * Returns a list of the elements of the XML object using the * specified name to constrain the list. name can be a * QName, String, or any other data type that will be converted * to a string prior to performing the search for elements of that * name. * * To list all objects use * for the value of name. * @param name the name of the elements to return or an * to return all elements. * @return a list of the elements of the XML object using the specified name to constrain the list. */ elements(name: any): XMLList; /** * Returns a Boolean value indicating whether * this XML object contains complex content. An XML object is considered * to contain complex content if it represents an XML element that has * child elements. XML objects representing attributes, comments, processing * instructions and text nodes do not have complex content. The existence of * attributes, comments, processing instructions and text nodes within an XML * object is not significant in determining if it has complex content. * * @return a Boolean value indicating whether this XML object contains complex content. */ hasComplexContent(): boolean; /** * Returns a Boolean value indicating whether this object has the * property specified by prop. * @param prop the property to locate. * @return true if the property exists, false otherwise. */ hasOwnProperty(prop: string): boolean; /** * Returns a Boolean value indicating whether this XML object contains * simple content. An XML object is considered to contain simple * content if it represents a text node, represents an attribute node * or if it represents an XML element that has no child elements. XML * objects representing comments and processing instructions do not * have simple content. The existence of attributes, comments, * processing instructions and text nodes within an XML object is not * significant in determining if it has simple content. * * @return a Boolean value indicating whether this XML object contains simple content. */ hasSimpleContent(): boolean; /** * Returns an Array of Namespace objects representing the namespaces * in scope for this XML object in the context of its parent. If the * parent of this XML object is modified, the associated namespace * declarations may change. The set of namespaces returned by this * method may be a super set of the namespaces used by this value * * @return an Array of Namespace objects representing the namespaces in scope for this XML object in the context of its parent. */ inScopeNamespaces(): Array<Namespace>; /** * Inserts the specified child2 after the specified child1 * in this XML object and returns this XML object. If child1 is null, * inserts child2 before all children of * this XML object. If child1 does not exist * in this XML object, it returns without modifying this XML object. * @param child1 the child after which child2 is inserted. * @param child2 the child to insert into this XML object. * @return the updated XML object. */ insertChildAfter(child1: any, child2: any): XML; /** * Inserts the specified child2 before the specified child1 * in this XML object and returns this XML object. If child1 is null, * inserts child2 after all children of * this XML object. If child1 does not exist * in this XML object, it returns without modifying this XML object. * @param child1 the child before which child2 is inserted. * @param child2 the child to insert into this XML object. * @return the updated XML object. */ insertChildBefore(child1: any, child2: any): XML; /** * Returns a value of 1 for XML objects. * * @return the value of 1. */ length(): number; /** * Returns the local name portion of the qualified name of the XML object. * * @return the local name as either a String or null. */ localName(): any; /** * Returns the qualified name for the XML object. * * @return the qualified name as either a QName or null. */ name(): any; /** * Returns the namespace associated with the qualified name * of this XML object. * * @return the namespace associated with the qualified name of this XML object. */ namespace(): any; /** * Returns the namespace that matches the specified prefix and * that is in scope for the XML object. if there is no such * namespace, the method returns undefined. * @param prefix the prefix to use when attempting to locate a namespace. * @return the namespace that matches the specified prefix and that is in scope for the XML object. If specified namespace does not exist, the method returns undefined. */ namespace(prefix: string): any; /** * Returns an Array of namespace declarations associated * with the XML Obnject in the context of its parent. * * @return an Array of namespace declarations associated with the XML Obnject in the context of its parent. */ namespaceDeclarations(): Array<Namespace>; /** * Returns the type of the XML object, such * as text, comment, processing-instruction, * or attribute. * * @return the type of the XML object. */ nodeKind(): string; /** * Merges adjacent text nodes and eliminates and eliminates * empty text nodes for this XML object and all its * descendents. * * @return the normalized XML object. */ normalize(): XML; /** * Returns the parent of the XML object * or null if the XML object does not have * a parent. * * @return the parent of the XML object of null if the XML object does not have a parent. */ parent(): any; /** * Inserts the specified child into this XML object * prior to its existing XML properties and then returns * this XML object. * @param value the child to prepend to this XML object. * @return the XML object updated with the prepended child. */ prependChild(value: any): XML; /** * Returns an XMLList containing all the children of this XML object * that are processing-instructions. * * @return an XMLList containing all the children of this XML object that are processing-instructions. */ processingInstructions(): XMLList; /** * Returns an XMLList containing all the children of this XML object * that are processing-instructions with the specified name. If you * use * for the name, all processing-instructions are returned. * @param name the name representing the processing-instructions you want to retreive. * @return an XMLList containing all the children of this XML object that are processing-instructions with the specified name. */ processingInstructions(name: string): XMLList; /** * Returns a Boolean indicating whether the specified * property will be included in the set of properties iterated * over when this XML object is used in a for..in statement. * @param property the property to test. * @return true when the property can be iterated in a for..in statement, false otherwise. */ propertyIsEnumerable(property: string): boolean; /** * Removes the specified namespace from the in scope namespaces * of this object and all its descendents, then returns a copy of * this XML object. This method will not remove a namespace from * an object when it is referenced by that object's QName or * the ONames of that object's attributes. * @param ns the namespace to remove. * @return a copy of this XML object with the namespace removed. */ removeNamespace(ns: Namespace): XML; /** * Replaces the XML properties of this XML object specified by * propertyName with value and returns this * updated XML object. If this XML object contains no properties * that match propertyName, the replace method returns without * modifying this XML object. * * The propertyName parameter may be a numeric property name, * an unqualified name for a set of XML elements, a qualified * name for a set of XML elements or the properties wildcard *. * * When the propertyName parameter is an unqualified name, * it identifies XML elements in the default namespace. The value * parameter may be an XML object, XMLList object or any value * that may be converted to a String. * @param propertyName a numeric property name, an unqualified name for a set of XML elements, a qualified name for a set of XML elements or the properties wildcard *. * @param value an XML object, XMLList object or any value that may be converted to a String. * @return the updated XML object. */ replace(propertyName: string, value: any): XML; /** * Replaces the XML properties of this XML object * with a new set of XML properties from value. * @param value a single XML object or an XMLList. * @return the updated XML object. */ setChildren(value: any): XML; /** * Replaces the local name of this XML object with * a string constructed from the specified name. * @param name the new local name. */ setLocalName(name: string): void; /** * Replaces the name of this XML object with a * QName or AttributeName constructed from the specified * name. * @param name the new name of this XML object. */ setName(name: string): void; /** * Replaces the namespace associated with the name of * this XML object with the specified namespace. * @param ns the namespace to associated with the name of thix XML object. */ setNamespace(ns: Namespace): void; /** * Restores the default settings for the following XML * properties: * * XML.ignoreComments = true * XML.ignoreProcessingInstructions = true * XML.ignoreWhitespace = true * XML.prettyIndent = 2 * XML.prettyPrinting = true * */ static setSettings(): void; /** * Updates the collection of global XML properties: * ignoreComments, ignoreProcessingInstructions, ignoreWhitespace, * prettyPrinting, prettyIndent, and prettyPrinting. * @param settings an object with each of the following properties: ignoreComments, ignoreProcessingInstructions, ignoreWhitespace, prettyIndent, and prettyPrinting. */ static setSettings(settings: any): void; /** * Returns the collection of global XML properties: * ignoreComments, ignoreProcessingInstructions, ignoreWhitespace, * prettyPrinting, prettyIndent, and prettyPrinting. * * @return an object with each of the following properties: ignoreComments, ignoreProcessingInstructions, ignoreWhitespace, prettyIndent, and prettyPrinting. */ static settings(): any; /** * Returns returns an XMLList containing all XML properties of * this XML object that represent XML text nodes. * * @return an XMLList containing all XML properties of this XML object that represent XML text nodes. */ text(): XMLList; /** * Returns the String representation of the XML object. If the object contains * simple content, this method returns a String with tag, attributes, and * namespace declarations removed. However, if the object contains complex * content, this method returns an XML encoded String representing the entire * XML object. If you want to return the entire XML object regardless of * content complexity, use the toXMLString() method. * * @return the String representation of the XML object. */ toString(): string; /** * Returns a XML-encoded String representation of the XML object, including tag and * attributed delimiters. * * @return the string representation of the XML object. */ toXMLString(): string; /** * Returns this XML object. * * @return this XML object. */ valueOf(): XML; } /** * An XMLList object is an ordered collection of properties. * A XMLList object represents a XML document, an XML fragment, * or an arbitrary collection of XML objects. * An individual XML object is the same thing as an XMLList * containing only that XML object. All operations available * for the XML object are also available for an XMLList object * that contains exactly one XML object. */ declare class XMLList { /** * Creates a new XMLList object using the * specified value. * @param value the value to use. */ constructor(value: any); /** * Returns the attribute associated with this XMLList object that * is identified by the specified name. * @param attributeName the name of the attribute. * @return the value of the attribute as either an XMLList or an empty XMLList */ attribute(attributeName: string): XMLList; /** * Returns an XMList of the attributes in this XMLList Object. * * @return an XMList of the attributes in this XMLList Object. */ attributes(): XMLList; /** * Returns the children of the XMLList object based on the specified * property name. * @param propertyName the property name representing the children of this XMLList object. * @return an XMLList of children that match the property name parameter. */ child(propertyName: any): XMLList; /** * Returns an XMLList containing the children of this XMLList object, maintaing * the sequence in which they appear. * * @return an XMLList containing the children of this XMLList object. */ children(): XMLList; /** * Returns the properties of the XMLList object that contain comments. * * @return properties of the XMLList object that contain comments. */ comments(): XMLList; /** * Returns true if this XMLList object contains the specified * XML object, false otherwise. * @param value the object to locate in this XMLList object. * @return true if this XMLList object contains the specified XML object, false otherwise. */ contains(value: XML): boolean; /** * Returns a deep copy of the this XMLList object. * * @return the deep copy of the object. */ copy(): XMLList; /** * Calls the descendants() method of each XML object in this XMLList * object and returns an XMLList containing the * results concatenated in order. * * @return a list of all descendents of the XML objects in this XMLList object. */ descendants(): XMLList; /** * Calls the descendants(name) method of each XML object in this XMLList * object and returns an XMLList containing the * results concatenated in order. * @param name the name of the element to match. To return all descendents, use * as the name parameter. * @return a list of all descendents of the XML objects in this XMLList constrained by the name parameter. */ descendants(name: string): XMLList; /** * Calls the elements() method in each XML object in this XMLList * object and returns an XMLList containing the results concatenated in order. * */ elements(): XMLList; /** * Calls the elements(name) method in each of the XML objects in * this XMLList object and returns an XMLList containing the results * concatenated in order. name can be a * QName, String, or any other data type that will be converted * to a string prior to performing the search for elements of that * name. * * To list all objects use * for the value of name. * @param name the name of the elements to return. * @return a list of all elements of the XML objects in this XMLList constrained by the name parameter. */ elements(name: any): XMLList; /** * Returns a Boolean value indicating whether * this XMLList object contains complex content. An XMLList object is considered * to contain complex content if it is not empty, contains a single XML item * with complex content or contains elements. * * @return a Boolean value indicating whether this XMLList object contains complex content. */ hasComplexContent(): boolean; /** * Returns a Boolean value indicating whether this object has the * property specified by prop. * @param prop the property to locate. * @return true if the property exists, false otherwise. */ hasOwnProperty(prop: string): boolean; /** * Returns a Boolean value indicating whether this XML object contains * simple content. An XMLList object is considered to contain simple * content if it is empty, contains a single XML item with simple * content or contains no elements. * * @return a Boolean value indicating whether this XML object contains simple content. */ hasSimpleContent(): boolean; /** * Returns the number of children in this XMLList * object. * * @return the number of children in this XMLList object. */ length(): number; /** * Puts all text nodes in this XMLList, all the XML objects it * contains and the descendents of all the XML objects it * contains into a normal form by merging adjacent text nodes * and eliminating empty text nodes. * * @return the XMLList object containing normailzed objects. */ normalize(): XMLList; /** * Returns the parent of the XMLList object * or null if the XMLList object does not have * a parent. * * @return the parent of the XMLList object or null if the XMLList object does not have a parent. */ parent(): any; /** * Calls the processingInstructions() method of each XML object * in this XMLList object and returns an XMList containing the results * in order. * * @return an XMLList contaiing the result of calling the processingInstructions() method of each XML object in this XMLList object. */ processingInstructions(): XMLList; /** * Calls the processingInstructions(name) method of each XML object * in this XMLList object and returns an XMList containing the results * in order. * @param name the name representing the processing-instructions you want to retreive. * @return an XMLList containing the result of calling the processingInstructions(name) method of each XML object in this XMLList object. */ processingInstructions(name: string): XMLList; /** * Returns a Boolean indicating whether the specified * property will be included in the set of properties iterated * over when this XML object is used in a for..in statement. * @param property the property to test. * @return true when the property can be iterated in a for..in statement, false otherwise. */ propertyIsEnumerable(property: string): boolean; /** * Calls the text() method of each XML object contained * in this XMLList object and returns an XMLList containing * the results concatenated in order. * * @return the concatenated results of calling the text() method of every XML object contained in this XMLList. */ text(): XMLList; /** * Returns the String representation of this XMLList object. * * @return the String representation of this XMLList object. */ toString(): string; /** * Retur