@qt-test/apex-dsl-compiler 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,135 @@
1
+ /**
2
+ * AST Types
3
+ *
4
+ * Abstract Syntax Tree node types for AXML and ACSS
5
+ */
6
+ interface BaseNode {
7
+ type: string;
8
+ start: number;
9
+ end: number;
10
+ loc: SourceLocation;
11
+ }
12
+ interface SourceLocation {
13
+ start: Position;
14
+ end: Position;
15
+ source?: string;
16
+ }
17
+ interface Position {
18
+ line: number;
19
+ column: number;
20
+ offset: number;
21
+ }
22
+ type AXMLNode = AXMLElement | AXMLText | AXMLExpression | AXMLComment;
23
+ interface AXMLElement extends BaseNode {
24
+ type: 'Element';
25
+ tag: string;
26
+ attributes: AXMLAttribute[];
27
+ directives: AXMLDirective[];
28
+ children: AXMLNode[];
29
+ selfClosing: boolean;
30
+ isComponent: boolean;
31
+ }
32
+ interface AXMLAttribute extends BaseNode {
33
+ type: 'Attribute';
34
+ name: string;
35
+ value: AXMLAttributeValue | null;
36
+ isDynamic: boolean;
37
+ }
38
+ type AXMLAttributeValue = AXMLLiteral | AXMLExpression;
39
+ interface AXMLLiteral extends BaseNode {
40
+ type: 'Literal';
41
+ value: string;
42
+ raw: string;
43
+ }
44
+ interface AXMLExpression extends BaseNode {
45
+ type: 'Expression';
46
+ expression: string;
47
+ raw: string;
48
+ }
49
+ interface AXMLText extends BaseNode {
50
+ type: 'Text';
51
+ content: string;
52
+ raw: string;
53
+ }
54
+ interface AXMLComment extends BaseNode {
55
+ type: 'Comment';
56
+ content: string;
57
+ }
58
+ interface AXMLDirective extends BaseNode {
59
+ type: 'Directive';
60
+ name: DirectiveName;
61
+ value: AXMLExpression | null;
62
+ modifiers: string[];
63
+ argument?: string;
64
+ }
65
+ type DirectiveName = 'if' | 'elif' | 'else' | 'for' | 'for-item' | 'for-index' | 'key' | 'ref' | 'slot';
66
+ interface AXMLEventBinding extends BaseNode {
67
+ type: 'EventBinding';
68
+ event: string;
69
+ handler: string;
70
+ modifiers: EventModifier[];
71
+ }
72
+ type EventModifier = 'catch' | 'capture' | 'mut';
73
+ interface AXMLTemplate extends BaseNode {
74
+ type: 'Template';
75
+ name: string;
76
+ children: AXMLNode[];
77
+ }
78
+ interface ACSSStylesheet extends BaseNode {
79
+ type: 'Stylesheet';
80
+ rules: ACSSRule[];
81
+ imports: ACSSImport[];
82
+ }
83
+ interface ACSSImport extends BaseNode {
84
+ type: 'Import';
85
+ path: string;
86
+ }
87
+ type ACSSRule = ACSSStyleRule | ACSSMediaRule | ACSSKeyframesRule;
88
+ interface ACSSStyleRule extends BaseNode {
89
+ type: 'StyleRule';
90
+ selectors: ACSSSelector[];
91
+ declarations: ACSSDeclaration[];
92
+ }
93
+ interface ACSSSelector extends BaseNode {
94
+ type: 'Selector';
95
+ value: string;
96
+ specificity: [number, number, number];
97
+ }
98
+ interface ACSSDeclaration extends BaseNode {
99
+ type: 'Declaration';
100
+ property: string;
101
+ value: string;
102
+ important: boolean;
103
+ }
104
+ interface ACSSMediaRule extends BaseNode {
105
+ type: 'MediaRule';
106
+ query: string;
107
+ rules: ACSSStyleRule[];
108
+ }
109
+ interface ACSSKeyframesRule extends BaseNode {
110
+ type: 'KeyframesRule';
111
+ name: string;
112
+ keyframes: ACSSKeyframe[];
113
+ }
114
+ interface ACSSKeyframe extends BaseNode {
115
+ type: 'Keyframe';
116
+ selector: string;
117
+ declarations: ACSSDeclaration[];
118
+ }
119
+ interface CompiledUnit {
120
+ type: 'CompiledUnit';
121
+ template: AXMLElement | null;
122
+ styles: ACSSStylesheet | null;
123
+ config: ComponentConfig;
124
+ imports: string[];
125
+ exports: string[];
126
+ }
127
+ interface ComponentConfig {
128
+ component?: boolean;
129
+ usingComponents?: Record<string, string>;
130
+ navigationBarTitleText?: string;
131
+ enablePullDownRefresh?: boolean;
132
+ [key: string]: unknown;
133
+ }
134
+
135
+ export type { ACSSDeclaration as A, BaseNode as B, ComponentConfig as C, DirectiveName as D, EventModifier as E, Position as P, SourceLocation as S, ACSSImport as a, ACSSKeyframe as b, ACSSKeyframesRule as c, ACSSMediaRule as d, ACSSRule as e, ACSSSelector as f, ACSSStyleRule as g, ACSSStylesheet as h, AXMLAttribute as i, AXMLAttributeValue as j, AXMLComment as k, AXMLDirective as l, AXMLElement as m, AXMLEventBinding as n, AXMLExpression as o, AXMLLiteral as p, AXMLNode as q, AXMLTemplate as r, AXMLText as s, CompiledUnit as t };
@@ -0,0 +1,135 @@
1
+ /**
2
+ * AST Types
3
+ *
4
+ * Abstract Syntax Tree node types for AXML and ACSS
5
+ */
6
+ interface BaseNode {
7
+ type: string;
8
+ start: number;
9
+ end: number;
10
+ loc: SourceLocation;
11
+ }
12
+ interface SourceLocation {
13
+ start: Position;
14
+ end: Position;
15
+ source?: string;
16
+ }
17
+ interface Position {
18
+ line: number;
19
+ column: number;
20
+ offset: number;
21
+ }
22
+ type AXMLNode = AXMLElement | AXMLText | AXMLExpression | AXMLComment;
23
+ interface AXMLElement extends BaseNode {
24
+ type: 'Element';
25
+ tag: string;
26
+ attributes: AXMLAttribute[];
27
+ directives: AXMLDirective[];
28
+ children: AXMLNode[];
29
+ selfClosing: boolean;
30
+ isComponent: boolean;
31
+ }
32
+ interface AXMLAttribute extends BaseNode {
33
+ type: 'Attribute';
34
+ name: string;
35
+ value: AXMLAttributeValue | null;
36
+ isDynamic: boolean;
37
+ }
38
+ type AXMLAttributeValue = AXMLLiteral | AXMLExpression;
39
+ interface AXMLLiteral extends BaseNode {
40
+ type: 'Literal';
41
+ value: string;
42
+ raw: string;
43
+ }
44
+ interface AXMLExpression extends BaseNode {
45
+ type: 'Expression';
46
+ expression: string;
47
+ raw: string;
48
+ }
49
+ interface AXMLText extends BaseNode {
50
+ type: 'Text';
51
+ content: string;
52
+ raw: string;
53
+ }
54
+ interface AXMLComment extends BaseNode {
55
+ type: 'Comment';
56
+ content: string;
57
+ }
58
+ interface AXMLDirective extends BaseNode {
59
+ type: 'Directive';
60
+ name: DirectiveName;
61
+ value: AXMLExpression | null;
62
+ modifiers: string[];
63
+ argument?: string;
64
+ }
65
+ type DirectiveName = 'if' | 'elif' | 'else' | 'for' | 'for-item' | 'for-index' | 'key' | 'ref' | 'slot';
66
+ interface AXMLEventBinding extends BaseNode {
67
+ type: 'EventBinding';
68
+ event: string;
69
+ handler: string;
70
+ modifiers: EventModifier[];
71
+ }
72
+ type EventModifier = 'catch' | 'capture' | 'mut';
73
+ interface AXMLTemplate extends BaseNode {
74
+ type: 'Template';
75
+ name: string;
76
+ children: AXMLNode[];
77
+ }
78
+ interface ACSSStylesheet extends BaseNode {
79
+ type: 'Stylesheet';
80
+ rules: ACSSRule[];
81
+ imports: ACSSImport[];
82
+ }
83
+ interface ACSSImport extends BaseNode {
84
+ type: 'Import';
85
+ path: string;
86
+ }
87
+ type ACSSRule = ACSSStyleRule | ACSSMediaRule | ACSSKeyframesRule;
88
+ interface ACSSStyleRule extends BaseNode {
89
+ type: 'StyleRule';
90
+ selectors: ACSSSelector[];
91
+ declarations: ACSSDeclaration[];
92
+ }
93
+ interface ACSSSelector extends BaseNode {
94
+ type: 'Selector';
95
+ value: string;
96
+ specificity: [number, number, number];
97
+ }
98
+ interface ACSSDeclaration extends BaseNode {
99
+ type: 'Declaration';
100
+ property: string;
101
+ value: string;
102
+ important: boolean;
103
+ }
104
+ interface ACSSMediaRule extends BaseNode {
105
+ type: 'MediaRule';
106
+ query: string;
107
+ rules: ACSSStyleRule[];
108
+ }
109
+ interface ACSSKeyframesRule extends BaseNode {
110
+ type: 'KeyframesRule';
111
+ name: string;
112
+ keyframes: ACSSKeyframe[];
113
+ }
114
+ interface ACSSKeyframe extends BaseNode {
115
+ type: 'Keyframe';
116
+ selector: string;
117
+ declarations: ACSSDeclaration[];
118
+ }
119
+ interface CompiledUnit {
120
+ type: 'CompiledUnit';
121
+ template: AXMLElement | null;
122
+ styles: ACSSStylesheet | null;
123
+ config: ComponentConfig;
124
+ imports: string[];
125
+ exports: string[];
126
+ }
127
+ interface ComponentConfig {
128
+ component?: boolean;
129
+ usingComponents?: Record<string, string>;
130
+ navigationBarTitleText?: string;
131
+ enablePullDownRefresh?: boolean;
132
+ [key: string]: unknown;
133
+ }
134
+
135
+ export type { ACSSDeclaration as A, BaseNode as B, ComponentConfig as C, DirectiveName as D, EventModifier as E, Position as P, SourceLocation as S, ACSSImport as a, ACSSKeyframe as b, ACSSKeyframesRule as c, ACSSMediaRule as d, ACSSRule as e, ACSSSelector as f, ACSSStyleRule as g, ACSSStylesheet as h, AXMLAttribute as i, AXMLAttributeValue as j, AXMLComment as k, AXMLDirective as l, AXMLElement as m, AXMLEventBinding as n, AXMLExpression as o, AXMLLiteral as p, AXMLNode as q, AXMLTemplate as r, AXMLText as s, CompiledUnit as t };
@@ -0,0 +1,59 @@
1
+ import { m as AXMLElement } from '../ast-DEVgojMx.mjs';
2
+ export { i as AXMLAttribute, j as AXMLAttributeValue, k as AXMLComment, l as AXMLDirective, o as AXMLExpression, p as AXMLLiteral, q as AXMLNode, s as AXMLText, D as DirectiveName } from '../ast-DEVgojMx.mjs';
3
+
4
+ /**
5
+ * AXML Parser
6
+ *
7
+ * Tokenizes and parses AXML templates into an AST
8
+ */
9
+
10
+ /**
11
+ * Parses AXML source into an AST
12
+ */
13
+ declare function parseAXML(source: string): {
14
+ ast: AXMLElement | null;
15
+ errors: string[];
16
+ };
17
+
18
+ /**
19
+ * AXML Compiler
20
+ *
21
+ * Transforms AXML AST into render function code
22
+ */
23
+
24
+ /**
25
+ * Compile options
26
+ */
27
+ interface AXMLCompileOptions {
28
+ /** Source filename for error reporting */
29
+ filename?: string;
30
+ /** Custom component mappings */
31
+ components?: Record<string, string>;
32
+ /** Generate source maps */
33
+ sourceMap?: boolean;
34
+ /** Optimize output */
35
+ optimize?: boolean;
36
+ }
37
+ /**
38
+ * Compile result
39
+ */
40
+ interface AXMLCompileResult {
41
+ /** Generated render function code */
42
+ code: string;
43
+ /** The AST (for debugging/tooling) */
44
+ ast: AXMLElement | null;
45
+ /** Compilation warnings */
46
+ warnings: string[];
47
+ /** Compilation errors */
48
+ errors: string[];
49
+ /** Used components */
50
+ usedComponents: Set<string>;
51
+ /** Used expressions (for dependency tracking) */
52
+ usedExpressions: Set<string>;
53
+ }
54
+ /**
55
+ * Compiles AXML source into a render function
56
+ */
57
+ declare function compileAXML(source: string, options?: AXMLCompileOptions): AXMLCompileResult;
58
+
59
+ export { type AXMLCompileOptions, type AXMLCompileResult, AXMLElement, compileAXML, parseAXML };
@@ -0,0 +1,59 @@
1
+ import { m as AXMLElement } from '../ast-DEVgojMx.js';
2
+ export { i as AXMLAttribute, j as AXMLAttributeValue, k as AXMLComment, l as AXMLDirective, o as AXMLExpression, p as AXMLLiteral, q as AXMLNode, s as AXMLText, D as DirectiveName } from '../ast-DEVgojMx.js';
3
+
4
+ /**
5
+ * AXML Parser
6
+ *
7
+ * Tokenizes and parses AXML templates into an AST
8
+ */
9
+
10
+ /**
11
+ * Parses AXML source into an AST
12
+ */
13
+ declare function parseAXML(source: string): {
14
+ ast: AXMLElement | null;
15
+ errors: string[];
16
+ };
17
+
18
+ /**
19
+ * AXML Compiler
20
+ *
21
+ * Transforms AXML AST into render function code
22
+ */
23
+
24
+ /**
25
+ * Compile options
26
+ */
27
+ interface AXMLCompileOptions {
28
+ /** Source filename for error reporting */
29
+ filename?: string;
30
+ /** Custom component mappings */
31
+ components?: Record<string, string>;
32
+ /** Generate source maps */
33
+ sourceMap?: boolean;
34
+ /** Optimize output */
35
+ optimize?: boolean;
36
+ }
37
+ /**
38
+ * Compile result
39
+ */
40
+ interface AXMLCompileResult {
41
+ /** Generated render function code */
42
+ code: string;
43
+ /** The AST (for debugging/tooling) */
44
+ ast: AXMLElement | null;
45
+ /** Compilation warnings */
46
+ warnings: string[];
47
+ /** Compilation errors */
48
+ errors: string[];
49
+ /** Used components */
50
+ usedComponents: Set<string>;
51
+ /** Used expressions (for dependency tracking) */
52
+ usedExpressions: Set<string>;
53
+ }
54
+ /**
55
+ * Compiles AXML source into a render function
56
+ */
57
+ declare function compileAXML(source: string, options?: AXMLCompileOptions): AXMLCompileResult;
58
+
59
+ export { type AXMLCompileOptions, type AXMLCompileResult, AXMLElement, compileAXML, parseAXML };