@markuplint/types 2.0.0 → 2.2.0
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/lib/check-multi-types.d.ts +1 -4
- package/lib/css-syntax.js +2 -2
- package/lib/debug.js +1 -1
- package/lib/get-candicate.d.ts +1 -4
- package/lib/get-candicate.js +1 -1
- package/lib/index.js +3 -3
- 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/token/token.js +6 -6
- package/lib/types.d.ts +55 -79
- package/lib/types.schema.d.ts +28 -1030
- package/lib/whatwg/check-autocomplete.js +40 -0
- package/lib/whatwg/check-autocomplete.spec.js +10 -1
- 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/lib/whatwg/check-mime-type.js +1 -1
- package/package.json +3 -3
- package/src/whatwg/check-autocomplete.spec.ts +10 -1
- package/src/whatwg/check-autocomplete.ts +56 -0
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -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
|
@@ -3,13 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.cssSyntaxMatch = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
// @ts-ignore
|
|
6
|
-
const css_tree_1 =
|
|
6
|
+
const css_tree_1 = tslib_1.__importDefault(require("css-tree"));
|
|
7
7
|
// @ts-ignore
|
|
8
8
|
const error_js_1 = require("css-tree/lib/lexer/error.js");
|
|
9
9
|
// @ts-ignore
|
|
10
10
|
const match_js_1 = require("css-tree/lib/lexer/match.js");
|
|
11
11
|
// @ts-ignore
|
|
12
|
-
const prepare_tokens_js_1 =
|
|
12
|
+
const prepare_tokens_js_1 = tslib_1.__importDefault(require("css-tree/lib/lexer/prepare-tokens.js"));
|
|
13
13
|
const debug_1 = require("./debug");
|
|
14
14
|
const defs_1 = require("./defs");
|
|
15
15
|
const match_result_1 = require("./match-result");
|
package/lib/debug.js
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.log = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const debug_1 =
|
|
5
|
+
const debug_1 = tslib_1.__importDefault(require("debug"));
|
|
6
6
|
exports.log = (0, debug_1.default)('@markuplint/types');
|
package/lib/get-candicate.d.ts
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
1
|
declare type NullableString = string | null | undefined;
|
|
2
|
-
export declare function getCandicate(
|
|
3
|
-
value: NullableString,
|
|
4
|
-
...candicates: (NullableString | NullableString[])[]
|
|
5
|
-
): string | undefined;
|
|
2
|
+
export declare function getCandicate(value: NullableString, ...candicates: (NullableString | NullableString[])[]): string | undefined;
|
|
6
3
|
export {};
|
package/lib/get-candicate.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getCandicate = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const leven_1 =
|
|
5
|
+
const leven_1 = tslib_1.__importDefault(require("leven"));
|
|
6
6
|
function getCandicate(value, ...candicates) {
|
|
7
7
|
if (!value) {
|
|
8
8
|
return;
|
package/lib/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
tslib_1.__exportStar(require("./whatwg/is-custom-element-name"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./check"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./types"), exports);
|
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
|
-
declare type TokenCollectionOptions = Partial<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
>;
|
|
4
|
+
declare type TokenCollectionOptions = Partial<Omit<List, 'token'> & {
|
|
5
|
+
speificSeparator: string | string[];
|
|
6
|
+
}>;
|
|
9
7
|
export declare 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
|
-
divide(position: number): readonly [TokenCollection, TokenCollection];
|
|
64
|
-
chunk(split: number): TokenCollection[];
|
|
65
|
-
toJSON(): {
|
|
66
|
-
type: number;
|
|
67
|
-
value: string;
|
|
68
|
-
offset: number;
|
|
69
|
-
}[];
|
|
9
|
+
private static _new;
|
|
10
|
+
static fromPatterns(value: Token | string, patterns: RegExp[], typeOptions?: Omit<TokenCollectionOptions, 'speificSeparator'> & {
|
|
11
|
+
repeat?: boolean;
|
|
12
|
+
}): TokenCollection;
|
|
13
|
+
static get [Symbol.species](): ArrayConstructor;
|
|
14
|
+
readonly disallowToSurroundBySpaces: NonNullable<List['disallowToSurroundBySpaces']>;
|
|
15
|
+
readonly allowEmpty: NonNullable<List['allowEmpty']>;
|
|
16
|
+
readonly ordered: NonNullable<List['ordered']>;
|
|
17
|
+
readonly unique: NonNullable<List['unique']>;
|
|
18
|
+
readonly caseInsensitive: NonNullable<List['caseInsensitive']>;
|
|
19
|
+
readonly number: List['number'];
|
|
20
|
+
readonly separator: NonNullable<List['separator']>;
|
|
21
|
+
constructor(value?: string, typeOptions?: TokenCollectionOptions);
|
|
22
|
+
constructor(value?: number);
|
|
23
|
+
get value(): string;
|
|
24
|
+
filter(callback: (value: Token, index: number, array: Token[]) => boolean): TokenCollection;
|
|
25
|
+
headAndTail(): {
|
|
26
|
+
head: Token | null;
|
|
27
|
+
tail: TokenCollection;
|
|
28
|
+
};
|
|
29
|
+
getIdentTokens(): TokenCollection;
|
|
30
|
+
compareTokens(callback: (prev: Token, current: Token) => Token | null | void): Token | null | undefined;
|
|
31
|
+
/**
|
|
32
|
+
*
|
|
33
|
+
* @param value The token value or the token type or its list
|
|
34
|
+
*/
|
|
35
|
+
has(value: string | RegExp | number | (string | RegExp | number)[]): boolean;
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
* @param value The token value or the token type or its list
|
|
39
|
+
*/
|
|
40
|
+
search(value: string | RegExp | number | (string | RegExp | number)[]): Token | null;
|
|
41
|
+
check(options?: {
|
|
42
|
+
expects?: Expect[];
|
|
43
|
+
ref?: string;
|
|
44
|
+
cache?: boolean;
|
|
45
|
+
}): import("..").MatchedResult | UnmatchedResult;
|
|
46
|
+
getConsecutiveToken(tokenType: number): Token | null;
|
|
47
|
+
takeTurns(tokenNumbers: ReadonlyArray<number>, lastTokenNumber?: number): {
|
|
48
|
+
unexpectedLastToken: boolean;
|
|
49
|
+
expectedTokenNumber: number;
|
|
50
|
+
token: Token;
|
|
51
|
+
} | null;
|
|
52
|
+
eachCheck(...callbacks: TokenEachCheck[]): Result;
|
|
53
|
+
getDuplicated(): Token | null;
|
|
54
|
+
divide(position: number): readonly [TokenCollection, TokenCollection];
|
|
55
|
+
chunk(split: number): TokenCollection[];
|
|
56
|
+
toJSON(): {
|
|
57
|
+
type: number;
|
|
58
|
+
value: string;
|
|
59
|
+
offset: number;
|
|
60
|
+
}[];
|
|
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
|
-
toJSON(): {
|
|
56
|
-
type: number;
|
|
57
|
-
value: string;
|
|
58
|
-
offset: number;
|
|
59
|
-
};
|
|
3
|
+
#private;
|
|
4
|
+
static getType(value: string, separators?: string[]): 1 | 13 | 18;
|
|
5
|
+
static getLine(value: string, offset: number): number;
|
|
6
|
+
static getCol(value: string, offset: number): number;
|
|
7
|
+
static shiftLocation(token: Token, offset: number): {
|
|
8
|
+
offset: number;
|
|
9
|
+
line: number;
|
|
10
|
+
column: number;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* ASCII whitespace is
|
|
14
|
+
* - U+0009 TAB
|
|
15
|
+
* - U+000A LF
|
|
16
|
+
* - U+000C FF
|
|
17
|
+
* - U+000D CR
|
|
18
|
+
* - U+0020 SPACE.
|
|
19
|
+
*
|
|
20
|
+
* @see https://infra.spec.whatwg.org/#ascii-whitespace
|
|
21
|
+
*/
|
|
22
|
+
static readonly whitespace: ReadonlyArray<string>;
|
|
23
|
+
/**
|
|
24
|
+
* @see https://github.com/csstree/csstree/blob/master/lib/tokenizer/types.js
|
|
25
|
+
*/
|
|
26
|
+
static readonly Ident = 1;
|
|
27
|
+
static readonly WhiteSpace = 13;
|
|
28
|
+
static readonly Comma = 18;
|
|
29
|
+
readonly type: number;
|
|
30
|
+
readonly value: string;
|
|
31
|
+
readonly offset: number;
|
|
32
|
+
constructor(value: string, offset: number, originalValue: string, separators?: string[]);
|
|
33
|
+
get length(): number;
|
|
34
|
+
get origin(): string;
|
|
35
|
+
unmatched(options?: UnmatchedResultOptions & {
|
|
36
|
+
ref?: string;
|
|
37
|
+
reason?: UnmatchedResultReason;
|
|
38
|
+
}): UnmatchedResult;
|
|
39
|
+
/**
|
|
40
|
+
*
|
|
41
|
+
* @param value The token value or the token type or its list
|
|
42
|
+
*/
|
|
43
|
+
match(value: string | RegExp | number | (string | RegExp | number)[], caseInsensitive?: boolean): boolean;
|
|
44
|
+
/**
|
|
45
|
+
*
|
|
46
|
+
* @param value The token value or the token type or its list
|
|
47
|
+
*/
|
|
48
|
+
includes(value: string | RegExp | number | (string | RegExp | number)[], caseInsensitive?: boolean): boolean;
|
|
49
|
+
toNumber(): number;
|
|
50
|
+
toJSON(): {
|
|
51
|
+
type: number;
|
|
52
|
+
value: string;
|
|
53
|
+
offset: number;
|
|
54
|
+
};
|
|
60
55
|
}
|
package/lib/token/token.js
CHANGED
|
@@ -9,7 +9,7 @@ class Token {
|
|
|
9
9
|
this.type = Token.getType(value, separators);
|
|
10
10
|
this.value = value;
|
|
11
11
|
this.offset = offset;
|
|
12
|
-
|
|
12
|
+
tslib_1.__classPrivateFieldSet(this, _Token_originalValue, originalValue, "f");
|
|
13
13
|
}
|
|
14
14
|
static getType(value, separators) {
|
|
15
15
|
if (Token.whitespace.includes(value[0])) {
|
|
@@ -34,15 +34,15 @@ class Token {
|
|
|
34
34
|
const shifted = token.offset + offset;
|
|
35
35
|
return {
|
|
36
36
|
offset: shifted,
|
|
37
|
-
line: Token.getLine(
|
|
38
|
-
column: Token.getCol(
|
|
37
|
+
line: Token.getLine(tslib_1.__classPrivateFieldGet(token, _Token_originalValue, "f"), shifted),
|
|
38
|
+
column: Token.getCol(tslib_1.__classPrivateFieldGet(token, _Token_originalValue, "f"), shifted),
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
41
|
get length() {
|
|
42
42
|
return this.value.length;
|
|
43
43
|
}
|
|
44
44
|
get origin() {
|
|
45
|
-
return
|
|
45
|
+
return tslib_1.__classPrivateFieldGet(this, _Token_originalValue, "f");
|
|
46
46
|
}
|
|
47
47
|
unmatched(options) {
|
|
48
48
|
var _a;
|
|
@@ -53,8 +53,8 @@ class Token {
|
|
|
53
53
|
raw: this.value,
|
|
54
54
|
offset: this.offset,
|
|
55
55
|
length: this.value.length,
|
|
56
|
-
line: Token.getLine(
|
|
57
|
-
column: Token.getCol(
|
|
56
|
+
line: Token.getLine(tslib_1.__classPrivateFieldGet(this, _Token_originalValue, "f"), this.offset),
|
|
57
|
+
column: Token.getCol(tslib_1.__classPrivateFieldGet(this, _Token_originalValue, "f"), this.offset),
|
|
58
58
|
reason: (_a = options === null || options === void 0 ? void 0 : options.reason) !== null && _a !== void 0 ? _a : 'syntax-error',
|
|
59
59
|
};
|
|
60
60
|
}
|
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 declare type Result = UnmatchedResult | MatchedResult;
|
|
4
4
|
export declare 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 declare type UnmatchedResultOptions = {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
partName?: string;
|
|
17
|
+
expects?: Expect[];
|
|
18
|
+
extra?: Expect;
|
|
19
|
+
candicate?: string;
|
|
20
|
+
};
|
|
21
|
+
export declare 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 declare 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 declare type MatchedResult = {
|
|
57
|
-
|
|
37
|
+
matched: true;
|
|
58
38
|
};
|
|
59
39
|
export declare type Expect = {
|
|
60
|
-
|
|
61
|
-
|
|
40
|
+
type: 'const' | 'format' | 'syntax' | 'regxp' | 'common';
|
|
41
|
+
value: string;
|
|
62
42
|
};
|
|
63
43
|
export declare type FormattedPrimitiveTypeCheck = (value: string) => boolean;
|
|
64
44
|
export declare type FormattedPrimitiveTypeCreator<O = never> = (options?: O) => FormattedPrimitiveTypeCheck;
|
|
65
45
|
export declare type Defs = Record<string, CustomCssSyntax | CustomSyntax>;
|
|
66
46
|
export declare type CustomSyntax = {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
47
|
+
ref: string;
|
|
48
|
+
expects?: Expect[];
|
|
49
|
+
is: CustomSyntaxCheck;
|
|
70
50
|
};
|
|
71
51
|
export declare type CustomSyntaxCheck = (value: string) => Result;
|
|
72
52
|
export declare type CustomSyntaxChecker<O = {}> = (options?: O) => CustomSyntaxCheck;
|
|
73
53
|
export declare 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 declare 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 declare type CssSyntaxTokenizer = (
|
|
98
|
-
token: CSSSyntaxToken | null,
|
|
99
|
-
getNextToken: GetNextToken,
|
|
100
|
-
match: typeof cssSyntaxMatch,
|
|
101
|
-
) => number;
|
|
77
|
+
export declare type CssSyntaxTokenizer = (token: CSSSyntaxToken | null, getNextToken: GetNextToken, match: typeof cssSyntaxMatch) => number;
|
|
102
78
|
export declare type GetNextToken = (length: number) => CSSSyntaxToken | null;
|