@markuplint/types 3.4.0 → 3.5.1

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.
@@ -1,2 +1,2 @@
1
1
  import type { CustomSyntaxCheck, UnmatchedResult } from './types';
2
- export declare function checkMultiTypes(value: string, checks: readonly CustomSyntaxCheck[]): import("./types").MatchedResult | UnmatchedResult;
2
+ export declare function checkMultiTypes(value: string, checks: readonly CustomSyntaxCheck[]): UnmatchedResult | import("./types").MatchedResult;
@@ -4,6 +4,7 @@ exports.checkMultiTypes = void 0;
4
4
  const debug_1 = require("./debug");
5
5
  const match_result_1 = require("./match-result");
6
6
  function checkMultiTypes(value, checks) {
7
+ var _a, _b, _c;
7
8
  let unmatched;
8
9
  for (const check of checks) {
9
10
  const res = check(value);
@@ -14,15 +15,15 @@ function checkMultiTypes(value, checks) {
14
15
  res._fn = check.name;
15
16
  // @ts-ignore
16
17
  (0, debug_1.log)('%s(%d) vs %s(%d)', unmatched === null || unmatched === void 0 ? void 0 : unmatched._fn, unmatched === null || unmatched === void 0 ? void 0 : unmatched.passCount, res._fn, res.passCount);
17
- const passedA = (unmatched === null || unmatched === void 0 ? void 0 : unmatched.passCount) || 0;
18
- const passedB = res.passCount || 0;
19
- const offsetA = (unmatched === null || unmatched === void 0 ? void 0 : unmatched.offset) || 0;
18
+ const passedA = (_a = unmatched === null || unmatched === void 0 ? void 0 : unmatched.passCount) !== null && _a !== void 0 ? _a : 0;
19
+ const passedB = (_b = res.passCount) !== null && _b !== void 0 ? _b : 0;
20
+ const offsetA = (_c = unmatched === null || unmatched === void 0 ? void 0 : unmatched.offset) !== null && _c !== void 0 ? _c : 0;
20
21
  const offsetB = res.offset;
21
22
  if (passedA < passedB || (passedA === passedB && offsetA <= offsetB)) {
22
23
  unmatched = res;
23
24
  }
24
25
  }
25
- const result = unmatched || (0, match_result_1.matched)();
26
+ const result = unmatched !== null && unmatched !== void 0 ? unmatched : (0, match_result_1.matched)();
26
27
  (0, debug_1.log)('%d checks result: %O', checks.length, result);
27
28
  return result;
28
29
  }
package/lib/check.spec.js CHANGED
@@ -75,3 +75,8 @@ test('Non-exist types', () => {
75
75
  // @ts-ignore
76
76
  expect((0, check_1.check)('abc', '').matched).toBe(true);
77
77
  });
78
+ test('ItemProp', () => {
79
+ expect((0, check_1.check)('itemListElement', 'ItemProp').matched).toBe(true);
80
+ expect((0, check_1.check)('item', 'ItemProp').matched).toBe(true);
81
+ expect((0, check_1.check)('position', 'ItemProp').matched).toBe(true);
82
+ });
package/lib/css-syntax.js CHANGED
@@ -9,6 +9,7 @@ const MIMIC_TAG_L = 'mimiccases---';
9
9
  const MIMIC_TAG_R = '---mimiccases';
10
10
  const MIMIC_LENGTH = (MIMIC_TAG_L + MIMIC_TAG_R).length;
11
11
  function cssSyntaxMatch(value, type) {
12
+ var _a;
12
13
  (0, debug_1.log)('Search CSS Syntax: "%s"', type);
13
14
  const origin = value;
14
15
  let defName;
@@ -24,7 +25,7 @@ function cssSyntaxMatch(value, type) {
24
25
  }
25
26
  else {
26
27
  defName = type.syntax.apply;
27
- ebnf = type.syntax.ebnf || null;
28
+ ebnf = (_a = type.syntax.ebnf) !== null && _a !== void 0 ? _a : null;
28
29
  if (ebnf) {
29
30
  // Work in progress
30
31
  return (0, match_result_1.matched)();
@@ -69,7 +70,7 @@ function cssSyntaxMatch(value, type) {
69
70
  throw new Error('MARKUPLINT_TYPE_NO_EXIST');
70
71
  }
71
72
  const refParam = isProp ? 'Property' : 'Type';
72
- ref = ref || `https://csstree.github.io/docs/syntax/#${refParam}:${name}`;
73
+ ref = ref !== null && ref !== void 0 ? ref : `https://csstree.github.io/docs/syntax/#${refParam}:${name}`;
73
74
  // eslint-disable-next-line no-console
74
75
  const _w = console.warn;
75
76
  if (debug_1.log.enabled) {
package/lib/defs.js CHANGED
@@ -115,7 +115,7 @@ exports.types = {
115
115
  reason: 'unexpected-space',
116
116
  });
117
117
  }
118
- if (!tokens.length) {
118
+ if (tokens.length === 0) {
119
119
  return (0, match_result_1.unmatched)(value, 'empty-token');
120
120
  }
121
121
  return (0, match_result_1.matched)();
@@ -431,7 +431,7 @@ exports.types = {
431
431
  if (!height) {
432
432
  return sep.unmatched({ reason: 'unexpected-token' });
433
433
  }
434
- if (tail && tail[0]) {
434
+ if (tail[0]) {
435
435
  return tail[0].unmatched({ reason: 'extra-token' });
436
436
  }
437
437
  if (!(0, primitive_1.isUint)(width.value)) {
@@ -1,3 +1,6 @@
1
1
  type NullableString = string | null | undefined;
2
- export declare function getCandidate(value: NullableString, ...candidates: readonly (NullableString | readonly NullableString[])[]): string | undefined;
2
+ export declare function getCandidate(
3
+ value: NullableString,
4
+ ...candidates: readonly (NullableString | readonly NullableString[])[]
5
+ ): string | undefined;
3
6
  export {};
@@ -33,6 +33,7 @@ function checkKeywordType(value, type, cache = true) {
33
33
  }
34
34
  exports.checkKeywordType = checkKeywordType;
35
35
  function _checkKeywordType(value, type) {
36
+ var _a, _b;
36
37
  const def = defs_1.types[type];
37
38
  if (!def) {
38
39
  (0, debug_1.log)('The "%s" type is not defined in custom type identifier markuplint specified', type);
@@ -51,8 +52,8 @@ function _checkKeywordType(value, type) {
51
52
  if (!matches.matched) {
52
53
  return {
53
54
  ...matches,
54
- ref: matches.ref || def.ref,
55
- expects: matches.expects || def.expects,
55
+ ref: (_a = matches.ref) !== null && _a !== void 0 ? _a : def.ref,
56
+ expects: (_b = matches.expects) !== null && _b !== void 0 ? _b : def.expects,
56
57
  };
57
58
  }
58
59
  return matches;
package/lib/list.js CHANGED
@@ -5,6 +5,7 @@ const check_1 = require("./check");
5
5
  const match_result_1 = require("./match-result");
6
6
  const token_1 = require("./token");
7
7
  function checkList(value, type, ref, cache = true) {
8
+ var _a;
8
9
  const tokens = new token_1.TokenCollection(value, type);
9
10
  const matches = tokens.check({ ref });
10
11
  if (!matches.matched) {
@@ -17,7 +18,7 @@ function checkList(value, type, ref, cache = true) {
17
18
  const { offset, line, column } = token_1.Token.shiftLocation(token, res.offset);
18
19
  return {
19
20
  ...res,
20
- partName: res.partName || 'the content of the list',
21
+ partName: (_a = res.partName) !== null && _a !== void 0 ? _a : 'the content of the list',
21
22
  offset,
22
23
  line,
23
24
  column,
@@ -2,7 +2,7 @@ import type { FormattedPrimitiveTypeCheck, MatchedResult, UnmatchedResult, Unmat
2
2
  export declare function matches(checker: FormattedPrimitiveTypeCheck, options?: UnmatchedResultOptions & {
3
3
  readonly ref?: string;
4
4
  readonly reason?: UnmatchedResultReason;
5
- }): (value: string) => MatchedResult | UnmatchedResult;
5
+ }): (value: string) => UnmatchedResult | MatchedResult;
6
6
  export declare function matched(): MatchedResult;
7
7
  export declare function unmatched(value: string, reason?: UnmatchedResultReason, options?: UnmatchedResultOptions & {
8
8
  readonly ref?: string;
@@ -18,10 +18,11 @@ function matched() {
18
18
  }
19
19
  exports.matched = matched;
20
20
  function unmatched(value, reason, options) {
21
+ var _a;
21
22
  return {
22
23
  ...options,
23
24
  matched: false,
24
- ref: (options === null || options === void 0 ? void 0 : options.ref) || null,
25
+ ref: (_a = options === null || options === void 0 ? void 0 : options.ref) !== null && _a !== void 0 ? _a : null,
25
26
  raw: value,
26
27
  offset: 0,
27
28
  length: value.length,
@@ -4,4 +4,8 @@
4
4
  * @param units
5
5
  * @param numberType
6
6
  */
7
- export declare function isQuantity(value: string, units: readonly string[], numberType?: 'int' | 'uint' | 'float'): boolean;
7
+ export declare function isQuantity(
8
+ value: string,
9
+ units: readonly string[],
10
+ numberType?: 'int' | 'uint' | 'float',
11
+ ): boolean;
@@ -3,6 +3,9 @@
3
3
  *
4
4
  * @param value
5
5
  */
6
- export declare function isUint(value: string, options?: {
7
- readonly gt?: number;
8
- }): boolean;
6
+ export declare function isUint(
7
+ value: string,
8
+ options?: {
9
+ readonly gt?: number;
10
+ },
11
+ ): boolean;
@@ -4,6 +4,6 @@
4
4
  * @returns
5
5
  */
6
6
  export declare function splitUnit(value: string): {
7
- num: string;
8
- unit: string;
7
+ num: string;
8
+ unit: string;
9
9
  };
@@ -26,7 +26,7 @@ export declare class TokenCollection extends Array<Token> {
26
26
  expects?: Expect[];
27
27
  ref?: string;
28
28
  cache?: boolean;
29
- }): import("..").MatchedResult | UnmatchedResult;
29
+ }): UnmatchedResult | import("..").MatchedResult;
30
30
  chunk(split: number): TokenCollection[];
31
31
  compareTokens(callback: (prev: Readonly<Token>, current: Readonly<Token>) => Readonly<Token> | null | void): Readonly<Token> | null | undefined;
32
32
  divide(position: number): readonly [TokenCollection, TokenCollection];
@@ -5,6 +5,7 @@ const match_result_1 = require("../match-result");
5
5
  const token_1 = require("./token");
6
6
  class TokenCollection extends Array {
7
7
  static fromPatterns(value, patterns, typeOptions) {
8
+ var _c;
8
9
  const originalValue = typeof value === 'string' ? value : value.originalValue;
9
10
  let strings = typeof value === 'string' ? value : value.value;
10
11
  let cumulativeOffset = typeof value === 'string' ? 0 : value.offset;
@@ -31,7 +32,7 @@ class TokenCollection extends Array {
31
32
  value = strings.slice(res.index + res[0].length);
32
33
  }
33
34
  else {
34
- value = res[0] || '';
35
+ value = (_c = res[0]) !== null && _c !== void 0 ? _c : '';
35
36
  }
36
37
  }
37
38
  const token = addToken(value);
@@ -51,14 +52,15 @@ class TokenCollection extends Array {
51
52
  return Array;
52
53
  }
53
54
  constructor(value, typeOptions) {
55
+ var _c, _d, _e, _f, _g, _h;
54
56
  super();
55
- this.disallowToSurroundBySpaces = (typeOptions === null || typeOptions === void 0 ? void 0 : typeOptions.disallowToSurroundBySpaces) || false;
56
- this.allowEmpty = (typeOptions === null || typeOptions === void 0 ? void 0 : typeOptions.allowEmpty) || true;
57
- this.ordered = (typeOptions === null || typeOptions === void 0 ? void 0 : typeOptions.ordered) || false;
58
- this.unique = (typeOptions === null || typeOptions === void 0 ? void 0 : typeOptions.unique) || false;
59
- this.caseInsensitive = (typeOptions === null || typeOptions === void 0 ? void 0 : typeOptions.caseInsensitive) || true;
57
+ this.disallowToSurroundBySpaces = (_c = typeOptions === null || typeOptions === void 0 ? void 0 : typeOptions.disallowToSurroundBySpaces) !== null && _c !== void 0 ? _c : false;
58
+ this.allowEmpty = (_d = typeOptions === null || typeOptions === void 0 ? void 0 : typeOptions.allowEmpty) !== null && _d !== void 0 ? _d : true;
59
+ this.ordered = (_e = typeOptions === null || typeOptions === void 0 ? void 0 : typeOptions.ordered) !== null && _e !== void 0 ? _e : false;
60
+ this.unique = (_f = typeOptions === null || typeOptions === void 0 ? void 0 : typeOptions.unique) !== null && _f !== void 0 ? _f : false;
61
+ this.caseInsensitive = (_g = typeOptions === null || typeOptions === void 0 ? void 0 : typeOptions.caseInsensitive) !== null && _g !== void 0 ? _g : true;
60
62
  this.number = typeOptions === null || typeOptions === void 0 ? void 0 : typeOptions.number;
61
- this.separator = (typeOptions === null || typeOptions === void 0 ? void 0 : typeOptions.separator) || 'space';
63
+ this.separator = (_h = typeOptions === null || typeOptions === void 0 ? void 0 : typeOptions.separator) !== null && _h !== void 0 ? _h : 'space';
62
64
  if (typeof value === 'number') {
63
65
  this.length = value;
64
66
  return;
@@ -70,7 +72,7 @@ class TokenCollection extends Array {
70
72
  if (this.separator === 'comma') {
71
73
  separators.push(',');
72
74
  }
73
- if (typeOptions === null || typeOptions === void 0 ? void 0 : typeOptions.specificSeparator) {
75
+ if ((typeOptions === null || typeOptions === void 0 ? void 0 : typeOptions.specificSeparator) != null) {
74
76
  if (typeof typeOptions.specificSeparator === 'string') {
75
77
  separators.push(typeOptions.specificSeparator);
76
78
  }
@@ -191,7 +193,7 @@ class TokenCollection extends Array {
191
193
  chunk(split) {
192
194
  const chunks = [];
193
195
  const tokens = this.slice();
194
- while (tokens.length) {
196
+ while (tokens.length > 0) {
195
197
  const chunkTokens = tokens.splice(0, split);
196
198
  const chunk = TokenCollection._new(chunkTokens, this);
197
199
  chunks.push(chunk);
@@ -222,6 +224,7 @@ class TokenCollection extends Array {
222
224
  return [a, b];
223
225
  }
224
226
  eachCheck(...callbacks) {
227
+ var _c, _d;
225
228
  let headAndTail = this.headAndTail();
226
229
  let head = headAndTail.head;
227
230
  let tail = headAndTail.tail;
@@ -234,10 +237,10 @@ class TokenCollection extends Array {
234
237
  wait--;
235
238
  const result = callback.call(this, head, tail);
236
239
  if (result && !result.matched) {
237
- passCount += result.passCount || 0;
240
+ passCount += (_c = result.passCount) !== null && _c !== void 0 ? _c : 0;
238
241
  if (prev && result.offset === 0 && result.length === 0) {
239
242
  const { offset, line, column } = token_1.Token.shiftLocation(prev, cumulativeOffset);
240
- firstUnmatched = firstUnmatched || {
243
+ firstUnmatched = firstUnmatched !== null && firstUnmatched !== void 0 ? firstUnmatched : {
241
244
  ...result,
242
245
  offset,
243
246
  line,
@@ -245,7 +248,7 @@ class TokenCollection extends Array {
245
248
  };
246
249
  }
247
250
  if (!prev && this.value.length === 0) {
248
- firstUnmatched = firstUnmatched || {
251
+ firstUnmatched = firstUnmatched !== null && firstUnmatched !== void 0 ? firstUnmatched : {
249
252
  ...result,
250
253
  reason: 'empty-token',
251
254
  expects: undefined,
@@ -262,7 +265,7 @@ class TokenCollection extends Array {
262
265
  }
263
266
  }
264
267
  }
265
- firstUnmatched = firstUnmatched || result;
268
+ firstUnmatched = firstUnmatched !== null && firstUnmatched !== void 0 ? firstUnmatched : result;
266
269
  }
267
270
  else if (result && !firstUnmatched && result.matched) {
268
271
  return result;
@@ -272,7 +275,7 @@ class TokenCollection extends Array {
272
275
  passCount += 4 * wait;
273
276
  }
274
277
  }
275
- cumulativeOffset = (head === null || head === void 0 ? void 0 : head.length) || 0;
278
+ cumulativeOffset = (_d = head === null || head === void 0 ? void 0 : head.length) !== null && _d !== void 0 ? _d : 0;
276
279
  headAndTail = tail.headAndTail();
277
280
  prev = head;
278
281
  head = headAndTail.head;
@@ -296,7 +299,7 @@ class TokenCollection extends Array {
296
299
  return current;
297
300
  }
298
301
  });
299
- return resultToken || null;
302
+ return resultToken !== null && resultToken !== void 0 ? resultToken : null;
300
303
  }
301
304
  getDuplicated() {
302
305
  const aList = this.slice();
@@ -333,7 +336,7 @@ class TokenCollection extends Array {
333
336
  const copy = this.slice();
334
337
  const head = copy.shift();
335
338
  if (!head) {
336
- return { head: head || null, tail: TokenCollection._new([], this) };
339
+ return { head: head !== null && head !== void 0 ? head : null, tail: TokenCollection._new([], this) };
337
340
  }
338
341
  const tail = TokenCollection._new(copy, this);
339
342
  return { head, tail };
@@ -20,7 +20,7 @@ export declare class Token {
20
20
  static readonly whitespace: ReadonlyArray<string>;
21
21
  static getCol(value: string, offset: number): number;
22
22
  static getLine(value: string, offset: number): number;
23
- static getType(value: string, separators?: readonly string[]): 1 | 13 | 18;
23
+ static getType(value: string, separators?: readonly string[]): 18 | 1 | 13;
24
24
  static shiftLocation(token: Readonly<Token>, offset: number): {
25
25
  offset: number;
26
26
  line: number;
@@ -54,7 +54,7 @@ class Token {
54
54
  if (typeof value === 'string') {
55
55
  const a = caseInsensitive ? this.value.toLowerCase() : this.value;
56
56
  const b = caseInsensitive ? value.toLowerCase() : value;
57
- return a.indexOf(b) !== -1;
57
+ return a.includes(b);
58
58
  }
59
59
  if (value instanceof RegExp) {
60
60
  const pattern = new RegExp(value, caseInsensitive ? 'i' : '');
@@ -89,20 +89,21 @@ class Token {
89
89
  };
90
90
  }
91
91
  toNumber() {
92
- return parseFloat(this.value);
92
+ const num = parseFloat(this.value);
93
+ return isNaN(num) ? 0 : num;
93
94
  }
94
95
  unmatched(options) {
95
- var _a;
96
+ var _a, _b;
96
97
  return {
97
98
  ...options,
98
99
  matched: false,
99
- ref: (options === null || options === void 0 ? void 0 : options.ref) || null,
100
+ ref: (_a = options === null || options === void 0 ? void 0 : options.ref) !== null && _a !== void 0 ? _a : null,
100
101
  raw: this.value,
101
102
  offset: this.offset,
102
103
  length: this.value.length,
103
104
  line: Token.getLine(this.originalValue, this.offset),
104
105
  column: Token.getCol(this.originalValue, this.offset),
105
- reason: (_a = options === null || options === void 0 ? void 0 : options.reason) !== null && _a !== void 0 ? _a : 'syntax-error',
106
+ reason: (_b = options === null || options === void 0 ? void 0 : options.reason) !== null && _b !== void 0 ? _b : 'syntax-error',
106
107
  };
107
108
  }
108
109
  }
package/lib/types.d.ts CHANGED
@@ -2,77 +2,101 @@ import type { cssSyntaxMatch } from './css-syntax';
2
2
  export type { Type, List, Enum, CssSyntax, KeywordDefinedType, Number } from './types.schema';
3
3
  export type Result = UnmatchedResult | MatchedResult;
4
4
  export type UnmatchedResult = {
5
- readonly matched: false;
6
- readonly ref: string | null;
7
- readonly raw: string;
8
- readonly length: number;
9
- readonly offset: number;
10
- readonly line: number;
11
- readonly column: number;
12
- readonly reason: UnmatchedResultReason;
13
- readonly passCount?: number;
5
+ readonly matched: false;
6
+ readonly ref: string | null;
7
+ readonly raw: string;
8
+ readonly length: number;
9
+ readonly offset: number;
10
+ readonly line: number;
11
+ readonly column: number;
12
+ readonly reason: UnmatchedResultReason;
13
+ readonly passCount?: number;
14
14
  } & UnmatchedResultOptions;
15
15
  export type UnmatchedResultOptions = {
16
- readonly partName?: string;
17
- readonly expects?: readonly Expect[];
18
- readonly extra?: Expect;
19
- readonly candidate?: string;
20
- };
21
- export type UnmatchedResultReason = 'syntax-error' | 'typo' | 'missing-token' | 'missing-comma' | 'unexpected-token' | 'unexpected-space' | 'unexpected-newline' | 'unexpected-comma' | 'empty-token' | 'out-of-range' | 'doesnt-exist-in-enum' | 'duplicated' | 'illegal-combination' | 'illegal-order' | 'extra-token' | 'must-be-percent-encoded' | 'must-be-serialized' | {
22
- readonly type: 'out-of-range';
23
- readonly gt?: number;
24
- readonly gte?: number;
25
- readonly lt?: number;
26
- readonly lte?: number;
27
- } | {
28
- readonly type: 'out-of-range-length-char';
29
- readonly gte: number;
30
- readonly lte?: number;
31
- } | {
32
- readonly type: 'out-of-range-length-digit';
33
- readonly gte: number;
34
- readonly lte?: number;
16
+ readonly partName?: string;
17
+ readonly expects?: readonly Expect[];
18
+ readonly extra?: Expect;
19
+ readonly candidate?: string;
35
20
  };
21
+ export type UnmatchedResultReason =
22
+ | 'syntax-error'
23
+ | 'typo'
24
+ | 'missing-token'
25
+ | 'missing-comma'
26
+ | 'unexpected-token'
27
+ | 'unexpected-space'
28
+ | 'unexpected-newline'
29
+ | 'unexpected-comma'
30
+ | 'empty-token'
31
+ | 'out-of-range'
32
+ | 'doesnt-exist-in-enum'
33
+ | 'duplicated'
34
+ | 'illegal-combination'
35
+ | 'illegal-order'
36
+ | 'extra-token'
37
+ | 'must-be-percent-encoded'
38
+ | 'must-be-serialized'
39
+ | {
40
+ readonly type: 'out-of-range';
41
+ readonly gt?: number;
42
+ readonly gte?: number;
43
+ readonly lt?: number;
44
+ readonly lte?: number;
45
+ }
46
+ | {
47
+ readonly type: 'out-of-range-length-char';
48
+ readonly gte: number;
49
+ readonly lte?: number;
50
+ }
51
+ | {
52
+ readonly type: 'out-of-range-length-digit';
53
+ readonly gte: number;
54
+ readonly lte?: number;
55
+ };
36
56
  export type MatchedResult = {
37
- readonly matched: true;
57
+ readonly matched: true;
38
58
  };
39
59
  export type Expect = {
40
- readonly type: 'const' | 'format' | 'syntax' | 'regexp' | 'common';
41
- readonly value: string;
60
+ readonly type: 'const' | 'format' | 'syntax' | 'regexp' | 'common';
61
+ readonly value: string;
42
62
  };
43
63
  export type FormattedPrimitiveTypeCheck = (value: string) => boolean;
44
64
  export type FormattedPrimitiveTypeCreator<O = never> = (options?: O) => FormattedPrimitiveTypeCheck;
45
65
  export type Defs = Record<string, CustomCssSyntax | CustomSyntax>;
46
66
  export type CustomSyntax = {
47
- readonly ref: string;
48
- readonly expects?: readonly Expect[];
49
- readonly is: CustomSyntaxCheck;
67
+ readonly ref: string;
68
+ readonly expects?: readonly Expect[];
69
+ readonly is: CustomSyntaxCheck;
50
70
  };
51
71
  export type CustomSyntaxCheck = (value: string) => Result;
52
72
  export type CustomSyntaxChecker<O = {}> = (options?: O) => CustomSyntaxCheck;
53
73
  export type CustomCssSyntax = {
54
- readonly ref: string;
55
- readonly caseSensitive?: boolean;
56
- readonly expects?: readonly Expect[];
57
- readonly syntax: {
58
- readonly apply: `<${string}>`;
59
- readonly def: Readonly<Record<string, string | CssSyntaxTokenizer>>;
60
- /**
61
- * @deprecated
62
- */
63
- readonly ebnf?: Readonly<Record<string, string | readonly string[]>>;
64
- /**
65
- * @deprecated
66
- */
67
- readonly properties?: Readonly<Record<string, string>>;
68
- };
74
+ readonly ref: string;
75
+ readonly caseSensitive?: boolean;
76
+ readonly expects?: readonly Expect[];
77
+ readonly syntax: {
78
+ readonly apply: `<${string}>`;
79
+ readonly def: Readonly<Record<string, string | CssSyntaxTokenizer>>;
80
+ /**
81
+ * @deprecated
82
+ */
83
+ readonly ebnf?: Readonly<Record<string, string | readonly string[]>>;
84
+ /**
85
+ * @deprecated
86
+ */
87
+ readonly properties?: Readonly<Record<string, string>>;
88
+ };
69
89
  };
70
90
  export type CSSSyntaxToken = {
71
- readonly type: number;
72
- readonly value: string;
73
- readonly index: number;
74
- readonly balance: number;
75
- readonly node?: any;
91
+ readonly type: number;
92
+ readonly value: string;
93
+ readonly index: number;
94
+ readonly balance: number;
95
+ readonly node?: any;
76
96
  };
77
- export type CssSyntaxTokenizer = (token: Readonly<CSSSyntaxToken> | null, getNextToken: GetNextToken, match: typeof cssSyntaxMatch) => number;
97
+ export type CssSyntaxTokenizer = (
98
+ token: Readonly<CSSSyntaxToken> | null,
99
+ getNextToken: GetNextToken,
100
+ match: typeof cssSyntaxMatch,
101
+ ) => number;
78
102
  export type GetNextToken = (length: number) => CSSSyntaxToken | null;