@markuplint/types 4.8.1 → 4.18.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/ARCHITECTURE.ja.md +252 -0
- package/ARCHITECTURE.md +252 -0
- package/CHANGELOG.md +14 -2
- package/README.md +37 -2
- package/SKILL.md +100 -0
- package/docs/check-pipeline.ja.md +494 -0
- package/docs/check-pipeline.md +494 -0
- package/docs/token-system.ja.md +584 -0
- package/docs/token-system.md +584 -0
- package/docs/type-system.ja.md +556 -0
- package/docs/type-system.md +556 -0
- package/docs/validators.ja.md +514 -0
- package/docs/validators.md +514 -0
- package/lib/check-base.d.ts +71 -0
- package/lib/check-base.js +71 -0
- package/lib/check-multi-types.d.ts +12 -1
- package/lib/check-multi-types.js +11 -0
- package/lib/check.d.ts +13 -0
- package/lib/check.js +13 -0
- package/lib/css-defs.d.ts +8 -0
- package/lib/css-defs.js +8 -0
- package/lib/css-overrides.d.ts +7 -0
- package/lib/css-overrides.js +7 -0
- package/lib/css-syntax.d.ts +11 -0
- package/lib/css-syntax.js +12 -1
- package/lib/css-tokenizers.d.ts +6 -0
- package/lib/css-tokenizers.js +6 -0
- package/lib/debug.d.ts +3 -0
- package/lib/debug.js +3 -0
- package/lib/defs.d.ts +8 -0
- package/lib/defs.js +8 -0
- package/lib/directive.d.ts +14 -0
- package/lib/directive.js +14 -0
- package/lib/enum.d.ts +11 -0
- package/lib/enum.js +11 -0
- package/lib/get-candidate.d.ts +11 -0
- package/lib/get-candidate.js +11 -0
- package/lib/index.d.ts +6 -0
- package/lib/index.js +6 -0
- package/lib/keyword-type.d.ts +13 -0
- package/lib/keyword-type.js +13 -0
- package/lib/list.d.ts +13 -0
- package/lib/list.js +13 -0
- package/lib/match-result.d.ts +22 -1
- package/lib/match-result.js +21 -0
- package/lib/number.d.ts +12 -0
- package/lib/number.js +12 -0
- package/lib/primitive/is-float.d.ts +4 -1
- package/lib/primitive/is-float.js +4 -1
- package/lib/primitive/is-int.d.ts +4 -1
- package/lib/primitive/is-int.js +4 -1
- package/lib/primitive/is-non-zero-uint.d.ts +3 -2
- package/lib/primitive/is-non-zero-uint.js +3 -2
- package/lib/primitive/is-quantity.d.ts +5 -3
- package/lib/primitive/is-quantity.js +5 -3
- package/lib/primitive/is-uint.d.ts +5 -1
- package/lib/primitive/is-uint.js +5 -1
- package/lib/primitive/range.d.ts +5 -4
- package/lib/primitive/range.js +5 -4
- package/lib/primitive/split-unit.d.ts +3 -2
- package/lib/primitive/split-unit.js +3 -2
- package/lib/rfc/is-bcp-47.d.ts +2 -0
- package/lib/rfc/is-bcp-47.js +2 -0
- package/lib/token/token-collection.d.ts +108 -3
- package/lib/token/token-collection.js +103 -3
- package/lib/token/token.d.ts +66 -2
- package/lib/token/token.js +66 -2
- package/lib/token/types.d.ts +9 -0
- package/lib/types.d.ts +107 -0
- package/lib/w3c/check-serialized-permissions-policy.d.ts +2 -0
- package/lib/w3c/check-serialized-permissions-policy.js +2 -0
- package/lib/whatwg/check-autocomplete.d.ts +5 -0
- package/lib/whatwg/check-autocomplete.js +6 -0
- package/lib/whatwg/check-datetime/date-string.d.ts +2 -0
- package/lib/whatwg/check-datetime/date-string.js +2 -0
- package/lib/whatwg/check-datetime/datetime-tokens.d.ts +13 -0
- package/lib/whatwg/check-datetime/datetime-tokens.js +13 -0
- package/lib/whatwg/check-datetime/duration-string.d.ts +7 -0
- package/lib/whatwg/check-datetime/duration-string.js +7 -0
- package/lib/whatwg/check-datetime/global-date-and-time-string.d.ts +2 -0
- package/lib/whatwg/check-datetime/global-date-and-time-string.js +2 -0
- package/lib/whatwg/check-datetime/index.d.ts +5 -0
- package/lib/whatwg/check-datetime/index.js +5 -0
- package/lib/whatwg/check-datetime/local-date-and-time-string.d.ts +4 -0
- package/lib/whatwg/check-datetime/local-date-and-time-string.js +4 -0
- package/lib/whatwg/check-datetime/month-string.d.ts +2 -0
- package/lib/whatwg/check-datetime/month-string.js +2 -0
- package/lib/whatwg/check-datetime/time-string.d.ts +2 -0
- package/lib/whatwg/check-datetime/time-string.js +2 -0
- package/lib/whatwg/check-datetime/time-zone-offset-string.d.ts +8 -0
- package/lib/whatwg/check-datetime/time-zone-offset-string.js +8 -0
- package/lib/whatwg/check-datetime/week-string.d.ts +2 -0
- package/lib/whatwg/check-datetime/week-string.js +2 -0
- package/lib/whatwg/check-datetime/year-string.d.ts +2 -0
- package/lib/whatwg/check-datetime/year-string.js +2 -0
- package/lib/whatwg/check-datetime/yearless-date-string.d.ts +2 -0
- package/lib/whatwg/check-datetime/yearless-date-string.js +2 -0
- package/lib/whatwg/check-link-type.d.ts +5 -1
- package/lib/whatwg/check-link-type.js +5 -1
- package/lib/whatwg/check-mime-type.d.ts +4 -1
- package/lib/whatwg/check-mime-type.js +5 -3
- package/lib/whatwg/is-abs-url.d.ts +2 -0
- package/lib/whatwg/is-abs-url.js +2 -0
- package/lib/whatwg/is-browser-context-name.d.ts +2 -2
- package/lib/whatwg/is-browser-context-name.js +2 -2
- package/lib/whatwg/is-custom-element-name.d.ts +1 -1
- package/lib/whatwg/is-custom-element-name.js +1 -1
- package/lib/whatwg/is-itemprop-name.d.ts +1 -0
- package/lib/whatwg/is-itemprop-name.js +1 -0
- package/lib/whatwg/is-navigable-target-name.d.ts +2 -0
- package/lib/whatwg/is-navigable-target-name.js +2 -0
- package/package.json +8 -8
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { CustomSyntaxChecker } from '../../types.js';
|
|
2
2
|
/**
|
|
3
|
+
* Validates a yearless date string in the format `MM-DD`.
|
|
4
|
+
*
|
|
3
5
|
* @see https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#yearless-dates
|
|
4
6
|
*/
|
|
5
7
|
export declare const checkYearlessDateString: CustomSyntaxChecker;
|
|
@@ -2,6 +2,8 @@ import { log } from '../../debug.js';
|
|
|
2
2
|
import { TokenCollection } from '../../token/index.js';
|
|
3
3
|
import { datetimeTokenCheck } from './datetime-tokens.js';
|
|
4
4
|
/**
|
|
5
|
+
* Validates a yearless date string in the format `MM-DD`.
|
|
6
|
+
*
|
|
5
7
|
* @see https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#yearless-dates
|
|
6
8
|
*/
|
|
7
9
|
export const checkYearlessDateString = () => function checkYearlessDateString(value) {
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type { CustomSyntaxChecker } from '../types.js';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Validates a link type attribute value against WHATWG and Microformats registries.
|
|
4
|
+
*
|
|
5
|
+
* Filters allowed keywords based on the element context (link, body link, a/area, or form).
|
|
6
|
+
* Rejects dropped, non-HTML, and rejected link types from the Microformats wiki.
|
|
7
|
+
*
|
|
4
8
|
* @see https://html.spec.whatwg.org/multipage/links.html#linkTypes
|
|
5
9
|
*/
|
|
6
10
|
export declare const checkLinkType: CustomSyntaxChecker<{
|
|
@@ -461,7 +461,11 @@ const ALLOWED_LINK_TYPE_MICROFORMATS = [
|
|
|
461
461
|
...DEF_LINK_TYPE_MICROFORMATS_DUBLIN_CORE,
|
|
462
462
|
].filter(def => !DEF_LINK_TYPE_WHATWG.some(whatwg => whatwg.keyword === def.keyword));
|
|
463
463
|
/**
|
|
464
|
-
*
|
|
464
|
+
* Validates a link type attribute value against WHATWG and Microformats registries.
|
|
465
|
+
*
|
|
466
|
+
* Filters allowed keywords based on the element context (link, body link, a/area, or form).
|
|
467
|
+
* Rejects dropped, non-HTML, and rejected link types from the Microformats wiki.
|
|
468
|
+
*
|
|
465
469
|
* @see https://html.spec.whatwg.org/multipage/links.html#linkTypes
|
|
466
470
|
*/
|
|
467
471
|
export const checkLinkType = options => value => {
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { CustomSyntaxChecker } from '../types.js';
|
|
2
2
|
/**
|
|
3
|
-
* MIME
|
|
3
|
+
* Validates a MIME type string according to the WHATWG MIME Sniffing specification.
|
|
4
|
+
*
|
|
5
|
+
* Optionally restricts to MIME types with no parameters.
|
|
6
|
+
*
|
|
4
7
|
* @see https://mimesniff.spec.whatwg.org/#valid-mime-type
|
|
5
8
|
*/
|
|
6
9
|
export declare const checkMIMEType: CustomSyntaxChecker<{
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import MIMEType from 'whatwg-mimetype';
|
|
1
|
+
import { MIMEType } from 'whatwg-mimetype';
|
|
3
2
|
import { matched, unmatched } from '../match-result.js';
|
|
4
3
|
import { Token } from '../token/index.js';
|
|
5
4
|
const expects = (withoutParameters) => [
|
|
@@ -9,7 +8,10 @@ const expects = (withoutParameters) => [
|
|
|
9
8
|
},
|
|
10
9
|
];
|
|
11
10
|
/**
|
|
12
|
-
* MIME
|
|
11
|
+
* Validates a MIME type string according to the WHATWG MIME Sniffing specification.
|
|
12
|
+
*
|
|
13
|
+
* Optionally restricts to MIME types with no parameters.
|
|
14
|
+
*
|
|
13
15
|
* @see https://mimesniff.spec.whatwg.org/#valid-mime-type
|
|
14
16
|
*/
|
|
15
17
|
export const checkMIMEType = options => value => {
|
package/lib/whatwg/is-abs-url.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { FormattedPrimitiveTypeCreator } from '../types.js';
|
|
2
2
|
/**
|
|
3
|
+
* Checks whether a string is a valid browsing context name.
|
|
3
4
|
*
|
|
4
5
|
* @see https://html.spec.whatwg.org/multipage/browsers.html#valid-browsing-context-name
|
|
5
6
|
*
|
|
@@ -7,7 +8,6 @@ import type { FormattedPrimitiveTypeCreator } from '../types.js';
|
|
|
7
8
|
* > that does not start with a U+005F LOW LINE character.
|
|
8
9
|
* > (Names starting with an underscore are reserved for special keywords.)
|
|
9
10
|
*
|
|
10
|
-
* @deprecated
|
|
11
|
-
*
|
|
11
|
+
* @deprecated Use {@link isNavigableTargetName} instead.
|
|
12
12
|
*/
|
|
13
13
|
export declare const isBrowserContextName: FormattedPrimitiveTypeCreator;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* Checks whether a string is a valid browsing context name.
|
|
2
3
|
*
|
|
3
4
|
* @see https://html.spec.whatwg.org/multipage/browsers.html#valid-browsing-context-name
|
|
4
5
|
*
|
|
@@ -6,8 +7,7 @@
|
|
|
6
7
|
* > that does not start with a U+005F LOW LINE character.
|
|
7
8
|
* > (Names starting with an underscore are reserved for special keywords.)
|
|
8
9
|
*
|
|
9
|
-
* @deprecated
|
|
10
|
-
*
|
|
10
|
+
* @deprecated Use {@link isNavigableTargetName} instead.
|
|
11
11
|
*/
|
|
12
12
|
export const isBrowserContextName = () => {
|
|
13
13
|
return value => {
|
|
@@ -11,7 +11,7 @@ const onlyPCENChar =
|
|
|
11
11
|
// eslint-disable-next-line no-misleading-character-class
|
|
12
12
|
/^[-.\d_a-z\u00B7\u00C0-\u00D6[\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u{10000}-\u{EFFFF}]*$/u;
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* Checks whether a string is a valid custom element name.
|
|
15
15
|
*
|
|
16
16
|
* > PotentialCustomElementName ::=
|
|
17
17
|
* > [a-z] (PCENChar)* '-' (PCENChar)*
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { FormattedPrimitiveTypeCreator } from '../types.js';
|
|
2
2
|
/**
|
|
3
|
+
* Checks whether a string is a valid navigable target name.
|
|
4
|
+
*
|
|
3
5
|
* @see https://html.spec.whatwg.org/multipage/document-sequences.html#valid-navigable-target-name
|
|
4
6
|
*
|
|
5
7
|
* > A valid navigable target name is any string with at least one character
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
*/
|
|
6
6
|
const TAB_OR_NEWLINE = /[\t\n\r]/;
|
|
7
7
|
/**
|
|
8
|
+
* Checks whether a string is a valid navigable target name.
|
|
9
|
+
*
|
|
8
10
|
* @see https://html.spec.whatwg.org/multipage/document-sequences.html#valid-navigable-target-name
|
|
9
11
|
*
|
|
10
12
|
* > A valid navigable target name is any string with at least one character
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@markuplint/types",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.18.0",
|
|
4
4
|
"description": "Type declaration and value checker",
|
|
5
5
|
"repository": "git@github.com:markuplint/markuplint.git",
|
|
6
6
|
"author": "Yusuke Hirao <yusukehirao@me.com>",
|
|
@@ -29,16 +29,16 @@
|
|
|
29
29
|
"schema:prettier": "npx prettier --write \"./src/types.schema.ts\" \"./types.schema.json\" --log-level warn"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@markuplint/shared": "4.
|
|
32
|
+
"@markuplint/shared": "4.18.0",
|
|
33
33
|
"@types/css-tree": "2.3.11",
|
|
34
|
-
"@types/debug": "4.1.
|
|
35
|
-
"@types/whatwg-mimetype": "
|
|
34
|
+
"@types/debug": "4.1.13",
|
|
35
|
+
"@types/whatwg-mimetype": "5.0.0",
|
|
36
36
|
"bcp-47": "2.1.0",
|
|
37
|
-
"css-tree": "3.1
|
|
37
|
+
"css-tree": "3.2.1",
|
|
38
38
|
"debug": "4.4.3",
|
|
39
39
|
"leven": "4.1.0",
|
|
40
|
-
"type-fest": "
|
|
41
|
-
"whatwg-mimetype": "
|
|
40
|
+
"type-fest": "5.6.0",
|
|
41
|
+
"whatwg-mimetype": "5.0.0"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "1885af6349def3f19df975b9e9c399dd47361de1"
|
|
44
44
|
}
|