@markuplint/rules 3.9.0 → 3.11.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.
Files changed (71) hide show
  1. package/lib/attr-check.d.ts +8 -19
  2. package/lib/attr-duplication/index.d.ts +1 -3
  3. package/lib/attr-value-quotes/index.d.ts +2 -2
  4. package/lib/case-sensitive-attr-name/index.d.ts +1 -1
  5. package/lib/case-sensitive-tag-name/index.d.ts +1 -1
  6. package/lib/character-reference/index.d.ts +1 -1
  7. package/lib/character-reference/index.js +1 -1
  8. package/lib/class-naming/index.d.ts +1 -1
  9. package/lib/create-message.d.ts +2 -12
  10. package/lib/deprecated-attr/index.d.ts +1 -3
  11. package/lib/deprecated-element/index.d.ts +1 -3
  12. package/lib/disallowed-element/index.d.ts +1 -1
  13. package/lib/doctype/index.d.ts +2 -2
  14. package/lib/end-tag/index.d.ts +1 -1
  15. package/lib/helpers.d.ts +16 -34
  16. package/lib/id-duplication/index.d.ts +1 -3
  17. package/lib/index.d.ts +99 -240
  18. package/lib/ineffective-attr/index.d.ts +1 -3
  19. package/lib/invalid-attr/index.d.ts +31 -38
  20. package/lib/label-has-control/index.d.ts +1 -3
  21. package/lib/landmark-roles/index.d.ts +3 -3
  22. package/lib/no-boolean-attr-value/index.d.ts +1 -3
  23. package/lib/no-default-value/index.d.ts +1 -3
  24. package/lib/no-empty-palpable-content/index.d.ts +3 -3
  25. package/lib/no-hard-code-id/index.d.ts +1 -3
  26. package/lib/no-refer-to-non-existent-id/index.d.ts +4 -9
  27. package/lib/no-use-event-handler-attr/index.d.ts +2 -2
  28. package/lib/permitted-contents/choice.d.ts +1 -7
  29. package/lib/permitted-contents/complex-branch.d.ts +1 -7
  30. package/lib/permitted-contents/count-pattern.d.ts +2 -17
  31. package/lib/permitted-contents/debug.browser.d.ts +15 -15
  32. package/lib/permitted-contents/debug.d.ts +1 -1
  33. package/lib/permitted-contents/index.d.ts +1 -1
  34. package/lib/permitted-contents/matches-selector.d.ts +1 -6
  35. package/lib/permitted-contents/order.d.ts +1 -7
  36. package/lib/permitted-contents/recursive-branch.d.ts +1 -7
  37. package/lib/permitted-contents/represent-transparent-nodes.d.ts +3 -7
  38. package/lib/permitted-contents/start.d.ts +1 -6
  39. package/lib/permitted-contents/types.d.ts +29 -29
  40. package/lib/permitted-contents/utils.d.ts +41 -90
  41. package/lib/placeholder-label-option/index.d.ts +1 -1
  42. package/lib/require-accessible-name/index.d.ts +2 -2
  43. package/lib/require-datetime/index.d.ts +2 -2
  44. package/lib/require-datetime/types.d.ts +2 -2
  45. package/lib/required-attr/index.d.ts +3 -3
  46. package/lib/required-element/index.d.ts +2 -2
  47. package/lib/required-h1/index.d.ts +3 -3
  48. package/lib/use-list/index.d.ts +2 -2
  49. package/lib/wai-aria/checkings/default-value.d.ts +3 -7
  50. package/lib/wai-aria/checkings/deprecated-props.d.ts +4 -8
  51. package/lib/wai-aria/checkings/disallowed-prop.d.ts +4 -8
  52. package/lib/wai-aria/checkings/implicit-props.d.ts +4 -8
  53. package/lib/wai-aria/checkings/no-global-prop.d.ts +3 -7
  54. package/lib/wai-aria/checkings/required-owned-elements.d.ts +3 -7
  55. package/lib/wai-aria/checkings/required-prop.d.ts +6 -12
  56. package/lib/wai-aria/checkings/value.d.ts +6 -15
  57. package/lib/wai-aria/index.d.ts +1 -1
  58. package/lib/wai-aria/types.d.ts +10 -10
  59. package/package.json +13 -13
  60. package/test/character-reference/index.spec.js +15 -0
  61. package/test/deprecated-element/index.spec.js +0 -13
  62. package/test/permitted-contents/index.spec.js +24 -0
  63. package/test/require-accessible-name/index.spec.js +21 -0
  64. package/lib/wai-aria/checkings/_.d.ts +0 -15
  65. package/lib/wai-aria/checkings/_.js +0 -27
  66. package/lib/wai-aria/checkings/required-prop copy.d.ts +0 -15
  67. package/lib/wai-aria/checkings/required-prop copy.js +0 -27
  68. package/lib/wai-aria/checkings/unadopted-explicit-roles.d.ts +0 -15
  69. package/lib/wai-aria/checkings/unadopted-explicit-roles.js +0 -17
  70. package/lib/xxx/index.d.ts +0 -2
  71. package/lib/xxx/index.js +0 -32
