/** * Namespace defining the `nil` attribute (used to represent `null` values). */ export declare const XSI_NS = "http://www.w3.org/2001/XMLSchema-instance"; /** * Namespace defining the `nil` attribute (used to represent `null` values). */ export declare const XSI_NS_PREFIX = "xsi"; /** * Transforms a map of namespaces into an object representing the attributes * used to declare the namespaces in the XML. * @param namespaces Record of namespaces (mapping from the namespace to its * prefix). * @returns Attributes to set in an XML element (mapping from attribute name to * its value). */ export declare function namespacesToAttributes(namespaces: Record): Record; /** * Transforms an object representing the attributes of an XML element into a map * of namespaces. * @param attrs object representing the attributes of an XML element (mapping * from attribute name to its value). * @returns Map of namespaces (mapping from the namespace to its prefix). */ export declare function attributesToNamespaces(attrs: Record): Record; /** * Adds a namespace to the record of namespaces if not yet added given a * preferred prefix for the namespace. If the prefix is already taken, a new one * is generated. * @param namespaces Map of namespaces (mapping from the namespace to its * prefix). * @param namespace Namespace to add. * @param preferredPrefix Preferred prefix to be associated with the namespace. */ export declare function addNamespace(namespaces: Record, namespace: string, preferredPrefix: string): void; /** * Returns the provided string with a namespace prefix. * @param namespaces Record of namespaces (mapping from the namespace to its * prefix). * @param ns Namespace to prefix. * @param str String to prefix with the namespace. * @returns Prefixed string. */ export declare function withPrefix(namespaces: Record, ns: string, str: string): string;