@tbela99/css-parser 2.3.0 → 2.3.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/CHANGELOG.md +43 -0
- package/README.md +66 -21
- package/architecture.png +0 -0
- package/dist/ast/arena-node.js +32 -3
- package/dist/ast/arena.js +88 -10
- package/dist/ast/cache.js +1 -1
- package/dist/ast/features/calc.js +1 -1
- package/dist/ast/features/if.js +1 -1
- package/dist/ast/features/index.js +1 -1
- package/dist/ast/features/inlinecssvariables.js +1 -1
- package/dist/ast/features/mixin.js +1 -1
- package/dist/ast/features/prefix.js +1 -1
- package/dist/ast/features/shorthand.js +1 -1
- package/dist/ast/features/transform.js +1 -1
- package/dist/ast/features/type.js +1 -1
- package/dist/ast/math/expression.js +1 -1
- package/dist/ast/math/math.js +1 -1
- package/dist/ast/minify.js +131 -36
- package/dist/ast/mixins/custom-function.js +1 -1
- package/dist/ast/mixins/utils.js +1 -1
- package/dist/ast/mixins/variables.js +1 -1
- package/dist/ast/strings.js +26 -1
- package/dist/ast/transform/compute.js +6 -2
- package/dist/ast/transform/matrix.js +1 -1
- package/dist/ast/transform/minify.js +1 -1
- package/dist/ast/transform/perspective.js +1 -1
- package/dist/ast/transform/rotate.js +1 -1
- package/dist/ast/transform/scale.js +1 -1
- package/dist/ast/transform/skew.js +1 -1
- package/dist/ast/transform/translate.js +1 -1
- package/dist/ast/transform/utils.js +1 -1
- package/dist/ast/types.js +22 -2
- package/dist/ast/walk.js +1 -1
- package/dist/data/properties.json.js +1 -1
- package/dist/data/validation.json.js +1 -1
- package/dist/fs/resolve.js +1 -1
- package/dist/index-umd-web.js +1099 -295
- package/dist/index.d.ts +612 -688
- package/dist/node.js +14 -8
- package/dist/parser/declaration/list.js +8 -5
- package/dist/parser/declaration/map.js +1 -1
- package/dist/parser/declaration/set.js +1 -1
- package/dist/parser/input.js +62 -4
- package/dist/parser/linesmap.js +1 -1
- package/dist/parser/parse.js +121 -13
- package/dist/parser/source.js +1 -1
- package/dist/parser/tokenize.js +161 -19
- package/dist/parser/utils/angle.js +1 -1
- package/dist/parser/utils/at-rule-container.js +1 -1
- package/dist/parser/utils/at-rule-font-feature-values.js +1 -1
- package/dist/parser/utils/at-rule-generic.js +1 -1
- package/dist/parser/utils/at-rule-import.js +1 -1
- package/dist/parser/utils/at-rule-media.js +42 -2
- package/dist/parser/utils/at-rule-support.js +1 -1
- package/dist/parser/utils/at-rule-when-else.js +1 -1
- package/dist/parser/utils/at-rule.js +1 -1
- package/dist/parser/utils/base64.js +1 -1
- package/dist/parser/utils/cache.js +1 -1
- package/dist/parser/utils/canonical.js +1 -1
- package/dist/parser/utils/codes.js +1 -1
- package/dist/parser/utils/config.js +1 -1
- package/dist/parser/utils/declaration.js +1 -1
- package/dist/parser/utils/eq.js +1 -1
- package/dist/parser/utils/hash.js +1 -1
- package/dist/parser/utils/selector.js +98 -6
- package/dist/parser/utils/text.js +1 -1
- package/dist/parser/utils/token.js +1 -1
- package/dist/parser/utils/type.js +1 -1
- package/dist/printer/lib/codec.js +1 -1
- package/dist/printer/render.js +5 -7
- package/dist/printer/result.js +18 -3
- package/dist/printer/sourcemap.js +1 -1
- package/dist/printer/writer.js +1 -1
- package/dist/syntax/color/a98rgb.js +1 -1
- package/dist/syntax/color/alpha.js +1 -1
- package/dist/syntax/color/cmyk.js +1 -1
- package/dist/syntax/color/color-mix.js +1 -1
- package/dist/syntax/color/color.js +1 -1
- package/dist/syntax/color/hex.js +1 -1
- package/dist/syntax/color/hsl.js +12 -4
- package/dist/syntax/color/hwb.js +9 -3
- package/dist/syntax/color/lab.js +1 -1
- package/dist/syntax/color/lch.js +1 -1
- package/dist/syntax/color/oklab.js +1 -1
- package/dist/syntax/color/oklch.js +2 -2
- package/dist/syntax/color/p3.js +1 -1
- package/dist/syntax/color/prophotorgb.js +1 -1
- package/dist/syntax/color/rec2020.js +1 -1
- package/dist/syntax/color/relative-color.js +1 -1
- package/dist/syntax/color/rgb.js +1 -1
- package/dist/syntax/color/srgb.js +3 -2
- package/dist/syntax/color/utils/color-type.js +1 -1
- package/dist/syntax/color/utils/colorspace.js +1 -1
- package/dist/syntax/color/utils/components.js +1 -1
- package/dist/syntax/color/utils/distance.js +1 -1
- package/dist/syntax/color/utils/make-color.js +1 -1
- package/dist/syntax/color/utils/matrix.js +1 -1
- package/dist/syntax/color/xyz.js +1 -1
- package/dist/syntax/color/xyzd50.js +1 -1
- package/dist/syntax/constants.js +2 -2
- package/dist/syntax/syntax.js +1 -1
- package/dist/types.js +1 -1
- package/dist/utils/sync.js +1 -1
- package/dist/validation/compiled/builtins.js +1 -1
- package/dist/validation/compiled/runtime.js +1 -1
- package/dist/validation/compiled/syntaxes.js +1 -1
- package/dist/validation/config.js +1 -1
- package/dist/validation/first.js +1 -1
- package/dist/validation/match.js +77 -4
- package/dist/validation/parser/parse.js +1 -1
- package/dist/validation/parser/typedef.js +4 -1
- package/dist/validation/utils/list.js +1 -1
- package/dist/version.js +2 -2
- package/dist/web.js +13 -6
- package/package.json +15 -6
package/dist/index.d.ts
CHANGED
|
@@ -751,7 +751,7 @@ declare enum EnumToken {
|
|
|
751
751
|
/**
|
|
752
752
|
* Supported color types enum
|
|
753
753
|
*/
|
|
754
|
-
declare enum ColorType
|
|
754
|
+
declare enum ColorType {
|
|
755
755
|
/**
|
|
756
756
|
* the color type is not known yet (the color function has not been parsed)
|
|
757
757
|
*/
|
|
@@ -989,6 +989,25 @@ declare enum WalkerEvent {
|
|
|
989
989
|
*/
|
|
990
990
|
Leave = 2
|
|
991
991
|
}
|
|
992
|
+
/**
|
|
993
|
+
* Merge of the adjacent rules, see {@link ParserOptions.mergeRules}. `true` is a shortcut for
|
|
994
|
+
* {@link MergeRulesEnum.All}, `false` for {@link MergeRulesEnum.None}
|
|
995
|
+
*/
|
|
996
|
+
declare enum MergeRulesEnum {
|
|
997
|
+
/**
|
|
998
|
+
* the rules are not merged
|
|
999
|
+
*/
|
|
1000
|
+
None = 0,
|
|
1001
|
+
/**
|
|
1002
|
+
* only the rules that have the same declarations are merged, the size of the output is not computed:
|
|
1003
|
+
* `.a{color:red}.b{color:red}` is merged into `.a,.b{color:red}`
|
|
1004
|
+
*/
|
|
1005
|
+
Identical = 1,
|
|
1006
|
+
/**
|
|
1007
|
+
* the rules that share declarations are merged when the output is smaller
|
|
1008
|
+
*/
|
|
1009
|
+
All = 2
|
|
1010
|
+
}
|
|
992
1011
|
|
|
993
1012
|
/**
|
|
994
1013
|
* Object view of the arena nodes and tokens: {@link AstArenaNode}
|
|
@@ -1054,20 +1073,25 @@ declare class AstArenaNode {
|
|
|
1054
1073
|
*/
|
|
1055
1074
|
readonly [ARENAID]: number;
|
|
1056
1075
|
/**
|
|
1057
|
-
*
|
|
1058
|
-
* @param
|
|
1076
|
+
* create a view of a node of the arena. the view reads and writes the arena: it holds no data
|
|
1077
|
+
* @param arena the arena that holds the node
|
|
1078
|
+
* @param id the node or token id
|
|
1059
1079
|
*/
|
|
1060
1080
|
constructor(arena: AstArena, id: number);
|
|
1061
1081
|
/**
|
|
1062
1082
|
* node or token type
|
|
1063
1083
|
*/
|
|
1064
1084
|
get typ(): EnumToken;
|
|
1085
|
+
/**
|
|
1086
|
+
* Set the node or token type
|
|
1087
|
+
*/
|
|
1065
1088
|
set typ(typ: EnumToken);
|
|
1066
1089
|
/**
|
|
1067
1090
|
* at-rule / declaration name, token name. undefined for the other nodes
|
|
1068
1091
|
*/
|
|
1069
1092
|
get nam(): string | undefined;
|
|
1070
1093
|
/**
|
|
1094
|
+
* Set the at-rule / declaration name, token name. undefined for the other nodes
|
|
1071
1095
|
*
|
|
1072
1096
|
* @param nam
|
|
1073
1097
|
*/
|
|
@@ -1077,6 +1101,7 @@ declare class AstArenaNode {
|
|
|
1077
1101
|
*/
|
|
1078
1102
|
get sel(): string | undefined;
|
|
1079
1103
|
/**
|
|
1104
|
+
* Set the rule selector. undefined for the other nodes
|
|
1080
1105
|
*
|
|
1081
1106
|
* @param sel
|
|
1082
1107
|
*/
|
|
@@ -1092,6 +1117,7 @@ declare class AstArenaNode {
|
|
|
1092
1117
|
*/
|
|
1093
1118
|
get val(): string | number | AstArenaNode | readonly AstArenaNode[] | null | undefined;
|
|
1094
1119
|
/**
|
|
1120
|
+
* Set the value, see the getter: a string, a number, a token or a list of tokens depending on the type of the node
|
|
1095
1121
|
*
|
|
1096
1122
|
* @param val
|
|
1097
1123
|
*/
|
|
@@ -1102,6 +1128,8 @@ declare class AstArenaNode {
|
|
|
1102
1128
|
*/
|
|
1103
1129
|
get chi(): readonly AstArenaNode[] | undefined;
|
|
1104
1130
|
/**
|
|
1131
|
+
* Set the children: the child nodes of a stylesheet, a rule or an at-rule with a block, the tokens of a function
|
|
1132
|
+
* token (arguments), a parentheses token, ... undefined when the node has no children
|
|
1105
1133
|
*
|
|
1106
1134
|
* @param chi
|
|
1107
1135
|
*/
|
|
@@ -1111,6 +1139,7 @@ declare class AstArenaNode {
|
|
|
1111
1139
|
*/
|
|
1112
1140
|
get tokens(): readonly AstArenaNode[] | null;
|
|
1113
1141
|
/**
|
|
1142
|
+
* Set the prelude tokens of an at-rule, selector tokens of a rule. null when the node has no prelude tokens
|
|
1114
1143
|
*
|
|
1115
1144
|
* @param tokens
|
|
1116
1145
|
*/
|
|
@@ -1120,6 +1149,7 @@ declare class AstArenaNode {
|
|
|
1120
1149
|
*/
|
|
1121
1150
|
get unit(): string | undefined;
|
|
1122
1151
|
/**
|
|
1152
|
+
* Set the unit of a dimension, calendar (`cal`) of a color, attribute (`attr`) of a match expression
|
|
1123
1153
|
*
|
|
1124
1154
|
* @param unit
|
|
1125
1155
|
*/
|
|
@@ -1128,22 +1158,32 @@ declare class AstArenaNode {
|
|
|
1128
1158
|
* color space of a color
|
|
1129
1159
|
*/
|
|
1130
1160
|
get cal(): string | undefined;
|
|
1161
|
+
/**
|
|
1162
|
+
* Set the color space of a color
|
|
1163
|
+
*/
|
|
1131
1164
|
set cal(cal: string | null | undefined);
|
|
1132
1165
|
/**
|
|
1133
1166
|
* attribute of a match expression
|
|
1134
1167
|
*/
|
|
1135
1168
|
get attr(): string | undefined;
|
|
1169
|
+
/**
|
|
1170
|
+
* Set the attribute of a match expression
|
|
1171
|
+
*/
|
|
1136
1172
|
set attr(attr: string | null | undefined);
|
|
1137
1173
|
/**
|
|
1138
1174
|
* color type of a color token
|
|
1139
1175
|
*/
|
|
1140
|
-
get kin(): ColorType
|
|
1141
|
-
|
|
1176
|
+
get kin(): ColorType | undefined;
|
|
1177
|
+
/**
|
|
1178
|
+
* Set the color type of a color token
|
|
1179
|
+
*/
|
|
1180
|
+
set kin(kin: ColorType | null | undefined);
|
|
1142
1181
|
/**
|
|
1143
1182
|
* sign of a unary expression
|
|
1144
1183
|
*/
|
|
1145
1184
|
get sign(): EnumToken | undefined;
|
|
1146
1185
|
/**
|
|
1186
|
+
* Set the sign of a unary expression
|
|
1147
1187
|
*
|
|
1148
1188
|
* @param sign
|
|
1149
1189
|
*/
|
|
@@ -1153,6 +1193,7 @@ declare class AstArenaNode {
|
|
|
1153
1193
|
*/
|
|
1154
1194
|
get op(): EnumToken | AstArenaNode | readonly AstArenaNode[] | null | undefined;
|
|
1155
1195
|
/**
|
|
1196
|
+
* Set the operator: the operator of a binary expression, the operator tokens of a structured token
|
|
1156
1197
|
*
|
|
1157
1198
|
* @param op
|
|
1158
1199
|
*/
|
|
@@ -1162,6 +1203,7 @@ declare class AstArenaNode {
|
|
|
1162
1203
|
*/
|
|
1163
1204
|
get op1(): AstArenaNode | readonly AstArenaNode[] | null | undefined;
|
|
1164
1205
|
/**
|
|
1206
|
+
* Set the first operator of a media range query
|
|
1165
1207
|
*
|
|
1166
1208
|
* @param op
|
|
1167
1209
|
*/
|
|
@@ -1171,6 +1213,7 @@ declare class AstArenaNode {
|
|
|
1171
1213
|
*/
|
|
1172
1214
|
get op2(): AstArenaNode | readonly AstArenaNode[] | null | undefined;
|
|
1173
1215
|
/**
|
|
1216
|
+
* Set the second operator of a media range query
|
|
1174
1217
|
*
|
|
1175
1218
|
* @param op
|
|
1176
1219
|
*/
|
|
@@ -1180,6 +1223,7 @@ declare class AstArenaNode {
|
|
|
1180
1223
|
*/
|
|
1181
1224
|
get l(): AstArenaNode | readonly AstArenaNode[] | null | undefined;
|
|
1182
1225
|
/**
|
|
1226
|
+
* Set the left hand side of a structured token, numerator of a fraction
|
|
1183
1227
|
*
|
|
1184
1228
|
* @param l
|
|
1185
1229
|
*/
|
|
@@ -1189,6 +1233,7 @@ declare class AstArenaNode {
|
|
|
1189
1233
|
*/
|
|
1190
1234
|
get r(): AstArenaNode | readonly AstArenaNode[] | null | undefined;
|
|
1191
1235
|
/**
|
|
1236
|
+
* Set the right hand side of a structured token, denominator of a fraction
|
|
1192
1237
|
*
|
|
1193
1238
|
* @param r
|
|
1194
1239
|
*/
|
|
@@ -1198,6 +1243,7 @@ declare class AstArenaNode {
|
|
|
1198
1243
|
*/
|
|
1199
1244
|
get loc(): Readonly<SourceLocation> | null;
|
|
1200
1245
|
/**
|
|
1246
|
+
* Set the source location. null when the node has no location
|
|
1201
1247
|
*
|
|
1202
1248
|
* @param loc
|
|
1203
1249
|
*/
|
|
@@ -1207,6 +1253,7 @@ declare class AstArenaNode {
|
|
|
1207
1253
|
*/
|
|
1208
1254
|
get state(): EnumAstNodeStatus;
|
|
1209
1255
|
/**
|
|
1256
|
+
* Set the validation state
|
|
1210
1257
|
*
|
|
1211
1258
|
* @param state
|
|
1212
1259
|
*/
|
|
@@ -1216,6 +1263,7 @@ declare class AstArenaNode {
|
|
|
1216
1263
|
*/
|
|
1217
1264
|
get errors(): readonly ErrorDescription[] | null;
|
|
1218
1265
|
/**
|
|
1266
|
+
* Set the validation errors. null when the node has no errors
|
|
1219
1267
|
*
|
|
1220
1268
|
* @param errors
|
|
1221
1269
|
*/
|
|
@@ -1327,11 +1375,20 @@ interface StringTableData {
|
|
|
1327
1375
|
*/
|
|
1328
1376
|
count: number;
|
|
1329
1377
|
/**
|
|
1330
|
-
* hash
|
|
1378
|
+
* hash of each string
|
|
1331
1379
|
*/
|
|
1332
1380
|
hashes: Int32Array;
|
|
1381
|
+
/**
|
|
1382
|
+
* source of each string: the index of its text in {@link texts}
|
|
1383
|
+
*/
|
|
1333
1384
|
sources: Int32Array;
|
|
1385
|
+
/**
|
|
1386
|
+
* start offset of each string in its source
|
|
1387
|
+
*/
|
|
1334
1388
|
starts: Int32Array;
|
|
1389
|
+
/**
|
|
1390
|
+
* end offset of each string in its source
|
|
1391
|
+
*/
|
|
1335
1392
|
ends: Int32Array;
|
|
1336
1393
|
/**
|
|
1337
1394
|
* text of each source, by source index
|
|
@@ -1476,6 +1533,12 @@ declare class StringTable {
|
|
|
1476
1533
|
* (faster than the text). see {@link releaseCodes}
|
|
1477
1534
|
*/
|
|
1478
1535
|
setText(source: number, text: string, codes?: CodeUnits | null): void;
|
|
1536
|
+
/**
|
|
1537
|
+
* code unit of the text of a source, NaN after its end
|
|
1538
|
+
* @param source source index
|
|
1539
|
+
* @param offset
|
|
1540
|
+
*/
|
|
1541
|
+
sourceCodeAt(source: number, offset: number): number;
|
|
1479
1542
|
/**
|
|
1480
1543
|
* drop the code units of a source: the source is no longer tokenized, see {@link setText}
|
|
1481
1544
|
* @param source
|
|
@@ -1846,6 +1909,10 @@ declare class Arena {
|
|
|
1846
1909
|
* the high word holds the 24 high bits of the start position and the source
|
|
1847
1910
|
*/
|
|
1848
1911
|
protected spans32: Uint32Array;
|
|
1912
|
+
/**
|
|
1913
|
+
* create an empty arena
|
|
1914
|
+
* @param size initial number of nodes the columns can hold. the columns grow when they are full
|
|
1915
|
+
*/
|
|
1849
1916
|
constructor(size?: number);
|
|
1850
1917
|
/**
|
|
1851
1918
|
* true when the column buffers have been transferred to another thread: the arena can no longer be used
|
|
@@ -1883,6 +1950,9 @@ declare class Arena {
|
|
|
1883
1950
|
* @returns an `Arena` or an `AstArena` depending on the class the method is called on
|
|
1884
1951
|
*/
|
|
1885
1952
|
static fromTransferableArenaObjects<T extends Arena>(this: new (size?: number) => T, properties: ArenaProperties, transferables: ArenaTransferables): T;
|
|
1953
|
+
/**
|
|
1954
|
+
* Allocate a node or a token: a released id is reused, the columns grow when the arena is full. Returns the new id
|
|
1955
|
+
*/
|
|
1886
1956
|
allocate(): number;
|
|
1887
1957
|
/**
|
|
1888
1958
|
* recycle a detached leaf node (no parent, no children, no tokens) that is no longer referenced:
|
|
@@ -1920,6 +1990,12 @@ declare class Arena {
|
|
|
1920
1990
|
* @param codes code units of the text while the source is tokenized (faster comparisons)
|
|
1921
1991
|
*/
|
|
1922
1992
|
setSourceText(source: number, text: string, codes?: CodeUnits | null): void;
|
|
1993
|
+
/**
|
|
1994
|
+
* code unit of the text of a source, NaN after its end. no string is created
|
|
1995
|
+
* @param source source index (see {@link getSourceId})
|
|
1996
|
+
* @param offset
|
|
1997
|
+
*/
|
|
1998
|
+
sourceCodeAt(source: number, offset: number): number;
|
|
1923
1999
|
/**
|
|
1924
2000
|
* drop the code units of a source set by {@link setSourceText}: the source is no longer tokenized
|
|
1925
2001
|
* @param source source index
|
|
@@ -1986,6 +2062,7 @@ declare class Arena {
|
|
|
1986
2062
|
* @param id
|
|
1987
2063
|
* @param flag
|
|
1988
2064
|
* @param compute computes the property from the string
|
|
2065
|
+
* @ignore
|
|
1989
2066
|
*/
|
|
1990
2067
|
stringFlag(id: number, flag: StringFlag, compute: (str: string) => boolean): boolean;
|
|
1991
2068
|
/**
|
|
@@ -1993,6 +2070,7 @@ declare class Arena {
|
|
|
1993
2070
|
* @param id
|
|
1994
2071
|
* @param flag
|
|
1995
2072
|
* @param compute computes the property from the string id
|
|
2073
|
+
* @ignore
|
|
1996
2074
|
*/
|
|
1997
2075
|
stringFlagId(id: number, flag: StringFlag, compute: (id: number) => boolean): boolean;
|
|
1998
2076
|
/**
|
|
@@ -2000,6 +2078,7 @@ declare class Arena {
|
|
|
2000
2078
|
* @param id
|
|
2001
2079
|
* @param slot
|
|
2002
2080
|
* @param compute computes the value from the string id
|
|
2081
|
+
* @ignore
|
|
2003
2082
|
*/
|
|
2004
2083
|
stringDerived<T>(id: number, slot: StringDerived, compute: (id: number) => T): T;
|
|
2005
2084
|
/**
|
|
@@ -2027,6 +2106,7 @@ declare class Arena {
|
|
|
2027
2106
|
*/
|
|
2028
2107
|
get stringEpoch(): object;
|
|
2029
2108
|
/**
|
|
2109
|
+
* Type of a node or a token, see {@link EnumToken}
|
|
2030
2110
|
*
|
|
2031
2111
|
* @param id
|
|
2032
2112
|
*/
|
|
@@ -2037,56 +2117,67 @@ declare class Arena {
|
|
|
2037
2117
|
*/
|
|
2038
2118
|
typeOf(id: number | null | undefined): EnumToken | null;
|
|
2039
2119
|
/**
|
|
2120
|
+
* Set the type of a node or a token, see {@link EnumToken}
|
|
2040
2121
|
*
|
|
2041
2122
|
* @param id
|
|
2042
2123
|
* @param type
|
|
2043
2124
|
*/
|
|
2044
2125
|
setType(id: number, type: EnumToken): void;
|
|
2045
2126
|
/**
|
|
2127
|
+
* Set the name of a node or a token: `nameId` is a string table id, see {@link AstArena.internString}
|
|
2046
2128
|
*
|
|
2047
2129
|
* @param id
|
|
2048
2130
|
* @param nameId
|
|
2049
2131
|
*/
|
|
2050
2132
|
setName(id: number, nameId: number): void;
|
|
2051
2133
|
/**
|
|
2134
|
+
* Name of a node or a token: the name of an at-rule, a declaration, a function, ...
|
|
2052
2135
|
*
|
|
2053
2136
|
* @param id
|
|
2054
2137
|
*/
|
|
2055
2138
|
getName(id: number): string;
|
|
2056
2139
|
/**
|
|
2140
|
+
* Set the value of a node or a token: `valueId` is a string table id, see {@link AstArena.internString}
|
|
2057
2141
|
*
|
|
2058
2142
|
* @param id
|
|
2059
2143
|
* @param valueId
|
|
2060
2144
|
*/
|
|
2061
2145
|
setValue(id: number, valueId: number): void;
|
|
2062
2146
|
/**
|
|
2147
|
+
* Value of a node or a token: the value of an identifier, a string, a hash, ...
|
|
2063
2148
|
*
|
|
2064
2149
|
* @param id
|
|
2065
2150
|
*/
|
|
2066
2151
|
getValue(id: number): string;
|
|
2067
2152
|
/**
|
|
2153
|
+
* Set the numeric value of a token
|
|
2068
2154
|
*
|
|
2069
2155
|
* @param id
|
|
2070
2156
|
* @param numericValue
|
|
2071
2157
|
*/
|
|
2072
2158
|
setNumericValue(id: number, numericValue: number): void;
|
|
2073
2159
|
/**
|
|
2160
|
+
* Set the unit of a dimension token: `unit` is a string table id
|
|
2074
2161
|
*
|
|
2075
2162
|
* @param id
|
|
2076
2163
|
* @param unit
|
|
2077
2164
|
*/
|
|
2078
2165
|
setUnit(id: number, unit: number): void;
|
|
2079
2166
|
/**
|
|
2167
|
+
* Unit of a dimension token
|
|
2080
2168
|
*
|
|
2081
2169
|
* @param id
|
|
2082
2170
|
*/
|
|
2083
2171
|
getUnit(id: number): string;
|
|
2084
2172
|
/**
|
|
2173
|
+
* Numeric value of a token: number, dimension, percentage, ...
|
|
2085
2174
|
*
|
|
2086
2175
|
* @param id
|
|
2087
2176
|
*/
|
|
2088
2177
|
getNumericValue(id: number): number;
|
|
2089
2178
|
/**
|
|
2179
|
+
* Set the parent id of a node. The node is not moved: use {@link AstArena.appendChild} or {@link
|
|
2180
|
+
* AstArena.insertBefore} to move it
|
|
2090
2181
|
*
|
|
2091
2182
|
* @param id
|
|
2092
2183
|
* @param parentId
|
|
@@ -2137,6 +2228,7 @@ declare class Arena {
|
|
|
2137
2228
|
*/
|
|
2138
2229
|
setFirstChild(id: number, firstChildId: number): void;
|
|
2139
2230
|
/**
|
|
2231
|
+
* Last child of a node. 0 when the node has no children
|
|
2140
2232
|
*
|
|
2141
2233
|
* @param id
|
|
2142
2234
|
*/
|
|
@@ -2166,34 +2258,40 @@ declare class Arena {
|
|
|
2166
2258
|
*/
|
|
2167
2259
|
setFirstToken(id: number, firstTokenId: number): void;
|
|
2168
2260
|
/**
|
|
2261
|
+
* Set the color type of a color token, see {@link ColorType}
|
|
2169
2262
|
*
|
|
2170
2263
|
* @param id
|
|
2171
2264
|
* @param colorType
|
|
2172
2265
|
*/
|
|
2173
2266
|
setColorType(id: number, colorType: number): void;
|
|
2174
2267
|
/**
|
|
2268
|
+
* Color type of a color token, see {@link ColorType}
|
|
2175
2269
|
*
|
|
2176
2270
|
* @param id
|
|
2177
2271
|
*/
|
|
2178
2272
|
getColorType(id: number): number;
|
|
2179
2273
|
/**
|
|
2274
|
+
* Replace the flags of a node, see {@link EnumAstNodeStatus}
|
|
2180
2275
|
*
|
|
2181
2276
|
* @param id
|
|
2182
2277
|
* @param flags
|
|
2183
2278
|
*/
|
|
2184
2279
|
setFlags(id: number, flags: number): void;
|
|
2185
2280
|
/**
|
|
2281
|
+
* Flags of a node, see {@link EnumAstNodeStatus}
|
|
2186
2282
|
*
|
|
2187
2283
|
* @param id
|
|
2188
2284
|
*/
|
|
2189
2285
|
getFlags(id: number): number;
|
|
2190
2286
|
/**
|
|
2287
|
+
* `true` when a node has all the given flags, see {@link EnumAstNodeStatus}
|
|
2191
2288
|
*
|
|
2192
2289
|
* @param id
|
|
2193
2290
|
* @param flag
|
|
2194
2291
|
*/
|
|
2195
2292
|
hasFlags(id: number, flag: number): boolean;
|
|
2196
2293
|
/**
|
|
2294
|
+
* The child of a node at a position (0 based). null when the position is out of range
|
|
2197
2295
|
*
|
|
2198
2296
|
* @param id
|
|
2199
2297
|
* @param index
|
|
@@ -2251,56 +2349,66 @@ declare class Arena {
|
|
|
2251
2349
|
*/
|
|
2252
2350
|
appendField(id: number, field: TokenField, ...tokens: number[]): void;
|
|
2253
2351
|
/**
|
|
2352
|
+
* Replace the tokens of the left hand side of a structured token
|
|
2254
2353
|
*
|
|
2255
2354
|
* @param id
|
|
2256
2355
|
* @param children
|
|
2257
2356
|
*/
|
|
2258
2357
|
setLeft(id: number, ...children: number[]): void;
|
|
2259
2358
|
/**
|
|
2359
|
+
* Tokens of the left hand side of a structured token (numerator of a fraction, ...). null when it is not set
|
|
2260
2360
|
*
|
|
2261
2361
|
* @param id
|
|
2262
2362
|
*/
|
|
2263
2363
|
getLeft(id: number): number[] | null;
|
|
2264
2364
|
/**
|
|
2365
|
+
* Remove the tokens of the right hand side of a structured token
|
|
2265
2366
|
*
|
|
2266
|
-
* @param id
|
|
2267
|
-
* @param rightId
|
|
2367
|
+
* @param id the structured token
|
|
2368
|
+
* @param rightId null
|
|
2268
2369
|
*/
|
|
2269
2370
|
setRight(id: number, rightId: null): void;
|
|
2270
2371
|
/**
|
|
2372
|
+
* Replace the tokens of the right hand side of a structured token (denominator of a fraction, ...)
|
|
2271
2373
|
*
|
|
2272
|
-
* @param id
|
|
2273
|
-
* @param rightId
|
|
2374
|
+
* @param id the structured token
|
|
2375
|
+
* @param rightId the tokens
|
|
2274
2376
|
*/
|
|
2275
2377
|
setRight(id: number, ...rightId: number[]): void;
|
|
2276
2378
|
/**
|
|
2379
|
+
* Tokens of the right hand side of a structured token (denominator of a fraction, ...). null when it is not set
|
|
2277
2380
|
*
|
|
2278
2381
|
* @param id
|
|
2279
2382
|
*/
|
|
2280
2383
|
getRight(id: number): number[] | null;
|
|
2281
2384
|
/**
|
|
2385
|
+
* Set the operator token of a structured token
|
|
2282
2386
|
*
|
|
2283
2387
|
* @param id
|
|
2284
2388
|
* @param opId
|
|
2285
2389
|
*/
|
|
2286
2390
|
setOp(id: number, opId: number): void;
|
|
2287
2391
|
/**
|
|
2392
|
+
* Operator token of a structured token: the operator of a binary expression, ...
|
|
2288
2393
|
*
|
|
2289
2394
|
* @param id
|
|
2290
2395
|
*/
|
|
2291
2396
|
getOp(id: number): number;
|
|
2292
2397
|
/**
|
|
2398
|
+
* Set the second operator token of a structured token: the second operator of a media range query
|
|
2293
2399
|
*
|
|
2294
2400
|
* @param id
|
|
2295
2401
|
* @param op2Id
|
|
2296
2402
|
*/
|
|
2297
2403
|
setOp2(id: number, op2Id: number): void;
|
|
2298
2404
|
/**
|
|
2405
|
+
* Second operator token of a structured token: the second operator of a media range query
|
|
2299
2406
|
*
|
|
2300
2407
|
* @param id
|
|
2301
2408
|
*/
|
|
2302
2409
|
getOp2(id: number): number;
|
|
2303
2410
|
/**
|
|
2411
|
+
* Set the location of a node or a token: the id of its source file and its start and end offsets
|
|
2304
2412
|
*
|
|
2305
2413
|
* @param id
|
|
2306
2414
|
* @param sourceId
|
|
@@ -2315,38 +2423,45 @@ declare class Arena {
|
|
|
2315
2423
|
*/
|
|
2316
2424
|
copySpan(target: number, source: number): void;
|
|
2317
2425
|
/**
|
|
2426
|
+
* Id of the source file of a node or a token, see {@link getSpanStart} and {@link getSpanEnd}
|
|
2318
2427
|
*
|
|
2319
2428
|
* @param id
|
|
2320
2429
|
*/
|
|
2321
2430
|
getSourceId(id: number): number;
|
|
2322
2431
|
/**
|
|
2432
|
+
* Start offset of a node or a token in its source file
|
|
2323
2433
|
*
|
|
2324
2434
|
* @param id
|
|
2325
2435
|
*/
|
|
2326
2436
|
getSpanStart(id: number): number;
|
|
2327
2437
|
/**
|
|
2438
|
+
* Set the start offset of a node or a token in its source file
|
|
2328
2439
|
*
|
|
2329
2440
|
* @param id
|
|
2330
2441
|
* @param start
|
|
2331
2442
|
*/
|
|
2332
2443
|
setSpandStart(id: number, start: number): void;
|
|
2333
2444
|
/**
|
|
2445
|
+
* End offset of a node or a token in its source file
|
|
2334
2446
|
*
|
|
2335
2447
|
* @param id
|
|
2336
2448
|
*/
|
|
2337
2449
|
getSpanEnd(id: number): number;
|
|
2338
2450
|
/**
|
|
2451
|
+
* Set the end offset of a node or a token in its source file
|
|
2339
2452
|
*
|
|
2340
2453
|
* @param id
|
|
2341
2454
|
* @param end
|
|
2342
2455
|
*/
|
|
2343
2456
|
setSpanEnd(id: number, end: number): void;
|
|
2344
2457
|
/**
|
|
2458
|
+
* Parent of a node. 0 when the node has no parent
|
|
2345
2459
|
*
|
|
2346
2460
|
* @param id
|
|
2347
2461
|
*/
|
|
2348
2462
|
getParent(id: number): number;
|
|
2349
2463
|
/**
|
|
2464
|
+
* The string of a string table id. The string is created the first time it is read
|
|
2350
2465
|
*
|
|
2351
2466
|
* @param id
|
|
2352
2467
|
*/
|
|
@@ -2493,7 +2608,13 @@ declare class Arena {
|
|
|
2493
2608
|
* @param matcher called with the arena and the token id
|
|
2494
2609
|
*/
|
|
2495
2610
|
findByValue(node: number, matcher: AstValueMatcher): {
|
|
2611
|
+
/**
|
|
2612
|
+
* the node that contains the matched token
|
|
2613
|
+
*/
|
|
2496
2614
|
node: number;
|
|
2615
|
+
/**
|
|
2616
|
+
* the matched token
|
|
2617
|
+
*/
|
|
2497
2618
|
value: number;
|
|
2498
2619
|
} | null;
|
|
2499
2620
|
/**
|
|
@@ -2512,6 +2633,7 @@ declare class Arena {
|
|
|
2512
2633
|
*/
|
|
2513
2634
|
subTokens(id: number): number[];
|
|
2514
2635
|
/**
|
|
2636
|
+
* The first child of a node for which the predicate returns `true`. null when there is none
|
|
2515
2637
|
*
|
|
2516
2638
|
* @param id
|
|
2517
2639
|
* @param predicate
|
|
@@ -2547,6 +2669,7 @@ declare class Arena {
|
|
|
2547
2669
|
*/
|
|
2548
2670
|
tokenCount(id: number): number;
|
|
2549
2671
|
/**
|
|
2672
|
+
* Replace the children of a node
|
|
2550
2673
|
*
|
|
2551
2674
|
* @param id
|
|
2552
2675
|
* @param children
|
|
@@ -2559,6 +2682,7 @@ declare class Arena {
|
|
|
2559
2682
|
*/
|
|
2560
2683
|
setChildList(id: number, children: number[]): void;
|
|
2561
2684
|
/**
|
|
2685
|
+
* Replace the tokens of a node or a token
|
|
2562
2686
|
*
|
|
2563
2687
|
* @param id
|
|
2564
2688
|
* @param children
|
|
@@ -2578,6 +2702,7 @@ declare class Arena {
|
|
|
2578
2702
|
*/
|
|
2579
2703
|
moveChildren(from: number, to: number, before?: number): void;
|
|
2580
2704
|
/**
|
|
2705
|
+
* Append children to a node
|
|
2581
2706
|
*
|
|
2582
2707
|
* @param id
|
|
2583
2708
|
* @param children
|
|
@@ -2590,6 +2715,7 @@ declare class Arena {
|
|
|
2590
2715
|
*/
|
|
2591
2716
|
appendChildList(id: number, children: number[]): void;
|
|
2592
2717
|
/**
|
|
2718
|
+
* Append tokens to a node or a token
|
|
2593
2719
|
*
|
|
2594
2720
|
* @param id
|
|
2595
2721
|
* @param children
|
|
@@ -2620,6 +2746,8 @@ declare class Arena {
|
|
|
2620
2746
|
*/
|
|
2621
2747
|
prependTokens(id: number, ...tokens: number[]): void;
|
|
2622
2748
|
/**
|
|
2749
|
+
* Compare the name (`"nam"`) or the value (`"val"`) of a node with a string, ignoring the case. The string of the
|
|
2750
|
+
* node is not created
|
|
2623
2751
|
*
|
|
2624
2752
|
* @param node
|
|
2625
2753
|
* @param key
|
|
@@ -2627,6 +2755,8 @@ declare class Arena {
|
|
|
2627
2755
|
*/
|
|
2628
2756
|
equalsIgnoreCase(node: number, key: "nam" | "val", string: string): boolean;
|
|
2629
2757
|
/**
|
|
2758
|
+
* `true` when the name (`"nam"`) or the value (`"val"`) of a node starts with a string. The string of the node is
|
|
2759
|
+
* not created
|
|
2630
2760
|
*
|
|
2631
2761
|
* @param node
|
|
2632
2762
|
* @param key
|
|
@@ -2634,6 +2764,7 @@ declare class Arena {
|
|
|
2634
2764
|
*/
|
|
2635
2765
|
startsWith(node: number, key: "nam" | "val", string: string): boolean;
|
|
2636
2766
|
/**
|
|
2767
|
+
* Grow the columns of the arena so they hold `newSize` ids. The columns are never shrunk
|
|
2637
2768
|
*
|
|
2638
2769
|
* @param newSize
|
|
2639
2770
|
*/
|
|
@@ -2676,12 +2807,14 @@ declare class Arena {
|
|
|
2676
2807
|
*/
|
|
2677
2808
|
trim(errors?: ErrorDescription[] | null): Uint32Array;
|
|
2678
2809
|
/**
|
|
2810
|
+
* Set the validation errors of a node. null or an empty list removes them
|
|
2679
2811
|
*
|
|
2680
2812
|
* @param id
|
|
2681
2813
|
* @param errors
|
|
2682
2814
|
*/
|
|
2683
2815
|
setErrors(id: number, errors: ErrorDescription[] | null): void;
|
|
2684
2816
|
/**
|
|
2817
|
+
* Validation errors of a node. null when the node has no errors
|
|
2685
2818
|
*
|
|
2686
2819
|
* @param id
|
|
2687
2820
|
*/
|
|
@@ -2731,16 +2864,23 @@ declare class AstArena extends Arena {
|
|
|
2731
2864
|
*/
|
|
2732
2865
|
inputLengths: Array<number | undefined>;
|
|
2733
2866
|
/**
|
|
2734
|
-
*
|
|
2735
|
-
* @param size
|
|
2867
|
+
* create an arena that holds an empty stylesheet
|
|
2868
|
+
* @param size initial number of nodes the columns can hold. the columns grow when they are full
|
|
2736
2869
|
*/
|
|
2737
2870
|
constructor(size?: number);
|
|
2738
2871
|
/**
|
|
2739
|
-
*
|
|
2872
|
+
* release nodes: detach them and drop their data (interned strings, errors) and their minification caches. node
|
|
2873
|
+
* ids are never reused: the memory is reclaimed by {@link trim}
|
|
2874
|
+
* @param id the node to release. every marked node (and its descendants) is released when omitted
|
|
2875
|
+
* @param deep release the children and the tokens too
|
|
2740
2876
|
*/
|
|
2741
2877
|
release(id?: number, deep?: boolean): void;
|
|
2742
2878
|
/**
|
|
2743
|
-
*
|
|
2879
|
+
* drop the nodes that are not reachable from the root and renumber the remaining nodes in document order.
|
|
2880
|
+
* the node ids change: ids obtained before the call (from visitors for instance) are no longer valid.
|
|
2881
|
+
* the unused strings and the minification caches are dropped too
|
|
2882
|
+
* @param errors error descriptions whose `node` is remapped
|
|
2883
|
+
* @returns mapping of the old ids to the new ids (0 when the node was dropped)
|
|
2744
2884
|
*/
|
|
2745
2885
|
compact(errors?: ErrorDescription[] | null): Uint32Array;
|
|
2746
2886
|
/**
|
|
@@ -2860,7 +3000,7 @@ declare class AstArena extends Arena {
|
|
|
2860
3000
|
* @param kin
|
|
2861
3001
|
* @param tokens color function arguments
|
|
2862
3002
|
*/
|
|
2863
|
-
createColor(val: string, kin: ColorType
|
|
3003
|
+
createColor(val: string, kin: ColorType, tokens?: number[] | null): number;
|
|
2864
3004
|
/**
|
|
2865
3005
|
* allocate a function token
|
|
2866
3006
|
* @param typ function token type
|
|
@@ -3102,11 +3242,14 @@ declare class AstArena extends Arena {
|
|
|
3102
3242
|
*/
|
|
3103
3243
|
replaceCompound(input: string, replace: string): string;
|
|
3104
3244
|
/**
|
|
3105
|
-
*
|
|
3245
|
+
* structured-cloneable properties of the arena, the sources and the minification caches included
|
|
3106
3246
|
*/
|
|
3107
3247
|
protected exportProperties(): ArenaProperties;
|
|
3108
3248
|
/**
|
|
3109
|
-
*
|
|
3249
|
+
* initialize the arena from exported properties and column buffers, the sources and the minification caches
|
|
3250
|
+
* included
|
|
3251
|
+
* @param properties
|
|
3252
|
+
* @param transferables
|
|
3110
3253
|
*/
|
|
3111
3254
|
protected importProperties(properties: ArenaProperties, transferables: ArenaTransferables): void;
|
|
3112
3255
|
/**
|
|
@@ -3128,6 +3271,7 @@ declare class AstArena extends Arena {
|
|
|
3128
3271
|
*/
|
|
3129
3272
|
protected expandRule(node: AstRule, parent: AstNode, before: AstNode): void;
|
|
3130
3273
|
/**
|
|
3274
|
+
* Replace the nesting selectors (`&`) of a compound selector with a selector
|
|
3131
3275
|
*
|
|
3132
3276
|
* @param selector
|
|
3133
3277
|
* @param replace
|
|
@@ -3336,7 +3480,13 @@ type AstNodeMatcher = (arena: AstArena, node: AstNode) => boolean;
|
|
|
3336
3480
|
* Unicode range token: `U+0025-00FF`, `U+4??`
|
|
3337
3481
|
*/
|
|
3338
3482
|
export declare interface UniCodeRangeToken extends BaseToken {
|
|
3483
|
+
/**
|
|
3484
|
+
* token type: {@link EnumToken.UniCodeRange}
|
|
3485
|
+
*/
|
|
3339
3486
|
typ: EnumToken.UniCodeRange;
|
|
3487
|
+
/**
|
|
3488
|
+
* the range: `U+0025-00FF`, `U+4??`
|
|
3489
|
+
*/
|
|
3340
3490
|
val: string;
|
|
3341
3491
|
}
|
|
3342
3492
|
|
|
@@ -3345,7 +3495,7 @@ export declare interface UniCodeRangeToken extends BaseToken {
|
|
|
3345
3495
|
*/
|
|
3346
3496
|
export declare interface LiteralToken extends BaseToken {
|
|
3347
3497
|
/**
|
|
3348
|
-
* @
|
|
3498
|
+
* token type: {@link EnumToken.LiteralTokenType}
|
|
3349
3499
|
*/
|
|
3350
3500
|
typ: EnumToken.LiteralTokenType;
|
|
3351
3501
|
/**
|
|
@@ -3359,7 +3509,7 @@ export declare interface LiteralToken extends BaseToken {
|
|
|
3359
3509
|
*/
|
|
3360
3510
|
export declare interface ClassSelectorToken extends BaseToken {
|
|
3361
3511
|
/**
|
|
3362
|
-
* @
|
|
3512
|
+
* token type: {@link EnumToken.ClassSelectorTokenType}
|
|
3363
3513
|
*/
|
|
3364
3514
|
typ: EnumToken.ClassSelectorTokenType;
|
|
3365
3515
|
/**
|
|
@@ -3373,7 +3523,7 @@ export declare interface ClassSelectorToken extends BaseToken {
|
|
|
3373
3523
|
*/
|
|
3374
3524
|
export declare interface UniversalSelectorToken extends BaseToken {
|
|
3375
3525
|
/**
|
|
3376
|
-
* @
|
|
3526
|
+
* token type: {@link EnumToken.UniversalSelectorTokenType}
|
|
3377
3527
|
*/
|
|
3378
3528
|
typ: EnumToken.UniversalSelectorTokenType;
|
|
3379
3529
|
}
|
|
@@ -3383,7 +3533,7 @@ export declare interface UniversalSelectorToken extends BaseToken {
|
|
|
3383
3533
|
*/
|
|
3384
3534
|
export declare interface IdentToken extends BaseToken {
|
|
3385
3535
|
/**
|
|
3386
|
-
* @
|
|
3536
|
+
* token type: {@link EnumToken.IdenTokenType}
|
|
3387
3537
|
*/
|
|
3388
3538
|
typ: EnumToken.IdenTokenType;
|
|
3389
3539
|
/**
|
|
@@ -3397,7 +3547,7 @@ export declare interface IdentToken extends BaseToken {
|
|
|
3397
3547
|
*/
|
|
3398
3548
|
export declare interface CssTypeTokenType extends BaseToken {
|
|
3399
3549
|
/**
|
|
3400
|
-
* @
|
|
3550
|
+
* token type: {@link EnumToken.CssTypeTokenType}
|
|
3401
3551
|
*/
|
|
3402
3552
|
typ: EnumToken.CssTypeTokenType;
|
|
3403
3553
|
/**
|
|
@@ -3411,7 +3561,7 @@ export declare interface CssTypeTokenType extends BaseToken {
|
|
|
3411
3561
|
*/
|
|
3412
3562
|
export declare interface IdentListToken extends BaseToken {
|
|
3413
3563
|
/**
|
|
3414
|
-
* @
|
|
3564
|
+
* token type: {@link EnumToken.IdenListTokenType}
|
|
3415
3565
|
*/
|
|
3416
3566
|
typ: EnumToken.IdenListTokenType;
|
|
3417
3567
|
/**
|
|
@@ -3425,7 +3575,7 @@ export declare interface IdentListToken extends BaseToken {
|
|
|
3425
3575
|
*/
|
|
3426
3576
|
export declare interface DashedIdentToken extends BaseToken {
|
|
3427
3577
|
/**
|
|
3428
|
-
* @
|
|
3578
|
+
* token type: {@link EnumToken.DashedIdenTokenType}
|
|
3429
3579
|
*/
|
|
3430
3580
|
typ: EnumToken.DashedIdenTokenType;
|
|
3431
3581
|
/**
|
|
@@ -3439,7 +3589,7 @@ export declare interface DashedIdentToken extends BaseToken {
|
|
|
3439
3589
|
*/
|
|
3440
3590
|
export declare interface CommaToken extends BaseToken {
|
|
3441
3591
|
/**
|
|
3442
|
-
* @
|
|
3592
|
+
* token type: {@link EnumToken.CommaTokenType}
|
|
3443
3593
|
*/
|
|
3444
3594
|
typ: EnumToken.CommaTokenType;
|
|
3445
3595
|
}
|
|
@@ -3449,7 +3599,7 @@ export declare interface CommaToken extends BaseToken {
|
|
|
3449
3599
|
*/
|
|
3450
3600
|
export declare interface ColonToken extends BaseToken {
|
|
3451
3601
|
/**
|
|
3452
|
-
* @
|
|
3602
|
+
* token type: {@link EnumToken.ColonTokenType}
|
|
3453
3603
|
*/
|
|
3454
3604
|
typ: EnumToken.ColonTokenType;
|
|
3455
3605
|
}
|
|
@@ -3459,7 +3609,7 @@ export declare interface ColonToken extends BaseToken {
|
|
|
3459
3609
|
*/
|
|
3460
3610
|
export declare interface DoubleColonToken extends BaseToken {
|
|
3461
3611
|
/**
|
|
3462
|
-
* @
|
|
3612
|
+
* token type: {@link EnumToken.DoubleColonTokenType}
|
|
3463
3613
|
*/
|
|
3464
3614
|
typ: EnumToken.DoubleColonTokenType;
|
|
3465
3615
|
}
|
|
@@ -3469,7 +3619,7 @@ export declare interface DoubleColonToken extends BaseToken {
|
|
|
3469
3619
|
*/
|
|
3470
3620
|
export declare interface SemiColonToken extends BaseToken {
|
|
3471
3621
|
/**
|
|
3472
|
-
* @
|
|
3622
|
+
* token type: {@link EnumToken.SemiColonTokenType}
|
|
3473
3623
|
*/
|
|
3474
3624
|
typ: EnumToken.SemiColonTokenType;
|
|
3475
3625
|
}
|
|
@@ -3479,7 +3629,7 @@ export declare interface SemiColonToken extends BaseToken {
|
|
|
3479
3629
|
*/
|
|
3480
3630
|
export declare interface NestingSelectorToken extends BaseToken {
|
|
3481
3631
|
/**
|
|
3482
|
-
* @
|
|
3632
|
+
* token type: {@link EnumToken.NestingSelectorTokenType}
|
|
3483
3633
|
*/
|
|
3484
3634
|
typ: EnumToken.NestingSelectorTokenType;
|
|
3485
3635
|
}
|
|
@@ -3489,7 +3639,7 @@ export declare interface NestingSelectorToken extends BaseToken {
|
|
|
3489
3639
|
*/
|
|
3490
3640
|
export declare interface NumberToken extends BaseToken {
|
|
3491
3641
|
/**
|
|
3492
|
-
* @
|
|
3642
|
+
* token type: {@link EnumToken.NumberTokenType}
|
|
3493
3643
|
*/
|
|
3494
3644
|
typ: EnumToken.NumberTokenType;
|
|
3495
3645
|
/**
|
|
@@ -3502,23 +3652,32 @@ export declare interface NumberToken extends BaseToken {
|
|
|
3502
3652
|
val: number | FractionToken;
|
|
3503
3653
|
}
|
|
3504
3654
|
|
|
3655
|
+
/**
|
|
3656
|
+
* `NaN` constant of a math function: `calc(NaN * 1px)`
|
|
3657
|
+
*/
|
|
3505
3658
|
export declare interface NaNToken extends BaseToken {
|
|
3506
3659
|
/**
|
|
3507
|
-
* @
|
|
3660
|
+
* token type: {@link EnumToken.NaNTokenType}
|
|
3508
3661
|
*/
|
|
3509
3662
|
typ: EnumToken.NaNTokenType;
|
|
3510
3663
|
}
|
|
3511
3664
|
|
|
3665
|
+
/**
|
|
3666
|
+
* `infinity` constant of a math function: `calc(infinity * 1px)`
|
|
3667
|
+
*/
|
|
3512
3668
|
export declare interface InfinityToken extends BaseToken {
|
|
3513
3669
|
/**
|
|
3514
|
-
* @
|
|
3670
|
+
* token type: {@link EnumToken.InfinityTokenType}
|
|
3515
3671
|
*/
|
|
3516
3672
|
typ: EnumToken.InfinityTokenType;
|
|
3517
3673
|
}
|
|
3518
3674
|
|
|
3675
|
+
/**
|
|
3676
|
+
* `-infinity` constant of a math function: `calc(-infinity * 1px)`
|
|
3677
|
+
*/
|
|
3519
3678
|
export declare interface NegativeInfinityToken extends BaseToken {
|
|
3520
3679
|
/**
|
|
3521
|
-
* @
|
|
3680
|
+
* token type: {@link EnumToken.NegativeInfinityTokenType}
|
|
3522
3681
|
*/
|
|
3523
3682
|
typ: EnumToken.NegativeInfinityTokenType;
|
|
3524
3683
|
}
|
|
@@ -3528,7 +3687,7 @@ export declare interface NegativeInfinityToken extends BaseToken {
|
|
|
3528
3687
|
*/
|
|
3529
3688
|
export declare interface AtRuleToken extends BaseToken {
|
|
3530
3689
|
/**
|
|
3531
|
-
* @
|
|
3690
|
+
* token type: {@link EnumToken.AtRuleTokenType}
|
|
3532
3691
|
*/
|
|
3533
3692
|
typ: EnumToken.AtRuleTokenType;
|
|
3534
3693
|
/**
|
|
@@ -3546,7 +3705,7 @@ export declare interface AtRuleToken extends BaseToken {
|
|
|
3546
3705
|
*/
|
|
3547
3706
|
export declare interface PercentageToken extends BaseToken {
|
|
3548
3707
|
/**
|
|
3549
|
-
* @
|
|
3708
|
+
* token type: {@link EnumToken.PercentageTokenType}
|
|
3550
3709
|
*/
|
|
3551
3710
|
typ: EnumToken.PercentageTokenType;
|
|
3552
3711
|
/**
|
|
@@ -3560,7 +3719,7 @@ export declare interface PercentageToken extends BaseToken {
|
|
|
3560
3719
|
*/
|
|
3561
3720
|
export declare interface FlexToken extends BaseToken {
|
|
3562
3721
|
/**
|
|
3563
|
-
* @
|
|
3722
|
+
* token type: {@link EnumToken.FlexTokenType}
|
|
3564
3723
|
*/
|
|
3565
3724
|
typ: EnumToken.FlexTokenType;
|
|
3566
3725
|
/**
|
|
@@ -3604,7 +3763,7 @@ export declare interface FunctionToken extends BaseToken {
|
|
|
3604
3763
|
*/
|
|
3605
3764
|
export declare interface GridTemplateFuncToken extends BaseToken {
|
|
3606
3765
|
/**
|
|
3607
|
-
* @
|
|
3766
|
+
* token type: {@link EnumToken.GridTemplateFuncTokenType}
|
|
3608
3767
|
*/
|
|
3609
3768
|
typ: EnumToken.GridTemplateFuncTokenType;
|
|
3610
3769
|
/**
|
|
@@ -3622,7 +3781,7 @@ export declare interface GridTemplateFuncToken extends BaseToken {
|
|
|
3622
3781
|
*/
|
|
3623
3782
|
export declare interface FunctionURLToken extends BaseToken {
|
|
3624
3783
|
/**
|
|
3625
|
-
* @
|
|
3784
|
+
* token type: {@link EnumToken.UrlFunctionTokenType}
|
|
3626
3785
|
*/
|
|
3627
3786
|
typ: EnumToken.UrlFunctionTokenType;
|
|
3628
3787
|
/**
|
|
@@ -3640,7 +3799,7 @@ export declare interface FunctionURLToken extends BaseToken {
|
|
|
3640
3799
|
*/
|
|
3641
3800
|
export declare interface FunctionImageToken extends BaseToken {
|
|
3642
3801
|
/**
|
|
3643
|
-
* @
|
|
3802
|
+
* token type: {@link EnumToken.ImageFunctionTokenType}
|
|
3644
3803
|
*/
|
|
3645
3804
|
typ: EnumToken.ImageFunctionTokenType;
|
|
3646
3805
|
/**
|
|
@@ -3667,7 +3826,7 @@ export declare interface FunctionImageToken extends BaseToken {
|
|
|
3667
3826
|
*/
|
|
3668
3827
|
export declare interface TimingFunctionToken extends BaseToken {
|
|
3669
3828
|
/**
|
|
3670
|
-
* @
|
|
3829
|
+
* token type: {@link EnumToken.TimingFunctionTokenType}
|
|
3671
3830
|
*/
|
|
3672
3831
|
typ: EnumToken.TimingFunctionTokenType;
|
|
3673
3832
|
/**
|
|
@@ -3685,7 +3844,7 @@ export declare interface TimingFunctionToken extends BaseToken {
|
|
|
3685
3844
|
*/
|
|
3686
3845
|
export declare interface TimelineFunctionToken extends BaseToken {
|
|
3687
3846
|
/**
|
|
3688
|
-
* @
|
|
3847
|
+
* token type: {@link EnumToken.TimelineFunctionTokenType}
|
|
3689
3848
|
*/
|
|
3690
3849
|
typ: EnumToken.TimelineFunctionTokenType;
|
|
3691
3850
|
/**
|
|
@@ -3703,7 +3862,7 @@ export declare interface TimelineFunctionToken extends BaseToken {
|
|
|
3703
3862
|
*/
|
|
3704
3863
|
export declare interface StringToken extends BaseToken {
|
|
3705
3864
|
/**
|
|
3706
|
-
* @
|
|
3865
|
+
* token type: {@link EnumToken.StringTokenType}
|
|
3707
3866
|
*/
|
|
3708
3867
|
typ: EnumToken.StringTokenType;
|
|
3709
3868
|
/**
|
|
@@ -3717,7 +3876,7 @@ export declare interface StringToken extends BaseToken {
|
|
|
3717
3876
|
*/
|
|
3718
3877
|
export declare interface BadStringToken extends BaseToken {
|
|
3719
3878
|
/**
|
|
3720
|
-
* @
|
|
3879
|
+
* token type: {@link EnumToken.BadStringTokenType}
|
|
3721
3880
|
*/
|
|
3722
3881
|
typ: EnumToken.BadStringTokenType;
|
|
3723
3882
|
/**
|
|
@@ -3731,7 +3890,7 @@ export declare interface BadStringToken extends BaseToken {
|
|
|
3731
3890
|
*/
|
|
3732
3891
|
export declare interface UnclosedStringToken extends BaseToken {
|
|
3733
3892
|
/**
|
|
3734
|
-
* @
|
|
3893
|
+
* token type: {@link EnumToken.UnclosedStringTokenType}
|
|
3735
3894
|
*/
|
|
3736
3895
|
typ: EnumToken.UnclosedStringTokenType;
|
|
3737
3896
|
/**
|
|
@@ -3745,7 +3904,7 @@ export declare interface UnclosedStringToken extends BaseToken {
|
|
|
3745
3904
|
*/
|
|
3746
3905
|
export declare interface DimensionToken extends BaseToken {
|
|
3747
3906
|
/**
|
|
3748
|
-
* @
|
|
3907
|
+
* token type: {@link EnumToken.DimensionTokenType}
|
|
3749
3908
|
*/
|
|
3750
3909
|
typ: EnumToken.DimensionTokenType;
|
|
3751
3910
|
/**
|
|
@@ -3763,7 +3922,7 @@ export declare interface DimensionToken extends BaseToken {
|
|
|
3763
3922
|
*/
|
|
3764
3923
|
export declare interface LengthToken extends BaseToken {
|
|
3765
3924
|
/**
|
|
3766
|
-
* @
|
|
3925
|
+
* token type: {@link EnumToken.LengthTokenType}
|
|
3767
3926
|
*/
|
|
3768
3927
|
typ: EnumToken.LengthTokenType;
|
|
3769
3928
|
/**
|
|
@@ -3781,7 +3940,7 @@ export declare interface LengthToken extends BaseToken {
|
|
|
3781
3940
|
*/
|
|
3782
3941
|
export declare interface AngleToken extends BaseToken {
|
|
3783
3942
|
/**
|
|
3784
|
-
* @
|
|
3943
|
+
* token type: {@link EnumToken.AngleTokenType}
|
|
3785
3944
|
*/
|
|
3786
3945
|
typ: EnumToken.AngleTokenType;
|
|
3787
3946
|
/**
|
|
@@ -3799,7 +3958,7 @@ export declare interface AngleToken extends BaseToken {
|
|
|
3799
3958
|
*/
|
|
3800
3959
|
export declare interface TimeToken extends BaseToken {
|
|
3801
3960
|
/**
|
|
3802
|
-
* @
|
|
3961
|
+
* token type: {@link EnumToken.TimeTokenType}
|
|
3803
3962
|
*/
|
|
3804
3963
|
typ: EnumToken.TimeTokenType;
|
|
3805
3964
|
/**
|
|
@@ -3817,7 +3976,7 @@ export declare interface TimeToken extends BaseToken {
|
|
|
3817
3976
|
*/
|
|
3818
3977
|
export declare interface FrequencyToken extends BaseToken {
|
|
3819
3978
|
/**
|
|
3820
|
-
* @
|
|
3979
|
+
* token type: {@link EnumToken.FrequencyTokenType}
|
|
3821
3980
|
*/
|
|
3822
3981
|
typ: EnumToken.FrequencyTokenType;
|
|
3823
3982
|
/**
|
|
@@ -3835,7 +3994,7 @@ export declare interface FrequencyToken extends BaseToken {
|
|
|
3835
3994
|
*/
|
|
3836
3995
|
export declare interface ResolutionToken extends BaseToken {
|
|
3837
3996
|
/**
|
|
3838
|
-
* @
|
|
3997
|
+
* token type: {@link EnumToken.ResolutionTokenType}
|
|
3839
3998
|
*/
|
|
3840
3999
|
typ: EnumToken.ResolutionTokenType;
|
|
3841
4000
|
/**
|
|
@@ -3853,7 +4012,7 @@ export declare interface ResolutionToken extends BaseToken {
|
|
|
3853
4012
|
*/
|
|
3854
4013
|
export declare interface HashToken extends BaseToken {
|
|
3855
4014
|
/**
|
|
3856
|
-
* @
|
|
4015
|
+
* token type: {@link EnumToken.HashTokenType}
|
|
3857
4016
|
*/
|
|
3858
4017
|
typ: EnumToken.HashTokenType;
|
|
3859
4018
|
/**
|
|
@@ -3867,7 +4026,7 @@ export declare interface HashToken extends BaseToken {
|
|
|
3867
4026
|
*/
|
|
3868
4027
|
export declare interface BlockStartToken extends BaseToken {
|
|
3869
4028
|
/**
|
|
3870
|
-
* @
|
|
4029
|
+
* token type: {@link EnumToken.BlockStartTokenType}
|
|
3871
4030
|
*/
|
|
3872
4031
|
typ: EnumToken.BlockStartTokenType;
|
|
3873
4032
|
}
|
|
@@ -3877,7 +4036,7 @@ export declare interface BlockStartToken extends BaseToken {
|
|
|
3877
4036
|
*/
|
|
3878
4037
|
export declare interface BlockEndToken extends BaseToken {
|
|
3879
4038
|
/**
|
|
3880
|
-
* @
|
|
4039
|
+
* token type: {@link EnumToken.BlockEndTokenType}
|
|
3881
4040
|
*/
|
|
3882
4041
|
typ: EnumToken.BlockEndTokenType;
|
|
3883
4042
|
}
|
|
@@ -3887,7 +4046,7 @@ export declare interface BlockEndToken extends BaseToken {
|
|
|
3887
4046
|
*/
|
|
3888
4047
|
export declare interface AttrStartToken extends BaseToken {
|
|
3889
4048
|
/**
|
|
3890
|
-
* @
|
|
4049
|
+
* token type: {@link EnumToken.AttrStartTokenType}
|
|
3891
4050
|
*/
|
|
3892
4051
|
typ: EnumToken.AttrStartTokenType;
|
|
3893
4052
|
/**
|
|
@@ -3901,7 +4060,7 @@ export declare interface AttrStartToken extends BaseToken {
|
|
|
3901
4060
|
*/
|
|
3902
4061
|
export declare interface AttrEndToken extends BaseToken {
|
|
3903
4062
|
/**
|
|
3904
|
-
* @
|
|
4063
|
+
* token type: {@link EnumToken.AttrEndTokenType}
|
|
3905
4064
|
*/
|
|
3906
4065
|
typ: EnumToken.AttrEndTokenType;
|
|
3907
4066
|
}
|
|
@@ -3911,7 +4070,7 @@ export declare interface AttrEndToken extends BaseToken {
|
|
|
3911
4070
|
*/
|
|
3912
4071
|
export declare interface ParensStartToken extends BaseToken {
|
|
3913
4072
|
/**
|
|
3914
|
-
* @
|
|
4073
|
+
* token type: {@link EnumToken.StartParensTokenType}
|
|
3915
4074
|
*/
|
|
3916
4075
|
typ: EnumToken.StartParensTokenType;
|
|
3917
4076
|
}
|
|
@@ -3921,7 +4080,7 @@ export declare interface ParensStartToken extends BaseToken {
|
|
|
3921
4080
|
*/
|
|
3922
4081
|
export declare interface ParensEndToken extends BaseToken {
|
|
3923
4082
|
/**
|
|
3924
|
-
* @
|
|
4083
|
+
* token type: {@link EnumToken.EndParensTokenType}
|
|
3925
4084
|
*/
|
|
3926
4085
|
typ: EnumToken.EndParensTokenType;
|
|
3927
4086
|
}
|
|
@@ -3931,7 +4090,7 @@ export declare interface ParensEndToken extends BaseToken {
|
|
|
3931
4090
|
*/
|
|
3932
4091
|
export declare interface ParensToken extends BaseToken {
|
|
3933
4092
|
/**
|
|
3934
|
-
* @
|
|
4093
|
+
* token type: {@link EnumToken.ParensTokenType}
|
|
3935
4094
|
*/
|
|
3936
4095
|
typ: EnumToken.ParensTokenType;
|
|
3937
4096
|
/**
|
|
@@ -3945,7 +4104,7 @@ export declare interface ParensToken extends BaseToken {
|
|
|
3945
4104
|
*/
|
|
3946
4105
|
export declare interface WhitespaceToken extends BaseToken {
|
|
3947
4106
|
/**
|
|
3948
|
-
* @
|
|
4107
|
+
* token type: {@link EnumToken.WhitespaceTokenType}
|
|
3949
4108
|
*/
|
|
3950
4109
|
typ: EnumToken.WhitespaceTokenType;
|
|
3951
4110
|
/**
|
|
@@ -3959,7 +4118,7 @@ export declare interface WhitespaceToken extends BaseToken {
|
|
|
3959
4118
|
*/
|
|
3960
4119
|
export declare interface CommentToken extends BaseToken {
|
|
3961
4120
|
/**
|
|
3962
|
-
* @
|
|
4121
|
+
* token type: {@link EnumToken.CommentTokenType}
|
|
3963
4122
|
*/
|
|
3964
4123
|
typ: EnumToken.CommentTokenType;
|
|
3965
4124
|
/**
|
|
@@ -3973,7 +4132,7 @@ export declare interface CommentToken extends BaseToken {
|
|
|
3973
4132
|
*/
|
|
3974
4133
|
export declare interface BadCommentToken extends BaseToken {
|
|
3975
4134
|
/**
|
|
3976
|
-
* @
|
|
4135
|
+
* token type: {@link EnumToken.BadCommentTokenType}
|
|
3977
4136
|
*/
|
|
3978
4137
|
typ: EnumToken.BadCommentTokenType;
|
|
3979
4138
|
/**
|
|
@@ -3987,7 +4146,7 @@ export declare interface BadCommentToken extends BaseToken {
|
|
|
3987
4146
|
*/
|
|
3988
4147
|
export declare interface CDOCommentToken extends BaseToken {
|
|
3989
4148
|
/**
|
|
3990
|
-
* @
|
|
4149
|
+
* token type: {@link EnumToken.CDOCOMMTokenType}
|
|
3991
4150
|
*/
|
|
3992
4151
|
typ: EnumToken.CDOCOMMTokenType;
|
|
3993
4152
|
/**
|
|
@@ -4001,7 +4160,7 @@ export declare interface CDOCommentToken extends BaseToken {
|
|
|
4001
4160
|
*/
|
|
4002
4161
|
export declare interface BadCDOCommentToken extends BaseToken {
|
|
4003
4162
|
/**
|
|
4004
|
-
* @
|
|
4163
|
+
* token type: {@link EnumToken.BadCdoTokenType}
|
|
4005
4164
|
*/
|
|
4006
4165
|
typ: EnumToken.BadCdoTokenType;
|
|
4007
4166
|
/**
|
|
@@ -4015,7 +4174,7 @@ export declare interface BadCDOCommentToken extends BaseToken {
|
|
|
4015
4174
|
*/
|
|
4016
4175
|
export declare interface IncludeMatchToken extends BaseToken {
|
|
4017
4176
|
/**
|
|
4018
|
-
* @
|
|
4177
|
+
* token type: {@link EnumToken.IncludeMatchTokenType}
|
|
4019
4178
|
*/
|
|
4020
4179
|
typ: EnumToken.IncludeMatchTokenType;
|
|
4021
4180
|
// val: '~=';
|
|
@@ -4026,7 +4185,7 @@ export declare interface IncludeMatchToken extends BaseToken {
|
|
|
4026
4185
|
*/
|
|
4027
4186
|
export declare interface DashMatchToken extends BaseToken {
|
|
4028
4187
|
/**
|
|
4029
|
-
* @
|
|
4188
|
+
* token type: {@link EnumToken.DashMatchTokenType}
|
|
4030
4189
|
*/
|
|
4031
4190
|
typ: EnumToken.DashMatchTokenType;
|
|
4032
4191
|
// val: '|=';
|
|
@@ -4037,7 +4196,7 @@ export declare interface DashMatchToken extends BaseToken {
|
|
|
4037
4196
|
*/
|
|
4038
4197
|
export declare interface EqualMatchToken extends BaseToken {
|
|
4039
4198
|
/**
|
|
4040
|
-
* @
|
|
4199
|
+
* token type: {@link EnumToken.EqualMatchTokenType}
|
|
4041
4200
|
*/
|
|
4042
4201
|
typ: EnumToken.EqualMatchTokenType;
|
|
4043
4202
|
// val: '|=';
|
|
@@ -4048,7 +4207,7 @@ export declare interface EqualMatchToken extends BaseToken {
|
|
|
4048
4207
|
*/
|
|
4049
4208
|
export declare interface StartMatchToken extends BaseToken {
|
|
4050
4209
|
/**
|
|
4051
|
-
* @
|
|
4210
|
+
* token type: {@link EnumToken.StartMatchTokenType}
|
|
4052
4211
|
*/
|
|
4053
4212
|
typ: EnumToken.StartMatchTokenType;
|
|
4054
4213
|
// val: '^=';
|
|
@@ -4059,7 +4218,7 @@ export declare interface StartMatchToken extends BaseToken {
|
|
|
4059
4218
|
*/
|
|
4060
4219
|
export declare interface EndMatchToken extends BaseToken {
|
|
4061
4220
|
/**
|
|
4062
|
-
* @
|
|
4221
|
+
* token type: {@link EnumToken.EndMatchTokenType}
|
|
4063
4222
|
*/
|
|
4064
4223
|
typ: EnumToken.EndMatchTokenType;
|
|
4065
4224
|
// val: '|=';
|
|
@@ -4070,7 +4229,7 @@ export declare interface EndMatchToken extends BaseToken {
|
|
|
4070
4229
|
*/
|
|
4071
4230
|
export declare interface ContainMatchToken extends BaseToken {
|
|
4072
4231
|
/**
|
|
4073
|
-
* @
|
|
4232
|
+
* token type: {@link EnumToken.ContainMatchTokenType}
|
|
4074
4233
|
*/
|
|
4075
4234
|
typ: EnumToken.ContainMatchTokenType;
|
|
4076
4235
|
// val: '|=';
|
|
@@ -4081,7 +4240,7 @@ export declare interface ContainMatchToken extends BaseToken {
|
|
|
4081
4240
|
*/
|
|
4082
4241
|
export declare interface LessThanToken extends BaseToken {
|
|
4083
4242
|
/**
|
|
4084
|
-
* @
|
|
4243
|
+
* token type: {@link EnumToken.LtTokenType}
|
|
4085
4244
|
*/
|
|
4086
4245
|
typ: EnumToken.LtTokenType;
|
|
4087
4246
|
}
|
|
@@ -4091,7 +4250,7 @@ export declare interface LessThanToken extends BaseToken {
|
|
|
4091
4250
|
*/
|
|
4092
4251
|
export declare interface LessThanOrEqualToken extends BaseToken {
|
|
4093
4252
|
/**
|
|
4094
|
-
* @
|
|
4253
|
+
* token type: {@link EnumToken.LteTokenType}
|
|
4095
4254
|
*/
|
|
4096
4255
|
typ: EnumToken.LteTokenType;
|
|
4097
4256
|
}
|
|
@@ -4101,7 +4260,7 @@ export declare interface LessThanOrEqualToken extends BaseToken {
|
|
|
4101
4260
|
*/
|
|
4102
4261
|
export declare interface GreaterThanToken extends BaseToken {
|
|
4103
4262
|
/**
|
|
4104
|
-
* @
|
|
4263
|
+
* token type: {@link EnumToken.GtTokenType}
|
|
4105
4264
|
*/
|
|
4106
4265
|
typ: EnumToken.GtTokenType;
|
|
4107
4266
|
}
|
|
@@ -4111,7 +4270,7 @@ export declare interface GreaterThanToken extends BaseToken {
|
|
|
4111
4270
|
*/
|
|
4112
4271
|
export declare interface GreaterThanOrEqualToken extends BaseToken {
|
|
4113
4272
|
/**
|
|
4114
|
-
* @
|
|
4273
|
+
* token type: {@link EnumToken.GteTokenType}
|
|
4115
4274
|
*/
|
|
4116
4275
|
typ: EnumToken.GteTokenType;
|
|
4117
4276
|
}
|
|
@@ -4121,7 +4280,7 @@ export declare interface GreaterThanOrEqualToken extends BaseToken {
|
|
|
4121
4280
|
*/
|
|
4122
4281
|
export declare interface ColumnCombinatorToken extends BaseToken {
|
|
4123
4282
|
/**
|
|
4124
|
-
* @
|
|
4283
|
+
* token type: {@link EnumToken.ColumnCombinatorTokenType}
|
|
4125
4284
|
*/
|
|
4126
4285
|
typ: EnumToken.ColumnCombinatorTokenType;
|
|
4127
4286
|
}
|
|
@@ -4131,7 +4290,7 @@ export declare interface ColumnCombinatorToken extends BaseToken {
|
|
|
4131
4290
|
*/
|
|
4132
4291
|
export declare interface PseudoClassToken extends BaseToken {
|
|
4133
4292
|
/**
|
|
4134
|
-
* @
|
|
4293
|
+
* token type: {@link EnumToken.PseudoClassTokenType}
|
|
4135
4294
|
*/
|
|
4136
4295
|
typ: EnumToken.PseudoClassTokenType;
|
|
4137
4296
|
/**
|
|
@@ -4145,7 +4304,7 @@ export declare interface PseudoClassToken extends BaseToken {
|
|
|
4145
4304
|
*/
|
|
4146
4305
|
export declare interface PseudoElementToken extends BaseToken {
|
|
4147
4306
|
/**
|
|
4148
|
-
* @
|
|
4307
|
+
* token type: {@link EnumToken.PseudoElementTokenType}
|
|
4149
4308
|
*/
|
|
4150
4309
|
typ: EnumToken.PseudoElementTokenType;
|
|
4151
4310
|
/**
|
|
@@ -4159,7 +4318,7 @@ export declare interface PseudoElementToken extends BaseToken {
|
|
|
4159
4318
|
*/
|
|
4160
4319
|
export declare interface PseudoPageToken extends BaseToken {
|
|
4161
4320
|
/**
|
|
4162
|
-
* @
|
|
4321
|
+
* token type: {@link EnumToken.PseudoPageTokenType}
|
|
4163
4322
|
*/
|
|
4164
4323
|
typ: EnumToken.PseudoPageTokenType;
|
|
4165
4324
|
/**
|
|
@@ -4173,7 +4332,7 @@ export declare interface PseudoPageToken extends BaseToken {
|
|
|
4173
4332
|
*/
|
|
4174
4333
|
export declare interface PseudoClassFunctionToken extends BaseToken {
|
|
4175
4334
|
/**
|
|
4176
|
-
* @
|
|
4335
|
+
* token type: {@link EnumToken.PseudoClassFuncTokenType}
|
|
4177
4336
|
*/
|
|
4178
4337
|
typ: EnumToken.PseudoClassFuncTokenType;
|
|
4179
4338
|
/**
|
|
@@ -4191,7 +4350,7 @@ export declare interface PseudoClassFunctionToken extends BaseToken {
|
|
|
4191
4350
|
*/
|
|
4192
4351
|
export declare interface DelimToken extends BaseToken {
|
|
4193
4352
|
/**
|
|
4194
|
-
* @
|
|
4353
|
+
* token type: {@link EnumToken.DelimTokenType}
|
|
4195
4354
|
*/
|
|
4196
4355
|
typ: EnumToken.DelimTokenType;
|
|
4197
4356
|
}
|
|
@@ -4201,7 +4360,7 @@ export declare interface DelimToken extends BaseToken {
|
|
|
4201
4360
|
*/
|
|
4202
4361
|
export declare interface BadUrlToken extends BaseToken {
|
|
4203
4362
|
/**
|
|
4204
|
-
* @
|
|
4363
|
+
* token type: {@link EnumToken.BadUrlTokenType}
|
|
4205
4364
|
*/
|
|
4206
4365
|
typ: EnumToken.BadUrlTokenType;
|
|
4207
4366
|
/**
|
|
@@ -4215,7 +4374,7 @@ export declare interface BadUrlToken extends BaseToken {
|
|
|
4215
4374
|
*/
|
|
4216
4375
|
export declare interface UrlToken extends BaseToken {
|
|
4217
4376
|
/**
|
|
4218
|
-
* @
|
|
4377
|
+
* token type: {@link EnumToken.UrlTokenTokenType}
|
|
4219
4378
|
*/
|
|
4220
4379
|
typ: EnumToken.UrlTokenTokenType;
|
|
4221
4380
|
/**
|
|
@@ -4229,7 +4388,7 @@ export declare interface UrlToken extends BaseToken {
|
|
|
4229
4388
|
*/
|
|
4230
4389
|
export declare interface EOFToken extends BaseToken {
|
|
4231
4390
|
/**
|
|
4232
|
-
* @
|
|
4391
|
+
* token type: {@link EnumToken.EOFTokenType}
|
|
4233
4392
|
*/
|
|
4234
4393
|
typ: EnumToken.EOFTokenType;
|
|
4235
4394
|
}
|
|
@@ -4239,7 +4398,7 @@ export declare interface EOFToken extends BaseToken {
|
|
|
4239
4398
|
*/
|
|
4240
4399
|
export declare interface ImportantToken extends BaseToken {
|
|
4241
4400
|
/**
|
|
4242
|
-
* @
|
|
4401
|
+
* token type: {@link EnumToken.ImportantTokenType}
|
|
4243
4402
|
*/
|
|
4244
4403
|
typ: EnumToken.ImportantTokenType;
|
|
4245
4404
|
}
|
|
@@ -4249,7 +4408,7 @@ export declare interface ImportantToken extends BaseToken {
|
|
|
4249
4408
|
*/
|
|
4250
4409
|
export declare interface ColorToken extends BaseToken {
|
|
4251
4410
|
/**
|
|
4252
|
-
* @
|
|
4411
|
+
* token type: {@link EnumToken.ColorTokenType}
|
|
4253
4412
|
*/
|
|
4254
4413
|
typ: EnumToken.ColorTokenType;
|
|
4255
4414
|
/**
|
|
@@ -4259,7 +4418,7 @@ export declare interface ColorToken extends BaseToken {
|
|
|
4259
4418
|
/**
|
|
4260
4419
|
* Color kind
|
|
4261
4420
|
*/
|
|
4262
|
-
kin: ColorType
|
|
4421
|
+
kin: ColorType;
|
|
4263
4422
|
/**
|
|
4264
4423
|
* Color components
|
|
4265
4424
|
*/
|
|
@@ -4275,7 +4434,7 @@ export declare interface ColorToken extends BaseToken {
|
|
|
4275
4434
|
*/
|
|
4276
4435
|
export declare interface AttrToken extends BaseToken {
|
|
4277
4436
|
/**
|
|
4278
|
-
* @
|
|
4437
|
+
* token type: {@link EnumToken.AttrTokenType}
|
|
4279
4438
|
*/
|
|
4280
4439
|
typ: EnumToken.AttrTokenType;
|
|
4281
4440
|
/**
|
|
@@ -4289,7 +4448,7 @@ export declare interface AttrToken extends BaseToken {
|
|
|
4289
4448
|
*/
|
|
4290
4449
|
export declare interface ChildCombinatorToken extends BaseToken {
|
|
4291
4450
|
/**
|
|
4292
|
-
* @
|
|
4451
|
+
* token type: {@link EnumToken.ChildCombinatorTokenType}
|
|
4293
4452
|
*/
|
|
4294
4453
|
typ: EnumToken.ChildCombinatorTokenType;
|
|
4295
4454
|
}
|
|
@@ -4299,7 +4458,7 @@ export declare interface ChildCombinatorToken extends BaseToken {
|
|
|
4299
4458
|
*/
|
|
4300
4459
|
export declare interface MediaFeatureToken extends BaseToken {
|
|
4301
4460
|
/**
|
|
4302
|
-
* @
|
|
4461
|
+
* token type: {@link EnumToken.MediaFeatureTokenType}
|
|
4303
4462
|
*/
|
|
4304
4463
|
typ: EnumToken.MediaFeatureTokenType;
|
|
4305
4464
|
/**
|
|
@@ -4313,7 +4472,7 @@ export declare interface MediaFeatureToken extends BaseToken {
|
|
|
4313
4472
|
*/
|
|
4314
4473
|
export declare interface NotToken extends BaseToken {
|
|
4315
4474
|
/**
|
|
4316
|
-
* @
|
|
4475
|
+
* token type: {@link EnumToken.NotTokenType}
|
|
4317
4476
|
*/
|
|
4318
4477
|
typ: EnumToken.NotTokenType;
|
|
4319
4478
|
/**
|
|
@@ -4327,7 +4486,7 @@ export declare interface NotToken extends BaseToken {
|
|
|
4327
4486
|
*/
|
|
4328
4487
|
export declare interface MediaFeatureOnlyToken extends BaseToken {
|
|
4329
4488
|
/**
|
|
4330
|
-
* @
|
|
4489
|
+
* token type: {@link EnumToken.OnlyTokenType}
|
|
4331
4490
|
*/
|
|
4332
4491
|
typ: EnumToken.OnlyTokenType;
|
|
4333
4492
|
/**
|
|
@@ -4341,7 +4500,7 @@ export declare interface MediaFeatureOnlyToken extends BaseToken {
|
|
|
4341
4500
|
*/
|
|
4342
4501
|
export declare interface AndToken extends BaseToken {
|
|
4343
4502
|
/**
|
|
4344
|
-
* @
|
|
4503
|
+
* token type: {@link EnumToken.AndTokenType}
|
|
4345
4504
|
*/
|
|
4346
4505
|
typ: EnumToken.AndTokenType;
|
|
4347
4506
|
}
|
|
@@ -4351,7 +4510,7 @@ export declare interface AndToken extends BaseToken {
|
|
|
4351
4510
|
*/
|
|
4352
4511
|
export declare interface OrToken extends BaseToken {
|
|
4353
4512
|
/**
|
|
4354
|
-
* @
|
|
4513
|
+
* token type: {@link EnumToken.OrTokenType}
|
|
4355
4514
|
*/
|
|
4356
4515
|
typ: EnumToken.OrTokenType;
|
|
4357
4516
|
}
|
|
@@ -4361,7 +4520,7 @@ export declare interface OrToken extends BaseToken {
|
|
|
4361
4520
|
*/
|
|
4362
4521
|
export declare interface MediaQueryUnaryFeatureToken extends BaseToken {
|
|
4363
4522
|
/**
|
|
4364
|
-
* @
|
|
4523
|
+
* token type: {@link EnumToken.MediaQueryUnaryFeatureTokenType}
|
|
4365
4524
|
*/
|
|
4366
4525
|
typ: EnumToken.MediaQueryUnaryFeatureTokenType;
|
|
4367
4526
|
/**
|
|
@@ -4374,77 +4533,92 @@ export declare interface MediaQueryUnaryFeatureToken extends BaseToken {
|
|
|
4374
4533
|
r: PlainToken[];
|
|
4375
4534
|
}
|
|
4376
4535
|
|
|
4536
|
+
/**
|
|
4537
|
+
* `@supports` unary condition: `not (display: grid)`
|
|
4538
|
+
*/
|
|
4377
4539
|
export declare interface SupportsQueryUnaryConditionToken extends BaseToken {
|
|
4378
4540
|
/**
|
|
4379
|
-
* @
|
|
4541
|
+
* token type: {@link EnumToken.SupportsQueryUnaryConditionTokenType}
|
|
4380
4542
|
*/
|
|
4381
4543
|
typ: EnumToken.SupportsQueryUnaryConditionTokenType;
|
|
4382
4544
|
/**
|
|
4383
|
-
*
|
|
4545
|
+
* the operator: `not`
|
|
4384
4546
|
*/
|
|
4385
4547
|
l: PlainToken;
|
|
4386
4548
|
/**
|
|
4387
|
-
*
|
|
4549
|
+
* the negated condition
|
|
4388
4550
|
*/
|
|
4389
4551
|
r: PlainToken[];
|
|
4390
4552
|
}
|
|
4391
4553
|
|
|
4554
|
+
/**
|
|
4555
|
+
* `@supports` condition: `(display: grid) and (gap: 1rem)`
|
|
4556
|
+
*/
|
|
4392
4557
|
export declare interface SupportsQueryConditionToken extends BaseToken {
|
|
4393
4558
|
/**
|
|
4394
|
-
* @
|
|
4559
|
+
* token type: {@link EnumToken.SupportsQueryConditionTokenType}
|
|
4395
4560
|
*/
|
|
4396
4561
|
typ: EnumToken.SupportsQueryConditionTokenType;
|
|
4397
4562
|
/**
|
|
4398
|
-
*
|
|
4563
|
+
* logical operator
|
|
4399
4564
|
*/
|
|
4400
4565
|
op: AndToken | OrToken;
|
|
4401
4566
|
/**
|
|
4402
|
-
*
|
|
4567
|
+
* left operand
|
|
4403
4568
|
*/
|
|
4404
4569
|
l: PlainToken[];
|
|
4405
4570
|
/**
|
|
4406
|
-
*
|
|
4571
|
+
* right operand
|
|
4407
4572
|
*/
|
|
4408
4573
|
r: PlainToken[];
|
|
4409
4574
|
}
|
|
4410
4575
|
|
|
4576
|
+
/**
|
|
4577
|
+
* `@when` / `@else` condition: `media(width >= 400px) and supports(display: grid)`
|
|
4578
|
+
*/
|
|
4411
4579
|
export declare interface WhenElseQueryConditionToken extends BaseToken {
|
|
4412
4580
|
/**
|
|
4413
|
-
* @
|
|
4581
|
+
* token type: {@link EnumToken.WhenElseQueryConditionTokenType}
|
|
4414
4582
|
*/
|
|
4415
4583
|
typ: EnumToken.WhenElseQueryConditionTokenType;
|
|
4416
4584
|
/**
|
|
4417
|
-
*
|
|
4585
|
+
* logical operator
|
|
4418
4586
|
*/
|
|
4419
4587
|
op: AndToken | OrToken;
|
|
4420
4588
|
/**
|
|
4421
|
-
*
|
|
4589
|
+
* left operand
|
|
4422
4590
|
*/
|
|
4423
4591
|
l: PlainToken[];
|
|
4424
4592
|
/**
|
|
4425
|
-
*
|
|
4593
|
+
* right operand
|
|
4426
4594
|
*/
|
|
4427
4595
|
r: PlainToken[];
|
|
4428
4596
|
}
|
|
4429
4597
|
|
|
4598
|
+
/**
|
|
4599
|
+
* `@when` / `@else` unary condition: `not media(width >= 400px)`
|
|
4600
|
+
*/
|
|
4430
4601
|
export declare interface WhenElseUnaryConditionToken extends BaseToken {
|
|
4431
4602
|
/**
|
|
4432
|
-
* @
|
|
4603
|
+
* token type: {@link EnumToken.WhenElseUnaryConditionTokenType}
|
|
4433
4604
|
*/
|
|
4434
4605
|
typ: EnumToken.WhenElseUnaryConditionTokenType;
|
|
4435
4606
|
/**
|
|
4436
|
-
*
|
|
4607
|
+
* the operator: `not`
|
|
4437
4608
|
*/
|
|
4438
4609
|
l: PlainToken;
|
|
4439
4610
|
/**
|
|
4440
|
-
*
|
|
4611
|
+
* the negated condition
|
|
4441
4612
|
*/
|
|
4442
4613
|
r: PlainToken[];
|
|
4443
4614
|
}
|
|
4444
4615
|
|
|
4616
|
+
/**
|
|
4617
|
+
* media query condition: `(min-width: 400px)`, `(width > 400px)`, `(hover) and (pointer: fine)`
|
|
4618
|
+
*/
|
|
4445
4619
|
export declare interface MediaQueryConditionToken extends BaseToken {
|
|
4446
4620
|
/**
|
|
4447
|
-
* @
|
|
4621
|
+
* token type: {@link EnumToken.MediaQueryConditionTokenType}
|
|
4448
4622
|
*/
|
|
4449
4623
|
typ: EnumToken.MediaQueryConditionTokenType;
|
|
4450
4624
|
/**
|
|
@@ -4469,9 +4643,12 @@ export declare interface MediaQueryConditionToken extends BaseToken {
|
|
|
4469
4643
|
r: PlainToken[];
|
|
4470
4644
|
}
|
|
4471
4645
|
|
|
4646
|
+
/**
|
|
4647
|
+
* condition of an `if()` function branch: `media(width >= 400px): 1rem`
|
|
4648
|
+
*/
|
|
4472
4649
|
export declare interface IfConditionToken extends BaseToken {
|
|
4473
4650
|
/**
|
|
4474
|
-
* @
|
|
4651
|
+
* token type: {@link EnumToken.IfConditionTokenType}
|
|
4475
4652
|
*/
|
|
4476
4653
|
typ: EnumToken.IfConditionTokenType;
|
|
4477
4654
|
/**
|
|
@@ -4484,9 +4661,12 @@ export declare interface IfConditionToken extends BaseToken {
|
|
|
4484
4661
|
r: PlainToken[];
|
|
4485
4662
|
}
|
|
4486
4663
|
|
|
4664
|
+
/**
|
|
4665
|
+
* `if()` function branch with an `else` fallback: `media(width >= 400px): 1rem; else: 2rem`
|
|
4666
|
+
*/
|
|
4487
4667
|
export declare interface IfElseConditionToken extends BaseToken {
|
|
4488
4668
|
/**
|
|
4489
|
-
* @
|
|
4669
|
+
* token type: {@link EnumToken.IfElseConditionTokenType}
|
|
4490
4670
|
*/
|
|
4491
4671
|
typ: EnumToken.IfElseConditionTokenType;
|
|
4492
4672
|
/**
|
|
@@ -4499,9 +4679,12 @@ export declare interface IfElseConditionToken extends BaseToken {
|
|
|
4499
4679
|
r: IfConditionToken;
|
|
4500
4680
|
}
|
|
4501
4681
|
|
|
4682
|
+
/**
|
|
4683
|
+
* range of a `@container style()` query: `style(--size > 10px)`
|
|
4684
|
+
*/
|
|
4502
4685
|
export declare interface ContainerStyleRangeToken extends BaseToken {
|
|
4503
4686
|
/**
|
|
4504
|
-
* @
|
|
4687
|
+
* token type: {@link EnumToken.ContainerStyleRangeTokenType}
|
|
4505
4688
|
*/
|
|
4506
4689
|
typ: EnumToken.ContainerStyleRangeTokenType;
|
|
4507
4690
|
/**
|
|
@@ -4518,13 +4701,12 @@ export declare interface ContainerStyleRangeToken extends BaseToken {
|
|
|
4518
4701
|
r: PlainToken[];
|
|
4519
4702
|
}
|
|
4520
4703
|
|
|
4521
|
-
// (20px <= width < 30px)
|
|
4522
4704
|
/**
|
|
4523
|
-
*
|
|
4705
|
+
* media range query: `(20px <= width < 30px)`
|
|
4524
4706
|
*/
|
|
4525
4707
|
export declare interface MediaRangeQueryToken extends BaseToken {
|
|
4526
4708
|
/**
|
|
4527
|
-
* @
|
|
4709
|
+
* token type: {@link EnumToken.MediaRangeQueryTokenType}
|
|
4528
4710
|
*/
|
|
4529
4711
|
typ: EnumToken.MediaRangeQueryTokenType;
|
|
4530
4712
|
/**
|
|
@@ -4554,7 +4736,7 @@ export declare interface MediaRangeQueryToken extends BaseToken {
|
|
|
4554
4736
|
*/
|
|
4555
4737
|
export declare interface DescendantCombinatorToken extends BaseToken {
|
|
4556
4738
|
/**
|
|
4557
|
-
* @
|
|
4739
|
+
* token type: {@link EnumToken.DescendantCombinatorTokenType}
|
|
4558
4740
|
*/
|
|
4559
4741
|
typ: EnumToken.DescendantCombinatorTokenType;
|
|
4560
4742
|
}
|
|
@@ -4564,7 +4746,7 @@ export declare interface DescendantCombinatorToken extends BaseToken {
|
|
|
4564
4746
|
*/
|
|
4565
4747
|
export declare interface NextSiblingCombinatorToken extends BaseToken {
|
|
4566
4748
|
/**
|
|
4567
|
-
* @
|
|
4749
|
+
* token type: {@link EnumToken.NextSiblingCombinatorTokenType}
|
|
4568
4750
|
*/
|
|
4569
4751
|
typ: EnumToken.NextSiblingCombinatorTokenType;
|
|
4570
4752
|
}
|
|
@@ -4574,7 +4756,7 @@ export declare interface NextSiblingCombinatorToken extends BaseToken {
|
|
|
4574
4756
|
*/
|
|
4575
4757
|
export declare interface SubsequentCombinatorToken extends BaseToken {
|
|
4576
4758
|
/**
|
|
4577
|
-
* @
|
|
4759
|
+
* token type: {@link EnumToken.SubsequentSiblingCombinatorTokenType}
|
|
4578
4760
|
*/
|
|
4579
4761
|
typ: EnumToken.SubsequentSiblingCombinatorTokenType;
|
|
4580
4762
|
}
|
|
@@ -4584,7 +4766,7 @@ export declare interface SubsequentCombinatorToken extends BaseToken {
|
|
|
4584
4766
|
*/
|
|
4585
4767
|
export declare interface AddToken extends BaseToken {
|
|
4586
4768
|
/**
|
|
4587
|
-
* @
|
|
4769
|
+
* token type: {@link EnumToken.Add}
|
|
4588
4770
|
*/
|
|
4589
4771
|
typ: EnumToken.Add;
|
|
4590
4772
|
}
|
|
@@ -4594,7 +4776,7 @@ export declare interface AddToken extends BaseToken {
|
|
|
4594
4776
|
*/
|
|
4595
4777
|
export declare interface SubToken extends BaseToken {
|
|
4596
4778
|
/**
|
|
4597
|
-
* @
|
|
4779
|
+
* token type: {@link EnumToken.Sub}
|
|
4598
4780
|
*/
|
|
4599
4781
|
typ: EnumToken.Sub;
|
|
4600
4782
|
}
|
|
@@ -4604,7 +4786,7 @@ export declare interface SubToken extends BaseToken {
|
|
|
4604
4786
|
*/
|
|
4605
4787
|
export declare interface DivToken extends BaseToken {
|
|
4606
4788
|
/**
|
|
4607
|
-
* @
|
|
4789
|
+
* token type: {@link EnumToken.Div}
|
|
4608
4790
|
*/
|
|
4609
4791
|
typ: EnumToken.Div;
|
|
4610
4792
|
}
|
|
@@ -4614,7 +4796,7 @@ export declare interface DivToken extends BaseToken {
|
|
|
4614
4796
|
*/
|
|
4615
4797
|
export declare interface MulToken extends BaseToken {
|
|
4616
4798
|
/**
|
|
4617
|
-
* @
|
|
4799
|
+
* token type: {@link EnumToken.Mul}
|
|
4618
4800
|
*/
|
|
4619
4801
|
typ: EnumToken.Mul;
|
|
4620
4802
|
}
|
|
@@ -4624,7 +4806,7 @@ export declare interface MulToken extends BaseToken {
|
|
|
4624
4806
|
*/
|
|
4625
4807
|
export declare interface WrappedValuesToken extends BaseToken {
|
|
4626
4808
|
/**
|
|
4627
|
-
* @
|
|
4809
|
+
* token type: {@link EnumToken.WrappedValuesTokenType}
|
|
4628
4810
|
*/
|
|
4629
4811
|
typ: EnumToken.WrappedValuesTokenType;
|
|
4630
4812
|
/**
|
|
@@ -4638,7 +4820,7 @@ export declare interface WrappedValuesToken extends BaseToken {
|
|
|
4638
4820
|
*/
|
|
4639
4821
|
export declare interface UnaryExpression extends BaseToken {
|
|
4640
4822
|
/**
|
|
4641
|
-
* @
|
|
4823
|
+
* token type: {@link EnumToken.UnaryExpressionTokenType}
|
|
4642
4824
|
*/
|
|
4643
4825
|
typ: EnumToken.UnaryExpressionTokenType;
|
|
4644
4826
|
/**
|
|
@@ -4656,7 +4838,7 @@ export declare interface UnaryExpression extends BaseToken {
|
|
|
4656
4838
|
*/
|
|
4657
4839
|
export declare interface FractionToken extends BaseToken {
|
|
4658
4840
|
/**
|
|
4659
|
-
* @
|
|
4841
|
+
* token type: {@link EnumToken.FractionTokenType}
|
|
4660
4842
|
*/
|
|
4661
4843
|
typ: EnumToken.FractionTokenType;
|
|
4662
4844
|
/**
|
|
@@ -4674,7 +4856,7 @@ export declare interface FractionToken extends BaseToken {
|
|
|
4674
4856
|
*/
|
|
4675
4857
|
export declare interface BinaryExpressionToken extends BaseToken {
|
|
4676
4858
|
/**
|
|
4677
|
-
* @
|
|
4859
|
+
* token type: {@link EnumToken.BinaryExpressionTokenType}
|
|
4678
4860
|
*/
|
|
4679
4861
|
typ: EnumToken.BinaryExpressionTokenType;
|
|
4680
4862
|
/**
|
|
@@ -4696,7 +4878,7 @@ export declare interface BinaryExpressionToken extends BaseToken {
|
|
|
4696
4878
|
*/
|
|
4697
4879
|
export declare interface MatchExpressionToken extends BaseToken {
|
|
4698
4880
|
/**
|
|
4699
|
-
* @
|
|
4881
|
+
* token type: {@link EnumToken.MatchExpressionTokenType}
|
|
4700
4882
|
*/
|
|
4701
4883
|
typ: EnumToken.MatchExpressionTokenType;
|
|
4702
4884
|
/**
|
|
@@ -4722,7 +4904,7 @@ export declare interface MatchExpressionToken extends BaseToken {
|
|
|
4722
4904
|
*/
|
|
4723
4905
|
export declare interface NameSpaceAttributeToken extends BaseToken {
|
|
4724
4906
|
/**
|
|
4725
|
-
* @
|
|
4907
|
+
* token type: {@link EnumToken.NameSpaceAttributeTokenType}
|
|
4726
4908
|
*/
|
|
4727
4909
|
typ: EnumToken.NameSpaceAttributeTokenType;
|
|
4728
4910
|
/**
|
|
@@ -4740,7 +4922,7 @@ export declare interface NameSpaceAttributeToken extends BaseToken {
|
|
|
4740
4922
|
*/
|
|
4741
4923
|
export declare interface ListToken extends BaseToken {
|
|
4742
4924
|
/**
|
|
4743
|
-
* @
|
|
4925
|
+
* token type: {@link EnumToken.ListToken}
|
|
4744
4926
|
*/
|
|
4745
4927
|
typ: EnumToken.ListToken;
|
|
4746
4928
|
/**
|
|
@@ -4754,9 +4936,9 @@ export declare interface ListToken extends BaseToken {
|
|
|
4754
4936
|
*/
|
|
4755
4937
|
export declare interface ComposesSelectorToken extends BaseToken {
|
|
4756
4938
|
/**
|
|
4757
|
-
* @
|
|
4939
|
+
* token type: {@link EnumToken.ComposesSelectorNodeType}
|
|
4758
4940
|
*/
|
|
4759
|
-
typ: EnumToken.
|
|
4941
|
+
typ: EnumToken.ComposesSelectorNodeType;
|
|
4760
4942
|
|
|
4761
4943
|
/**
|
|
4762
4944
|
* Left handle
|
|
@@ -4773,7 +4955,7 @@ export declare interface ComposesSelectorToken extends BaseToken {
|
|
|
4773
4955
|
*/
|
|
4774
4956
|
export declare interface CssVariableToken extends BaseToken {
|
|
4775
4957
|
/**
|
|
4776
|
-
* @
|
|
4958
|
+
* token type: {@link EnumToken.CssVariableTokenType}
|
|
4777
4959
|
*/
|
|
4778
4960
|
typ: EnumToken.CssVariableTokenType;
|
|
4779
4961
|
/**
|
|
@@ -4791,7 +4973,7 @@ export declare interface CssVariableToken extends BaseToken {
|
|
|
4791
4973
|
*/
|
|
4792
4974
|
export declare interface CssVariableImportTokenType extends BaseToken {
|
|
4793
4975
|
/**
|
|
4794
|
-
* @
|
|
4976
|
+
* token type: {@link EnumToken.CssVariableImportTokenType}
|
|
4795
4977
|
*/
|
|
4796
4978
|
typ: EnumToken.CssVariableImportTokenType;
|
|
4797
4979
|
/**
|
|
@@ -4809,7 +4991,7 @@ export declare interface CssVariableImportTokenType extends BaseToken {
|
|
|
4809
4991
|
*/
|
|
4810
4992
|
export declare interface CssVariableMapTokenType extends BaseToken {
|
|
4811
4993
|
/**
|
|
4812
|
-
* @
|
|
4994
|
+
* token type: {@link EnumToken.CssVariableDeclarationMapTokenType}
|
|
4813
4995
|
*/
|
|
4814
4996
|
typ: EnumToken.CssVariableDeclarationMapTokenType;
|
|
4815
4997
|
/**
|
|
@@ -4827,10 +5009,10 @@ export declare interface CssVariableMapTokenType extends BaseToken {
|
|
|
4827
5009
|
*/
|
|
4828
5010
|
export declare interface FunctionDefToken extends BaseToken {
|
|
4829
5011
|
/**
|
|
4830
|
-
*
|
|
5012
|
+
* token type: one of the function definition token types
|
|
4831
5013
|
*/
|
|
4832
5014
|
typ:
|
|
4833
|
-
| EnumToken.
|
|
5015
|
+
| EnumToken.FunctionTokenDefType
|
|
4834
5016
|
| EnumToken.UrlFunctionTokenDefType
|
|
4835
5017
|
| EnumToken.GridTemplateFuncTokenDefType
|
|
4836
5018
|
| EnumToken.ImageFunctionTokenDefType
|
|
@@ -4853,9 +5035,9 @@ export declare interface FunctionDefToken extends BaseToken {
|
|
|
4853
5035
|
/**
|
|
4854
5036
|
* Raw node token
|
|
4855
5037
|
*/
|
|
4856
|
-
export declare interface RawNodeToken extends BaseToken
|
|
5038
|
+
export declare interface RawNodeToken extends BaseToken {
|
|
4857
5039
|
/**
|
|
4858
|
-
* @
|
|
5040
|
+
* token type: {@link EnumToken.RawNodeTokenType}
|
|
4859
5041
|
*/
|
|
4860
5042
|
typ: EnumToken.RawNodeTokenType;
|
|
4861
5043
|
/**
|
|
@@ -5069,20 +5251,60 @@ export declare type GenericVisitorSyncHandler<T> = (arena: AstArena, node: T) =>
|
|
|
5069
5251
|
export declare type GenericVisitorAstNodeSyncHandlerMap<T> =
|
|
5070
5252
|
| Record<string, GenericVisitorSyncHandler<T>>
|
|
5071
5253
|
| GenericVisitorSyncHandler<T>
|
|
5072
|
-
|
|
|
5073
|
-
|
|
5074
|
-
|
|
5254
|
+
| {
|
|
5255
|
+
/**
|
|
5256
|
+
* when the handler is called: {@link WalkerEvent.Enter} (before the children of the node) or
|
|
5257
|
+
* {@link WalkerEvent.Leave} (after them)
|
|
5258
|
+
*/
|
|
5259
|
+
type: WalkerEvent;
|
|
5260
|
+
/**
|
|
5261
|
+
* the handler
|
|
5262
|
+
*/
|
|
5263
|
+
handler: GenericVisitorSyncHandler<T>;
|
|
5264
|
+
}
|
|
5265
|
+
| {
|
|
5266
|
+
/**
|
|
5267
|
+
* when the handlers are called: {@link WalkerEvent.Enter} (before the children of the node) or
|
|
5268
|
+
* {@link WalkerEvent.Leave} (after them)
|
|
5269
|
+
*/
|
|
5270
|
+
type: WalkerEvent;
|
|
5271
|
+
/**
|
|
5272
|
+
* the handlers, by name
|
|
5273
|
+
*/
|
|
5274
|
+
handler: Record<string, GenericVisitorSyncHandler<T>>;
|
|
5275
|
+
};
|
|
5075
5276
|
|
|
5076
5277
|
/**
|
|
5077
5278
|
* Generic visitor handler
|
|
5078
5279
|
*/
|
|
5079
5280
|
export declare type ValueVisitorSyncHandler = GenericVisitorSyncHandler<Token>;
|
|
5080
5281
|
|
|
5282
|
+
/**
|
|
5283
|
+
* Declaration visitor handler
|
|
5284
|
+
*/
|
|
5285
|
+
export declare type DeclarationVisitorSyncHandler = GenericVisitorSyncHandler<AstDeclaration>;
|
|
5286
|
+
/**
|
|
5287
|
+
* Rule visitor handler
|
|
5288
|
+
*/
|
|
5289
|
+
export declare type RuleVisitorSyncHandler = GenericVisitorSyncHandler<AstRule>;
|
|
5290
|
+
|
|
5291
|
+
/**
|
|
5292
|
+
* AtRule visitor handler
|
|
5293
|
+
*/
|
|
5294
|
+
export declare type AtRuleVisitorSyncHandler = GenericVisitorSyncHandler<AstAtRule>;
|
|
5295
|
+
|
|
5296
|
+
/**
|
|
5297
|
+
* token visitors, by token type name (see {@link EnumToken})
|
|
5298
|
+
*/
|
|
5299
|
+
export declare type VisitorSyncTokenMap = {
|
|
5300
|
+
[key in keyof typeof EnumToken]?: GenericVisitorAstNodeSyncHandlerMap<Token> | GenericVisitorAstNodeSyncHandlerMap<AstNode>;
|
|
5301
|
+
};
|
|
5302
|
+
|
|
5081
5303
|
/**
|
|
5082
5304
|
* node visitor callback map
|
|
5083
5305
|
*
|
|
5084
5306
|
*/
|
|
5085
|
-
export declare interface VisitorSyncNodeMap {
|
|
5307
|
+
export declare interface VisitorSyncNodeMap extends VisitorSyncTokenMap {
|
|
5086
5308
|
/**
|
|
5087
5309
|
* at rule visitor
|
|
5088
5310
|
*
|
|
@@ -5285,57 +5507,6 @@ export declare interface VisitorSyncNodeMap {
|
|
|
5285
5507
|
*/
|
|
5286
5508
|
Value?: GenericVisitorAstNodeSyncHandlerMap<Token>;
|
|
5287
5509
|
|
|
5288
|
-
/**
|
|
5289
|
-
* generic token visitor. the key name is of type keyof EnumToken.
|
|
5290
|
-
* generic tokens are called for every token of the specified type.
|
|
5291
|
-
*
|
|
5292
|
-
* ```ts
|
|
5293
|
-
*
|
|
5294
|
-
* import {transform, parse, parseDeclarations} from "@tbela99/css-parser";
|
|
5295
|
-
*
|
|
5296
|
-
* const options: ParserOptions = {
|
|
5297
|
-
*
|
|
5298
|
-
* inlineCssVariables: true,
|
|
5299
|
-
* visitor: {
|
|
5300
|
-
*
|
|
5301
|
-
* // Stylesheet node visitor
|
|
5302
|
-
* StyleSheetNodeType: async (arena, node) => {
|
|
5303
|
-
*
|
|
5304
|
-
* // insert a new rule. nodes of another arena are imported
|
|
5305
|
-
* const result = await parse('html {--base-color: pink}');
|
|
5306
|
-
* arena.prependChildren(node, arena.import(result.arena, result.arena.getFirstChild(result.ast)));
|
|
5307
|
-
* },
|
|
5308
|
-
* ColorTokenType: (arena, node) => {
|
|
5309
|
-
*
|
|
5310
|
-
* // dump all color tokens
|
|
5311
|
-
* // console.debug(arena.toObject(node));
|
|
5312
|
-
* },
|
|
5313
|
-
* FunctionTokenType: (arena, node) => {
|
|
5314
|
-
*
|
|
5315
|
-
* // dump all function tokens
|
|
5316
|
-
* // console.debug(arena.toObject(node));
|
|
5317
|
-
* },
|
|
5318
|
-
* DeclarationNodeType: (arena, node) => {
|
|
5319
|
-
*
|
|
5320
|
-
* // dump all declaration nodes
|
|
5321
|
-
* // console.debug(arena.toObject(node));
|
|
5322
|
-
* }
|
|
5323
|
-
* }
|
|
5324
|
-
* };
|
|
5325
|
-
*
|
|
5326
|
-
* const css = `
|
|
5327
|
-
*
|
|
5328
|
-
* body { color: color(from var(--base-color) display-p3 r calc(g + 0.24) calc(b + 0.15)); }
|
|
5329
|
-
* `;
|
|
5330
|
-
*
|
|
5331
|
-
* console.debug(await transform(css, options));
|
|
5332
|
-
*
|
|
5333
|
-
* // body {color:#f3fff0}
|
|
5334
|
-
* ```
|
|
5335
|
-
*/
|
|
5336
|
-
[key: keyof typeof EnumToken]:
|
|
5337
|
-
| GenericVisitorAstNodeSyncHandlerMap<Token>
|
|
5338
|
-
| GenericVisitorAstNodeSyncHandlerMap<AstNode>;
|
|
5339
5510
|
}
|
|
5340
5511
|
|
|
5341
5512
|
/**
|
|
@@ -5352,19 +5523,34 @@ export declare type GenericVisitorHandler<T> = (
|
|
|
5352
5523
|
export declare type GenericVisitorAstNodeHandlerMap<T> =
|
|
5353
5524
|
| Record<string, GenericVisitorHandler<T>>
|
|
5354
5525
|
| GenericVisitorHandler<T>
|
|
5355
|
-
| {
|
|
5356
|
-
|
|
5526
|
+
| {
|
|
5527
|
+
/**
|
|
5528
|
+
* when the handler is called: {@link WalkerEvent.Enter} (before the children of the node) or
|
|
5529
|
+
* {@link WalkerEvent.Leave} (after them)
|
|
5530
|
+
*/
|
|
5531
|
+
type: WalkerEvent;
|
|
5532
|
+
/**
|
|
5533
|
+
* the handler
|
|
5534
|
+
*/
|
|
5535
|
+
handler: GenericVisitorHandler<T>;
|
|
5536
|
+
}
|
|
5537
|
+
| {
|
|
5538
|
+
/**
|
|
5539
|
+
* when the handlers are called: {@link WalkerEvent.Enter} (before the children of the node) or
|
|
5540
|
+
* {@link WalkerEvent.Leave} (after them)
|
|
5541
|
+
*/
|
|
5542
|
+
type: WalkerEvent;
|
|
5543
|
+
/**
|
|
5544
|
+
* the handlers, by name
|
|
5545
|
+
*/
|
|
5546
|
+
handler: Record<string, GenericVisitorHandler<T>>;
|
|
5547
|
+
};
|
|
5357
5548
|
|
|
5358
5549
|
/**
|
|
5359
5550
|
* Generic visitor handler
|
|
5360
5551
|
*/
|
|
5361
5552
|
export declare type ValueVisitorHandler = GenericVisitorHandler<Token>;
|
|
5362
5553
|
|
|
5363
|
-
/**
|
|
5364
|
-
* Declaration visitor handler
|
|
5365
|
-
*/
|
|
5366
|
-
export declare type DeclarationVisitorHandler = GenericVisitorHandler<AstDeclaration>;
|
|
5367
|
-
|
|
5368
5554
|
/**
|
|
5369
5555
|
* Declaration visitor handler
|
|
5370
5556
|
*/
|
|
@@ -5373,10 +5559,6 @@ export declare type DeclarationVisitorHandler = GenericVisitorHandler<AstDeclara
|
|
|
5373
5559
|
* Rule visitor handler
|
|
5374
5560
|
*/
|
|
5375
5561
|
export declare type RuleVisitorHandler = GenericVisitorHandler<AstRule>;
|
|
5376
|
-
/**
|
|
5377
|
-
* Rule visitor handler
|
|
5378
|
-
*/
|
|
5379
|
-
export declare type RuleVisitorHandler = GenericVisitorHandler<AstRule>;
|
|
5380
5562
|
|
|
5381
5563
|
/**
|
|
5382
5564
|
* AtRule visitor handler
|
|
@@ -5384,15 +5566,21 @@ export declare type RuleVisitorHandler = GenericVisitorHandler<AstRule>;
|
|
|
5384
5566
|
export declare type AtRuleVisitorHandler = GenericVisitorHandler<AstAtRule>;
|
|
5385
5567
|
|
|
5386
5568
|
/**
|
|
5387
|
-
*
|
|
5569
|
+
* node visitor callback map
|
|
5570
|
+
*
|
|
5388
5571
|
*/
|
|
5389
|
-
|
|
5572
|
+
/**
|
|
5573
|
+
* token visitors, by token type name (see {@link EnumToken})
|
|
5574
|
+
*/
|
|
5575
|
+
export declare type VisitorTokenMap = {
|
|
5576
|
+
[key in keyof typeof EnumToken]?: GenericVisitorAstNodeHandlerMap<Token> | GenericVisitorAstNodeHandlerMap<AstNode>;
|
|
5577
|
+
};
|
|
5390
5578
|
|
|
5391
5579
|
/**
|
|
5392
5580
|
* node visitor callback map
|
|
5393
5581
|
*
|
|
5394
5582
|
*/
|
|
5395
|
-
export declare interface VisitorNodeMap {
|
|
5583
|
+
export declare interface VisitorNodeMap extends VisitorTokenMap {
|
|
5396
5584
|
/**
|
|
5397
5585
|
* at rule visitor
|
|
5398
5586
|
*
|
|
@@ -5595,55 +5783,6 @@ export declare interface VisitorNodeMap {
|
|
|
5595
5783
|
*/
|
|
5596
5784
|
Value?: GenericVisitorAstNodeHandlerMap<Token>;
|
|
5597
5785
|
|
|
5598
|
-
/**
|
|
5599
|
-
* generic token visitor. the key name is of type keyof EnumToken.
|
|
5600
|
-
* generic tokens are called for every token of the specified type.
|
|
5601
|
-
*
|
|
5602
|
-
* ```ts
|
|
5603
|
-
*
|
|
5604
|
-
* import {transform, parse, parseDeclarations} from "@tbela99/css-parser";
|
|
5605
|
-
*
|
|
5606
|
-
* const options: ParserOptions = {
|
|
5607
|
-
*
|
|
5608
|
-
* inlineCssVariables: true,
|
|
5609
|
-
* visitor: {
|
|
5610
|
-
*
|
|
5611
|
-
* // Stylesheet node visitor
|
|
5612
|
-
* StyleSheetNodeType: async (arena, node) => {
|
|
5613
|
-
*
|
|
5614
|
-
* // insert a new rule. nodes of another arena are imported
|
|
5615
|
-
* const result = await parse('html {--base-color: pink}');
|
|
5616
|
-
* arena.prependChildren(node, arena.import(result.arena, result.arena.getFirstChild(result.ast)));
|
|
5617
|
-
* },
|
|
5618
|
-
* ColorTokenType: (arena, node) => {
|
|
5619
|
-
*
|
|
5620
|
-
* // dump all color tokens
|
|
5621
|
-
* // console.debug(arena.toObject(node));
|
|
5622
|
-
* },
|
|
5623
|
-
* FunctionTokenType: (arena, node) => {
|
|
5624
|
-
*
|
|
5625
|
-
* // dump all function tokens
|
|
5626
|
-
* // console.debug(arena.toObject(node));
|
|
5627
|
-
* },
|
|
5628
|
-
* DeclarationNodeType: (arena, node) => {
|
|
5629
|
-
*
|
|
5630
|
-
* // dump all declaration nodes
|
|
5631
|
-
* // console.debug(arena.toObject(node));
|
|
5632
|
-
* }
|
|
5633
|
-
* }
|
|
5634
|
-
* };
|
|
5635
|
-
*
|
|
5636
|
-
* const css = `
|
|
5637
|
-
*
|
|
5638
|
-
* body { color: color(from var(--base-color) display-p3 r calc(g + 0.24) calc(b + 0.15)); }
|
|
5639
|
-
* `;
|
|
5640
|
-
*
|
|
5641
|
-
* console.debug(await transform(css, options));
|
|
5642
|
-
*
|
|
5643
|
-
* // body {color:#f3fff0}
|
|
5644
|
-
* ```
|
|
5645
|
-
*/
|
|
5646
|
-
[key: keyof typeof EnumToken]: GenericVisitorAstNodeHandlerMap<Token> | GenericVisitorAstNodeHandlerMap<AstNode>;
|
|
5647
5786
|
}
|
|
5648
5787
|
|
|
5649
5788
|
/**
|
|
@@ -5657,7 +5796,12 @@ interface ParsedVisitorHandlers {
|
|
|
5657
5796
|
/**
|
|
5658
5797
|
* all handlers
|
|
5659
5798
|
*/
|
|
5660
|
-
allHandlers: Array<
|
|
5799
|
+
allHandlers: Array<
|
|
5800
|
+
Map<
|
|
5801
|
+
EnumToken | string,
|
|
5802
|
+
Array<GenericVisitorAstNodeHandlerMap<any> | Record<string, Array<GenericVisitorAstNodeHandlerMap<any>>>>
|
|
5803
|
+
>
|
|
5804
|
+
>;
|
|
5661
5805
|
/**
|
|
5662
5806
|
* all visitors
|
|
5663
5807
|
*/
|
|
@@ -5883,7 +6027,7 @@ export declare interface PropertyListOptions {
|
|
|
5883
6027
|
/**
|
|
5884
6028
|
* parse info
|
|
5885
6029
|
*/
|
|
5886
|
-
export declare interface ParseInfo
|
|
6030
|
+
export declare interface ParseInfo {
|
|
5887
6031
|
/**
|
|
5888
6032
|
* the utf-16 code units of the css, read by the tokenizer. the code units of an ascii ArrayBuffer are its bytes
|
|
5889
6033
|
*/
|
|
@@ -5896,6 +6040,7 @@ export declare interface ParseInfo$1 {
|
|
|
5896
6040
|
|
|
5897
6041
|
/**
|
|
5898
6042
|
* Source file
|
|
6043
|
+
* @ignore
|
|
5899
6044
|
*/
|
|
5900
6045
|
source: SourceFile;
|
|
5901
6046
|
|
|
@@ -5937,10 +6082,13 @@ declare enum FeatureWalkMode {
|
|
|
5937
6082
|
}
|
|
5938
6083
|
|
|
5939
6084
|
/**
|
|
5940
|
-
*
|
|
6085
|
+
* key of the position of a validation token in the syntax, see {@link ValidationToken}
|
|
5941
6086
|
*/
|
|
5942
6087
|
declare const LOC: unique symbol;
|
|
5943
6088
|
|
|
6089
|
+
/**
|
|
6090
|
+
* type of a validation token: a node of the parsed value definition syntax, see {@link parseSyntax}
|
|
6091
|
+
*/
|
|
5944
6092
|
declare enum ValidationTokenEnum {
|
|
5945
6093
|
Root = 0,
|
|
5946
6094
|
Keyword = 1,
|
|
@@ -6047,32 +6195,56 @@ declare enum MediaFeatureType {
|
|
|
6047
6195
|
StringType = "string"
|
|
6048
6196
|
}
|
|
6049
6197
|
|
|
6198
|
+
/**
|
|
6199
|
+
* position of a validation token in the syntax
|
|
6200
|
+
*/
|
|
6050
6201
|
interface Position {
|
|
6202
|
+
/**
|
|
6203
|
+
* offset
|
|
6204
|
+
*/
|
|
6051
6205
|
ind: number;
|
|
6206
|
+
/**
|
|
6207
|
+
* line
|
|
6208
|
+
*/
|
|
6052
6209
|
lin: number;
|
|
6210
|
+
/**
|
|
6211
|
+
* column
|
|
6212
|
+
*/
|
|
6053
6213
|
col: number;
|
|
6054
6214
|
}
|
|
6055
6215
|
|
|
6216
|
+
/**
|
|
6217
|
+
* range of a numeric value: `<number [0,∞]>`
|
|
6218
|
+
*/
|
|
6056
6219
|
interface ValidationValueRangeMatch {
|
|
6057
6220
|
/**
|
|
6058
6221
|
* lower bound. null: -∞
|
|
6059
6222
|
*/
|
|
6060
6223
|
min: ValidationNumberToken | null;
|
|
6224
|
+
/**
|
|
6225
|
+
* upper bound. null: ∞
|
|
6226
|
+
*/
|
|
6061
6227
|
max: ValidationNumberToken | null;
|
|
6062
6228
|
}
|
|
6063
6229
|
|
|
6230
|
+
/**
|
|
6231
|
+
* range of a dimension: `<length [0,10px]>`
|
|
6232
|
+
*/
|
|
6064
6233
|
interface ValidationDimensionRangeMatch {
|
|
6065
6234
|
/**
|
|
6066
6235
|
* lower bound. null: -∞
|
|
6067
6236
|
*/
|
|
6068
6237
|
min: ValidationDimensionToken | null;
|
|
6238
|
+
/**
|
|
6239
|
+
* upper bound. null: ∞
|
|
6240
|
+
*/
|
|
6069
6241
|
max: ValidationDimensionToken | null;
|
|
6070
6242
|
}
|
|
6071
6243
|
|
|
6072
6244
|
/**
|
|
6073
6245
|
* Validation token
|
|
6074
6246
|
*/
|
|
6075
|
-
interface ValidationToken
|
|
6247
|
+
interface ValidationToken {
|
|
6076
6248
|
/**
|
|
6077
6249
|
* token type
|
|
6078
6250
|
*/
|
|
@@ -6086,7 +6258,7 @@ interface ValidationToken$1 {
|
|
|
6086
6258
|
*/
|
|
6087
6259
|
isList?: boolean;
|
|
6088
6260
|
/**
|
|
6089
|
-
*
|
|
6261
|
+
* source text of the token
|
|
6090
6262
|
* @private
|
|
6091
6263
|
*/
|
|
6092
6264
|
text?: string;
|
|
@@ -6133,7 +6305,7 @@ interface ValidationToken$1 {
|
|
|
6133
6305
|
/**
|
|
6134
6306
|
* Number token
|
|
6135
6307
|
*/
|
|
6136
|
-
interface ValidationNumberToken extends ValidationToken
|
|
6308
|
+
interface ValidationNumberToken extends ValidationToken {
|
|
6137
6309
|
/**
|
|
6138
6310
|
* token type
|
|
6139
6311
|
*/
|
|
@@ -6144,10 +6316,25 @@ interface ValidationNumberToken extends ValidationToken$1 {
|
|
|
6144
6316
|
val: number;
|
|
6145
6317
|
}
|
|
6146
6318
|
|
|
6147
|
-
|
|
6148
|
-
|
|
6319
|
+
/**
|
|
6320
|
+
* Dimension token: a bound of a range `[0,10px]`
|
|
6321
|
+
*/
|
|
6322
|
+
interface ValidationDimensionToken extends ValidationToken {
|
|
6323
|
+
/**
|
|
6324
|
+
* token type
|
|
6325
|
+
*/
|
|
6326
|
+
typ: ValidationTokenEnum.Dimension;
|
|
6327
|
+
/**
|
|
6328
|
+
* token value
|
|
6329
|
+
*/
|
|
6149
6330
|
val: number;
|
|
6331
|
+
/**
|
|
6332
|
+
* unit, as written
|
|
6333
|
+
*/
|
|
6150
6334
|
unitText: string;
|
|
6335
|
+
/**
|
|
6336
|
+
* unit type
|
|
6337
|
+
*/
|
|
6151
6338
|
unit: keyof EnumToken;
|
|
6152
6339
|
}
|
|
6153
6340
|
|
|
@@ -6504,417 +6691,6 @@ interface ShorthandType {
|
|
|
6504
6691
|
properties: ShorthandProperties;
|
|
6505
6692
|
}
|
|
6506
6693
|
|
|
6507
|
-
// generated from config.json at https://app.quicktype.io/?l=ts
|
|
6508
|
-
|
|
6509
|
-
/**
|
|
6510
|
-
* @private
|
|
6511
|
-
*/
|
|
6512
|
-
export declare interface PropertiesConfig {
|
|
6513
|
-
/**
|
|
6514
|
-
* shorthand property minification rules
|
|
6515
|
-
*/
|
|
6516
|
-
properties: PropertiesConfigProperties;
|
|
6517
|
-
/**
|
|
6518
|
-
* shorthand property minification rules
|
|
6519
|
-
*/
|
|
6520
|
-
map: Map$1;
|
|
6521
|
-
/**
|
|
6522
|
-
* single property minification rules
|
|
6523
|
-
*/
|
|
6524
|
-
property: Record<string, SinglePropertyTypeMapping>;
|
|
6525
|
-
}
|
|
6526
|
-
|
|
6527
|
-
/**
|
|
6528
|
-
* @private
|
|
6529
|
-
*/
|
|
6530
|
-
interface Map$1 {
|
|
6531
|
-
border: Border;
|
|
6532
|
-
"border-color": BackgroundPositionClass;
|
|
6533
|
-
"border-style": BackgroundPositionClass;
|
|
6534
|
-
"border-width": BackgroundPositionClass;
|
|
6535
|
-
outline: Outline;
|
|
6536
|
-
"outline-color": BackgroundPositionClass;
|
|
6537
|
-
"outline-style": BackgroundPositionClass;
|
|
6538
|
-
"outline-width": BackgroundPositionClass;
|
|
6539
|
-
font: Font;
|
|
6540
|
-
"font-weight": BackgroundPositionClass;
|
|
6541
|
-
"font-style": BackgroundPositionClass;
|
|
6542
|
-
"font-size": BackgroundPositionClass;
|
|
6543
|
-
"line-height": BackgroundPositionClass;
|
|
6544
|
-
"font-stretch": BackgroundPositionClass;
|
|
6545
|
-
"font-variant": BackgroundPositionClass;
|
|
6546
|
-
"font-family": BackgroundPositionClass;
|
|
6547
|
-
background: Background;
|
|
6548
|
-
"background-repeat": BackgroundPositionClass;
|
|
6549
|
-
"background-color": BackgroundPositionClass;
|
|
6550
|
-
"background-image": BackgroundPositionClass;
|
|
6551
|
-
"background-attachment": BackgroundPositionClass;
|
|
6552
|
-
"background-clip": BackgroundPositionClass;
|
|
6553
|
-
"background-origin": BackgroundPositionClass;
|
|
6554
|
-
"background-position": BackgroundPositionClass;
|
|
6555
|
-
"background-size": BackgroundPositionClass;
|
|
6556
|
-
}
|
|
6557
|
-
|
|
6558
|
-
/**
|
|
6559
|
-
* @private
|
|
6560
|
-
*/
|
|
6561
|
-
interface Background {
|
|
6562
|
-
shorthand: string;
|
|
6563
|
-
pattern: string;
|
|
6564
|
-
keywords: string[];
|
|
6565
|
-
default: any[];
|
|
6566
|
-
multiple: boolean;
|
|
6567
|
-
separator: Separator;
|
|
6568
|
-
properties: BackgroundProperties;
|
|
6569
|
-
}
|
|
6570
|
-
|
|
6571
|
-
/**
|
|
6572
|
-
* @private
|
|
6573
|
-
*/
|
|
6574
|
-
interface BackgroundProperties {
|
|
6575
|
-
"background-repeat": BackgroundRepeat;
|
|
6576
|
-
"background-color": PurpleBackgroundAttachment;
|
|
6577
|
-
"background-image": PurpleBackgroundAttachment;
|
|
6578
|
-
"background-attachment": PurpleBackgroundAttachment;
|
|
6579
|
-
"background-clip": PurpleBackgroundAttachment;
|
|
6580
|
-
"background-origin": PurpleBackgroundAttachment;
|
|
6581
|
-
"background-position": BackgroundPosition;
|
|
6582
|
-
"background-size": BackgroundSize;
|
|
6583
|
-
}
|
|
6584
|
-
|
|
6585
|
-
/**
|
|
6586
|
-
* @private
|
|
6587
|
-
*/
|
|
6588
|
-
interface PurpleBackgroundAttachment {
|
|
6589
|
-
types: string[];
|
|
6590
|
-
default: string[];
|
|
6591
|
-
keywords: string[];
|
|
6592
|
-
required?: boolean;
|
|
6593
|
-
mapping?: BackgroundAttachmentMapping;
|
|
6594
|
-
}
|
|
6595
|
-
|
|
6596
|
-
/**
|
|
6597
|
-
* @private
|
|
6598
|
-
*/
|
|
6599
|
-
interface BackgroundAttachmentMapping {
|
|
6600
|
-
"ultra-condensed": string;
|
|
6601
|
-
"extra-condensed": string;
|
|
6602
|
-
condensed: string;
|
|
6603
|
-
"semi-condensed": string;
|
|
6604
|
-
normal: string;
|
|
6605
|
-
"semi-expanded": string;
|
|
6606
|
-
expanded: string;
|
|
6607
|
-
"extra-expanded": string;
|
|
6608
|
-
"ultra-expanded": string;
|
|
6609
|
-
}
|
|
6610
|
-
|
|
6611
|
-
/**
|
|
6612
|
-
* @private
|
|
6613
|
-
*/
|
|
6614
|
-
interface BackgroundPosition {
|
|
6615
|
-
multiple: boolean;
|
|
6616
|
-
types: string[];
|
|
6617
|
-
default: string[];
|
|
6618
|
-
keywords: string[];
|
|
6619
|
-
mapping: BackgroundPositionMapping;
|
|
6620
|
-
constraints: BackgroundPositionConstraints;
|
|
6621
|
-
}
|
|
6622
|
-
|
|
6623
|
-
/**
|
|
6624
|
-
* @private
|
|
6625
|
-
*/
|
|
6626
|
-
interface BackgroundPositionConstraints {
|
|
6627
|
-
mapping: ConstraintsMapping;
|
|
6628
|
-
}
|
|
6629
|
-
|
|
6630
|
-
/**
|
|
6631
|
-
* @private
|
|
6632
|
-
*/
|
|
6633
|
-
interface ConstraintsMapping {
|
|
6634
|
-
max: number;
|
|
6635
|
-
}
|
|
6636
|
-
|
|
6637
|
-
/**
|
|
6638
|
-
* @private
|
|
6639
|
-
*/
|
|
6640
|
-
interface BackgroundPositionMapping {
|
|
6641
|
-
left: string;
|
|
6642
|
-
top: string;
|
|
6643
|
-
center: string;
|
|
6644
|
-
bottom: string;
|
|
6645
|
-
right: string;
|
|
6646
|
-
}
|
|
6647
|
-
|
|
6648
|
-
/**
|
|
6649
|
-
* @private
|
|
6650
|
-
*/
|
|
6651
|
-
interface BackgroundRepeat {
|
|
6652
|
-
types: any[];
|
|
6653
|
-
default: string[];
|
|
6654
|
-
multiple: boolean;
|
|
6655
|
-
keywords: string[];
|
|
6656
|
-
mapping: BackgroundRepeatMapping;
|
|
6657
|
-
}
|
|
6658
|
-
|
|
6659
|
-
/**
|
|
6660
|
-
* @private
|
|
6661
|
-
*/
|
|
6662
|
-
interface BackgroundRepeatMapping {
|
|
6663
|
-
"repeat no-repeat": string;
|
|
6664
|
-
"no-repeat repeat": string;
|
|
6665
|
-
"repeat repeat": string;
|
|
6666
|
-
"space space": string;
|
|
6667
|
-
"round round": string;
|
|
6668
|
-
"no-repeat no-repeat": string;
|
|
6669
|
-
}
|
|
6670
|
-
|
|
6671
|
-
/**
|
|
6672
|
-
* @private
|
|
6673
|
-
*/
|
|
6674
|
-
interface BackgroundSize {
|
|
6675
|
-
multiple: boolean;
|
|
6676
|
-
previous: string;
|
|
6677
|
-
prefix: Prefix;
|
|
6678
|
-
types: string[];
|
|
6679
|
-
default: string[];
|
|
6680
|
-
keywords: string[];
|
|
6681
|
-
mapping: BackgroundSizeMapping;
|
|
6682
|
-
}
|
|
6683
|
-
|
|
6684
|
-
/**
|
|
6685
|
-
* @private
|
|
6686
|
-
*/
|
|
6687
|
-
interface BackgroundSizeMapping {
|
|
6688
|
-
"auto auto": string;
|
|
6689
|
-
}
|
|
6690
|
-
|
|
6691
|
-
/**
|
|
6692
|
-
* @private
|
|
6693
|
-
*/
|
|
6694
|
-
interface Prefix {
|
|
6695
|
-
typ: string;
|
|
6696
|
-
val: string;
|
|
6697
|
-
}
|
|
6698
|
-
|
|
6699
|
-
/**
|
|
6700
|
-
* @private
|
|
6701
|
-
*/
|
|
6702
|
-
interface Separator {
|
|
6703
|
-
typ: string;
|
|
6704
|
-
}
|
|
6705
|
-
|
|
6706
|
-
/**
|
|
6707
|
-
* @private
|
|
6708
|
-
*/
|
|
6709
|
-
interface BackgroundPositionClass {
|
|
6710
|
-
shorthand: string;
|
|
6711
|
-
}
|
|
6712
|
-
|
|
6713
|
-
/**
|
|
6714
|
-
* @private
|
|
6715
|
-
*/
|
|
6716
|
-
interface Border {
|
|
6717
|
-
shorthand: string;
|
|
6718
|
-
pattern: string;
|
|
6719
|
-
keywords: string[];
|
|
6720
|
-
default: string[];
|
|
6721
|
-
properties: BorderProperties;
|
|
6722
|
-
}
|
|
6723
|
-
|
|
6724
|
-
/**
|
|
6725
|
-
* @private
|
|
6726
|
-
*/
|
|
6727
|
-
interface BorderProperties {
|
|
6728
|
-
"border-color": BorderColorClass;
|
|
6729
|
-
"border-style": BorderColorClass;
|
|
6730
|
-
"border-width": BorderColorClass;
|
|
6731
|
-
}
|
|
6732
|
-
|
|
6733
|
-
/**
|
|
6734
|
-
* @private
|
|
6735
|
-
*/
|
|
6736
|
-
interface BorderColorClass {}
|
|
6737
|
-
|
|
6738
|
-
/**
|
|
6739
|
-
* @private
|
|
6740
|
-
*/
|
|
6741
|
-
interface Font {
|
|
6742
|
-
shorthand: string;
|
|
6743
|
-
pattern: string;
|
|
6744
|
-
keywords: string[];
|
|
6745
|
-
default: any[];
|
|
6746
|
-
properties: FontProperties;
|
|
6747
|
-
}
|
|
6748
|
-
|
|
6749
|
-
/**
|
|
6750
|
-
* @private
|
|
6751
|
-
*/
|
|
6752
|
-
interface FontProperties {
|
|
6753
|
-
"font-weight": FontWeight;
|
|
6754
|
-
"font-style": PurpleBackgroundAttachment;
|
|
6755
|
-
"font-size": PurpleBackgroundAttachment;
|
|
6756
|
-
"line-height": LineHeight;
|
|
6757
|
-
"font-stretch": PurpleBackgroundAttachment;
|
|
6758
|
-
"font-variant": PurpleBackgroundAttachment;
|
|
6759
|
-
"font-family": FontFamily;
|
|
6760
|
-
}
|
|
6761
|
-
|
|
6762
|
-
/**
|
|
6763
|
-
* @private
|
|
6764
|
-
*/
|
|
6765
|
-
interface FontFamily {
|
|
6766
|
-
types: string[];
|
|
6767
|
-
default: any[];
|
|
6768
|
-
keywords: string[];
|
|
6769
|
-
required: boolean;
|
|
6770
|
-
multiple: boolean;
|
|
6771
|
-
separator: Separator;
|
|
6772
|
-
}
|
|
6773
|
-
|
|
6774
|
-
/**
|
|
6775
|
-
* @private
|
|
6776
|
-
*/
|
|
6777
|
-
interface FontWeight {
|
|
6778
|
-
types: string[];
|
|
6779
|
-
default: string[];
|
|
6780
|
-
keywords: string[];
|
|
6781
|
-
constraints: FontWeightConstraints;
|
|
6782
|
-
mapping: FontWeightMapping;
|
|
6783
|
-
}
|
|
6784
|
-
|
|
6785
|
-
/**
|
|
6786
|
-
* @private
|
|
6787
|
-
*/
|
|
6788
|
-
interface FontWeightConstraints {
|
|
6789
|
-
value: Value;
|
|
6790
|
-
}
|
|
6791
|
-
|
|
6792
|
-
/**
|
|
6793
|
-
* @private
|
|
6794
|
-
*/
|
|
6795
|
-
interface Value {
|
|
6796
|
-
min: string;
|
|
6797
|
-
max: string;
|
|
6798
|
-
}
|
|
6799
|
-
|
|
6800
|
-
/**
|
|
6801
|
-
* @private
|
|
6802
|
-
*/
|
|
6803
|
-
interface FontWeightMapping {
|
|
6804
|
-
thin: string;
|
|
6805
|
-
hairline: string;
|
|
6806
|
-
"extra light": string;
|
|
6807
|
-
"ultra light": string;
|
|
6808
|
-
light: string;
|
|
6809
|
-
normal: string;
|
|
6810
|
-
regular: string;
|
|
6811
|
-
medium: string;
|
|
6812
|
-
"semi bold": string;
|
|
6813
|
-
"demi bold": string;
|
|
6814
|
-
bold: string;
|
|
6815
|
-
"extra bold": string;
|
|
6816
|
-
"ultra bold": string;
|
|
6817
|
-
black: string;
|
|
6818
|
-
heavy: string;
|
|
6819
|
-
"extra black": string;
|
|
6820
|
-
"ultra black": string;
|
|
6821
|
-
}
|
|
6822
|
-
|
|
6823
|
-
/**
|
|
6824
|
-
* @private
|
|
6825
|
-
*/
|
|
6826
|
-
interface LineHeight {
|
|
6827
|
-
types: string[];
|
|
6828
|
-
default: string[];
|
|
6829
|
-
keywords: string[];
|
|
6830
|
-
previous: string;
|
|
6831
|
-
prefix: Prefix;
|
|
6832
|
-
}
|
|
6833
|
-
|
|
6834
|
-
/**
|
|
6835
|
-
* @private
|
|
6836
|
-
*/
|
|
6837
|
-
interface Outline {
|
|
6838
|
-
shorthand: string;
|
|
6839
|
-
pattern: string;
|
|
6840
|
-
keywords: string[];
|
|
6841
|
-
default: string[];
|
|
6842
|
-
properties: OutlineProperties;
|
|
6843
|
-
}
|
|
6844
|
-
|
|
6845
|
-
/**
|
|
6846
|
-
* @private
|
|
6847
|
-
*/
|
|
6848
|
-
interface OutlineProperties {
|
|
6849
|
-
"outline-color": PurpleBackgroundAttachment;
|
|
6850
|
-
"outline-style": PurpleBackgroundAttachment;
|
|
6851
|
-
"outline-width": PurpleBackgroundAttachment;
|
|
6852
|
-
}
|
|
6853
|
-
|
|
6854
|
-
/**
|
|
6855
|
-
* @private
|
|
6856
|
-
*/
|
|
6857
|
-
interface PropertiesConfigProperties {
|
|
6858
|
-
inset: BorderRadius;
|
|
6859
|
-
top: BackgroundPositionClass;
|
|
6860
|
-
right: BackgroundPositionClass;
|
|
6861
|
-
bottom: BackgroundPositionClass;
|
|
6862
|
-
left: BackgroundPositionClass;
|
|
6863
|
-
margin: BorderRadius;
|
|
6864
|
-
"margin-top": BackgroundPositionClass;
|
|
6865
|
-
"margin-right": BackgroundPositionClass;
|
|
6866
|
-
"margin-bottom": BackgroundPositionClass;
|
|
6867
|
-
"margin-left": BackgroundPositionClass;
|
|
6868
|
-
padding: BorderColor;
|
|
6869
|
-
"padding-top": BackgroundPositionClass;
|
|
6870
|
-
"padding-right": BackgroundPositionClass;
|
|
6871
|
-
"padding-bottom": BackgroundPositionClass;
|
|
6872
|
-
"padding-left": BackgroundPositionClass;
|
|
6873
|
-
"border-radius": BorderRadius;
|
|
6874
|
-
"border-top-left-radius": BackgroundPositionClass;
|
|
6875
|
-
"border-top-right-radius": BackgroundPositionClass;
|
|
6876
|
-
"border-bottom-right-radius": BackgroundPositionClass;
|
|
6877
|
-
"border-bottom-left-radius": BackgroundPositionClass;
|
|
6878
|
-
"border-width": BorderColor;
|
|
6879
|
-
"border-top-width": BackgroundPositionClass;
|
|
6880
|
-
"border-right-width": BackgroundPositionClass;
|
|
6881
|
-
"border-bottom-width": BackgroundPositionClass;
|
|
6882
|
-
"border-left-width": BackgroundPositionClass;
|
|
6883
|
-
"border-style": BorderColor;
|
|
6884
|
-
"border-top-style": BackgroundPositionClass;
|
|
6885
|
-
"border-right-style": BackgroundPositionClass;
|
|
6886
|
-
"border-bottom-style": BackgroundPositionClass;
|
|
6887
|
-
"border-left-style": BackgroundPositionClass;
|
|
6888
|
-
"border-color": BorderColor;
|
|
6889
|
-
"border-top-color": BackgroundPositionClass;
|
|
6890
|
-
"border-right-color": BackgroundPositionClass;
|
|
6891
|
-
"border-bottom-color": BackgroundPositionClass;
|
|
6892
|
-
"border-left-color": BackgroundPositionClass;
|
|
6893
|
-
}
|
|
6894
|
-
|
|
6895
|
-
/**
|
|
6896
|
-
* @private
|
|
6897
|
-
*/
|
|
6898
|
-
interface BorderColor {
|
|
6899
|
-
shorthand: string;
|
|
6900
|
-
map?: string;
|
|
6901
|
-
properties: string[];
|
|
6902
|
-
types: string[];
|
|
6903
|
-
keywords: string[];
|
|
6904
|
-
}
|
|
6905
|
-
|
|
6906
|
-
/**
|
|
6907
|
-
* @private
|
|
6908
|
-
*/
|
|
6909
|
-
interface BorderRadius {
|
|
6910
|
-
shorthand: string;
|
|
6911
|
-
properties: string[];
|
|
6912
|
-
types: string[];
|
|
6913
|
-
multiple: boolean;
|
|
6914
|
-
separator: null | string;
|
|
6915
|
-
keywords: string[];
|
|
6916
|
-
}
|
|
6917
|
-
|
|
6918
6694
|
/**
|
|
6919
6695
|
* node walker options of {@link AstArena.walk}
|
|
6920
6696
|
*/
|
|
@@ -7018,7 +6794,16 @@ declare class RenderResult {
|
|
|
7018
6794
|
*/
|
|
7019
6795
|
static readonly shape: RenderResult;
|
|
7020
6796
|
/**
|
|
7021
|
-
* Rendered CSS, encoded as UTF-8
|
|
6797
|
+
* Rendered CSS, encoded as UTF-8: the output of the render, no conversion. Use it to write the css to a file or to
|
|
6798
|
+
* the network, or to send it to another thread without a copy:
|
|
6799
|
+
*
|
|
6800
|
+
* ```ts
|
|
6801
|
+
* self.postMessage(result.write, [result.write.buffer]);
|
|
6802
|
+
* ```
|
|
6803
|
+
*
|
|
6804
|
+
* It is a view of the first bytes of a larger buffer (`write.buffer`): without a transfer, `postMessage()` copies
|
|
6805
|
+
* the whole buffer, send `write.slice()` to copy only the css. See
|
|
6806
|
+
* [Zero copy between threads](../../files/usage.md#zero-copy-between-threads).
|
|
7022
6807
|
*/
|
|
7023
6808
|
write: Uint8Array;
|
|
7024
6809
|
/**
|
|
@@ -7034,6 +6819,7 @@ declare class RenderResult {
|
|
|
7034
6819
|
*/
|
|
7035
6820
|
map?: SourceMap;
|
|
7036
6821
|
/**
|
|
6822
|
+
* create a render result
|
|
7037
6823
|
* @param write rendered css, encoded as UTF-8
|
|
7038
6824
|
* @param errors
|
|
7039
6825
|
* @param stats
|
|
@@ -7049,7 +6835,11 @@ declare class RenderResult {
|
|
|
7049
6835
|
*/
|
|
7050
6836
|
static codeLength(result: RenderResult): number;
|
|
7051
6837
|
/**
|
|
7052
|
-
* Rendered CSS. The bytes of {@link RenderResult.write} are decoded the first time the property is read
|
|
6838
|
+
* Rendered CSS. The bytes of {@link RenderResult.write} are decoded the first time the property is read, the
|
|
6839
|
+
* string is kept for the next reads: no string is created when it is not read.
|
|
6840
|
+
*
|
|
6841
|
+
* It is a getter, not a property of the object: `postMessage()` and `structuredClone()` do not send it, and it is
|
|
6842
|
+
* an empty string when it is read for the first time after {@link RenderResult.write} was transferred.
|
|
7053
6843
|
*/
|
|
7054
6844
|
get code(): string;
|
|
7055
6845
|
/**
|
|
@@ -7100,6 +6890,7 @@ declare class TransformResult extends RenderResult {
|
|
|
7100
6890
|
*/
|
|
7101
6891
|
revMapping?: Record<string, string>;
|
|
7102
6892
|
/**
|
|
6893
|
+
* create a transform result from the parse result and the render result
|
|
7103
6894
|
* @param parseResult
|
|
7104
6895
|
* @param renderResult
|
|
7105
6896
|
* @param stats
|
|
@@ -7123,7 +6914,7 @@ export declare interface ErrorDescription {
|
|
|
7123
6914
|
/**
|
|
7124
6915
|
* Syntax error description
|
|
7125
6916
|
*/
|
|
7126
|
-
syntax?: string | ValidationToken
|
|
6917
|
+
syntax?: string | ValidationToken | null;
|
|
7127
6918
|
/**
|
|
7128
6919
|
* Error node
|
|
7129
6920
|
*/
|
|
@@ -7220,6 +7011,53 @@ interface MinifyOptions {
|
|
|
7220
7011
|
* Generate nested rules
|
|
7221
7012
|
*/
|
|
7222
7013
|
nestingRules?: boolean;
|
|
7014
|
+
/**
|
|
7015
|
+
* Merge the adjacent rules ({@link MergeRulesEnum}, `true` is a shortcut for {@link MergeRulesEnum.All}, `false`
|
|
7016
|
+
* for {@link MergeRulesEnum.None}).
|
|
7017
|
+
*
|
|
7018
|
+
* - {@link MergeRulesEnum.All}: the rules that share declarations are merged when the output is smaller
|
|
7019
|
+
* - {@link MergeRulesEnum.Identical}: only the rules that have the same declarations are merged, the size of the
|
|
7020
|
+
* output is not computed: `.a{color:red}.b{color:red}` is merged into `.a,.b{color:red}`
|
|
7021
|
+
* - {@link MergeRulesEnum.None}: the rules that have different selectors are not merged
|
|
7022
|
+
*
|
|
7023
|
+
* The default is {@link MergeRulesEnum.All} when the ast is minified, {@link MergeRulesEnum.None} otherwise. With
|
|
7024
|
+
* `minify: false`, {@link MergeRulesEnum.Identical} and {@link MergeRulesEnum.All} merge the rules without
|
|
7025
|
+
* minifying the ast: the adjacent rules and keyframes rules that have the same selector and the adjacent at-rules
|
|
7026
|
+
* that have the same prelude are merged (`@font-face` is not merged), the last `@keyframes` of a name is kept, the
|
|
7027
|
+
* rules that have different selectors are merged as above. The other minifications are not applied.
|
|
7028
|
+
*
|
|
7029
|
+
* ```ts
|
|
7030
|
+
* import {transformSync, MergeRulesEnum} from '@tbela99/css-parser';
|
|
7031
|
+
*
|
|
7032
|
+
* // the adjacent rules that have the same declarations are merged, the ast is not minified
|
|
7033
|
+
* const result = transformSync(css, {minify: false, mergeRules: MergeRulesEnum.Identical});
|
|
7034
|
+
* ```
|
|
7035
|
+
*/
|
|
7036
|
+
mergeRules?: boolean | MergeRulesEnum;
|
|
7037
|
+
/**
|
|
7038
|
+
* Fast mode: the ast is not minified and the rules are not merged, the values are minified when they are
|
|
7039
|
+
* rendered. The output is larger and the minification is faster. It sets the default value of these options, an option given
|
|
7040
|
+
* explicitly takes precedence:
|
|
7041
|
+
*
|
|
7042
|
+
* ```ts
|
|
7043
|
+
* {
|
|
7044
|
+
* minify: false,
|
|
7045
|
+
* mergeRules: MergeRulesEnum.None,
|
|
7046
|
+
* }
|
|
7047
|
+
* ```
|
|
7048
|
+
*
|
|
7049
|
+
* ```ts
|
|
7050
|
+
* import {transformSync} from '@tbela99/css-parser';
|
|
7051
|
+
*
|
|
7052
|
+
* const result = transformSync(css, {fastMode: true});
|
|
7053
|
+
* ```
|
|
7054
|
+
*/
|
|
7055
|
+
fastMode?: boolean;
|
|
7056
|
+
/**
|
|
7057
|
+
* Optimize the selectors (default `true`): remove the redundant selectors, factor the selectors with `:is()`.
|
|
7058
|
+
* `false` only applies when {@link nestingRules} is `false`: the nesting of the rules reads the optimized selectors.
|
|
7059
|
+
*/
|
|
7060
|
+
optimizeSelectors?: boolean;
|
|
7223
7061
|
/**
|
|
7224
7062
|
* Remove duplicate declarations from the same rule. if passed as a string array, duplicated declarations are removed, except for those in the array
|
|
7225
7063
|
*
|
|
@@ -7438,7 +7276,10 @@ export declare interface ModuleSyncOptions {
|
|
|
7438
7276
|
generateScopedName?: (localName: string, filePath: string, pattern: string, hashLength?: number) => string;
|
|
7439
7277
|
}
|
|
7440
7278
|
|
|
7441
|
-
|
|
7279
|
+
/**
|
|
7280
|
+
* CSS modules options of the asynchronous functions
|
|
7281
|
+
*/
|
|
7282
|
+
export declare interface ModuleAsyncOptions extends Omit<ModuleSyncOptions, "generateScopedName"> {
|
|
7442
7283
|
/**
|
|
7443
7284
|
* The pattern used to generate scoped names. the supported placeholders are:
|
|
7444
7285
|
* - name: the file base name without the extension
|
|
@@ -7672,7 +7513,7 @@ export declare interface ParserSyncOptions
|
|
|
7672
7513
|
* Node visitor
|
|
7673
7514
|
* {@link VisitorSyncNodeMap | VisitorSyncNodeMap[]}
|
|
7674
7515
|
*/
|
|
7675
|
-
visitor?: GenericVisitorAstNodeSyncHandlerMap<
|
|
7516
|
+
visitor?: GenericVisitorAstNodeSyncHandlerMap<any> | VisitorSyncNodeMap | VisitorSyncNodeMap[];
|
|
7676
7517
|
/**
|
|
7677
7518
|
* Abort signal
|
|
7678
7519
|
*
|
|
@@ -7714,7 +7555,7 @@ export declare interface ParserSyncOptions
|
|
|
7714
7555
|
/**
|
|
7715
7556
|
* Parser options
|
|
7716
7557
|
*/
|
|
7717
|
-
export declare interface ParserOptions extends ParserSyncOptions, ModuleAsyncOptions {
|
|
7558
|
+
export declare interface ParserOptions extends Omit<ParserSyncOptions, "visitor">, ModuleAsyncOptions {
|
|
7718
7559
|
/**
|
|
7719
7560
|
* Resolve import
|
|
7720
7561
|
*/
|
|
@@ -7738,8 +7579,8 @@ export declare interface ParserOptions extends ParserSyncOptions, ModuleAsyncOpt
|
|
|
7738
7579
|
* {@link VisitorNodeMap | VisitorNodeMap[]}
|
|
7739
7580
|
*/
|
|
7740
7581
|
visitor?:
|
|
7741
|
-
| GenericVisitorAstNodeSyncHandlerMap<
|
|
7742
|
-
| GenericVisitorAstNodeHandlerMap<
|
|
7582
|
+
| GenericVisitorAstNodeSyncHandlerMap<any>
|
|
7583
|
+
| GenericVisitorAstNodeHandlerMap<any>
|
|
7743
7584
|
| VisitorNodeMap
|
|
7744
7585
|
| VisitorNodeMap[];
|
|
7745
7586
|
}
|
|
@@ -8178,6 +8019,83 @@ declare const resolve: (url: string, currentDirectory?: string, cwd?: string) =>
|
|
|
8178
8019
|
relative: string;
|
|
8179
8020
|
};
|
|
8180
8021
|
|
|
8022
|
+
/**
|
|
8023
|
+
* validation context
|
|
8024
|
+
*/
|
|
8025
|
+
interface ValidationContext {
|
|
8026
|
+
/**
|
|
8027
|
+
* arena the tokens are allocated in
|
|
8028
|
+
*/
|
|
8029
|
+
arena: AstArena;
|
|
8030
|
+
/**
|
|
8031
|
+
* the tokens
|
|
8032
|
+
*/
|
|
8033
|
+
tokens: Token[];
|
|
8034
|
+
/**
|
|
8035
|
+
* current index
|
|
8036
|
+
*/
|
|
8037
|
+
index: number;
|
|
8038
|
+
|
|
8039
|
+
/**
|
|
8040
|
+
* return the next token without consuming the current one
|
|
8041
|
+
* @param offset
|
|
8042
|
+
*/
|
|
8043
|
+
peek(offset?: number): Token | null;
|
|
8044
|
+
|
|
8045
|
+
/**
|
|
8046
|
+
* return a range of tokens.
|
|
8047
|
+
* @param close
|
|
8048
|
+
* @param counter
|
|
8049
|
+
*/
|
|
8050
|
+
peekRange(close?: EnumToken, counter?: number): Token[];
|
|
8051
|
+
|
|
8052
|
+
/**
|
|
8053
|
+
*
|
|
8054
|
+
* @param split
|
|
8055
|
+
*/
|
|
8056
|
+
split(split?: EnumToken): Token[][];
|
|
8057
|
+
|
|
8058
|
+
/**
|
|
8059
|
+
* return the current token that is not consumed yet
|
|
8060
|
+
*/
|
|
8061
|
+
current(): Token | null;
|
|
8062
|
+
|
|
8063
|
+
/**
|
|
8064
|
+
* consume the current token and move to the next
|
|
8065
|
+
*/
|
|
8066
|
+
next(): Token | null;
|
|
8067
|
+
|
|
8068
|
+
/**
|
|
8069
|
+
* return tokens that are not consumed
|
|
8070
|
+
*/
|
|
8071
|
+
getRemainingTokens(): Token[];
|
|
8072
|
+
/**
|
|
8073
|
+
*
|
|
8074
|
+
*/
|
|
8075
|
+
// last(): Token | null;
|
|
8076
|
+
|
|
8077
|
+
/**
|
|
8078
|
+
* clone the validation context
|
|
8079
|
+
*/
|
|
8080
|
+
slice(): ValidationContext;
|
|
8081
|
+
|
|
8082
|
+
/**
|
|
8083
|
+
* consume all tokens up to the specified token
|
|
8084
|
+
* @param token
|
|
8085
|
+
*/
|
|
8086
|
+
update(token: Token | null | undefined): ValidationContext;
|
|
8087
|
+
|
|
8088
|
+
/**
|
|
8089
|
+
* returns true if all tokens are consumed. returns false otherwise
|
|
8090
|
+
*/
|
|
8091
|
+
done(): boolean;
|
|
8092
|
+
|
|
8093
|
+
/**
|
|
8094
|
+
* consume all remaining tokens
|
|
8095
|
+
*/
|
|
8096
|
+
end(): ValidationContext;
|
|
8097
|
+
}
|
|
8098
|
+
|
|
8181
8099
|
/**
|
|
8182
8100
|
* Validation syntax
|
|
8183
8101
|
* @internal
|
|
@@ -8284,7 +8202,7 @@ interface ValidationSyntaxResult extends ValidationResult {
|
|
|
8284
8202
|
/**
|
|
8285
8203
|
* context
|
|
8286
8204
|
*/
|
|
8287
|
-
context: ValidationContext
|
|
8205
|
+
context: ValidationContext | Token[];
|
|
8288
8206
|
}
|
|
8289
8207
|
|
|
8290
8208
|
/**
|
|
@@ -8314,7 +8232,13 @@ declare function minify(arena: AstArena, ast: AstNode, options: ParserOptions |
|
|
|
8314
8232
|
* ```
|
|
8315
8233
|
*/
|
|
8316
8234
|
declare function parseDeclarations(declaration: string, arena?: AstArena): {
|
|
8235
|
+
/**
|
|
8236
|
+
* the arena the nodes are allocated in
|
|
8237
|
+
*/
|
|
8317
8238
|
arena: AstArena;
|
|
8239
|
+
/**
|
|
8240
|
+
* the declaration and comment nodes
|
|
8241
|
+
*/
|
|
8318
8242
|
nodes: Array<AstDeclaration | AstComment>;
|
|
8319
8243
|
};
|
|
8320
8244
|
/**
|
|
@@ -8374,7 +8298,7 @@ declare function renderValue(arena: AstArena, token: Token, options?: RenderOpti
|
|
|
8374
8298
|
*
|
|
8375
8299
|
* ```
|
|
8376
8300
|
*/
|
|
8377
|
-
declare function convertColor(arena: AstArena, token: Token, to: ColorType
|
|
8301
|
+
declare function convertColor(arena: AstArena, token: Token, to: ColorType): Token | null;
|
|
8378
8302
|
|
|
8379
8303
|
/**
|
|
8380
8304
|
* Calculate the distance between two okLab colors.
|
|
@@ -8402,12 +8326,12 @@ declare function isOkLabClose(arena: AstArena, color1: Token, color2: Token, thr
|
|
|
8402
8326
|
* @param syntax
|
|
8403
8327
|
* @returns
|
|
8404
8328
|
*/
|
|
8405
|
-
declare function parseSyntax(syntax: string): ValidationToken
|
|
8329
|
+
declare function parseSyntax(syntax: string): ValidationToken[];
|
|
8406
8330
|
|
|
8407
8331
|
/**
|
|
8408
8332
|
* Version number
|
|
8409
8333
|
*/
|
|
8410
|
-
declare const version = "2.3.
|
|
8334
|
+
declare const version = "2.3.2";
|
|
8411
8335
|
|
|
8412
8336
|
/**
|
|
8413
8337
|
* Load file or url
|
|
@@ -8746,5 +8670,5 @@ declare function transform(options: ParseInputStreamOptions & TransformOptions):
|
|
|
8746
8670
|
*/
|
|
8747
8671
|
declare function transform(options: ParseInputFileOptions & TransformOptions): Promise<TransformResult>;
|
|
8748
8672
|
|
|
8749
|
-
export { ARENA, ARENAID, Arena, AstArena, AstArenaNode, ColorType
|
|
8750
|
-
export type {
|
|
8673
|
+
export { ARENA, ARENAID, Arena, AstArena, AstArenaNode, ColorType, EnumAstNodeStatus, EnumToken, FeatureWalkMode, LOC, MergeRulesEnum, ModuleCaseTransformEnum, ModuleScopeEnumOptions, RenderResult, ResponseType, SourceMap, TokenField, TransformResult, ValidationTokenEnum, WalkerEvent, WalkerOptionEnum, arenaColumns, convertColor, dirname, isOkLabClose, load, minify, okLabDistance, parse, parseDeclarations, parseString, parseSync, parseSyntax, render, renderValue, resolve, transform, transformSync, version };
|
|
8674
|
+
export type { ArenaProperties, ArenaTransferables, AstNodeMatcher, AstValueMatcher, CodeUnits, CssInput, MinifyOptions, ParsedVisitorHandlers, Position, PropertyMapType, PropertySetType, PropertyType, ShorthandDef, ShorthandMapType, ShorthandProperties, ShorthandPropertyType, ShorthandType, SinglePropertyType, SinglePropertyTypeMapping, StringTableData, ValidationDimensionRangeMatch, ValidationDimensionToken, ValidationNumberToken, ValidationOptions, ValidationResult, ValidationSelectorOptions, ValidationSyntaxResult, ValidationToken, ValidationValueRangeMatch };
|