@@ -1,44 +1,37 @@
1
1
  import type { AttributeType } from '@markuplint/ml-spec';
2
2
  type Option = {
3
- /**
4
- * @since 3.7.0
5
- */
6
- allowAttrs?: (string | Attr)[] | Record<string, ValueRule>;
7
- /**
8
- * @since 3.7.0
9
- */
10
- disallowAttrs?: (string | Attr)[] | Record<string, ValueRule>;
11
- ignoreAttrNamePrefix?: string | string[];
12
- allowToAddPropertiesForPretender?: boolean;
13
- /**
14
- * @deprecated Since version 3.7.0. Use `allowAttrs` or `disallowAttrs` instead.
15
- * This option (`attr`) is now considered ambiguous and may lead to confusion.
16
- * Please use the more explicit `allowAttrs` or `disallowAttrs` option
17
- * to specify allowed attributes for the `invalid-attr` rule.
18
- * @see {@link Option.allowAttrs}
19
- * @see {@link Option.disallowAttrs}
20
- */
21
- attrs?: Record<
22
- string,
23
- | ValueRule
24
- | {
25
- disallowed: true;
26
- }
27
- >;
3
+ /**
4
+ * @since 3.7.0
5
+ */
6
+ allowAttrs?: (string | Attr)[] | Record<string, ValueRule>;
7
+ /**
8
+ * @since 3.7.0
9
+ */
10
+ disallowAttrs?: (string | Attr)[] | Record<string, ValueRule>;
11
+ ignoreAttrNamePrefix?: string | string[];
12
+ allowToAddPropertiesForPretender?: boolean;
13
+ /**
14
+ * @deprecated Since version 3.7.0. Use `allowAttrs` or `disallowAttrs` instead.
15
+ * This option (`attr`) is now considered ambiguous and may lead to confusion.
16
+ * Please use the more explicit `allowAttrs` or `disallowAttrs` option
17
+ * to specify allowed attributes for the `invalid-attr` rule.
18
+ * @see {@link Option.allowAttrs}
19
+ * @see {@link Option.disallowAttrs}
20
+ */
21
+ attrs?: Record<string, ValueRule | {
22
+ disallowed: true;
23
+ }>;
28
24
  };
29
25
  type Attr = {
30
- name: string;
31
- value: AttributeType | ValueRule;
26
+ name: string;
27
+ value: AttributeType | ValueRule;
32
28
  };
33
- type ValueRule =
34
- | {
35
- enum: [string, ...string[]];
36
- }
37
- | {
38
- pattern: string;
39
- }
40
- | {
41
- type: AttributeType;
42
- };
43
- declare const _default: Readonly<import('@markuplint/ml-core').RuleSeed<boolean, Option>>;
29
+ type ValueRule = {
30
+ enum: [string, ...string[]];
31
+ } | {
32
+ pattern: string;
33
+ } | {
34
+ type: AttributeType;
35
+ };
36
+ declare const _default: Readonly<import("@markuplint/ml-core").RuleSeed<boolean, Option>>;
44
37
  export default _default;
@@ -1,4 +1,2 @@
1
- declare const _default: Readonly<
2
- import('@markuplint/ml-core').RuleSeed<import('@markuplint/ml-core').RuleConfigValue, undefined>
3
- >;
1
+ declare const _default: Readonly<import("@markuplint/ml-core").RuleSeed<import("@markuplint/ml-core").RuleConfigValue, undefined>>;
4
2
  export default _default;
