@markuplint/types 3.0.0-alpha.6 → 3.0.0-dev.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -8
- package/lib/check-multi-types.d.ts +1 -4
- package/lib/css-syntax.js +6 -6
- package/lib/get-candidate.d.ts +1 -4
- package/lib/match-result.d.ts +8 -21
- package/lib/primitive/is-uint.d.ts +3 -6
- package/lib/primitive/split-unit.d.ts +2 -2
- package/lib/token/token-collection.d.ts +55 -64
- package/lib/token/token.d.ts +52 -57
- package/lib/types.d.ts +55 -79
- package/lib/types.schema.d.ts +31 -1033
- package/lib/whatwg/check-datetime/datetime-tokens.d.ts +1 -21
- package/lib/whatwg/check-datetime/time-zone-offset-string.d.ts +1 -1
- package/lib/whatwg/check-mime-type.d.ts +4 -4
- package/package.json +6 -5
- package/patches/css-tree+2.3.1.patch +23 -0
- package/src/css-syntax.ts +3 -3
- package/src/types.schema.ts +67 -16
- package/tsconfig.tsbuildinfo +1 -1
- package/types.schema.json +67 -16
package/README.md
CHANGED
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
# @markuplint/types
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@markuplint/types)
|
|
4
|
-
[](https://travis-ci.org/markuplint/markuplint)
|
|
5
|
-
[](https://coveralls.io/github/markuplint/markuplint?branch=main)
|
|
6
4
|
|
|
7
|
-
|
|
5
|
+
**Type declaration and value checker**
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
$ npm install @markuplint/types
|
|
7
|
+
## Type declaration
|
|
11
8
|
|
|
12
|
-
|
|
13
|
-
```
|
|
9
|
+
- [types.schema.json](./types.schema.json)
|
|
14
10
|
|
|
15
|
-
##
|
|
11
|
+
## API
|
|
16
12
|
|
|
17
13
|
```ts
|
|
18
14
|
import { check } from '@markuplint/types';
|
|
@@ -100,3 +96,11 @@ check('2020-02-30', 'DateTime');
|
|
|
100
96
|
| `<number-optional-number>` | Some attributes for SVG | | ✅ |
|
|
101
97
|
|
|
102
98
|
In addition, you can use types **[CSSTree](https://github.com/csstree/csstree)** defined.
|
|
99
|
+
|
|
100
|
+
## Install
|
|
101
|
+
|
|
102
|
+
```shell
|
|
103
|
+
$ npm install @markuplint/types
|
|
104
|
+
|
|
105
|
+
$ yarn add @markuplint/types
|
|
106
|
+
```
|
|
@@ -1,5 +1,2 @@
|
|
|
1
1
|
import type { CustomSyntaxCheck, UnmatchedResult } from './types';
|
|
2
|
-
export declare function checkMultiTypes(
|
|
3
|
-
value: string,
|
|
4
|
-
checks: CustomSyntaxCheck[],
|
|
5
|
-
): import('./types').MatchedResult | UnmatchedResult;
|
|
2
|
+
export declare function checkMultiTypes(value: string, checks: CustomSyntaxCheck[]): import("./types").MatchedResult | UnmatchedResult;
|
package/lib/css-syntax.js
CHANGED
|
@@ -5,11 +5,11 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
// @ts-ignore
|
|
6
6
|
const css_tree_1 = tslib_1.__importDefault(require("css-tree"));
|
|
7
7
|
// @ts-ignore
|
|
8
|
-
const
|
|
8
|
+
const error_1 = require("css-tree/lexer/error");
|
|
9
9
|
// @ts-ignore
|
|
10
|
-
const
|
|
10
|
+
const match_1 = require("css-tree/lexer/match");
|
|
11
11
|
// @ts-ignore
|
|
12
|
-
const
|
|
12
|
+
const prepare_tokens_1 = tslib_1.__importDefault(require("css-tree/lexer/prepare-tokens"));
|
|
13
13
|
const debug_1 = require("./debug");
|
|
14
14
|
const defs_1 = require("./defs");
|
|
15
15
|
const match_result_1 = require("./match-result");
|
|
@@ -74,8 +74,8 @@ function cssSyntaxMatch(value, type) {
|
|
|
74
74
|
// eslint-disable-next-line no-console
|
|
75
75
|
console.warn = warn => (0, debug_1.log)('WARNING: %s (by %s => %s)', warn, value, type);
|
|
76
76
|
}
|
|
77
|
-
const tokens = (0,
|
|
78
|
-
const result = (0,
|
|
77
|
+
const tokens = (0, prepare_tokens_1.default)(value, lexer.syntax);
|
|
78
|
+
const result = (0, match_1.matchAsTree)(tokens, matcher.match, lexer);
|
|
79
79
|
if (caseSensitive) {
|
|
80
80
|
if (result.tokens && Array.isArray(result.tokens)) {
|
|
81
81
|
let reducer = 0;
|
|
@@ -99,7 +99,7 @@ function cssSyntaxMatch(value, type) {
|
|
|
99
99
|
}
|
|
100
100
|
return (0, match_result_1.matched)();
|
|
101
101
|
}
|
|
102
|
-
const error = new
|
|
102
|
+
const error = new error_1.SyntaxMatchError(result.reason, matcher.syntax, value, result);
|
|
103
103
|
if (caseSensitive) {
|
|
104
104
|
error.message = deMimicCases(error.message);
|
|
105
105
|
error.syntax = deMimicCases(error.syntax);
|
package/lib/get-candidate.d.ts
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
1
|
type NullableString = string | null | undefined;
|
|
2
|
-
export declare function getCandidate(
|
|
3
|
-
value: NullableString,
|
|
4
|
-
...candidates: (NullableString | NullableString[])[]
|
|
5
|
-
): string | undefined;
|
|
2
|
+
export declare function getCandidate(value: NullableString, ...candidates: (NullableString | NullableString[])[]): string | undefined;
|
|
6
3
|
export {};
|
package/lib/match-result.d.ts
CHANGED
|
@@ -1,22 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
UnmatchedResultReason,
|
|
7
|
-
} from './types';
|
|
8
|
-
export declare function matches(
|
|
9
|
-
checker: FormattedPrimitiveTypeCheck,
|
|
10
|
-
options?: UnmatchedResultOptions & {
|
|
11
|
-
ref?: string;
|
|
12
|
-
reason?: UnmatchedResultReason;
|
|
13
|
-
},
|
|
14
|
-
): (value: string) => MatchedResult | UnmatchedResult;
|
|
1
|
+
import type { FormattedPrimitiveTypeCheck, MatchedResult, UnmatchedResult, UnmatchedResultOptions, UnmatchedResultReason } from './types';
|
|
2
|
+
export declare function matches(checker: FormattedPrimitiveTypeCheck, options?: UnmatchedResultOptions & {
|
|
3
|
+
ref?: string;
|
|
4
|
+
reason?: UnmatchedResultReason;
|
|
5
|
+
}): (value: string) => MatchedResult | UnmatchedResult;
|
|
15
6
|
export declare function matched(): MatchedResult;
|
|
16
|
-
export declare function unmatched(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
options?: UnmatchedResultOptions & {
|
|
20
|
-
ref?: string;
|
|
21
|
-
},
|
|
22
|
-
): UnmatchedResult;
|
|
7
|
+
export declare function unmatched(value: string, reason?: UnmatchedResultReason, options?: UnmatchedResultOptions & {
|
|
8
|
+
ref?: string;
|
|
9
|
+
}): UnmatchedResult;
|
|
@@ -1,71 +1,62 @@
|
|
|
1
1
|
import type { UnmatchedResult } from '..';
|
|
2
2
|
import type { Expect, Result, List } from '../types';
|
|
3
3
|
import { Token } from './token';
|
|
4
|
-
type TokenCollectionOptions = Partial<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
>;
|
|
4
|
+
type TokenCollectionOptions = Partial<Omit<List, 'token'> & {
|
|
5
|
+
specificSeparator: string | string[];
|
|
6
|
+
}>;
|
|
9
7
|
export type TokenEachCheck = (head: Token | null, tail: TokenCollection) => Result | void;
|
|
10
8
|
export declare class TokenCollection extends Array<Token> {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
} | null;
|
|
64
|
-
toJSON(): {
|
|
65
|
-
type: number;
|
|
66
|
-
value: string;
|
|
67
|
-
offset: number;
|
|
68
|
-
}[];
|
|
69
|
-
private static _new;
|
|
9
|
+
static fromPatterns(value: Token | string, patterns: RegExp[], typeOptions?: Omit<TokenCollectionOptions, 'specificSeparator'> & {
|
|
10
|
+
repeat?: boolean;
|
|
11
|
+
}): TokenCollection;
|
|
12
|
+
static get [Symbol.species](): ArrayConstructor;
|
|
13
|
+
readonly allowEmpty: NonNullable<List['allowEmpty']>;
|
|
14
|
+
readonly caseInsensitive: NonNullable<List['caseInsensitive']>;
|
|
15
|
+
readonly disallowToSurroundBySpaces: NonNullable<List['disallowToSurroundBySpaces']>;
|
|
16
|
+
readonly number: List['number'];
|
|
17
|
+
readonly ordered: NonNullable<List['ordered']>;
|
|
18
|
+
readonly separator: NonNullable<List['separator']>;
|
|
19
|
+
readonly unique: NonNullable<List['unique']>;
|
|
20
|
+
constructor(value?: string, typeOptions?: TokenCollectionOptions);
|
|
21
|
+
constructor(value?: number);
|
|
22
|
+
get value(): string;
|
|
23
|
+
check(options?: {
|
|
24
|
+
expects?: Expect[];
|
|
25
|
+
ref?: string;
|
|
26
|
+
cache?: boolean;
|
|
27
|
+
}): import("..").MatchedResult | UnmatchedResult;
|
|
28
|
+
chunk(split: number): TokenCollection[];
|
|
29
|
+
compareTokens(callback: (prev: Token, current: Token) => Token | null | void): Token | null | undefined;
|
|
30
|
+
divide(position: number): readonly [TokenCollection, TokenCollection];
|
|
31
|
+
eachCheck(...callbacks: TokenEachCheck[]): Result;
|
|
32
|
+
filter(callback: (value: Token, index: number, array: Token[]) => boolean): TokenCollection;
|
|
33
|
+
getConsecutiveToken(tokenType: number): Token | null;
|
|
34
|
+
getDuplicated(): Token | null;
|
|
35
|
+
getIdentTokens(): TokenCollection;
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
* @param value The token value or the token type or its list
|
|
39
|
+
*/
|
|
40
|
+
has(value: string | RegExp | number | (string | RegExp | number)[]): boolean;
|
|
41
|
+
headAndTail(): {
|
|
42
|
+
head: Token | null;
|
|
43
|
+
tail: TokenCollection;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
*
|
|
47
|
+
* @param value The token value or the token type or its list
|
|
48
|
+
*/
|
|
49
|
+
search(value: string | RegExp | number | (string | RegExp | number)[]): Token | null;
|
|
50
|
+
takeTurns(tokenNumbers: ReadonlyArray<number>, lastTokenNumber?: number): {
|
|
51
|
+
unexpectedLastToken: boolean;
|
|
52
|
+
expectedTokenNumber: number;
|
|
53
|
+
token: Token;
|
|
54
|
+
} | null;
|
|
55
|
+
toJSON(): {
|
|
56
|
+
type: number;
|
|
57
|
+
value: string;
|
|
58
|
+
offset: number;
|
|
59
|
+
}[];
|
|
60
|
+
private static _new;
|
|
70
61
|
}
|
|
71
62
|
export {};
|
package/lib/token/token.d.ts
CHANGED
|
@@ -1,60 +1,55 @@
|
|
|
1
1
|
import type { UnmatchedResult, UnmatchedResultOptions, UnmatchedResultReason } from '../types';
|
|
2
2
|
export declare class Token {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
options?: UnmatchedResultOptions & {
|
|
56
|
-
ref?: string;
|
|
57
|
-
reason?: UnmatchedResultReason;
|
|
58
|
-
},
|
|
59
|
-
): UnmatchedResult;
|
|
3
|
+
#private;
|
|
4
|
+
/**
|
|
5
|
+
* @see https://github.com/csstree/csstree/blob/master/lib/tokenizer/types.js
|
|
6
|
+
*/
|
|
7
|
+
static readonly Comma = 18;
|
|
8
|
+
static readonly Ident = 1;
|
|
9
|
+
static readonly WhiteSpace = 13;
|
|
10
|
+
/**
|
|
11
|
+
* ASCII whitespace is
|
|
12
|
+
* - U+0009 TAB
|
|
13
|
+
* - U+000A LF
|
|
14
|
+
* - U+000C FF
|
|
15
|
+
* - U+000D CR
|
|
16
|
+
* - U+0020 SPACE.
|
|
17
|
+
*
|
|
18
|
+
* @see https://infra.spec.whatwg.org/#ascii-whitespace
|
|
19
|
+
*/
|
|
20
|
+
static readonly whitespace: ReadonlyArray<string>;
|
|
21
|
+
static getCol(value: string, offset: number): number;
|
|
22
|
+
static getLine(value: string, offset: number): number;
|
|
23
|
+
static getType(value: string, separators?: string[]): 1 | 13 | 18;
|
|
24
|
+
static shiftLocation(token: Token, offset: number): {
|
|
25
|
+
offset: number;
|
|
26
|
+
line: number;
|
|
27
|
+
column: number;
|
|
28
|
+
};
|
|
29
|
+
readonly offset: number;
|
|
30
|
+
readonly type: number;
|
|
31
|
+
readonly value: string;
|
|
32
|
+
constructor(value: string, offset: number, originalValue: string, separators?: string[]);
|
|
33
|
+
get length(): number;
|
|
34
|
+
get origin(): string;
|
|
35
|
+
/**
|
|
36
|
+
*
|
|
37
|
+
* @param value The token value or the token type or its list
|
|
38
|
+
*/
|
|
39
|
+
includes(value: string | RegExp | number | (string | RegExp | number)[], caseInsensitive?: boolean): boolean;
|
|
40
|
+
/**
|
|
41
|
+
*
|
|
42
|
+
* @param value The token value or the token type or its list
|
|
43
|
+
*/
|
|
44
|
+
match(value: string | RegExp | number | (string | RegExp | number)[], caseInsensitive?: boolean): boolean;
|
|
45
|
+
toJSON(): {
|
|
46
|
+
type: number;
|
|
47
|
+
value: string;
|
|
48
|
+
offset: number;
|
|
49
|
+
};
|
|
50
|
+
toNumber(): number;
|
|
51
|
+
unmatched(options?: UnmatchedResultOptions & {
|
|
52
|
+
ref?: string;
|
|
53
|
+
reason?: UnmatchedResultReason;
|
|
54
|
+
}): UnmatchedResult;
|
|
60
55
|
}
|
package/lib/types.d.ts
CHANGED
|
@@ -2,101 +2,77 @@ 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
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
matched: false;
|
|
6
|
+
ref: string | null;
|
|
7
|
+
raw: string;
|
|
8
|
+
length: number;
|
|
9
|
+
offset: number;
|
|
10
|
+
line: number;
|
|
11
|
+
column: number;
|
|
12
|
+
reason: UnmatchedResultReason;
|
|
13
|
+
passCount?: number;
|
|
14
14
|
} & UnmatchedResultOptions;
|
|
15
15
|
export type UnmatchedResultOptions = {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
partName?: string;
|
|
17
|
+
expects?: Expect[];
|
|
18
|
+
extra?: Expect;
|
|
19
|
+
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
|
+
type: 'out-of-range';
|
|
23
|
+
gt?: number;
|
|
24
|
+
gte?: number;
|
|
25
|
+
lt?: number;
|
|
26
|
+
lte?: number;
|
|
27
|
+
} | {
|
|
28
|
+
type: 'out-of-range-length-char';
|
|
29
|
+
gte: number;
|
|
30
|
+
lte?: number;
|
|
31
|
+
} | {
|
|
32
|
+
type: 'out-of-range-length-digit';
|
|
33
|
+
gte: number;
|
|
34
|
+
lte?: number;
|
|
20
35
|
};
|
|
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
|
-
type: 'out-of-range';
|
|
41
|
-
gt?: number;
|
|
42
|
-
gte?: number;
|
|
43
|
-
lt?: number;
|
|
44
|
-
lte?: number;
|
|
45
|
-
}
|
|
46
|
-
| {
|
|
47
|
-
type: 'out-of-range-length-char';
|
|
48
|
-
gte: number;
|
|
49
|
-
lte?: number;
|
|
50
|
-
}
|
|
51
|
-
| {
|
|
52
|
-
type: 'out-of-range-length-digit';
|
|
53
|
-
gte: number;
|
|
54
|
-
lte?: number;
|
|
55
|
-
};
|
|
56
36
|
export type MatchedResult = {
|
|
57
|
-
|
|
37
|
+
matched: true;
|
|
58
38
|
};
|
|
59
39
|
export type Expect = {
|
|
60
|
-
|
|
61
|
-
|
|
40
|
+
type: 'const' | 'format' | 'syntax' | 'regexp' | 'common';
|
|
41
|
+
value: string;
|
|
62
42
|
};
|
|
63
43
|
export type FormattedPrimitiveTypeCheck = (value: string) => boolean;
|
|
64
44
|
export type FormattedPrimitiveTypeCreator<O = never> = (options?: O) => FormattedPrimitiveTypeCheck;
|
|
65
45
|
export type Defs = Record<string, CustomCssSyntax | CustomSyntax>;
|
|
66
46
|
export type CustomSyntax = {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
47
|
+
ref: string;
|
|
48
|
+
expects?: Expect[];
|
|
49
|
+
is: CustomSyntaxCheck;
|
|
70
50
|
};
|
|
71
51
|
export type CustomSyntaxCheck = (value: string) => Result;
|
|
72
52
|
export type CustomSyntaxChecker<O = {}> = (options?: O) => CustomSyntaxCheck;
|
|
73
53
|
export type CustomCssSyntax = {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
54
|
+
ref: string;
|
|
55
|
+
caseSensitive?: boolean;
|
|
56
|
+
expects?: Expect[];
|
|
57
|
+
syntax: {
|
|
58
|
+
apply: `<${string}>`;
|
|
59
|
+
def: Record<string, string | CssSyntaxTokenizer>;
|
|
60
|
+
/**
|
|
61
|
+
* @deprecated
|
|
62
|
+
*/
|
|
63
|
+
ebnf?: Record<string, string | string[]>;
|
|
64
|
+
/**
|
|
65
|
+
* @deprecated
|
|
66
|
+
*/
|
|
67
|
+
properties?: Record<string, string>;
|
|
68
|
+
};
|
|
89
69
|
};
|
|
90
70
|
export type CSSSyntaxToken = {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
71
|
+
type: number;
|
|
72
|
+
value: string;
|
|
73
|
+
index: number;
|
|
74
|
+
balance: number;
|
|
75
|
+
node?: any;
|
|
96
76
|
};
|
|
97
|
-
export type CssSyntaxTokenizer = (
|
|
98
|
-
token: CSSSyntaxToken | null,
|
|
99
|
-
getNextToken: GetNextToken,
|
|
100
|
-
match: typeof cssSyntaxMatch,
|
|
101
|
-
) => number;
|
|
77
|
+
export type CssSyntaxTokenizer = (token: CSSSyntaxToken | null, getNextToken: GetNextToken, match: typeof cssSyntaxMatch) => number;
|
|
102
78
|
export type GetNextToken = (length: number) => CSSSyntaxToken | null;
|