UNPKG

@rxap/xml-parser

Version:

Provides a set of decorators and services for parsing and serializing XML documents into TypeScript classes. It simplifies the process of mapping XML elements and attributes to class properties, handling data validation, and serializing objects back into

23 lines (22 loc) 1.95 kB
import { RxapElement } from '../element'; import { ParsedElement } from '../elements/parsed-element'; import { XmlParserService } from '../xml-parser.service'; import { ElementParser } from './element.parser'; import { AttributeElementMixin, AttributeElementOptions } from './mixins/attribute-element.mixin'; import { ChildrenElementMixin, ChildrenElementOptions } from './mixins/children-element.mixin'; import { TagElementMixin, TagElementOptions } from './mixins/tag-element.mixin'; export interface ElementChildrenAttributeOptions<Value> extends AttributeElementOptions<Value>, TagElementOptions, ChildrenElementOptions { } export interface ElementChildrenAttributeParser<T extends ParsedElement, Value> extends AttributeElementMixin<Value>, TagElementMixin, ChildrenElementMixin { } export declare class ElementChildrenAttributeParser<T extends ParsedElement = ParsedElement, Value = any> implements ElementParser<T> { readonly propertyKey: string; readonly options: ElementChildrenAttributeOptions<Value>; constructor(propertyKey: string, options: ElementChildrenAttributeOptions<Value>); parse(xmlParser: XmlParserService, element: RxapElement, parsedElement: T): T; } export declare function ElementChildrenAttribute<Value>(options: ElementChildrenAttributeOptions<Value>): (target: any, propertyKey: string) => void; export declare function ElementChildrenAttribute<Value>(tag: string): (target: any, propertyKey: string) => void; export declare function ElementChildrenAttribute<Value>(tag: string, options: Partial<ElementChildrenAttributeOptions<Value>>): (target: any, propertyKey: string) => void; export declare function ElementChildrenAttribute<Value>(tag: string, attribute: string): (target: any, propertyKey: string) => void; export declare function ElementChildrenAttribute<Value>(tag: string, attribute: string, options: Partial<ElementChildrenAttributeOptions<Value>>): (target: any, propertyKey: string) => void;