@@ -1,8 +1,8 @@
1
1
  type Options = {
2
- ignoreRoles: Roles[];
3
- labelEachArea: boolean;
2
+ ignoreRoles: Roles[];
3
+ labelEachArea: boolean;
4
4
  };
5
5
  type TopLevelRoles = 'banner' | 'main' | 'complementary' | 'contentinfo';
6
6
  type Roles = TopLevelRoles | 'form' | 'navigation' | 'region';
7
- declare const _default: Readonly<import('@markuplint/ml-core').RuleSeed<boolean, Options>>;
7
+ declare const _default: Readonly<import("@markuplint/ml-core").RuleSeed<boolean, Options>>;
8
8
  export default _default;
@@ -1,4 +1,2 @@
1
- declare const _default: Readonly<
2
- import('@markuplint/ml-core').RuleSeed<import('@markuplint/ml-core').RuleConfigValue, undefined>
3
- >;
1
+ declare const _default: Readonly<import("@markuplint/ml-core").RuleSeed<import("@markuplint/ml-core").RuleConfigValue, undefined>>;
4
2
  export default _default;
@@ -1,4 +1,2 @@
1
- declare const _default: Readonly<
2
- import('@markuplint/ml-core').RuleSeed<import('@markuplint/ml-core').RuleConfigValue, undefined>
3
- >;
1
+ declare const _default: Readonly<import("@markuplint/ml-core").RuleSeed<import("@markuplint/ml-core").RuleConfigValue, undefined>>;
4
2
  export default _default;
@@ -1,6 +1,6 @@
1
1
  type Options = {
2
- extendsExposableElements?: boolean;
3
- ignoreIfAriaBusy?: boolean;
2
+ extendsExposableElements?: boolean;
3
+ ignoreIfAriaBusy?: boolean;
4
4
  };
5
- declare const _default: Readonly<import('@markuplint/ml-core').RuleSeed<boolean, Options>>;
5
+ declare const _default: Readonly<import("@markuplint/ml-core").RuleSeed<boolean, Options>>;
6
6
  export default _default;
@@ -1,4 +1,2 @@
1
- declare const _default: Readonly<
2
- import('@markuplint/ml-core').RuleSeed<import('@markuplint/ml-core').RuleConfigValue, undefined>
3
- >;
1
+ declare const _default: Readonly<import("@markuplint/ml-core").RuleSeed<import("@markuplint/ml-core").RuleConfigValue, undefined>>;
4
2
  export default _default;
@@ -1,10 +1,5 @@
1
- declare const _default: Readonly<
2
- import('@markuplint/ml-core').RuleSeed<
3
- import('@markuplint/ml-core').RuleConfigValue,
4
- {
5
- ariaVersion: '1.1' | '1.2' | '1.3';
6
- fragmentRefersNameAttr: boolean;
7
- }
8
- >
9
- >;
1
+ declare const _default: Readonly<import("@markuplint/ml-core").RuleSeed<import("@markuplint/ml-core").RuleConfigValue, {
2
+ ariaVersion: "1.1" | "1.2" | "1.3";
3
+ fragmentRefersNameAttr: boolean;
4
+ }>>;
10
5
  export default _default;
@@ -1,5 +1,5 @@
1
1
  type Options = {
2
- ignore?: string | string[];
2
+ ignore?: string | string[];
3
3
  };
4
- declare const _default: Readonly<import('@markuplint/ml-core').RuleSeed<boolean, Options>>;
4
+ declare const _default: Readonly<import("@markuplint/ml-core").RuleSeed<boolean, Options>>;
5
5
  export default _default;
@@ -1,10 +1,4 @@
1
1
  import type { ChildNode, Options, Result, Specs } from './types';
2
2
  import type { PermittedContentChoice } from '@markuplint/ml-spec';
3
3
  import type { ReadonlyDeep } from 'type-fest';
4
- export declare function choice(
5
- pattern: ReadonlyDeep<PermittedContentChoice>,
6
- elements: readonly ChildNode[],
7
- specs: Specs,
8
- options: Options,
9
- depth: number,
10
- ): Result;
4
+ export declare function choice(pattern: ReadonlyDeep<PermittedContentChoice>, elements: readonly ChildNode[], specs: Specs, options: Options, depth: number): Result;
@@ -11,10 +11,4 @@ import type { ReadonlyDeep } from 'type-fest';
11
11
  * @param depth
12
12
  * @returns
13
13
  */
