@markuplint/types 1.0.0-dev.20211213.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/LICENSE +21 -0
- package/README.md +117 -0
- package/extends.json +12 -0
- package/gen/specific-schema.json +98 -0
- package/gen/types.ts +66 -0
- package/lib/check-multi-types.d.ts +2 -0
- package/lib/check-multi-types.js +29 -0
- package/lib/check.d.ts +8 -0
- package/lib/check.js +49 -0
- package/lib/check.spec.d.ts +1 -0
- package/lib/check.spec.js +57 -0
- package/lib/css-syntax.d.ts +2 -0
- package/lib/css-syntax.js +141 -0
- package/lib/css-syntax.spec.d.ts +1 -0
- package/lib/css-syntax.spec.js +157 -0
- package/lib/debug.d.ts +2 -0
- package/lib/debug.js +6 -0
- package/lib/defs.d.ts +3 -0
- package/lib/defs.js +752 -0
- package/lib/enum.d.ts +3 -0
- package/lib/enum.js +26 -0
- package/lib/get-candicate.d.ts +3 -0
- package/lib/get-candicate.js +26 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.js +6 -0
- package/lib/keyword-type.d.ts +3 -0
- package/lib/keyword-type.js +46 -0
- package/lib/list.d.ts +3 -0
- package/lib/list.js +29 -0
- package/lib/list.spec.d.ts +1 -0
- package/lib/list.spec.js +129 -0
- package/lib/match-result.d.ts +9 -0
- package/lib/match-result.js +33 -0
- package/lib/number.d.ts +3 -0
- package/lib/number.js +41 -0
- package/lib/primitive/index.d.ts +7 -0
- package/lib/primitive/index.js +17 -0
- package/lib/primitive/index.spec.d.ts +1 -0
- package/lib/primitive/index.spec.js +62 -0
- package/lib/primitive/is-float.d.ts +6 -0
- package/lib/primitive/is-float.js +12 -0
- package/lib/primitive/is-int.d.ts +6 -0
- package/lib/primitive/is-int.js +12 -0
- package/lib/primitive/is-non-zero-uint.d.ts +6 -0
- package/lib/primitive/is-non-zero-uint.js +12 -0
- package/lib/primitive/is-quantity.d.ts +7 -0
- package/lib/primitive/is-quantity.js +41 -0
- package/lib/primitive/is-uint.d.ts +8 -0
- package/lib/primitive/is-uint.js +19 -0
- package/lib/primitive/range.d.ts +8 -0
- package/lib/primitive/range.js +18 -0
- package/lib/primitive/split-unit.d.ts +9 -0
- package/lib/primitive/split-unit.js +24 -0
- package/lib/rfc/is-bcp-47.d.ts +5 -0
- package/lib/rfc/is-bcp-47.js +14 -0
- package/lib/rfc/is-bcp-47.spec.d.ts +1 -0
- package/lib/rfc/is-bcp-47.spec.js +19 -0
- package/lib/token/index.d.ts +2 -0
- package/lib/token/index.js +7 -0
- package/lib/token/token-collection.d.ts +62 -0
- package/lib/token/token-collection.js +383 -0
- package/lib/token/token-collection.spec.d.ts +1 -0
- package/lib/token/token-collection.spec.js +144 -0
- package/lib/token/token.d.ts +55 -0
- package/lib/token/token.js +128 -0
- package/lib/types.d.ts +78 -0
- package/lib/types.js +2 -0
- package/lib/types.schema.d.ts +54 -0
- package/lib/types.schema.js +8 -0
- package/lib/w3c/check-serialized-permissions-policy.d.ts +15 -0
- package/lib/w3c/check-serialized-permissions-policy.js +251 -0
- package/lib/w3c/check-serialized-permissions-policy.spec.d.ts +1 -0
- package/lib/w3c/check-serialized-permissions-policy.spec.js +26 -0
- package/lib/whatwg/check-autocomplete.d.ts +5 -0
- package/lib/whatwg/check-autocomplete.js +282 -0
- package/lib/whatwg/check-autocomplete.spec.d.ts +1 -0
- package/lib/whatwg/check-autocomplete.spec.js +370 -0
- package/lib/whatwg/check-datetime/date-string.d.ts +5 -0
- package/lib/whatwg/check-datetime/date-string.js +31 -0
- package/lib/whatwg/check-datetime/datetime-tokens.d.ts +3 -0
- package/lib/whatwg/check-datetime/datetime-tokens.js +509 -0
- package/lib/whatwg/check-datetime/duration-string.d.ts +6 -0
- package/lib/whatwg/check-datetime/duration-string.js +322 -0
- package/lib/whatwg/check-datetime/global-date-and-time-string.d.ts +5 -0
- package/lib/whatwg/check-datetime/global-date-and-time-string.js +66 -0
- package/lib/whatwg/check-datetime/index.d.ts +5 -0
- package/lib/whatwg/check-datetime/index.js +35 -0
- package/lib/whatwg/check-datetime/index.spec.d.ts +1 -0
- package/lib/whatwg/check-datetime/index.spec.js +318 -0
- package/lib/whatwg/check-datetime/local-date-and-time-string.d.ts +9 -0
- package/lib/whatwg/check-datetime/local-date-and-time-string.js +116 -0
- package/lib/whatwg/check-datetime/month-string.d.ts +5 -0
- package/lib/whatwg/check-datetime/month-string.js +20 -0
- package/lib/whatwg/check-datetime/time-string.d.ts +5 -0
- package/lib/whatwg/check-datetime/time-string.js +35 -0
- package/lib/whatwg/check-datetime/time-zone-offset-string.d.ts +7 -0
- package/lib/whatwg/check-datetime/time-zone-offset-string.js +75 -0
- package/lib/whatwg/check-datetime/week-string.d.ts +5 -0
- package/lib/whatwg/check-datetime/week-string.js +29 -0
- package/lib/whatwg/check-datetime/year-string.d.ts +5 -0
- package/lib/whatwg/check-datetime/year-string.js +20 -0
- package/lib/whatwg/check-datetime/yearless-date-string.d.ts +5 -0
- package/lib/whatwg/check-datetime/yearless-date-string.js +27 -0
- package/lib/whatwg/check-mime-type.d.ts +11 -0
- package/lib/whatwg/check-mime-type.js +42 -0
- package/lib/whatwg/check-mime-type.spec.d.ts +1 -0
- package/lib/whatwg/check-mime-type.spec.js +58 -0
- package/lib/whatwg/is-abs-url.d.ts +15 -0
- package/lib/whatwg/is-abs-url.js +34 -0
- package/lib/whatwg/is-abs-url.spec.d.ts +1 -0
- package/lib/whatwg/is-abs-url.spec.js +8 -0
- package/lib/whatwg/is-browser-context-name.d.ts +11 -0
- package/lib/whatwg/is-browser-context-name.js +18 -0
- package/lib/whatwg/is-custom-element-name.d.ts +22 -0
- package/lib/whatwg/is-custom-element-name.js +77 -0
- package/lib/whatwg/is-itemprop-name.d.ts +12 -0
- package/lib/whatwg/is-itemprop-name.js +19 -0
- package/package.json +33 -0
- package/src/check-multi-types.ts +35 -0
- package/src/check.spec.ts +62 -0
- package/src/check.ts +48 -0
- package/src/css-syntax.spec.ts +167 -0
- package/src/css-syntax.ts +177 -0
- package/src/debug.ts +3 -0
- package/src/defs.ts +810 -0
- package/src/enum.ts +25 -0
- package/src/get-candicate.ts +24 -0
- package/src/index.ts +3 -0
- package/src/keyword-type.ts +52 -0
- package/src/list.spec.ts +133 -0
- package/src/list.ts +34 -0
- package/src/match-result.ts +49 -0
- package/src/number.ts +46 -0
- package/src/primitive/index.spec.ts +65 -0
- package/src/primitive/index.ts +7 -0
- package/src/primitive/is-float.ts +8 -0
- package/src/primitive/is-int.ts +8 -0
- package/src/primitive/is-non-zero-uint.ts +8 -0
- package/src/primitive/is-quantity.ts +38 -0
- package/src/primitive/is-uint.ts +15 -0
- package/src/primitive/range.ts +14 -0
- package/src/primitive/split-unit.ts +20 -0
- package/src/rfc/is-bcp-47.spec.ts +23 -0
- package/src/rfc/is-bcp-47.ts +13 -0
- package/src/token/index.ts +2 -0
- package/src/token/token-collection.spec.ts +147 -0
- package/src/token/token-collection.ts +444 -0
- package/src/token/token.ts +144 -0
- package/src/types.schema.ts +1059 -0
- package/src/types.ts +118 -0
- package/src/w3c/check-serialized-permissions-policy.spec.ts +27 -0
- package/src/w3c/check-serialized-permissions-policy.ts +287 -0
- package/src/whatwg/check-autocomplete.spec.ts +378 -0
- package/src/whatwg/check-autocomplete.ts +324 -0
- package/src/whatwg/check-datetime/date-string.ts +44 -0
- package/src/whatwg/check-datetime/datetime-tokens.ts +600 -0
- package/src/whatwg/check-datetime/duration-string.ts +399 -0
- package/src/whatwg/check-datetime/global-date-and-time-string.ts +96 -0
- package/src/whatwg/check-datetime/index.spec.ts +333 -0
- package/src/whatwg/check-datetime/index.ts +36 -0
- package/src/whatwg/check-datetime/local-date-and-time-string.ts +163 -0
- package/src/whatwg/check-datetime/month-string.ts +31 -0
- package/src/whatwg/check-datetime/time-string.ts +49 -0
- package/src/whatwg/check-datetime/time-zone-offset-string.ts +93 -0
- package/src/whatwg/check-datetime/week-string.ts +41 -0
- package/src/whatwg/check-datetime/year-string.ts +26 -0
- package/src/whatwg/check-datetime/yearless-date-string.ts +38 -0
- package/src/whatwg/check-mime-type.spec.ts +59 -0
- package/src/whatwg/check-mime-type.ts +46 -0
- package/src/whatwg/is-abs-url.spec.ts +8 -0
- package/src/whatwg/is-abs-url.ts +31 -0
- package/src/whatwg/is-browser-context-name.ts +16 -0
- package/src/whatwg/is-custom-element-name.ts +76 -0
- package/src/whatwg/is-itemprop-name.ts +17 -0
- package/tsconfig.test.json +3 -0
- package/tsconfig.tsbuildinfo +1 -0
- package/types.schema.json +1092 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { UnmatchedResult, UnmatchedResultOptions, UnmatchedResultReason } from '../types';
|
|
2
|
+
export declare class Token {
|
|
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
|
+
};
|
|
55
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _Token_originalValue;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Token = void 0;
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
6
|
+
class Token {
|
|
7
|
+
constructor(value, offset, originalValue, separators) {
|
|
8
|
+
_Token_originalValue.set(this, void 0);
|
|
9
|
+
this.type = Token.getType(value, separators);
|
|
10
|
+
this.value = value;
|
|
11
|
+
this.offset = offset;
|
|
12
|
+
(0, tslib_1.__classPrivateFieldSet)(this, _Token_originalValue, originalValue, "f");
|
|
13
|
+
}
|
|
14
|
+
static getType(value, separators) {
|
|
15
|
+
if (Token.whitespace.includes(value[0])) {
|
|
16
|
+
return Token.WhiteSpace;
|
|
17
|
+
}
|
|
18
|
+
if (separators === null || separators === void 0 ? void 0 : separators.includes(value[0])) {
|
|
19
|
+
switch (value[0]) {
|
|
20
|
+
case ',':
|
|
21
|
+
return Token.Comma;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return Token.Ident;
|
|
25
|
+
}
|
|
26
|
+
static getLine(value, offset) {
|
|
27
|
+
return value.slice(0, offset).split(/\n/g).length;
|
|
28
|
+
}
|
|
29
|
+
static getCol(value, offset) {
|
|
30
|
+
const lines = value.slice(0, offset).split(/\n/g);
|
|
31
|
+
return lines[lines.length - 1].length + 1;
|
|
32
|
+
}
|
|
33
|
+
static shiftLocation(token, offset) {
|
|
34
|
+
const shifted = token.offset + offset;
|
|
35
|
+
return {
|
|
36
|
+
offset: shifted,
|
|
37
|
+
line: Token.getLine((0, tslib_1.__classPrivateFieldGet)(token, _Token_originalValue, "f"), shifted),
|
|
38
|
+
column: Token.getCol((0, tslib_1.__classPrivateFieldGet)(token, _Token_originalValue, "f"), shifted),
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
get length() {
|
|
42
|
+
return this.value.length;
|
|
43
|
+
}
|
|
44
|
+
get origin() {
|
|
45
|
+
return (0, tslib_1.__classPrivateFieldGet)(this, _Token_originalValue, "f");
|
|
46
|
+
}
|
|
47
|
+
unmatched(options) {
|
|
48
|
+
var _a;
|
|
49
|
+
return {
|
|
50
|
+
...options,
|
|
51
|
+
matched: false,
|
|
52
|
+
ref: (options === null || options === void 0 ? void 0 : options.ref) || null,
|
|
53
|
+
raw: this.value,
|
|
54
|
+
offset: this.offset,
|
|
55
|
+
length: this.value.length,
|
|
56
|
+
line: Token.getLine((0, tslib_1.__classPrivateFieldGet)(this, _Token_originalValue, "f"), this.offset),
|
|
57
|
+
column: Token.getCol((0, tslib_1.__classPrivateFieldGet)(this, _Token_originalValue, "f"), this.offset),
|
|
58
|
+
reason: (_a = options === null || options === void 0 ? void 0 : options.reason) !== null && _a !== void 0 ? _a : 'syntax-error',
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
*
|
|
63
|
+
* @param value The token value or the token type or its list
|
|
64
|
+
*/
|
|
65
|
+
match(value, caseInsensitive) {
|
|
66
|
+
if (Array.isArray(value)) {
|
|
67
|
+
return value.some(v => this.match(v));
|
|
68
|
+
}
|
|
69
|
+
if (typeof value === 'string') {
|
|
70
|
+
const a = caseInsensitive ? this.value.toLowerCase() : this.value;
|
|
71
|
+
const b = caseInsensitive ? value.toLowerCase() : value;
|
|
72
|
+
return a === b;
|
|
73
|
+
}
|
|
74
|
+
if (value instanceof RegExp) {
|
|
75
|
+
const pattern = new RegExp(value, caseInsensitive ? 'i' : '');
|
|
76
|
+
return pattern.test(this.value);
|
|
77
|
+
}
|
|
78
|
+
return this.type === value;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
*
|
|
82
|
+
* @param value The token value or the token type or its list
|
|
83
|
+
*/
|
|
84
|
+
includes(value, caseInsensitive) {
|
|
85
|
+
if (Array.isArray(value)) {
|
|
86
|
+
return value.some(v => this.includes(v));
|
|
87
|
+
}
|
|
88
|
+
if (typeof value === 'string') {
|
|
89
|
+
const a = caseInsensitive ? this.value.toLowerCase() : this.value;
|
|
90
|
+
const b = caseInsensitive ? value.toLowerCase() : value;
|
|
91
|
+
return a.indexOf(b) !== -1;
|
|
92
|
+
}
|
|
93
|
+
if (value instanceof RegExp) {
|
|
94
|
+
const pattern = new RegExp(value, caseInsensitive ? 'i' : '');
|
|
95
|
+
return pattern.test(this.value);
|
|
96
|
+
}
|
|
97
|
+
return this.type === value;
|
|
98
|
+
}
|
|
99
|
+
toNumber() {
|
|
100
|
+
return parseFloat(this.value);
|
|
101
|
+
}
|
|
102
|
+
toJSON() {
|
|
103
|
+
return {
|
|
104
|
+
type: this.type,
|
|
105
|
+
value: this.value,
|
|
106
|
+
offset: this.offset,
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
exports.Token = Token;
|
|
111
|
+
_Token_originalValue = new WeakMap();
|
|
112
|
+
/**
|
|
113
|
+
* ASCII whitespace is
|
|
114
|
+
* - U+0009 TAB
|
|
115
|
+
* - U+000A LF
|
|
116
|
+
* - U+000C FF
|
|
117
|
+
* - U+000D CR
|
|
118
|
+
* - U+0020 SPACE.
|
|
119
|
+
*
|
|
120
|
+
* @see https://infra.spec.whatwg.org/#ascii-whitespace
|
|
121
|
+
*/
|
|
122
|
+
Token.whitespace = ['\u0009', '\u000A', '\u000C', '\u000D', '\u0020'];
|
|
123
|
+
/**
|
|
124
|
+
* @see https://github.com/csstree/csstree/blob/master/lib/tokenizer/types.js
|
|
125
|
+
*/
|
|
126
|
+
Token.Ident = 1;
|
|
127
|
+
Token.WhiteSpace = 13;
|
|
128
|
+
Token.Comma = 18;
|
package/lib/types.d.ts
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { cssSyntaxMatch } from './css-syntax';
|
|
2
|
+
export type { Type, List, Enum, CssSyntax, KeywordDefinedType, Number } from './types.schema';
|
|
3
|
+
export declare type Result = UnmatchedResult | MatchedResult;
|
|
4
|
+
export declare type UnmatchedResult = {
|
|
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
|
+
} & UnmatchedResultOptions;
|
|
15
|
+
export declare type UnmatchedResultOptions = {
|
|
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;
|
|
35
|
+
};
|
|
36
|
+
export declare type MatchedResult = {
|
|
37
|
+
matched: true;
|
|
38
|
+
};
|
|
39
|
+
export declare type Expect = {
|
|
40
|
+
type: 'const' | 'format' | 'syntax' | 'regxp' | 'common';
|
|
41
|
+
value: string;
|
|
42
|
+
};
|
|
43
|
+
export declare type FormattedPrimitiveTypeCheck = (value: string) => boolean;
|
|
44
|
+
export declare type FormattedPrimitiveTypeCreator<O = never> = (options?: O) => FormattedPrimitiveTypeCheck;
|
|
45
|
+
export declare type Defs = Record<string, CustomCssSyntax | CustomSyntax>;
|
|
46
|
+
export declare type CustomSyntax = {
|
|
47
|
+
ref: string;
|
|
48
|
+
expects?: Expect[];
|
|
49
|
+
is: CustomSyntaxCheck;
|
|
50
|
+
};
|
|
51
|
+
export declare type CustomSyntaxCheck = (value: string) => Result;
|
|
52
|
+
export declare type CustomSyntaxChecker<O = {}> = (options?: O) => CustomSyntaxCheck;
|
|
53
|
+
export declare type CustomCssSyntax = {
|
|
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
|
+
};
|
|
69
|
+
};
|
|
70
|
+
export declare type CSSSyntaxToken = {
|
|
71
|
+
type: number;
|
|
72
|
+
value: string;
|
|
73
|
+
index: number;
|
|
74
|
+
balance: number;
|
|
75
|
+
node?: any;
|
|
76
|
+
};
|
|
77
|
+
export declare type CssSyntaxTokenizer = (token: CSSSyntaxToken | null, getNextToken: GetNextToken, match: typeof cssSyntaxMatch) => number;
|
|
78
|
+
export declare type GetNextToken = (length: number) => CSSSyntaxToken | null;
|
package/lib/types.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was automatically generated by json-schema-to-typescript.
|
|
3
|
+
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
4
|
+
* and run json-schema-to-typescript to regenerate this file.
|
|
5
|
+
*/
|
|
6
|
+
export declare type Type = KeywordDefinedType | List | Enum | Number;
|
|
7
|
+
export declare type KeywordDefinedType = CssSyntax | ExtendedType | HtmlAttrRequirement;
|
|
8
|
+
export declare type CssSyntax = "<'--*'>" | "<'-ms-accelerator'>" | "<'-ms-block-progression'>" | "<'-ms-content-zoom-chaining'>" | "<'-ms-content-zooming'>" | "<'-ms-content-zoom-limit'>" | "<'-ms-content-zoom-limit-max'>" | "<'-ms-content-zoom-limit-min'>" | "<'-ms-content-zoom-snap'>" | "<'-ms-content-zoom-snap-points'>" | "<'-ms-content-zoom-snap-type'>" | "<'-ms-filter'>" | "<'-ms-flow-from'>" | "<'-ms-flow-into'>" | "<'-ms-grid-columns'>" | "<'-ms-grid-rows'>" | "<'-ms-high-contrast-adjust'>" | "<'-ms-hyphenate-limit-chars'>" | "<'-ms-hyphenate-limit-lines'>" | "<'-ms-hyphenate-limit-zone'>" | "<'-ms-ime-align'>" | "<'-ms-overflow-style'>" | "<'-ms-scrollbar-3dlight-color'>" | "<'-ms-scrollbar-arrow-color'>" | "<'-ms-scrollbar-base-color'>" | "<'-ms-scrollbar-darkshadow-color'>" | "<'-ms-scrollbar-face-color'>" | "<'-ms-scrollbar-highlight-color'>" | "<'-ms-scrollbar-shadow-color'>" | "<'-ms-scrollbar-track-color'>" | "<'-ms-scroll-chaining'>" | "<'-ms-scroll-limit'>" | "<'-ms-scroll-limit-x-max'>" | "<'-ms-scroll-limit-x-min'>" | "<'-ms-scroll-limit-y-max'>" | "<'-ms-scroll-limit-y-min'>" | "<'-ms-scroll-rails'>" | "<'-ms-scroll-snap-points-x'>" | "<'-ms-scroll-snap-points-y'>" | "<'-ms-scroll-snap-type'>" | "<'-ms-scroll-snap-x'>" | "<'-ms-scroll-snap-y'>" | "<'-ms-scroll-translation'>" | "<'-ms-text-autospace'>" | "<'-ms-touch-select'>" | "<'-ms-user-select'>" | "<'-ms-wrap-flow'>" | "<'-ms-wrap-margin'>" | "<'-ms-wrap-through'>" | "<'-moz-appearance'>" | "<'-moz-binding'>" | "<'-moz-border-bottom-colors'>" | "<'-moz-border-left-colors'>" | "<'-moz-border-right-colors'>" | "<'-moz-border-top-colors'>" | "<'-moz-context-properties'>" | "<'-moz-float-edge'>" | "<'-moz-force-broken-image-icon'>" | "<'-moz-image-region'>" | "<'-moz-orient'>" | "<'-moz-outline-radius'>" | "<'-moz-outline-radius-bottomleft'>" | "<'-moz-outline-radius-bottomright'>" | "<'-moz-outline-radius-topleft'>" | "<'-moz-outline-radius-topright'>" | "<'-moz-stack-sizing'>" | "<'-moz-text-blink'>" | "<'-moz-user-focus'>" | "<'-moz-user-input'>" | "<'-moz-user-modify'>" | "<'-moz-window-dragging'>" | "<'-moz-window-shadow'>" | "<'-webkit-appearance'>" | "<'-webkit-border-before'>" | "<'-webkit-border-before-color'>" | "<'-webkit-border-before-style'>" | "<'-webkit-border-before-width'>" | "<'-webkit-box-reflect'>" | "<'-webkit-line-clamp'>" | "<'-webkit-mask'>" | "<'-webkit-mask-attachment'>" | "<'-webkit-mask-clip'>" | "<'-webkit-mask-composite'>" | "<'-webkit-mask-image'>" | "<'-webkit-mask-origin'>" | "<'-webkit-mask-position'>" | "<'-webkit-mask-position-x'>" | "<'-webkit-mask-position-y'>" | "<'-webkit-mask-repeat'>" | "<'-webkit-mask-repeat-x'>" | "<'-webkit-mask-repeat-y'>" | "<'-webkit-mask-size'>" | "<'-webkit-overflow-scrolling'>" | "<'-webkit-tap-highlight-color'>" | "<'-webkit-text-fill-color'>" | "<'-webkit-text-stroke'>" | "<'-webkit-text-stroke-color'>" | "<'-webkit-text-stroke-width'>" | "<'-webkit-touch-callout'>" | "<'-webkit-user-modify'>" | "<'align-content'>" | "<'align-items'>" | "<'align-self'>" | "<'align-tracks'>" | "<'all'>" | "<'animation'>" | "<'animation-delay'>" | "<'animation-direction'>" | "<'animation-duration'>" | "<'animation-fill-mode'>" | "<'animation-iteration-count'>" | "<'animation-name'>" | "<'animation-play-state'>" | "<'animation-timing-function'>" | "<'appearance'>" | "<'aspect-ratio'>" | "<'azimuth'>" | "<'backdrop-filter'>" | "<'backface-visibility'>" | "<'background'>" | "<'background-attachment'>" | "<'background-blend-mode'>" | "<'background-clip'>" | "<'background-color'>" | "<'background-image'>" | "<'background-origin'>" | "<'background-position'>" | "<'background-position-x'>" | "<'background-position-y'>" | "<'background-repeat'>" | "<'background-size'>" | "<'block-overflow'>" | "<'block-size'>" | "<'border'>" | "<'border-block'>" | "<'border-block-color'>" | "<'border-block-style'>" | "<'border-block-width'>" | "<'border-block-end'>" | "<'border-block-end-color'>" | "<'border-block-end-style'>" | "<'border-block-end-width'>" | "<'border-block-start'>" | "<'border-block-start-color'>" | "<'border-block-start-style'>" | "<'border-block-start-width'>" | "<'border-bottom'>" | "<'border-bottom-color'>" | "<'border-bottom-left-radius'>" | "<'border-bottom-right-radius'>" | "<'border-bottom-style'>" | "<'border-bottom-width'>" | "<'border-collapse'>" | "<'border-color'>" | "<'border-end-end-radius'>" | "<'border-end-start-radius'>" | "<'border-image'>" | "<'border-image-outset'>" | "<'border-image-repeat'>" | "<'border-image-slice'>" | "<'border-image-source'>" | "<'border-image-width'>" | "<'border-inline'>" | "<'border-inline-end'>" | "<'border-inline-color'>" | "<'border-inline-style'>" | "<'border-inline-width'>" | "<'border-inline-end-color'>" | "<'border-inline-end-style'>" | "<'border-inline-end-width'>" | "<'border-inline-start'>" | "<'border-inline-start-color'>" | "<'border-inline-start-style'>" | "<'border-inline-start-width'>" | "<'border-left'>" | "<'border-left-color'>" | "<'border-left-style'>" | "<'border-left-width'>" | "<'border-radius'>" | "<'border-right'>" | "<'border-right-color'>" | "<'border-right-style'>" | "<'border-right-width'>" | "<'border-spacing'>" | "<'border-start-end-radius'>" | "<'border-start-start-radius'>" | "<'border-style'>" | "<'border-top'>" | "<'border-top-color'>" | "<'border-top-left-radius'>" | "<'border-top-right-radius'>" | "<'border-top-style'>" | "<'border-top-width'>" | "<'border-width'>" | "<'bottom'>" | "<'box-align'>" | "<'box-decoration-break'>" | "<'box-direction'>" | "<'box-flex'>" | "<'box-flex-group'>" | "<'box-lines'>" | "<'box-ordinal-group'>" | "<'box-orient'>" | "<'box-pack'>" | "<'box-shadow'>" | "<'box-sizing'>" | "<'break-after'>" | "<'break-before'>" | "<'break-inside'>" | "<'caption-side'>" | "<'caret-color'>" | "<'clear'>" | "<'clip'>" | "<'clip-path'>" | "<'color'>" | "<'color-adjust'>" | "<'column-count'>" | "<'column-fill'>" | "<'column-gap'>" | "<'column-rule'>" | "<'column-rule-color'>" | "<'column-rule-style'>" | "<'column-rule-width'>" | "<'column-span'>" | "<'column-width'>" | "<'columns'>" | "<'contain'>" | "<'content'>" | "<'counter-increment'>" | "<'counter-reset'>" | "<'counter-set'>" | "<'cursor'>" | "<'direction'>" | "<'display'>" | "<'empty-cells'>" | "<'filter'>" | "<'flex'>" | "<'flex-basis'>" | "<'flex-direction'>" | "<'flex-flow'>" | "<'flex-grow'>" | "<'flex-shrink'>" | "<'flex-wrap'>" | "<'float'>" | "<'font'>" | "<'font-family'>" | "<'font-feature-settings'>" | "<'font-kerning'>" | "<'font-language-override'>" | "<'font-optical-sizing'>" | "<'font-variation-settings'>" | "<'font-size'>" | "<'font-size-adjust'>" | "<'font-smooth'>" | "<'font-stretch'>" | "<'font-style'>" | "<'font-synthesis'>" | "<'font-variant'>" | "<'font-variant-alternates'>" | "<'font-variant-caps'>" | "<'font-variant-east-asian'>" | "<'font-variant-ligatures'>" | "<'font-variant-numeric'>" | "<'font-variant-position'>" | "<'font-weight'>" | "<'gap'>" | "<'grid'>" | "<'grid-area'>" | "<'grid-auto-columns'>" | "<'grid-auto-flow'>" | "<'grid-auto-rows'>" | "<'grid-column'>" | "<'grid-column-end'>" | "<'grid-column-gap'>" | "<'grid-column-start'>" | "<'grid-gap'>" | "<'grid-row'>" | "<'grid-row-end'>" | "<'grid-row-gap'>" | "<'grid-row-start'>" | "<'grid-template'>" | "<'grid-template-areas'>" | "<'grid-template-columns'>" | "<'grid-template-rows'>" | "<'hanging-punctuation'>" | "<'height'>" | "<'hyphens'>" | "<'image-orientation'>" | "<'image-rendering'>" | "<'image-resolution'>" | "<'ime-mode'>" | "<'initial-letter'>" | "<'initial-letter-align'>" | "<'inline-size'>" | "<'inset'>" | "<'inset-block'>" | "<'inset-block-end'>" | "<'inset-block-start'>" | "<'inset-inline'>" | "<'inset-inline-end'>" | "<'inset-inline-start'>" | "<'isolation'>" | "<'justify-content'>" | "<'justify-items'>" | "<'justify-self'>" | "<'justify-tracks'>" | "<'left'>" | "<'letter-spacing'>" | "<'line-break'>" | "<'line-clamp'>" | "<'line-height'>" | "<'line-height-step'>" | "<'list-style'>" | "<'list-style-image'>" | "<'list-style-position'>" | "<'list-style-type'>" | "<'margin'>" | "<'margin-block'>" | "<'margin-block-end'>" | "<'margin-block-start'>" | "<'margin-bottom'>" | "<'margin-inline'>" | "<'margin-inline-end'>" | "<'margin-inline-start'>" | "<'margin-left'>" | "<'margin-right'>" | "<'margin-top'>" | "<'margin-trim'>" | "<'mask'>" | "<'mask-border'>" | "<'mask-border-mode'>" | "<'mask-border-outset'>" | "<'mask-border-repeat'>" | "<'mask-border-slice'>" | "<'mask-border-source'>" | "<'mask-border-width'>" | "<'mask-clip'>" | "<'mask-composite'>" | "<'mask-image'>" | "<'mask-mode'>" | "<'mask-origin'>" | "<'mask-position'>" | "<'mask-repeat'>" | "<'mask-size'>" | "<'mask-type'>" | "<'masonry-auto-flow'>" | "<'math-style'>" | "<'max-block-size'>" | "<'max-height'>" | "<'max-inline-size'>" | "<'max-lines'>" | "<'max-width'>" | "<'min-block-size'>" | "<'min-height'>" | "<'min-inline-size'>" | "<'min-width'>" | "<'mix-blend-mode'>" | "<'object-fit'>" | "<'object-position'>" | "<'offset'>" | "<'offset-anchor'>" | "<'offset-distance'>" | "<'offset-path'>" | "<'offset-position'>" | "<'offset-rotate'>" | "<'opacity'>" | "<'order'>" | "<'orphans'>" | "<'outline'>" | "<'outline-color'>" | "<'outline-offset'>" | "<'outline-style'>" | "<'outline-width'>" | "<'overflow'>" | "<'overflow-anchor'>" | "<'overflow-block'>" | "<'overflow-clip-box'>" | "<'overflow-inline'>" | "<'overflow-wrap'>" | "<'overflow-x'>" | "<'overflow-y'>" | "<'overscroll-behavior'>" | "<'overscroll-behavior-block'>" | "<'overscroll-behavior-inline'>" | "<'overscroll-behavior-x'>" | "<'overscroll-behavior-y'>" | "<'padding'>" | "<'padding-block'>" | "<'padding-block-end'>" | "<'padding-block-start'>" | "<'padding-bottom'>" | "<'padding-inline'>" | "<'padding-inline-end'>" | "<'padding-inline-start'>" | "<'padding-left'>" | "<'padding-right'>" | "<'padding-top'>" | "<'page-break-after'>" | "<'page-break-before'>" | "<'page-break-inside'>" | "<'paint-order'>" | "<'perspective'>" | "<'perspective-origin'>" | "<'place-content'>" | "<'place-items'>" | "<'place-self'>" | "<'pointer-events'>" | "<'position'>" | "<'quotes'>" | "<'resize'>" | "<'right'>" | "<'rotate'>" | "<'row-gap'>" | "<'ruby-align'>" | "<'ruby-merge'>" | "<'ruby-position'>" | "<'scale'>" | "<'scrollbar-color'>" | "<'scrollbar-gutter'>" | "<'scrollbar-width'>" | "<'scroll-behavior'>" | "<'scroll-margin'>" | "<'scroll-margin-block'>" | "<'scroll-margin-block-start'>" | "<'scroll-margin-block-end'>" | "<'scroll-margin-bottom'>" | "<'scroll-margin-inline'>" | "<'scroll-margin-inline-start'>" | "<'scroll-margin-inline-end'>" | "<'scroll-margin-left'>" | "<'scroll-margin-right'>" | "<'scroll-margin-top'>" | "<'scroll-padding'>" | "<'scroll-padding-block'>" | "<'scroll-padding-block-start'>" | "<'scroll-padding-block-end'>" | "<'scroll-padding-bottom'>" | "<'scroll-padding-inline'>" | "<'scroll-padding-inline-start'>" | "<'scroll-padding-inline-end'>" | "<'scroll-padding-left'>" | "<'scroll-padding-right'>" | "<'scroll-padding-top'>" | "<'scroll-snap-align'>" | "<'scroll-snap-coordinate'>" | "<'scroll-snap-destination'>" | "<'scroll-snap-points-x'>" | "<'scroll-snap-points-y'>" | "<'scroll-snap-stop'>" | "<'scroll-snap-type'>" | "<'scroll-snap-type-x'>" | "<'scroll-snap-type-y'>" | "<'shape-image-threshold'>" | "<'shape-margin'>" | "<'shape-outside'>" | "<'tab-size'>" | "<'table-layout'>" | "<'text-align'>" | "<'text-align-last'>" | "<'text-combine-upright'>" | "<'text-decoration'>" | "<'text-decoration-color'>" | "<'text-decoration-line'>" | "<'text-decoration-skip'>" | "<'text-decoration-skip-ink'>" | "<'text-decoration-style'>" | "<'text-decoration-thickness'>" | "<'text-emphasis'>" | "<'text-emphasis-color'>" | "<'text-emphasis-position'>" | "<'text-emphasis-style'>" | "<'text-indent'>" | "<'text-justify'>" | "<'text-orientation'>" | "<'text-overflow'>" | "<'text-rendering'>" | "<'text-shadow'>" | "<'text-size-adjust'>" | "<'text-transform'>" | "<'text-underline-offset'>" | "<'text-underline-position'>" | "<'top'>" | "<'touch-action'>" | "<'transform'>" | "<'transform-box'>" | "<'transform-origin'>" | "<'transform-style'>" | "<'transition'>" | "<'transition-delay'>" | "<'transition-duration'>" | "<'transition-property'>" | "<'transition-timing-function'>" | "<'translate'>" | "<'unicode-bidi'>" | "<'user-select'>" | "<'vertical-align'>" | "<'visibility'>" | "<'white-space'>" | "<'widows'>" | "<'width'>" | "<'will-change'>" | "<'word-break'>" | "<'word-spacing'>" | "<'word-wrap'>" | "<'writing-mode'>" | "<'z-index'>" | "<'zoom'>" | "<'-moz-background-clip'>" | "<'-moz-border-radius-bottomleft'>" | "<'-moz-border-radius-bottomright'>" | "<'-moz-border-radius-topleft'>" | "<'-moz-border-radius-topright'>" | "<'-moz-control-character-visibility'>" | "<'-moz-osx-font-smoothing'>" | "<'-moz-user-select'>" | "<'-ms-flex-align'>" | "<'-ms-flex-item-align'>" | "<'-ms-flex-line-pack'>" | "<'-ms-flex-negative'>" | "<'-ms-flex-pack'>" | "<'-ms-flex-order'>" | "<'-ms-flex-positive'>" | "<'-ms-flex-preferred-size'>" | "<'-ms-interpolation-mode'>" | "<'-ms-grid-column-align'>" | "<'-ms-grid-row-align'>" | "<'-ms-hyphenate-limit-last'>" | "<'-webkit-background-clip'>" | "<'-webkit-column-break-after'>" | "<'-webkit-column-break-before'>" | "<'-webkit-column-break-inside'>" | "<'-webkit-font-smoothing'>" | "<'-webkit-mask-box-image'>" | "<'-webkit-print-color-adjust'>" | "<'-webkit-text-security'>" | "<'-webkit-user-drag'>" | "<'-webkit-user-select'>" | "<'alignment-baseline'>" | "<'baseline-shift'>" | "<'behavior'>" | "<'clip-rule'>" | "<'cue'>" | "<'cue-after'>" | "<'cue-before'>" | "<'dominant-baseline'>" | "<'fill'>" | "<'fill-opacity'>" | "<'fill-rule'>" | "<'glyph-orientation-horizontal'>" | "<'glyph-orientation-vertical'>" | "<'kerning'>" | "<'marker'>" | "<'marker-end'>" | "<'marker-mid'>" | "<'marker-start'>" | "<'pause'>" | "<'pause-after'>" | "<'pause-before'>" | "<'rest'>" | "<'rest-after'>" | "<'rest-before'>" | "<'shape-rendering'>" | "<'src'>" | "<'speak'>" | "<'speak-as'>" | "<'stroke'>" | "<'stroke-dasharray'>" | "<'stroke-dashoffset'>" | "<'stroke-linecap'>" | "<'stroke-linejoin'>" | "<'stroke-miterlimit'>" | "<'stroke-opacity'>" | "<'stroke-width'>" | "<'text-anchor'>" | "<'unicode-range'>" | "<'voice-balance'>" | "<'voice-duration'>" | "<'voice-family'>" | "<'voice-pitch'>" | "<'voice-range'>" | "<'voice-rate'>" | "<'voice-stress'>" | "<'voice-volume'>" | '<absolute-size>' | '<alpha-value>' | '<angle-percentage>' | '<angular-color-hint>' | '<angular-color-stop>' | '<angular-color-stop-list>' | '<animateable-feature>' | '<attachment>' | '<attr()>' | '<attr-matcher>' | '<attr-modifier>' | '<attribute-selector>' | '<auto-repeat>' | '<auto-track-list>' | '<baseline-position>' | '<basic-shape>' | '<bg-image>' | '<bg-layer>' | '<bg-position>' | '<bg-size>' | '<blur()>' | '<blend-mode>' | '<box>' | '<brightness()>' | '<calc()>' | '<calc-sum>' | '<calc-product>' | '<calc-value>' | '<cf-final-image>' | '<cf-mixing-image>' | '<circle()>' | '<clamp()>' | '<class-selector>' | '<clip-source>' | '<color>' | '<color-stop>' | '<color-stop-angle>' | '<color-stop-length>' | '<color-stop-list>' | '<combinator>' | '<common-lig-values>' | '<compat-auto>' | '<composite-style>' | '<compositing-operator>' | '<compound-selector>' | '<compound-selector-list>' | '<complex-selector>' | '<complex-selector-list>' | '<conic-gradient()>' | '<contextual-alt-values>' | '<content-distribution>' | '<content-list>' | '<content-position>' | '<content-replacement>' | '<contrast()>' | '<counter()>' | '<counter-style>' | '<counter-style-name>' | '<counters()>' | '<cross-fade()>' | '<cubic-bezier-timing-function>' | '<deprecated-system-color>' | '<discretionary-lig-values>' | '<display-box>' | '<display-inside>' | '<display-internal>' | '<display-legacy>' | '<display-listitem>' | '<display-outside>' | '<drop-shadow()>' | '<east-asian-variant-values>' | '<east-asian-width-values>' | '<element()>' | '<ellipse()>' | '<ending-shape>' | '<env()>' | '<explicit-track-list>' | '<family-name>' | '<feature-tag-value>' | '<feature-type>' | '<feature-value-block>' | '<feature-value-block-list>' | '<feature-value-declaration>' | '<feature-value-declaration-list>' | '<feature-value-name>' | '<fill-rule>' | '<filter-function>' | '<filter-function-list>' | '<final-bg-layer>' | '<fit-content()>' | '<fixed-breadth>' | '<fixed-repeat>' | '<fixed-size>' | '<font-stretch-absolute>' | '<font-variant-css21>' | '<font-weight-absolute>' | '<frequency-percentage>' | '<general-enclosed>' | '<generic-family>' | '<generic-name>' | '<geometry-box>' | '<gradient>' | '<grayscale()>' | '<grid-line>' | '<historical-lig-values>' | '<hsl()>' | '<hsla()>' | '<hue>' | '<hue-rotate()>' | '<id-selector>' | '<image>' | '<image()>' | '<image-set()>' | '<image-set-option>' | '<image-src>' | '<image-tags>' | '<inflexible-breadth>' | '<inset()>' | '<invert()>' | '<keyframes-name>' | '<keyframe-block>' | '<keyframe-block-list>' | '<keyframe-selector>' | '<leader()>' | '<leader-type>' | '<length-percentage>' | '<line-names>' | '<line-name-list>' | '<line-style>' | '<line-width>' | '<linear-color-hint>' | '<linear-color-stop>' | '<linear-gradient()>' | '<mask-layer>' | '<mask-position>' | '<mask-reference>' | '<mask-source>' | '<masking-mode>' | '<matrix()>' | '<matrix3d()>' | '<max()>' | '<media-and>' | '<media-condition>' | '<media-condition-without-or>' | '<media-feature>' | '<media-in-parens>' | '<media-not>' | '<media-or>' | '<media-query>' | '<media-query-list>' | '<media-type>' | '<mf-boolean>' | '<mf-name>' | '<mf-plain>' | '<mf-range>' | '<mf-value>' | '<min()>' | '<minmax()>' | '<named-color>' | '<namespace-prefix>' | '<ns-prefix>' | '<number-percentage>' | '<numeric-figure-values>' | '<numeric-fraction-values>' | '<numeric-spacing-values>' | '<nth>' | '<opacity()>' | '<overflow-position>' | '<outline-radius>' | '<page-body>' | '<page-margin-box>' | '<page-margin-box-type>' | '<page-selector-list>' | '<page-selector>' | '<path()>' | '<paint()>' | '<perspective()>' | '<polygon()>' | '<position>' | '<pseudo-class-selector>' | '<pseudo-element-selector>' | '<pseudo-page>' | '<quote>' | '<radial-gradient()>' | '<relative-selector>' | '<relative-selector-list>' | '<relative-size>' | '<repeat-style>' | '<repeating-linear-gradient()>' | '<repeating-radial-gradient()>' | '<rgb()>' | '<rgba()>' | '<rotate()>' | '<rotate3d()>' | '<rotateX()>' | '<rotateY()>' | '<rotateZ()>' | '<saturate()>' | '<scale()>' | '<scale3d()>' | '<scaleX()>' | '<scaleY()>' | '<scaleZ()>' | '<self-position>' | '<shape-radius>' | '<skew()>' | '<skewX()>' | '<skewY()>' | '<sepia()>' | '<shadow>' | '<shadow-t>' | '<shape>' | '<shape-box>' | '<side-or-corner>' | '<single-animation>' | '<single-animation-direction>' | '<single-animation-fill-mode>' | '<single-animation-iteration-count>' | '<single-animation-play-state>' | '<single-transition>' | '<single-transition-property>' | '<size>' | '<step-position>' | '<step-timing-function>' | '<subclass-selector>' | '<supports-condition>' | '<supports-in-parens>' | '<supports-feature>' | '<supports-decl>' | '<supports-selector-fn>' | '<symbol>' | '<target>' | '<target-counter()>' | '<target-counters()>' | '<target-text()>' | '<time-percentage>' | '<timing-function>' | '<track-breadth>' | '<track-list>' | '<track-repeat>' | '<track-size>' | '<transform-function>' | '<transform-list>' | '<translate()>' | '<translate3d()>' | '<translateX()>' | '<translateY()>' | '<translateZ()>' | '<type-or-unit>' | '<type-selector>' | '<var()>' | '<viewport-length>' | '<wq-name>' | '<-legacy-gradient>' | '<-legacy-linear-gradient>' | '<-legacy-repeating-linear-gradient>' | '<-legacy-linear-gradient-arguments>' | '<-legacy-radial-gradient>' | '<-legacy-repeating-radial-gradient>' | '<-legacy-radial-gradient-arguments>' | '<-legacy-radial-gradient-size>' | '<-legacy-radial-gradient-shape>' | '<-non-standard-font>' | '<-non-standard-color>' | '<-non-standard-image-rendering>' | '<-non-standard-overflow>' | '<-non-standard-width>' | '<-webkit-gradient()>' | '<-webkit-gradient-color-stop>' | '<-webkit-gradient-point>' | '<-webkit-gradient-radius>' | '<-webkit-gradient-type>' | '<-webkit-mask-box-repeat>' | '<-webkit-mask-clip-style>' | '<-ms-filter-function-list>' | '<-ms-filter-function>' | '<-ms-filter-function-progid>' | '<-ms-filter-function-legacy>' | '<-ms-filter>' | '<age>' | '<attr-name>' | '<attr-fallback>' | '<border-radius>' | '<bottom>' | '<generic-voice>' | '<gender>' | '<left>' | '<mask-image>' | '<name-repeat>' | '<paint>' | '<page-size>' | '<ratio>' | '<right>' | '<svg-length>' | '<svg-writing-mode>' | '<top>' | '<track-group>' | '<track-list-v0>' | '<track-minmax>' | '<x>' | '<y>' | '<declaration>' | '<declaration-list>' | '<url>' | '<url-modifier>' | '<number-zero-one>' | '<number-one-or-greater>' | '<positive-integer>' | '<-non-standard-display>' | '<ident-token>' | '<function-token>' | '<at-keyword-token>' | '<hash-token>' | '<string-token>' | '<bad-string-token>' | '<url-token>' | '<bad-url-token>' | '<delim-token>' | '<number-token>' | '<percentage-token>' | '<dimension-token>' | '<whitespace-token>' | '<CDO-token>' | '<CDC-token>' | '<colon-token>' | '<semicolon-token>' | '<comma-token>' | '<[-token>' | '<]-token>' | '<(-token>' | '<)-token>' | '<{-token>' | '<}-token>' | '<string>' | '<ident>' | '<custom-ident>' | '<custom-property-name>' | '<hex-color>' | '<an-plus-b>' | '<urange>' | '<declaration-value>' | '<any-value>' | '<dimension>' | '<angle>' | '<decibel>' | '<frequency>' | '<flex>' | '<length>' | '<resolution>' | '<semitones>' | '<time>' | '<percentage>' | '<zero>' | '<number>' | '<integer>' | '<-ms-legacy-expression>' | '<bcp-47>';
|
|
9
|
+
export declare type ExtendedType = 'Any' | 'NoEmptyAny' | 'OneLineAny' | 'Zero' | 'Number' | 'Int' | 'Uint' | 'XMLName' | 'DOMID' | 'FunctionBody' | 'Pattern' | 'DateTime' | 'TabIndex' | 'BCP47' | 'URL' | 'AbsoluteURL' | 'HashName' | 'OneCodePointChar' | 'CustomElementName' | 'BrowsingContextName' | 'BrowsingContextNameOrKeyword' | 'HTTPSchemaURL' | 'MIMEType' | 'ItemProp' | 'Srcset' | 'SourceSizeList' | 'IconSize' | 'AutoComplete' | 'Accept' | 'SerializedPermissionsPolicy' | '<css-declaration-list>' | '<class-list>' | '<svg-font-size>' | '<svg-font-size-adjust>' | "<'color-profile'>" | "<'color-rendering'>" | "<'enable-background'>" | '<list-of-svg-feature-string>' | '<animatable-value>' | '<begin-value-list>' | '<end-value-list>' | '<list-of-value>' | '<clock-value>' | '<color-matrix>' | '<dasharray>' | '<key-points>' | '<key-splines>' | '<key-times>' | '<system-language>' | '<list-of-lengths>' | '<list-of-numbers>' | '<number-optional-number>' | '<origin>' | '<svg-path>' | '<list-of-percentages>' | '<points>' | '<preserve-aspect-ratio>' | '<view-box>' | '<rotate>' | '<text-coordinate>';
|
|
10
|
+
export declare type HtmlAttrRequirement = 'Boolean';
|
|
11
|
+
export interface TypesSchema {
|
|
12
|
+
type?: Type;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* - [Space-separated tokens](https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#space-separated-tokens)
|
|
16
|
+
* - [Comma-separated tokens](https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#comma-separated-tokens)
|
|
17
|
+
*/
|
|
18
|
+
export interface List {
|
|
19
|
+
token: ExtendedType | Enum;
|
|
20
|
+
disallowToSurroundBySpaces?: boolean;
|
|
21
|
+
allowEmpty?: boolean;
|
|
22
|
+
ordered?: boolean;
|
|
23
|
+
unique?: boolean;
|
|
24
|
+
caseInsensitive?: boolean;
|
|
25
|
+
number?: ('zeroOrMore' | 'oneOrMore') | {
|
|
26
|
+
min: number;
|
|
27
|
+
max: number;
|
|
28
|
+
};
|
|
29
|
+
separator: 'space' | 'comma';
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* [Enumerated attributes](https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#enumerated-attribute)
|
|
33
|
+
*/
|
|
34
|
+
export interface Enum {
|
|
35
|
+
enum: [string, ...string[]];
|
|
36
|
+
disallowToSurroundBySpaces?: boolean;
|
|
37
|
+
caseInsensitive?: boolean;
|
|
38
|
+
invalidValueDefault?: string;
|
|
39
|
+
missingValueDefault?: string;
|
|
40
|
+
sameStates?: {
|
|
41
|
+
[k: string]: unknown;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* [Numbers](https://html.spec.whatwg.org/dev/common-microsyntaxes.html#numbers)
|
|
46
|
+
*/
|
|
47
|
+
export interface Number {
|
|
48
|
+
type: 'float' | 'integer';
|
|
49
|
+
gt?: number;
|
|
50
|
+
gte?: number;
|
|
51
|
+
lt?: number;
|
|
52
|
+
lte?: number;
|
|
53
|
+
clampable?: boolean;
|
|
54
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/**
|
|
4
|
+
* This file was automatically generated by json-schema-to-typescript.
|
|
5
|
+
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
6
|
+
* and run json-schema-to-typescript to regenerate this file.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { CustomSyntaxChecker } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* @see https://w3c.github.io/webappsec-permissions-policy/#serialized-permissions-policy
|
|
4
|
+
*
|
|
5
|
+
* > Policy Directives in HTML attributes are represented as their
|
|
6
|
+
* > ASCII serialization, with the following ABNF:
|
|
7
|
+
* > ```abnf
|
|
8
|
+
* > serialized-permissions-policy = serialized-policy-directive *(";" serialized-policy-directive)
|
|
9
|
+
* > serialized-policy-directive = feature-identifier RWS allow-list
|
|
10
|
+
* > feature-identifier = 1*( ALPHA / DIGIT / "-")
|
|
11
|
+
* > allow-list = allow-list-value *(RWS allow-list-value)
|
|
12
|
+
* > allow-list-value = serialized-origin / "*" / "'self'" / "'src'" / "'none'"
|
|
13
|
+
* > ```
|
|
14
|
+
*/
|
|
15
|
+
export declare const checkSerializedPermissionsPolicy: CustomSyntaxChecker;
|