@jesscss/plugin-less-compat 2.0.0-alpha.6 → 2.0.0-alpha.7
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/README.md +3 -2
- package/lib/index.cjs +844 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +800 -10
- package/lib/less-adapter.cjs +216 -0
- package/lib/less-adapter.js +181 -0
- package/lib/less-compat-structures.cjs +378 -0
- package/lib/less-compat-structures.d.ts +2 -2
- package/lib/less-compat-structures.js +367 -512
- package/lib/nodes/at-rule.d.ts +2 -2
- package/lib/nodes/attribute-selector.d.ts +2 -2
- package/lib/nodes/call.d.ts +2 -2
- package/lib/nodes/color.d.ts +2 -1
- package/lib/nodes/combinator.d.ts +2 -1
- package/lib/nodes/comment.d.ts +2 -1
- package/lib/nodes/condition.d.ts +2 -2
- package/lib/nodes/declaration.d.ts +2 -2
- package/lib/nodes/dimension.d.ts +2 -1
- package/lib/nodes/expression.d.ts +2 -2
- package/lib/nodes/extend.d.ts +2 -1
- package/lib/nodes/import.d.ts +2 -2
- package/lib/nodes/keyword.d.ts +2 -1
- package/lib/nodes/list.d.ts +3 -2
- package/lib/nodes/mixin.d.ts +2 -2
- package/lib/nodes/negative.d.ts +2 -2
- package/lib/nodes/operation.d.ts +2 -2
- package/lib/nodes/paren.d.ts +2 -2
- package/lib/nodes/quoted.d.ts +2 -1
- package/lib/nodes/reference.d.ts +2 -1
- package/lib/nodes/ruleset.d.ts +2 -2
- package/lib/nodes/selector.d.ts +2 -2
- package/lib/nodes/sequence.d.ts +2 -2
- package/lib/nodes/url.d.ts +2 -1
- package/lib/nodes/var-declaration.d.ts +2 -2
- package/lib/plugin.d.ts +44 -16
- package/lib/transform/adapter.d.ts +9 -11
- package/lib/transform/index.cjs +13 -0
- package/lib/transform/index.d.ts +1 -1
- package/lib/transform/index.js +3 -8
- package/lib/transform/less-adapter.d.ts +29 -0
- package/lib/transform.cjs +1045 -0
- package/lib/transform.js +1015 -0
- package/lib/types.d.ts +153 -28
- package/package.json +6 -9
- package/lib/index.js.map +0 -1
- package/lib/less-compat-structures.js.map +0 -1
- package/lib/nodes/at-rule.js +0 -21
- package/lib/nodes/at-rule.js.map +0 -1
- package/lib/nodes/attribute-selector.js +0 -18
- package/lib/nodes/attribute-selector.js.map +0 -1
- package/lib/nodes/call.js +0 -27
- package/lib/nodes/call.js.map +0 -1
- package/lib/nodes/color.js +0 -23
- package/lib/nodes/color.js.map +0 -1
- package/lib/nodes/combinator.js +0 -7
- package/lib/nodes/combinator.js.map +0 -1
- package/lib/nodes/comment.js +0 -9
- package/lib/nodes/comment.js.map +0 -1
- package/lib/nodes/condition.js +0 -19
- package/lib/nodes/condition.js.map +0 -1
- package/lib/nodes/declaration.js +0 -38
- package/lib/nodes/declaration.js.map +0 -1
- package/lib/nodes/dimension.js +0 -9
- package/lib/nodes/dimension.js.map +0 -1
- package/lib/nodes/expression.js +0 -16
- package/lib/nodes/expression.js.map +0 -1
- package/lib/nodes/extend.js +0 -18
- package/lib/nodes/extend.js.map +0 -1
- package/lib/nodes/import.js +0 -22
- package/lib/nodes/import.js.map +0 -1
- package/lib/nodes/index.js +0 -308
- package/lib/nodes/index.js.map +0 -1
- package/lib/nodes/keyword.js +0 -8
- package/lib/nodes/keyword.js.map +0 -1
- package/lib/nodes/list.js +0 -61
- package/lib/nodes/list.js.map +0 -1
- package/lib/nodes/mixin.js +0 -22
- package/lib/nodes/mixin.js.map +0 -1
- package/lib/nodes/negative.js +0 -13
- package/lib/nodes/negative.js.map +0 -1
- package/lib/nodes/operation.js +0 -22
- package/lib/nodes/operation.js.map +0 -1
- package/lib/nodes/paren.js +0 -13
- package/lib/nodes/paren.js.map +0 -1
- package/lib/nodes/quoted.js +0 -23
- package/lib/nodes/quoted.js.map +0 -1
- package/lib/nodes/reference.js +0 -44
- package/lib/nodes/reference.js.map +0 -1
- package/lib/nodes/ruleset.js +0 -67
- package/lib/nodes/ruleset.js.map +0 -1
- package/lib/nodes/selector.js +0 -158
- package/lib/nodes/selector.js.map +0 -1
- package/lib/nodes/sequence.js +0 -56
- package/lib/nodes/sequence.js.map +0 -1
- package/lib/nodes/url.js +0 -13
- package/lib/nodes/url.js.map +0 -1
- package/lib/nodes/var-declaration.js +0 -21
- package/lib/nodes/var-declaration.js.map +0 -1
- package/lib/plugin-utils.js +0 -100
- package/lib/plugin-utils.js.map +0 -1
- package/lib/plugin.js +0 -1026
- package/lib/plugin.js.map +0 -1
- package/lib/transform/adapter.js +0 -111
- package/lib/transform/adapter.js.map +0 -1
- package/lib/transform/from-less.js +0 -170
- package/lib/transform/from-less.js.map +0 -1
- package/lib/transform/index.js.map +0 -1
- package/lib/transform/proxy.d.ts +0 -32
- package/lib/transform/proxy.js +0 -138
- package/lib/transform/proxy.js.map +0 -1
- package/lib/transform/to-less.js +0 -130
- package/lib/transform/to-less.js.map +0 -1
- package/lib/transform/type-map.js +0 -105
- package/lib/transform/type-map.js.map +0 -1
- package/lib/types.js +0 -5
- package/lib/types.js.map +0 -1
package/lib/transform/to-less.js
DELETED
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import { Node, Rules } from '@jesscss/core';
|
|
2
|
-
import { createLessProxy } from './proxy.js';
|
|
3
|
-
import { getTransformer } from '../nodes/index.js';
|
|
4
|
-
import { mapJessTypeToLessType } from './type-map.js';
|
|
5
|
-
// typeIndex handling is now in proxy.ts - plugins don't need to know about it
|
|
6
|
-
/**
|
|
7
|
-
* Convert a Jess node to a Less-compatible proxy
|
|
8
|
-
*
|
|
9
|
-
* @param jessNode - The Jess node to convert
|
|
10
|
-
* @param options - Conversion options
|
|
11
|
-
* @returns A Less-compatible proxy node
|
|
12
|
-
*/
|
|
13
|
-
import { IS_PROXYING_SYMBOL } from './proxy.js';
|
|
14
|
-
export function toLessNode(jessNode, options) {
|
|
15
|
-
if (!jessNode) {
|
|
16
|
-
return jessNode;
|
|
17
|
-
}
|
|
18
|
-
const cache = options?.cache || new WeakMap();
|
|
19
|
-
// Check cache first - if we have a cached proxy, return it even if IS_PROXYING_SYMBOL is set
|
|
20
|
-
if (cache.has(jessNode)) {
|
|
21
|
-
return cache.get(jessNode);
|
|
22
|
-
}
|
|
23
|
-
// Check if already being proxied (prevent recursion)
|
|
24
|
-
// Only return node as-is if there's no cached proxy
|
|
25
|
-
if (jessNode[IS_PROXYING_SYMBOL]) {
|
|
26
|
-
// Return the node as-is to prevent recursion
|
|
27
|
-
// This should only happen if cache doesn't have it (checked above)
|
|
28
|
-
return jessNode;
|
|
29
|
-
}
|
|
30
|
-
// Get transformer for this node type
|
|
31
|
-
const transformer = getTransformer(jessNode.type);
|
|
32
|
-
if (transformer) {
|
|
33
|
-
// Use specific transformer
|
|
34
|
-
return transformer(jessNode, cache);
|
|
35
|
-
}
|
|
36
|
-
// Fallback: create a basic proxy with type mapping
|
|
37
|
-
return createLessProxy(jessNode, cache, (prop, target) => {
|
|
38
|
-
// Map 'type' property
|
|
39
|
-
if (prop === 'type') {
|
|
40
|
-
return mapJessTypeToLessType(target.type);
|
|
41
|
-
}
|
|
42
|
-
// typeIndex is handled automatically by the base proxy handler
|
|
43
|
-
// For child nodes, convert them lazily
|
|
44
|
-
// Use instance field `.value` (the canonical accessor for leaf nodes)
|
|
45
|
-
if (prop === 'value' && target.value !== undefined) {
|
|
46
|
-
const nodeValue = target.value;
|
|
47
|
-
// If value is a Node, convert it
|
|
48
|
-
if (nodeValue instanceof Node) {
|
|
49
|
-
return toLessNode(nodeValue, options);
|
|
50
|
-
}
|
|
51
|
-
// If value is an array, convert each element
|
|
52
|
-
if (Array.isArray(nodeValue)) {
|
|
53
|
-
return nodeValue.map((item) => {
|
|
54
|
-
if (item instanceof Node) {
|
|
55
|
-
return toLessNode(item, options);
|
|
56
|
-
}
|
|
57
|
-
return item;
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
// If value is an object, convert nested nodes
|
|
61
|
-
if (typeof nodeValue === 'object' && nodeValue !== null) {
|
|
62
|
-
const converted = {};
|
|
63
|
-
for (const [key, val] of Object.entries(nodeValue)) {
|
|
64
|
-
if (val instanceof Node) {
|
|
65
|
-
converted[key] = toLessNode(val, options);
|
|
66
|
-
}
|
|
67
|
-
else if (Array.isArray(val)) {
|
|
68
|
-
converted[key] = val.map((item) => {
|
|
69
|
-
if (item instanceof Node) {
|
|
70
|
-
return toLessNode(item, options);
|
|
71
|
-
}
|
|
72
|
-
return item;
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
converted[key] = val;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
return converted;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
// Map 'accept' method for visitor traversal
|
|
83
|
-
// This is called by Less visitors when they want to traverse the tree
|
|
84
|
-
// Note: Less visitors should NOT call node.accept() in their visit() methods
|
|
85
|
-
// as this causes infinite recursion. The less-compat plugin handles traversal.
|
|
86
|
-
if (prop === 'accept') {
|
|
87
|
-
return function (visitor) {
|
|
88
|
-
// Check if the visitor is a Less visitor (has visitRuleset, visitDeclaration, etc.)
|
|
89
|
-
// vs the less-compat visitor (has a visit method that converts to Less)
|
|
90
|
-
const isLessVisitor = visitor && (typeof visitor.visitRuleset === 'function'
|
|
91
|
-
|| typeof visitor.visitDeclaration === 'function'
|
|
92
|
-
|| typeof visitor.visitVariable === 'function'
|
|
93
|
-
|| typeof visitor.visitAtRule === 'function'
|
|
94
|
-
|| (typeof visitor.visit === 'function' && !visitor.atRule && !visitor.ruleset && !visitor.visit));
|
|
95
|
-
if (!isLessVisitor) {
|
|
96
|
-
// This is likely the less-compat visitor or a Jess visitor
|
|
97
|
-
// Just return the node without processing to avoid recursion
|
|
98
|
-
return target;
|
|
99
|
-
}
|
|
100
|
-
// This is a Less visitor - but we should NOT call visitor.visit here
|
|
101
|
-
// because the Less visitor's visit() method might call node.accept() again,
|
|
102
|
-
// causing infinite recursion. Instead, we just return the node.
|
|
103
|
-
// The less-compat plugin's visit() method handles calling Less visitors.
|
|
104
|
-
// If a Less visitor needs to traverse children, it should do so through
|
|
105
|
-
// the less-compat plugin's traversal, not by calling node.accept().
|
|
106
|
-
return target;
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
return undefined;
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* Convert an entire Jess Rules tree to Less-compatible format
|
|
114
|
-
*
|
|
115
|
-
* @param jessRules - The Jess Rules tree to convert
|
|
116
|
-
* @param options - Conversion options
|
|
117
|
-
* @returns A Less-compatible tree
|
|
118
|
-
*/
|
|
119
|
-
export function toLessTree(jessRules, options) {
|
|
120
|
-
// If it's a Rules container, convert the root node
|
|
121
|
-
if (jessRules instanceof Rules) {
|
|
122
|
-
// Rules is a container - we need to find the root ruleset
|
|
123
|
-
// For now, create a synthetic root ruleset
|
|
124
|
-
// TODO: Handle this properly based on how Less structures its root
|
|
125
|
-
return toLessNode(jessRules, options);
|
|
126
|
-
}
|
|
127
|
-
// Otherwise, convert the node directly
|
|
128
|
-
return toLessNode(jessRules, options);
|
|
129
|
-
}
|
|
130
|
-
//# sourceMappingURL=to-less.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"to-less.js","sourceRoot":"","sources":["../../src/transform/to-less.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AActD,8EAA8E;AAE9E;;;;;;GAMG;AACH,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,UAAU,UAAU,CACxB,QAAc,EACd,OAAuB;IAEvB,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,MAAM,K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BAAgB,KAAK,UAAU;uBAC9C,OAAO,OAAO,CAAC,aAAa,KAAK,UAAU;uBAC3C,OAAO,OAAO,CAAC,WAAW,KAAK,UAAU;uBACzC,CAAC,OAAO,OAAO,CAAC,KAAK,KAAK,UAAU,IAAI,CAAC,OAAO,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAClG,CAAC;gBAEF,IAAI,CAAC,aAAa,EAAE,CAAC;oBACnB,2DAA2D;oBAC3D,6DAA6D;oBAC7D,OAAO,MAAM,CAAC;gBAChB,CAAC;gBAED,qEAAqE;gBACrE,4EAA4E;gBAC5E,gEAAgE;gBAChE,yEAAyE;gBACzE,wEAAwE;gBACxE,oEAAoE;gBACpE,OAAO,MAAM,CAAC;YAChB,CAAC,CAAC;QACJ,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,UAAU,CACxB,SAAuB,EACvB,OAAuB;IAEvB,mDAAmD;IACnD,IAAI,SAAS,YAAY,KAAK,EAAE,CAAC;QAC/B,0DAA0D;QAC1D,2CAA2C;QAC3C,mEAAmE;QACnE,OAAO,UAAU,CAAC,SAAgB,EAAE,OAAO,CAAC,CAAC;IAC/C,CAAC;IAED,uCAAuC;IACvC,OAAO,UAAU,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AACxC,CAAC"}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Type mapping utilities for converting between Jess and Less node types
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Map Jess node types to Less node types
|
|
6
|
-
*
|
|
7
|
-
* @param jessType - The Jess node type
|
|
8
|
-
* @returns The corresponding Less node type
|
|
9
|
-
*/
|
|
10
|
-
export function mapJessTypeToLessType(jessType) {
|
|
11
|
-
const typeMap = {
|
|
12
|
-
Ruleset: 'Ruleset',
|
|
13
|
-
Declaration: 'Declaration',
|
|
14
|
-
SelectorList: 'Selector',
|
|
15
|
-
ComplexSelector: 'Selector',
|
|
16
|
-
CompoundSelector: 'Selector',
|
|
17
|
-
BasicSelector: 'Element', // Note: Less's Element includes combinator
|
|
18
|
-
Combinator: 'Combinator',
|
|
19
|
-
AttributeSelector: 'Attribute',
|
|
20
|
-
Dimension: 'Dimension',
|
|
21
|
-
Num: 'Dimension',
|
|
22
|
-
Reference: 'Variable', // Default, but can be Variable/Property/VariableCall
|
|
23
|
-
Mixin: 'MixinDefinition',
|
|
24
|
-
Call: 'Call',
|
|
25
|
-
Operation: 'Operation',
|
|
26
|
-
Expression: 'Expression',
|
|
27
|
-
Sequence: 'Expression',
|
|
28
|
-
Quoted: 'Quoted',
|
|
29
|
-
Url: 'URL',
|
|
30
|
-
Color: 'Color',
|
|
31
|
-
Comment: 'Comment',
|
|
32
|
-
AtRule: 'AtRule',
|
|
33
|
-
StyleImport: 'Import',
|
|
34
|
-
Extend: 'Extend',
|
|
35
|
-
Condition: 'Condition',
|
|
36
|
-
Paren: 'Paren',
|
|
37
|
-
Negative: 'Negative',
|
|
38
|
-
List: 'Value',
|
|
39
|
-
VarDeclaration: 'Assignment',
|
|
40
|
-
Keyword: 'Keyword'
|
|
41
|
-
};
|
|
42
|
-
return typeMap[jessType] || jessType;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Map Less node types to Jess node types
|
|
46
|
-
*
|
|
47
|
-
* @param lessType - The Less node type
|
|
48
|
-
* @returns The corresponding Jess node type
|
|
49
|
-
*/
|
|
50
|
-
export function mapLessTypeToJessType(lessType) {
|
|
51
|
-
const typeMap = {
|
|
52
|
-
Ruleset: 'Ruleset',
|
|
53
|
-
Declaration: 'Declaration',
|
|
54
|
-
Selector: 'SelectorList', // Less Selector → Jess SelectorList
|
|
55
|
-
Element: 'BasicSelector', // Note: Less Element includes combinator
|
|
56
|
-
Combinator: 'Combinator',
|
|
57
|
-
Attribute: 'AttributeSelector',
|
|
58
|
-
Dimension: 'Dimension',
|
|
59
|
-
Variable: 'Reference',
|
|
60
|
-
Property: 'Reference',
|
|
61
|
-
VariableCall: 'Reference',
|
|
62
|
-
MixinDefinition: 'Mixin',
|
|
63
|
-
MixinCall: 'Call',
|
|
64
|
-
Call: 'Call',
|
|
65
|
-
Operation: 'Operation',
|
|
66
|
-
Expression: 'Expression',
|
|
67
|
-
Quoted: 'Quoted',
|
|
68
|
-
URL: 'Url',
|
|
69
|
-
Color: 'Color',
|
|
70
|
-
Comment: 'Comment',
|
|
71
|
-
AtRule: 'AtRule',
|
|
72
|
-
// Less.js v2 used "Directive" - map to AtRule for compatibility
|
|
73
|
-
Directive: 'AtRule',
|
|
74
|
-
// Less.js v2 used "Rule" - map to Declaration for compatibility
|
|
75
|
-
Rule: 'Declaration',
|
|
76
|
-
Import: 'StyleImport',
|
|
77
|
-
Extend: 'Extend',
|
|
78
|
-
Condition: 'Condition',
|
|
79
|
-
Paren: 'Paren',
|
|
80
|
-
Negative: 'Negative',
|
|
81
|
-
Value: 'List',
|
|
82
|
-
Assignment: 'VarDeclaration',
|
|
83
|
-
Keyword: 'Keyword'
|
|
84
|
-
};
|
|
85
|
-
return typeMap[lessType] || lessType;
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Get Less typeIndex for a Jess node type
|
|
89
|
-
*
|
|
90
|
-
* Less.js uses typeIndex for visitor caching. This function
|
|
91
|
-
* maps Jess types to their corresponding Less typeIndex values.
|
|
92
|
-
*
|
|
93
|
-
* @param jessType - The Jess node type
|
|
94
|
-
* @returns The Less typeIndex, or undefined if not found
|
|
95
|
-
*/
|
|
96
|
-
export function getLessTypeIndex(_jessType) {
|
|
97
|
-
// Less.js assigns typeIndex dynamically, so we'll need to
|
|
98
|
-
// either:
|
|
99
|
-
// 1. Import Less's tree module and access typeIndex
|
|
100
|
-
// 2. Maintain our own mapping
|
|
101
|
-
// 3. Set typeIndex dynamically when creating proxies
|
|
102
|
-
// For now, return undefined - will be set during proxy creation
|
|
103
|
-
return undefined;
|
|
104
|
-
}
|
|
105
|
-
//# sourceMappingURL=type-map.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"type-map.js","sourceRoot":"","sources":["../../src/transform/type-map.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CAAC,QAAgB;IACpD,MAAM,OAAO,GAA2B;QACtC,OAAO,EAAE,SAAS;QAClB,WAAW,EAAE,aAAa;QAC1B,YAAY,EAAE,UAAU;QACxB,eAAe,EAAE,UAAU;QAC3B,gBAAgB,EAAE,UAAU;QAC5B,aAAa,EAAE,SAAS,EAAE,2CAA2C;QACrE,UAAU,EAAE,YAAY;QACxB,iBAAiB,EAAE,WAAW;QAC9B,SAAS,EAAE,WAAW;QACtB,GAAG,EAAE,WAAW;QAChB,SAAS,EAAE,UAAU,EAAE,qDAAqD;QAC5E,KAAK,EAAE,iBAAiB;QACxB,IAAI,EAAE,MAAM;QACZ,SAAS,EAAE,WAAW;QACtB,UAAU,EAAE,YAAY;QACxB,QAAQ,EAAE,YAAY;QACtB,MAAM,EAAE,QAAQ;QAChB,GAAG,EAAE,KAAK;QACV,KAAK,EAAE,OAAO;QACd,OAAO,EAAE,SAAS;QAClB,MAAM,EAAE,QAAQ;QAChB,WAAW,EAAE,QAAQ;QACrB,MAAM,EAAE,QAAQ;QAChB,SAAS,EAAE,WAAW;QACtB,KAAK,EAAE,OAAO;QACd,QAAQ,EAAE,UAAU;QACpB,IAAI,EAAE,OAAO;QACb,cAAc,EAAE,YAAY;QAC5B,OAAO,EAAE,SAAS;KACnB,CAAC;IAEF,OAAO,OAAO,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC;AACvC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CAAC,QAAgB;IACpD,MAAM,OAAO,GAA2B;QACtC,OAAO,EAAE,SAAS;QAClB,WAAW,EAAE,aAAa;QAC1B,QAAQ,EAAE,cAAc,EAAE,oCAAoC;QAC9D,OAAO,EAAE,eAAe,EAAE,yCAAyC;QACnE,UAAU,EAAE,YAAY;QACxB,SAAS,EAAE,mBAAmB;QAC9B,SAAS,EAAE,WAAW;QACtB,QAAQ,EAAE,WAAW;QACrB,QAAQ,EAAE,WAAW;QACrB,YAAY,EAAE,WAAW;QACzB,eAAe,EAAE,OAAO;QACxB,SAAS,EAAE,MAAM;QACjB,IAAI,EAAE,MAAM;QACZ,SAAS,EAAE,WAAW;QACtB,UAAU,EAAE,YAAY;QACxB,MAAM,EAAE,QAAQ;QAChB,GAAG,EAAE,KAAK;QACV,KAAK,EAAE,OAAO;QACd,OAAO,EAAE,SAAS;QAClB,MAAM,EAAE,QAAQ;QAChB,gEAAgE;QAChE,SAAS,EAAE,QAAQ;QACnB,gEAAgE;QAChE,IAAI,EAAE,aAAa;QACnB,MAAM,EAAE,aAAa;QACrB,MAAM,EAAE,QAAQ;QAChB,SAAS,EAAE,WAAW;QACtB,KAAK,EAAE,OAAO;QACd,QAAQ,EAAE,UAAU;QACpB,KAAK,EAAE,MAAM;QACb,UAAU,EAAE,gBAAgB;QAC5B,OAAO,EAAE,SAAS;KACnB,CAAC;IAEF,OAAO,OAAO,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC;AACvC,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,gBAAgB,CAAC,SAAiB;IAChD,0DAA0D;IAC1D,UAAU;IACV,oDAAoD;IACpD,8BAA8B;IAC9B,qDAAqD;IAErD,gEAAgE;IAChE,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
package/lib/types.js
DELETED
package/lib/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|