14
- export declare function complexBranch(
15
- pattern: ReadonlyDeep<PermittedContentPattern>,
16
- elements: readonly ChildNode[],
17
- specs: Specs,
18
- options: Options,
19
- depth: number,
20
- ): Result;
14
+ export declare function complexBranch(pattern: ReadonlyDeep<PermittedContentPattern>, elements: readonly ChildNode[], specs: Specs, options: Options, depth: number): Result;
@@ -1,10 +1,5 @@
1
1
  import type { ChildNode, Options, Result, Specs } from './types';
2
- import type {
3
- PermittedContentOneOrMore,
4
- PermittedContentOptional,
5
- PermittedContentRequire,
6
- PermittedContentZeroOrMore,
7
- } from '@markuplint/ml-spec';
2
+ import type { PermittedContentOneOrMore, PermittedContentOptional, PermittedContentRequire, PermittedContentZeroOrMore } from '@markuplint/ml-spec';
8
3
  import type { ReadonlyDeep } from 'type-fest';
9
4
  /**
10
5
  * Check count
@@ -16,14 +11,4 @@ import type { ReadonlyDeep } from 'type-fest';
16
11
  * @param depth
17
12
  * @returns
18
13
  */
19
- export declare function countPattern(
20
- pattern:
21
- | ReadonlyDeep<PermittedContentOneOrMore>
22
- | ReadonlyDeep<PermittedContentOptional>
23
- | ReadonlyDeep<PermittedContentRequire>
24
- | ReadonlyDeep<PermittedContentZeroOrMore>,
25
- elements: readonly ChildNode[],
26
- specs: Specs,
27
- options: Options,
28
- depth: number,
29
- ): Result;
14
+ export declare function countPattern(pattern: ReadonlyDeep<PermittedContentOneOrMore> | ReadonlyDeep<PermittedContentOptional> | ReadonlyDeep<PermittedContentRequire> | ReadonlyDeep<PermittedContentZeroOrMore>, elements: readonly ChildNode[], specs: Specs, options: Options, depth: number): Result;
@@ -1,30 +1,30 @@
1
1
  /// <reference types="debug" />
2
- export declare const cmLog: import('debug').Debugger;
2
+ export declare const cmLog: import("debug").Debugger;
3
3
  export declare const bgGreen: {
4
- (): void;
5
- bold(): void;
4
+ (): void;
5
+ bold(): void;
6
6
  };
7
7
  export declare const green: {
8
- (): void;
9
- bold(): void;
8
+ (): void;
9
+ bold(): void;
10
10
  };
11
11
  export declare const bgRed: {
12
- (): void;
13
- bold(): void;
12
+ (): void;
13
+ bold(): void;
14
14
  };
15
15
  export declare const bgBlue: {
16
- (): void;
17
- bold(): void;
16
+ (): void;
17
+ bold(): void;
18
18
  };
19
19
  export declare const blue: {
20
- (): void;
21
- bold(): void;
20
+ (): void;
21
+ bold(): void;
22
22
  };
23
23
  export declare const bgMagenta: {
24
- (): void;
25
- bold(): void;
24
+ (): void;
25
+ bold(): void;
26
26
  };
27
27
  export declare const cyan: {
28
- (): void;
29
- bold(): void;
28
+ (): void;
29
+ bold(): void;
30
30
  };
@@ -1,3 +1,3 @@
1
1
  /// <reference types="debug" />
2
- export declare const cmLog: import('debug').Debugger;
2
+ export declare const cmLog: import("debug").Debugger;
3
3
  export { bgGreen, green, bgRed, bgBlue, blue, bgMagenta, cyan } from 'ansi-colors';
@@ -1,3 +1,3 @@
1
1
  import type { Options, TagRule } from './types';
2
- declare const _default: Readonly<import('@markuplint/ml-core').RuleSeed<TagRule[], Options>>;
2
+ declare const _default: Readonly<import("@markuplint/ml-core").RuleSeed<TagRule[], Options>>;
3
3
  export default _default;
@@ -1,8 +1,3 @@
1
1
  import type { ChildNode, Result, Specs } from './types';
2
2
  export type SelectorResult = Result<'UNMATCHED_SELECTOR_BUT_MAY_EMPTY' | 'MISSING_NODE' | 'UNMATCHED_SELECTORS'>;
