import { type IXmlSerializerFormatOptions } from "./xml.serializer.format.js"; /** Describes an XML qualified name with an optional namespace. */ export interface IQualifiedName { /** The namespace URI or prefix. */ ns?: string; /** The local XML name. */ name: string; } /** Provides a fluent interface for writing XML content. */ export interface IXmlBuilder { /** * Writes the XML declaration. * @param version defines the XML version * @param encoding defines the optional XML encoding * @param standalone defines the optional standalone flag * @returns the XML builder */ dec(version: string, encoding?: string, standalone?: boolean): IXmlBuilder; /** * Writes an XML attribute. * @param ns defines the attribute namespace * @param n defines the attribute name * @param v defines the attribute value * @returns the XML builder */ att(ns: string | null, n: string, v: string): IXmlBuilder; /** * Writes an XML element. * @param ns defines the element namespace * @param n defines the element name * @returns the XML builder */ ele(ns: string | null, n: string): IXmlBuilder; /** * Writes text content. * @param txt defines the text to write * @returns the XML builder */ text(txt: string): IXmlBuilder; /** * Ends the current XML element. * @returns the XML builder */ end(): IXmlBuilder; } /** * @param x * @returns */ export declare function IsQualifiedName(x: unknown): x is { name: string; }; export type XmlName = string | IQualifiedName; type FieldKind = "attr" | "elem" | "none"; /** Formats values for XML serialization. */ export interface IFormatter { /** * Converts a value to its XML string representation. * @param value defines the value to format * @returns the XML string representation */ toString(value: T): string; } export type FormatterCtor = new (args: IXmlSerializerFormatOptions) => IFormatter; type FieldMeta = { kind: FieldKind; prop: string; name?: XmlName; ignore?: boolean; formatter?: FormatterCtor; }; /** * @param name * @returns */ export declare function XmlName(name: XmlName): (ctor: Function, _context: ClassDecoratorContext) => void; /** * tell the serializer to ignore the property * @returns */ export declare function XmlIgnore(): (_value: unknown, context: { name: string | symbol; metadata: DecoratorMetadataObject; }) => void; /** * tell the serializer to serialize the property as attribute * @returns */ export declare function XmlAttr(opts?: { name: XmlName; formatter?: FormatterCtor; }): (_value: unknown, context: { name: string | symbol; metadata: DecoratorMetadataObject; }) => void; /** * tell the serializer to serialize the property as element - this is the default behavior but shoud be * specified when wanted to update the default name of the classe or if the class is not decorated (without \@XmlName) * @returns */ export declare function XmlElem(opts?: { name: XmlName; }): (_value: unknown, context: { name: string | symbol; metadata: DecoratorMetadataObject; }) => void; /** * * @param obj * @returns */ export declare function GetXmlFieldMeta(obj: any): FieldMeta[]; /** * * @param obj * @returns */ export declare function GetXmlName(obj: any): XmlName | undefined; /** * * @param qn * @returns */ export declare function XmlNameToParts(qn: XmlName): IQualifiedName; /** * * @param name * @param prefix * @returns */ export declare function ToQualifiedString(name: string, prefix?: string): string; export {};