1 | import { Template, KeyedTemplate } from '../core/view';
|
2 | import * as xml from '../../xml';
|
3 | import type { ComponentModule } from './component-builder';
|
4 | export declare namespace xml2ui {
|
5 | |
6 |
|
7 |
|
8 |
|
9 | interface XmlProducer {
|
10 | pipe<Next extends XmlConsumer>(next: Next): Next;
|
11 | }
|
12 | interface XmlConsumer {
|
13 | parse(args: xml.ParserEvent): any;
|
14 | }
|
15 | interface ParseInputData extends String {
|
16 | default?: string;
|
17 | }
|
18 | export class XmlProducerBase implements XmlProducer {
|
19 | private _next;
|
20 | pipe<Next extends XmlConsumer>(next: Next): Next;
|
21 | protected next(args: xml.ParserEvent): void;
|
22 | }
|
23 | export class XmlStringParser extends XmlProducerBase implements XmlProducer {
|
24 | private error;
|
25 | constructor(error?: ErrorFormatter);
|
26 | parse(value: ParseInputData): void;
|
27 | }
|
28 | interface ErrorFormatter {
|
29 | (e: Error, p: xml.Position): Error;
|
30 | }
|
31 | export function PositionErrorFormat(e: Error, p: xml.Position): Error;
|
32 | export function SourceErrorFormat(uri: any): ErrorFormatter;
|
33 | interface SourceTracker {
|
34 | (component: any, p: xml.Position): void;
|
35 | }
|
36 | export function ComponentSourceTracker(uri: any): SourceTracker;
|
37 | export class PlatformFilter extends XmlProducerBase implements XmlProducer, XmlConsumer {
|
38 | private currentPlatformContext;
|
39 | parse(args: xml.ParserEvent): void;
|
40 | private static isPlatform;
|
41 | private static isCurentPlatform;
|
42 | }
|
43 | export class XmlArgsReplay extends XmlProducerBase implements XmlProducer {
|
44 | private error;
|
45 | private args;
|
46 | constructor(args: xml.ParserEvent[], errorFormat: ErrorFormatter);
|
47 | replay(): void;
|
48 | }
|
49 | interface TemplateProperty {
|
50 | context?: any;
|
51 | parent: ComponentModule;
|
52 | name: string;
|
53 | elementName: string;
|
54 | templateItems: Array<string>;
|
55 | errorFormat: ErrorFormatter;
|
56 | sourceTracker: SourceTracker;
|
57 | }
|
58 | |
59 |
|
60 |
|
61 |
|
62 | export class XmlStateParser implements XmlConsumer {
|
63 | private state;
|
64 | constructor(state: XmlStateConsumer);
|
65 | parse(args: xml.ParserEvent): void;
|
66 | }
|
67 | interface XmlStateConsumer extends XmlConsumer {
|
68 | parse(args: xml.ParserEvent): XmlStateConsumer;
|
69 | }
|
70 | export class TemplateParser implements XmlStateConsumer {
|
71 | private _context;
|
72 | private _recordedXmlStream;
|
73 | private _templateProperty;
|
74 | private _nestingLevel;
|
75 | private _state;
|
76 | private parent;
|
77 | private _setTemplateProperty;
|
78 | constructor(parent: XmlStateConsumer, templateProperty: TemplateProperty, setTemplateProperty?: boolean);
|
79 | parse(args: xml.ParserEvent): XmlStateConsumer;
|
80 | get elementName(): string;
|
81 | private parseStartElement;
|
82 | private parseEndElement;
|
83 | buildTemplate(): Template;
|
84 | }
|
85 | export class MultiTemplateParser implements XmlStateConsumer {
|
86 | private parent;
|
87 | private templateProperty;
|
88 | private _childParsers;
|
89 | private _value;
|
90 | get value(): KeyedTemplate[];
|
91 | constructor(parent: XmlStateConsumer, templateProperty: TemplateProperty);
|
92 | parse(args: xml.ParserEvent): XmlStateConsumer;
|
93 | }
|
94 | export namespace TemplateParser {
|
95 | const enum State {
|
96 | EXPECTING_START = 0,
|
97 | PARSING = 1,
|
98 | FINISHED = 2
|
99 | }
|
100 | }
|
101 | export class ComponentParser implements XmlStateConsumer {
|
102 | private moduleName?;
|
103 | private static KNOWNCOLLECTIONS;
|
104 | private static KNOWNTEMPLATES;
|
105 | private static KNOWNMULTITEMPLATES;
|
106 | rootComponentModule: ComponentModule;
|
107 | private context;
|
108 | private currentRootView;
|
109 | private parents;
|
110 | private complexProperties;
|
111 | private error;
|
112 | private sourceTracker;
|
113 | constructor(context: any, errorFormat: ErrorFormatter, sourceTracker: SourceTracker, moduleName?: string);
|
114 | private buildComponent;
|
115 | parse(args: xml.ParserEvent): XmlStateConsumer;
|
116 | private static isComplexProperty;
|
117 | static getComplexPropertyName(fullName: string): string;
|
118 | private static isKnownTemplate;
|
119 | private static isKnownMultiTemplate;
|
120 | private static addToComplexProperty;
|
121 | private static isKnownCollection;
|
122 | }
|
123 | export namespace ComponentParser {
|
124 | interface ComplexProperty {
|
125 | parent: ComponentModule;
|
126 | name: string;
|
127 | items?: Array<any>;
|
128 | parser?: {
|
129 | value: any;
|
130 | };
|
131 | }
|
132 | }
|
133 | export {};
|
134 | }
|