3
- export declare function matchesSelector(
4
- query: string,
5
- node: ChildNode | undefined,
6
- specs: Specs,
7
- depth: number,
8
- ): SelectorResult;
3
+ export declare function matchesSelector(query: string, node: ChildNode | undefined, specs: Specs, depth: number): SelectorResult;
@@ -11,10 +11,4 @@ import type { ReadonlyDeep } from 'type-fest';
11
11
  * @param depth
12
12
  * @returns
13
13
  */
14
- export declare function order(
15
- contents: ReadonlyDeep<PermittedContentPattern[]>,
16
- nodes: readonly ChildNode[],
17
- specs: Specs,
18
- options: Options,
19
- depth: number,
20
- ): Result;
14
+ export declare function order(contents: ReadonlyDeep<PermittedContentPattern[]>, nodes: readonly ChildNode[], specs: Specs, options: Options, depth: number): Result;
@@ -2,10 +2,4 @@ import type { SelectorResult } from './matches-selector';
2
2
  import type { ChildNode, Options, Specs } from './types';
3
3
  import type { PermittedContentPattern, Model } from '@markuplint/ml-spec';
4
4
  import type { ReadonlyDeep } from 'type-fest';
5
- export declare function recursiveBranch(
6
- model: ReadonlyDeep<Model | PermittedContentPattern[]>,
7
- nodes: readonly ChildNode[],
8
- specs: Specs,
9
- options: Options,
10
- depth: number,
11
- ): SelectorResult;
5
+ export declare function recursiveBranch(model: ReadonlyDeep<Model | PermittedContentPattern[]>, nodes: readonly ChildNode[], specs: Specs, options: Options, depth: number): SelectorResult;
@@ -1,10 +1,6 @@
1
1
  import type { ChildNode, Options, Result, Specs } from './types';
2
2
  export declare const transparentMode: Map<ChildNode, true>;
