@lwc/template-compiler 2.7.1 → 2.7.2
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.
- package/dist/commonjs/codegen/codegen.js +3 -73
- package/dist/commonjs/codegen/codegen.js.map +1 -1
- package/dist/commonjs/codegen/helpers.js +20 -34
- package/dist/commonjs/codegen/helpers.js.map +1 -1
- package/dist/commonjs/codegen/index.js +192 -183
- package/dist/commonjs/codegen/index.js.map +1 -1
- package/dist/commonjs/codegen/scope.js +61 -0
- package/dist/commonjs/codegen/scope.js.map +1 -0
- package/dist/commonjs/index.js +5 -12
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/parser/attribute.js +3 -3
- package/dist/commonjs/parser/attribute.js.map +1 -1
- package/dist/commonjs/parser/constants.js +7 -1
- package/dist/commonjs/parser/constants.js.map +1 -1
- package/dist/commonjs/parser/expression.js +2 -5
- package/dist/commonjs/parser/expression.js.map +1 -1
- package/dist/commonjs/parser/html.js +1 -2
- package/dist/commonjs/parser/html.js.map +1 -1
- package/dist/commonjs/parser/index.js +337 -355
- package/dist/commonjs/parser/index.js.map +1 -1
- package/dist/commonjs/parser/parser.js +30 -85
- package/dist/commonjs/parser/parser.js.map +1 -1
- package/dist/commonjs/shared/ir.js +90 -0
- package/dist/commonjs/shared/ir.js.map +1 -0
- package/dist/commonjs/shared/parse5.js +15 -1
- package/dist/commonjs/shared/parse5.js.map +1 -1
- package/dist/commonjs/shared/types.js +7 -1
- package/dist/commonjs/shared/types.js.map +1 -1
- package/dist/types/codegen/codegen.d.ts +3 -25
- package/dist/types/codegen/helpers.d.ts +5 -11
- package/dist/types/codegen/index.d.ts +2 -2
- package/dist/types/codegen/scope.d.ts +8 -0
- package/dist/types/index.d.ts +2 -1
- package/dist/types/parser/attribute.d.ts +7 -7
- package/dist/types/parser/constants.d.ts +6 -0
- package/dist/types/parser/expression.d.ts +4 -3
- package/dist/types/parser/parser.d.ts +28 -57
- package/dist/types/shared/estree.d.ts +2 -0
- package/dist/types/shared/ir.d.ts +15 -0
- package/dist/types/shared/parse5.d.ts +1 -0
- package/dist/types/shared/types.d.ts +86 -129
- package/package.json +5 -5
- package/dist/commonjs/shared/ast.js +0 -303
- package/dist/commonjs/shared/ast.js.map +0 -1
- package/dist/types/shared/ast.d.ts +0 -45
|
@@ -1,303 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isProperty = exports.isPreserveCommentsDirective = exports.isRenderModeDirective = exports.isKeyDirective = exports.isInnerHTMLDirective = exports.isDomDirective = exports.isDynamicDirective = exports.isParentNode = exports.isIf = exports.isForBlock = exports.isForEach = exports.isForOf = exports.isBooleanLiteral = exports.isStringLiteral = exports.isExpression = exports.isComment = exports.isText = exports.isBaseElement = exports.isSlot = exports.isComponent = exports.isRoot = exports.isElement = exports.property = exports.attribute = exports.renderModeDirective = exports.preserveCommentsDirective = exports.innerHTMLDirective = exports.domDirective = exports.dynamicDirective = exports.keyDirective = exports.eventListener = exports.ifNode = exports.forOf = exports.forEach = exports.literal = exports.sourceLocation = exports.elementSourceLocation = exports.comment = exports.text = exports.slot = exports.component = exports.element = exports.root = void 0;
|
|
4
|
-
function root(parse5ElmLocation) {
|
|
5
|
-
return {
|
|
6
|
-
type: 'Root',
|
|
7
|
-
location: elementSourceLocation(parse5ElmLocation),
|
|
8
|
-
directives: [],
|
|
9
|
-
children: [],
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
exports.root = root;
|
|
13
|
-
function element(parse5Elm, parse5ElmLocation) {
|
|
14
|
-
return {
|
|
15
|
-
type: 'Element',
|
|
16
|
-
name: parse5Elm.nodeName,
|
|
17
|
-
namespace: parse5Elm.namespaceURI,
|
|
18
|
-
location: elementSourceLocation(parse5ElmLocation),
|
|
19
|
-
attributes: [],
|
|
20
|
-
properties: [],
|
|
21
|
-
directives: [],
|
|
22
|
-
listeners: [],
|
|
23
|
-
children: [],
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
exports.element = element;
|
|
27
|
-
function component(parse5Elm, parse5ElmLocation) {
|
|
28
|
-
return {
|
|
29
|
-
type: 'Component',
|
|
30
|
-
name: parse5Elm.nodeName,
|
|
31
|
-
location: elementSourceLocation(parse5ElmLocation),
|
|
32
|
-
attributes: [],
|
|
33
|
-
properties: [],
|
|
34
|
-
directives: [],
|
|
35
|
-
listeners: [],
|
|
36
|
-
children: [],
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
exports.component = component;
|
|
40
|
-
function slot(slotName, parse5ElmLocation) {
|
|
41
|
-
return {
|
|
42
|
-
type: 'Slot',
|
|
43
|
-
name: 'slot',
|
|
44
|
-
slotName,
|
|
45
|
-
location: elementSourceLocation(parse5ElmLocation),
|
|
46
|
-
attributes: [],
|
|
47
|
-
properties: [],
|
|
48
|
-
directives: [],
|
|
49
|
-
listeners: [],
|
|
50
|
-
children: [],
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
exports.slot = slot;
|
|
54
|
-
function text(value, parse5Location) {
|
|
55
|
-
return {
|
|
56
|
-
type: 'Text',
|
|
57
|
-
value,
|
|
58
|
-
location: sourceLocation(parse5Location),
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
exports.text = text;
|
|
62
|
-
function comment(value, parse5Location) {
|
|
63
|
-
return {
|
|
64
|
-
type: 'Comment',
|
|
65
|
-
value,
|
|
66
|
-
location: sourceLocation(parse5Location),
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
exports.comment = comment;
|
|
70
|
-
function elementSourceLocation(parse5ElmLocation) {
|
|
71
|
-
const elementLocation = sourceLocation(parse5ElmLocation);
|
|
72
|
-
const startTag = sourceLocation(parse5ElmLocation.startTag);
|
|
73
|
-
// endTag must be optional because Parse5 currently fails to collect end tag location for element with a tag name
|
|
74
|
-
// containing an upper case character (inikulin/parse5#352).
|
|
75
|
-
const endTag = parse5ElmLocation.endTag
|
|
76
|
-
? sourceLocation(parse5ElmLocation.endTag)
|
|
77
|
-
: parse5ElmLocation.endTag;
|
|
78
|
-
return { ...elementLocation, startTag, endTag };
|
|
79
|
-
}
|
|
80
|
-
exports.elementSourceLocation = elementSourceLocation;
|
|
81
|
-
function sourceLocation(location) {
|
|
82
|
-
return {
|
|
83
|
-
startLine: location.startLine,
|
|
84
|
-
startColumn: location.startCol,
|
|
85
|
-
endLine: location.endLine,
|
|
86
|
-
endColumn: location.endCol,
|
|
87
|
-
start: location.startOffset,
|
|
88
|
-
end: location.endOffset,
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
exports.sourceLocation = sourceLocation;
|
|
92
|
-
function literal(value) {
|
|
93
|
-
return {
|
|
94
|
-
type: 'Literal',
|
|
95
|
-
value,
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
exports.literal = literal;
|
|
99
|
-
function forEach(expression, elementLocation, directiveLocation, item, index) {
|
|
100
|
-
return {
|
|
101
|
-
type: 'ForEach',
|
|
102
|
-
expression,
|
|
103
|
-
item,
|
|
104
|
-
index,
|
|
105
|
-
location: elementLocation,
|
|
106
|
-
directiveLocation,
|
|
107
|
-
children: [],
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
exports.forEach = forEach;
|
|
111
|
-
function forOf(expression, iterator, elementLocation, directiveLocation) {
|
|
112
|
-
return {
|
|
113
|
-
type: 'ForOf',
|
|
114
|
-
expression,
|
|
115
|
-
iterator,
|
|
116
|
-
location: elementLocation,
|
|
117
|
-
directiveLocation,
|
|
118
|
-
children: [],
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
exports.forOf = forOf;
|
|
122
|
-
function ifNode(modifier, condition, elementLocation, directiveLocation) {
|
|
123
|
-
return {
|
|
124
|
-
type: 'If',
|
|
125
|
-
modifier,
|
|
126
|
-
condition,
|
|
127
|
-
location: elementLocation,
|
|
128
|
-
directiveLocation,
|
|
129
|
-
children: [],
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
exports.ifNode = ifNode;
|
|
133
|
-
function eventListener(name, handler, location) {
|
|
134
|
-
return {
|
|
135
|
-
type: 'EventListener',
|
|
136
|
-
name,
|
|
137
|
-
handler,
|
|
138
|
-
location,
|
|
139
|
-
};
|
|
140
|
-
}
|
|
141
|
-
exports.eventListener = eventListener;
|
|
142
|
-
function keyDirective(value, location) {
|
|
143
|
-
return {
|
|
144
|
-
type: 'Directive',
|
|
145
|
-
name: 'Key',
|
|
146
|
-
value,
|
|
147
|
-
location,
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
exports.keyDirective = keyDirective;
|
|
151
|
-
function dynamicDirective(value, location) {
|
|
152
|
-
return {
|
|
153
|
-
type: 'Directive',
|
|
154
|
-
name: 'Dynamic',
|
|
155
|
-
value,
|
|
156
|
-
location,
|
|
157
|
-
};
|
|
158
|
-
}
|
|
159
|
-
exports.dynamicDirective = dynamicDirective;
|
|
160
|
-
function domDirective(lwcDomAttr, location) {
|
|
161
|
-
return {
|
|
162
|
-
type: 'Directive',
|
|
163
|
-
name: 'Dom',
|
|
164
|
-
value: literal(lwcDomAttr),
|
|
165
|
-
location,
|
|
166
|
-
};
|
|
167
|
-
}
|
|
168
|
-
exports.domDirective = domDirective;
|
|
169
|
-
function innerHTMLDirective(value, location) {
|
|
170
|
-
return {
|
|
171
|
-
type: 'Directive',
|
|
172
|
-
name: 'InnerHTML',
|
|
173
|
-
value,
|
|
174
|
-
location,
|
|
175
|
-
};
|
|
176
|
-
}
|
|
177
|
-
exports.innerHTMLDirective = innerHTMLDirective;
|
|
178
|
-
function preserveCommentsDirective(preserveComments, location) {
|
|
179
|
-
return {
|
|
180
|
-
type: 'Directive',
|
|
181
|
-
name: 'PreserveComments',
|
|
182
|
-
value: literal(preserveComments),
|
|
183
|
-
location,
|
|
184
|
-
};
|
|
185
|
-
}
|
|
186
|
-
exports.preserveCommentsDirective = preserveCommentsDirective;
|
|
187
|
-
function renderModeDirective(renderMode, location) {
|
|
188
|
-
return {
|
|
189
|
-
type: 'Directive',
|
|
190
|
-
name: 'RenderMode',
|
|
191
|
-
value: literal(renderMode),
|
|
192
|
-
location,
|
|
193
|
-
};
|
|
194
|
-
}
|
|
195
|
-
exports.renderModeDirective = renderModeDirective;
|
|
196
|
-
function attribute(name, value, location) {
|
|
197
|
-
return {
|
|
198
|
-
type: 'Attribute',
|
|
199
|
-
name,
|
|
200
|
-
value,
|
|
201
|
-
location,
|
|
202
|
-
};
|
|
203
|
-
}
|
|
204
|
-
exports.attribute = attribute;
|
|
205
|
-
function property(name, attributeName, value, location) {
|
|
206
|
-
return {
|
|
207
|
-
type: 'Property',
|
|
208
|
-
name,
|
|
209
|
-
attributeName,
|
|
210
|
-
value,
|
|
211
|
-
location,
|
|
212
|
-
};
|
|
213
|
-
}
|
|
214
|
-
exports.property = property;
|
|
215
|
-
function isElement(node) {
|
|
216
|
-
return node.type === 'Element';
|
|
217
|
-
}
|
|
218
|
-
exports.isElement = isElement;
|
|
219
|
-
function isRoot(node) {
|
|
220
|
-
return node.type === 'Root';
|
|
221
|
-
}
|
|
222
|
-
exports.isRoot = isRoot;
|
|
223
|
-
function isComponent(node) {
|
|
224
|
-
return node.type === 'Component';
|
|
225
|
-
}
|
|
226
|
-
exports.isComponent = isComponent;
|
|
227
|
-
function isSlot(node) {
|
|
228
|
-
return node.type === 'Slot';
|
|
229
|
-
}
|
|
230
|
-
exports.isSlot = isSlot;
|
|
231
|
-
function isBaseElement(node) {
|
|
232
|
-
return isElement(node) || isComponent(node) || isSlot(node);
|
|
233
|
-
}
|
|
234
|
-
exports.isBaseElement = isBaseElement;
|
|
235
|
-
function isText(node) {
|
|
236
|
-
return node.type === 'Text';
|
|
237
|
-
}
|
|
238
|
-
exports.isText = isText;
|
|
239
|
-
function isComment(node) {
|
|
240
|
-
return node.type === 'Comment';
|
|
241
|
-
}
|
|
242
|
-
exports.isComment = isComment;
|
|
243
|
-
function isExpression(node) {
|
|
244
|
-
return node.type === 'Identifier' || node.type === 'MemberExpression';
|
|
245
|
-
}
|
|
246
|
-
exports.isExpression = isExpression;
|
|
247
|
-
function isStringLiteral(node) {
|
|
248
|
-
return node.type === 'Literal' && typeof node.value === 'string';
|
|
249
|
-
}
|
|
250
|
-
exports.isStringLiteral = isStringLiteral;
|
|
251
|
-
function isBooleanLiteral(node) {
|
|
252
|
-
return node.type === 'Literal' && typeof node.value === 'boolean';
|
|
253
|
-
}
|
|
254
|
-
exports.isBooleanLiteral = isBooleanLiteral;
|
|
255
|
-
function isForOf(node) {
|
|
256
|
-
return node.type === 'ForOf';
|
|
257
|
-
}
|
|
258
|
-
exports.isForOf = isForOf;
|
|
259
|
-
function isForEach(node) {
|
|
260
|
-
return node.type === 'ForEach';
|
|
261
|
-
}
|
|
262
|
-
exports.isForEach = isForEach;
|
|
263
|
-
function isForBlock(node) {
|
|
264
|
-
return isForOf(node) || isForEach(node);
|
|
265
|
-
}
|
|
266
|
-
exports.isForBlock = isForBlock;
|
|
267
|
-
function isIf(node) {
|
|
268
|
-
return node.type === 'If';
|
|
269
|
-
}
|
|
270
|
-
exports.isIf = isIf;
|
|
271
|
-
function isParentNode(node) {
|
|
272
|
-
return isBaseElement(node) || isRoot(node) || isForBlock(node) || isIf(node);
|
|
273
|
-
}
|
|
274
|
-
exports.isParentNode = isParentNode;
|
|
275
|
-
function isDynamicDirective(directive) {
|
|
276
|
-
return directive.name === 'Dynamic';
|
|
277
|
-
}
|
|
278
|
-
exports.isDynamicDirective = isDynamicDirective;
|
|
279
|
-
function isDomDirective(directive) {
|
|
280
|
-
return directive.name === 'Dom';
|
|
281
|
-
}
|
|
282
|
-
exports.isDomDirective = isDomDirective;
|
|
283
|
-
function isInnerHTMLDirective(directive) {
|
|
284
|
-
return directive.name === 'InnerHTML';
|
|
285
|
-
}
|
|
286
|
-
exports.isInnerHTMLDirective = isInnerHTMLDirective;
|
|
287
|
-
function isKeyDirective(directive) {
|
|
288
|
-
return directive.name === 'Key';
|
|
289
|
-
}
|
|
290
|
-
exports.isKeyDirective = isKeyDirective;
|
|
291
|
-
function isRenderModeDirective(directive) {
|
|
292
|
-
return directive.name === 'RenderMode';
|
|
293
|
-
}
|
|
294
|
-
exports.isRenderModeDirective = isRenderModeDirective;
|
|
295
|
-
function isPreserveCommentsDirective(directive) {
|
|
296
|
-
return directive.name === 'PreserveComments';
|
|
297
|
-
}
|
|
298
|
-
exports.isPreserveCommentsDirective = isPreserveCommentsDirective;
|
|
299
|
-
function isProperty(node) {
|
|
300
|
-
return node.type === 'Property';
|
|
301
|
-
}
|
|
302
|
-
exports.isProperty = isProperty;
|
|
303
|
-
//# sourceMappingURL=ast.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ast.js","sourceRoot":"","sources":["../../../src/shared/ast.ts"],"names":[],"mappings":";;;AAyCA,SAAgB,IAAI,CAAC,iBAAyC;IAC1D,OAAO;QACH,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,qBAAqB,CAAC,iBAAiB,CAAC;QAClD,UAAU,EAAE,EAAE;QACd,QAAQ,EAAE,EAAE;KACf,CAAC;AACN,CAAC;AAPD,oBAOC;AAED,SAAgB,OAAO,CACnB,SAAyB,EACzB,iBAAyC;IAEzC,OAAO;QACH,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,SAAS,CAAC,QAAQ;QACxB,SAAS,EAAE,SAAS,CAAC,YAAY;QACjC,QAAQ,EAAE,qBAAqB,CAAC,iBAAiB,CAAC;QAClD,UAAU,EAAE,EAAE;QACd,UAAU,EAAE,EAAE;QACd,UAAU,EAAE,EAAE;QACd,SAAS,EAAE,EAAE;QACb,QAAQ,EAAE,EAAE;KACf,CAAC;AACN,CAAC;AAfD,0BAeC;AAED,SAAgB,SAAS,CACrB,SAAyB,EACzB,iBAAyC;IAEzC,OAAO;QACH,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAAS,CAAC,QAAQ;QACxB,QAAQ,EAAE,qBAAqB,CAAC,iBAAiB,CAAC;QAClD,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AAc,CAAC,SAAoB;IAC/C,OAAO,SAAS,CAAC,IAAI,KAAK,KAAK,CAAC;AACpC,CAAC;AAFD,wCAEC;AAED,SAAgB,qBAAqB,CAAC,SAAoB;IACtD,OAAO,SAAS,CAAC,IAAI,KAAK,YAAY,CAAC;AAC3C,CAAC;AAFD,sDAEC;AAED,SAAgB,2BAA2B,CACvC,SAAoB;IAEpB,OAAO,SAAS,CAAC,IAAI,KAAK,kBAAkB,CAAC;AACjD,CAAC;AAJD,kEAIC;AAED,SAAgB,UAAU,CAAC,IAAc;IACrC,OAAO,IAAI,CAAC,IAAI,KAAK,UAAU,CAAC;AACpC,CAAC;AAFD,gCAEC"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import * as parse5 from 'parse5';
|
|
2
|
-
import { Literal, SourceLocation, Element, Component, Expression, Comment, Text, ForEach, ForBlock, Slot, Identifier, Root, EventListener, KeyDirective, DynamicDirective, DomDirective, PreserveCommentsDirective, RenderModeDirective, Attribute, Property, ParentNode, BaseNode, ForOf, LWCDirectiveRenderMode, If, ElementSourceLocation, InnerHTMLDirective, Directive, BaseElement, LWCDirectiveDomMode } from './types';
|
|
3
|
-
export declare function root(parse5ElmLocation: parse5.ElementLocation): Root;
|
|
4
|
-
export declare function element(parse5Elm: parse5.Element, parse5ElmLocation: parse5.ElementLocation): Element;
|
|
5
|
-
export declare function component(parse5Elm: parse5.Element, parse5ElmLocation: parse5.ElementLocation): Component;
|
|
6
|
-
export declare function slot(slotName: string, parse5ElmLocation: parse5.ElementLocation): Slot;
|
|
7
|
-
export declare function text(value: Literal | Expression, parse5Location: parse5.Location): Text;
|
|
8
|
-
export declare function comment(value: string, parse5Location: parse5.Location): Comment;
|
|
9
|
-
export declare function elementSourceLocation(parse5ElmLocation: parse5.ElementLocation): ElementSourceLocation;
|
|
10
|
-
export declare function sourceLocation(location: parse5.Location): SourceLocation;
|
|
11
|
-
export declare function literal<T extends string | boolean>(value: T): Literal<T>;
|
|
12
|
-
export declare function forEach(expression: Expression, elementLocation: SourceLocation, directiveLocation: SourceLocation, item: Identifier, index?: Identifier): ForEach;
|
|
13
|
-
export declare function forOf(expression: Expression, iterator: Identifier, elementLocation: SourceLocation, directiveLocation: SourceLocation): ForOf;
|
|
14
|
-
export declare function ifNode(modifier: string, condition: Expression, elementLocation: SourceLocation, directiveLocation: SourceLocation): If;
|
|
15
|
-
export declare function eventListener(name: string, handler: Expression, location: SourceLocation): EventListener;
|
|
16
|
-
export declare function keyDirective(value: Expression, location: SourceLocation): KeyDirective;
|
|
17
|
-
export declare function dynamicDirective(value: Expression, location: SourceLocation): DynamicDirective;
|
|
18
|
-
export declare function domDirective(lwcDomAttr: LWCDirectiveDomMode, location: SourceLocation): DomDirective;
|
|
19
|
-
export declare function innerHTMLDirective(value: Expression | Literal<string>, location: SourceLocation): InnerHTMLDirective;
|
|
20
|
-
export declare function preserveCommentsDirective(preserveComments: boolean, location: SourceLocation): PreserveCommentsDirective;
|
|
21
|
-
export declare function renderModeDirective(renderMode: LWCDirectiveRenderMode, location: SourceLocation): RenderModeDirective;
|
|
22
|
-
export declare function attribute(name: string, value: Expression | Literal, location: SourceLocation): Attribute;
|
|
23
|
-
export declare function property(name: string, attributeName: string, value: Expression | Literal, location: SourceLocation): Property;
|
|
24
|
-
export declare function isElement(node: BaseNode): node is Element;
|
|
25
|
-
export declare function isRoot(node: BaseNode): node is Root;
|
|
26
|
-
export declare function isComponent(node: BaseNode): node is Component;
|
|
27
|
-
export declare function isSlot(node: BaseNode): node is Slot;
|
|
28
|
-
export declare function isBaseElement(node: BaseNode): node is BaseElement;
|
|
29
|
-
export declare function isText(node: BaseNode): node is Text;
|
|
30
|
-
export declare function isComment(node: BaseNode): node is Comment;
|
|
31
|
-
export declare function isExpression(node: Expression | Literal): node is Expression;
|
|
32
|
-
export declare function isStringLiteral(node: Expression | Literal): node is Literal<string>;
|
|
33
|
-
export declare function isBooleanLiteral(node: Expression | Literal): node is Literal<boolean>;
|
|
34
|
-
export declare function isForOf(node: BaseNode): node is ForOf;
|
|
35
|
-
export declare function isForEach(node: BaseNode): node is ForEach;
|
|
36
|
-
export declare function isForBlock(node: BaseNode): node is ForBlock;
|
|
37
|
-
export declare function isIf(node: BaseNode): node is If;
|
|
38
|
-
export declare function isParentNode(node: BaseNode): node is ParentNode;
|
|
39
|
-
export declare function isDynamicDirective(directive: Directive): directive is DynamicDirective;
|
|
40
|
-
export declare function isDomDirective(directive: Directive): directive is DomDirective;
|
|
41
|
-
export declare function isInnerHTMLDirective(directive: Directive): directive is InnerHTMLDirective;
|
|
42
|
-
export declare function isKeyDirective(directive: Directive): directive is KeyDirective;
|
|
43
|
-
export declare function isRenderModeDirective(directive: Directive): directive is RenderModeDirective;
|
|
44
|
-
export declare function isPreserveCommentsDirective(directive: Directive): directive is PreserveCommentsDirective;
|
|
45
|
-
export declare function isProperty(node: BaseNode): node is Property;
|