@openxmldev/linq-to-xml
Version:
LINQ to XML for TypeScript
46 lines (45 loc) • 1.33 kB
TypeScript
/**
* @author Thomas Barnekow
* @license MIT
*/
import { XNamespace } from './internal.js';
/**
* Represents XML names.
*/
export declare class XName {
readonly namespace: XNamespace;
readonly localName: string;
/**
* Initializes a new `XName` with the given namespace, local name, and prefix.
*
* @param namespace The `XNamespace`.
* @param localName The local name.
*/
constructor(namespace: XNamespace, localName: string);
/**
* Gets the namespace name.
*/
get namespaceName(): string;
/**
* Gets the `XName` having the given expanded name.
*
* @param expandedName The expanded name.
* @returns A new or existing `XName` instance.
*/
static get(expandedName: string): XName;
/**
* Gets the `XName` having the given local and namespace name.
*
* @param localName
* @param namespaceName
*/
static get(localName: string, namespaceName: string): XName;
/**
* Gets the string representation of this `XName`, i.e., either:
* - `localName`, if the namespace name is the empty string, or
* - \{`namespaceName`\}`localName`, if the namespace name is not empty.
*
* @returns The string representation.
*/
toString(): string;
}