3
- export declare function representTransparentNodes(
4
- nodes: ChildNode[],
5
- specs: Specs,
6
- options: Options,
7
- ): {
8
- nodes: ChildNode[];
9
- errors: Result[];
3
+ export declare function representTransparentNodes(nodes: ChildNode[], specs: Specs, options: Options): {
4
+ nodes: ChildNode[];
5
+ errors: Result[];
10
6
  };
@@ -10,9 +10,4 @@ import type { ReadonlyDeep } from 'type-fest';
10
10
  * @param options
11
11
  * @returns
12
12
  */
13
- export declare function start(
14
- contents: ReadonlyDeep<ContentModel['contents']>,
15
- el: Element,
16
- specs: Specs,
17
- options: Options,
18
- ): ContentModelResult[];
13
+ export declare function start(contents: ReadonlyDeep<ContentModel['contents']>, el: Element, specs: Specs, options: Options): ContentModelResult[];
@@ -4,49 +4,49 @@ import type { ReadonlyDeep } from 'type-fest';
4
4
  export type Element = _Element<TagRule[], Options>;
5
5
  export type ChildNode = _ChildNode<TagRule[], Options>;
6
6
  export type Specs = {
7
- readonly cites: MLMLSpec['cites'];
8
- readonly def: MLMLSpec['def'];
9
- readonly specs: readonly {
10
- readonly name: string;
11
- readonly contentModel: {
12
- readonly contents: MLMLSpec['specs'][0]['contentModel']['contents'];
13
- };
14
- }[];
7
+ readonly cites: MLMLSpec['cites'];
8
+ readonly def: MLMLSpec['def'];
9
+ readonly specs: readonly {
10
+ readonly name: string;
11
+ readonly contentModel: {
12
+ readonly contents: MLMLSpec['specs'][0]['contentModel']['contents'];
13
+ };
14
+ }[];
15
15
  };
16
16
  export type ContentModelResult = {
17
- type: MatchedReason | UnmatchedReason;
18
- scope: ChildNode;
19
- query: Result['query'];
20
- hint: Result['hint'];
17
+ type: MatchedReason | UnmatchedReason;
18
+ scope: ChildNode;
19
+ query: Result['query'];
20
+ hint: Result['hint'];
21
21
  };
22
22
  export type Result<T extends string = MatchedReason> = {
23
- type: MatchedReason | UnmatchedReason | T;
24
- matched: ChildNode[];
25
- unmatched: ChildNode[];
26
- zeroMatch: boolean;
27
- query: string;
28
- hint: Hints;
23
+ type: MatchedReason | UnmatchedReason | T;
24
+ matched: ChildNode[];
25
+ unmatched: ChildNode[];
26
+ zeroMatch: boolean;
27
+ query: string;
28
+ hint: Hints;
29
29
  };
30
30
  export type Hints = {
31
- max?: number;
32
- not?: ChildNode;
33
- transparent?: Element;
34
- missing?: {
35
- barelyMatchedElements?: number;
36
- need?: string;
37
- };
31
+ max?: number;
32
+ not?: ChildNode;
33
+ transparent?: Element;
34
+ missing?: {
35
+ barelyMatchedElements?: number;
36
+ need?: string;
37
+ };
38
38
  };
39
39
  export type MatchedReason = 'MATCHED' | 'MATCHED_ZERO';
40
40
  export type UnmatchedReason = 'NOTHING' | 'UNEXPECTED_EXTRA_NODE' | 'TRANSPARENT_MODEL_DISALLOWS' | MissingNodeReason;
41
41
  export type MissingNodeReason = 'MISSING_NODE_REQUIRED' | 'MISSING_NODE_ONE_OR_MORE';
42
42
  export type RepeatSign = '' | '?' | '+' | '*' | `{${number},${number}}`;
43
43
  export type TransparentModel = {
44
- el: Element;
45
- additionalCondition: string;
44
+ el: Element;
45
+ additionalCondition: string;
46
46
  };
47
47
  export type TagRule = {
48
- readonly tag: string;
48
+ readonly tag: string;
49
49
  } & ReadonlyDeep<ContentModel>;
50
50
  export type Options = {
51
- readonly ignoreHasMutableChildren: boolean;
51
+ readonly ignoreHasMutableChildren: boolean;
52
52
  };
@@ -1,100 +1,51 @@
1
1
  import type { ChildNode, Element, Hints, MissingNodeReason, RepeatSign, Specs } from './types';
2
- import type {
3
- PermittedContentPattern,
4
- PermittedContentChoice,
5
- PermittedContentOneOrMore,
6
- PermittedContentOptional,
7
- PermittedContentRequire,
8
- PermittedContentTransparent,
9
- PermittedContentZeroOrMore,
10
- Model,
11
- } from '@markuplint/ml-spec';
2
+ import type { PermittedContentPattern, PermittedContentChoice, PermittedContentOneOrMore, PermittedContentOptional, PermittedContentRequire, PermittedContentTransparent, PermittedContentZeroOrMore, Model } from '@markuplint/ml-spec';
12
3
  import type { ReadonlyDeep } from 'type-fest';
13
4
  export declare function getChildNodesWithoutWhitespaces(el: Element): ChildNode[];
14
5
  export declare function isModel(model: ReadonlyDeep<Model | PermittedContentPattern[]>): model is ReadonlyDeep<Model>;
15
- export declare function matches(
16
- selector: string,
17
- node: ChildNode,
18
- specs: Specs,
19
- ):
20
- | {
21
- matched: boolean;
22
- not?: undefined;
23
- }
24
- | {
25
- matched: boolean;
26
- not: ChildNode | undefined;
27
- };
28
- export declare function isRequire(
29
- content: ReadonlyDeep<PermittedContentPattern>,
30
- ): content is ReadonlyDeep<PermittedContentRequire>;
31
- export declare function isOptional(
32
- content: ReadonlyDeep<PermittedContentPattern>,
33
- ): content is ReadonlyDeep<PermittedContentOptional>;
34
- export declare function isOneOrMore(
35
- content: ReadonlyDeep<PermittedContentPattern>,
36
- ): content is ReadonlyDeep<PermittedContentOneOrMore>;
37
- export declare function isZeroOrMore(
38
- content: ReadonlyDeep<PermittedContentPattern>,
39
- ): content is ReadonlyDeep<PermittedContentZeroOrMore>;
40
- export declare function isChoice(
41
- content: ReadonlyDeep<PermittedContentPattern>,
42
- ): content is ReadonlyDeep<PermittedContentChoice>;
43
- export declare function isTransparent(
44
- content: ReadonlyDeep<PermittedContentPattern>,
45
- ): content is ReadonlyDeep<PermittedContentTransparent>;
46
- export declare function normalizeModel(
47
- pattern:
48
- | ReadonlyDeep<PermittedContentRequire>
49
- | ReadonlyDeep<PermittedContentOptional>
50
- | ReadonlyDeep<PermittedContentOneOrMore>
51
- | ReadonlyDeep<PermittedContentZeroOrMore>,
52
- ): {
53
- model: ReadonlyDeep<PermittedContentPattern[] | Model>;
54
- min: number;
55
- max: number;
56
- repeat: RepeatSign;
57
- missingType: MissingNodeReason | undefined;
6
+ export declare function matches(selector: string, node: ChildNode, specs: Specs): {
7
+ matched: boolean;
8
+ not?: undefined;
9
+ } | {
10
+ matched: boolean;
11
+ not: ChildNode | undefined;
58
12
  };
59
- export declare function mergeHints(
60
- a: Readonly<Hints>,
61
- b: Readonly<Hints>,
62
- ): Partial<{
63
- missing:
64
- | Partial<{
65
- barelyMatchedElements?: number | undefined;
66
- need?: string | undefined;
67
- }>
68
- | undefined;
69
- max?: number | undefined;
70
- not?:
71
- | import('packages/@markuplint/ml-core/lib').DocumentType<
72
- import('./types').TagRule[],
73
- import('./types').Options
74
- >
75
- | import('packages/@markuplint/ml-core/lib/ml-dom/node/character-data').MLCharacterData<
76
- import('./types').TagRule[],
77
- import('./types').Options,
78
- import('packages/@markuplint/ml-ast/lib').MLASTAbstractNode
79
- >
80
- | import('packages/@markuplint/ml-core/lib').Element<import('./types').TagRule[], import('./types').Options>
81
- | import('packages/@markuplint/ml-core/lib').Block<import('./types').TagRule[], import('./types').Options>
82
- | undefined;
83
- transparent?: Element | undefined;
13
+ export declare function isRequire(content: ReadonlyDeep<PermittedContentPattern>): content is ReadonlyDeep<PermittedContentRequire>;
14
+ export declare function isOptional(content: ReadonlyDeep<PermittedContentPattern>): content is ReadonlyDeep<PermittedContentOptional>;
15
+ export declare function isOneOrMore(content: ReadonlyDeep<PermittedContentPattern>): content is ReadonlyDeep<PermittedContentOneOrMore>;
16
+ export declare function isZeroOrMore(content: ReadonlyDeep<PermittedContentPattern>): content is ReadonlyDeep<PermittedContentZeroOrMore>;
17
+ export declare function isChoice(content: ReadonlyDeep<PermittedContentPattern>): content is ReadonlyDeep<PermittedContentChoice>;
18
+ export declare function isTransparent(content: ReadonlyDeep<PermittedContentPattern>): content is ReadonlyDeep<PermittedContentTransparent>;
19
+ export declare function normalizeModel(pattern: ReadonlyDeep<PermittedContentRequire> | ReadonlyDeep<PermittedContentOptional> | ReadonlyDeep<PermittedContentOneOrMore> | ReadonlyDeep<PermittedContentZeroOrMore>): {
20
+ model: ReadonlyDeep<PermittedContentPattern[] | Model>;
21
+ min: number;
22
+ max: number;
23
+ repeat: RepeatSign;
24
+ missingType: MissingNodeReason | undefined;
25
+ };
26
+ export declare function mergeHints(a: Readonly<Hints>, b: Readonly<Hints>): Partial<{
27
+ missing: Partial<{
28
+ barelyMatchedElements?: number | undefined;
29
+ need?: string | undefined;
30
+ }> | undefined;
31
+ max?: number | undefined;
32
+ not?: ChildNode | undefined;
33
+ transparent?: Element | undefined;
84
34
  }>;
85
35
  export declare function cleanObject<T extends Object>(object: T): Partial<T>;
86
36
  export declare class Collection {
87
- #private;
88
- constructor(origin: readonly ChildNode[]);
89
- get matched(): ChildNode[];
90
- get matchedCount(): number;
91
- get nodes(): ChildNode[];
92
- get unmatched(): ChildNode[];
93
- addMatched(nodes: ChildNode[]): boolean;
94
- back(): void;
95
- lock(): void;
96
- max(max: number): void;
97
- toString(highlightExtraNodes?: boolean): string;
37
+ #private;
38
+ constructor(origin: readonly ChildNode[]);
39
+ get matched(): ChildNode[];
40
+ get matchedCount(): number;
41
+ get nodes(): ChildNode[];
42
+ get unmatched(): ChildNode[];
43
+ addMatched(nodes: ChildNode[]): boolean;
44
+ back(): void;
45
+ lock(): void;
46
+ max(max: number): void;
47
+ toString(highlightExtraNodes?: boolean): string;
48
+ }
49
+ export declare class UnsupportedError extends Error {
98
50
  }
99
- export declare class UnsupportedError extends Error {}
100
51
  export declare function modelLog(model: ReadonlyDeep<Model | PermittedContentPattern[]>, repeat: RepeatSign): string;
@@ -1,2 +1,2 @@
1
- declare const _default: Readonly<import('@markuplint/ml-core').RuleSeed<boolean, undefined>>;
1
+ declare const _default: Readonly<import("@markuplint/ml-core").RuleSeed<boolean, undefined>>;
2
2
  export default _default;
@@ -1,6 +1,6 @@
1
1
  import type { ARIAVersion } from '@markuplint/ml-spec';
2
2
  type Option = {
3
- ariaVersion: ARIAVersion;
3
+ ariaVersion: ARIAVersion;
4
4
  };
5
- declare const _default: Readonly<import('@markuplint/ml-core').RuleSeed<boolean, Option>>;
5
+ declare const _default: Readonly<import("@markuplint/ml-core").RuleSeed<boolean, Option>>;
6
6
  export default _default;
@@ -1,6 +1,6 @@
1
1
  import type { Lang } from './types';
2
2
  type Options = {
3
- langs?: Lang[];
3
+ langs?: Lang[];
4
4
  };
5
- declare const _default: Readonly<import('@markuplint/ml-core').RuleSeed<boolean, Options>>;
5
+ declare const _default: Readonly<import("@markuplint/ml-core").RuleSeed<boolean, Options>>;
6
6
  export default _default;
@@ -1,8 +1,8 @@
1
1
  export type DateTimeKey = 'year' | 'month' | 'day' | 'hour' | 'minute' | 'second' | 'ms';
2
2
  export type DateTimeData = Partial<Record<DateTimeKey, number>>;
3
3
  export type DateTime = {
4
- datetime: DateTimeData;
5
- zone?: number;
4
+ datetime: DateTimeData;
5
+ zone?: number;
6
6
  };
7
7
  /**
8
8
  * @see https://github.com/wanasit/chrono#locales
@@ -1,7 +1,7 @@
1
1
  type RequiredAttributes = string | (string | Attr)[];
2
2
  type Attr = {
3
- name: string;
4
- value?: string | string[];
3
+ name: string;
4
+ value?: string | string[];
5
5
  };
6
- declare const _default: Readonly<import('@markuplint/ml-core').RuleSeed<RequiredAttributes, undefined>>;
6
+ declare const _default: Readonly<import("@markuplint/ml-core").RuleSeed<RequiredAttributes, undefined>>;
7
7
  export default _default;
@@ -1,5 +1,5 @@
1
1
  type Options = {
2
- ignoreHasMutableContents: boolean;
2
+ ignoreHasMutableContents: boolean;
3
3
  };
4
- declare const _default: Readonly<import('@markuplint/ml-core').RuleSeed<string[], Options>>;
4
+ declare const _default: Readonly<import("@markuplint/ml-core").RuleSeed<string[], Options>>;
5
5
  export default _default;
@@ -1,6 +1,6 @@
1
1
  export interface Options {
2
- 'expected-once': boolean;
3
- 'in-document-fragment': boolean;
2
+ 'expected-once': boolean;
3
+ 'in-document-fragment': boolean;
4
4
  }
5
- declare const _default: Readonly<import('@markuplint/ml-core').RuleSeed<boolean, Options>>;
5
+ declare const _default: Readonly<import("@markuplint/ml-core").RuleSeed<boolean, Options>>;
6
6
  export default _default;
@@ -1,6 +1,6 @@
1
1
  type Bullets = readonly string[];
2
2
  type Options = {
3
- spaceNeededBullets?: string[];
3
+ spaceNeededBullets?: string[];
4
4
  };
5
- declare const _default: Readonly<import('@markuplint/ml-core').RuleSeed<Bullets, Options>>;
5
+ declare const _default: Readonly<import("@markuplint/ml-core").RuleSeed<Bullets, Options>>;
6
6
  export default _default;