@markuplint/ml-spec 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 (32) hide show
  1. package/lib/constant/aria-version.d.ts +2 -2
  2. package/lib/dom-traverse/get-attr-specs.d.ts +1 -1
  3. package/lib/dom-traverse/get-computed-aria-props.d.ts +5 -5
  4. package/lib/dom-traverse/get-computed-role.d.ts +1 -6
  5. package/lib/dom-traverse/get-computed-role.js +49 -3
  6. package/lib/dom-traverse/get-content-model.d.ts +1 -26
  7. package/lib/dom-traverse/get-implicit-role.d.ts +1 -5
  8. package/lib/dom-traverse/get-non-presentational-ancestor.d.ts +4 -10
  9. package/lib/dom-traverse/get-permitted-roles.d.ts +3 -7
  10. package/lib/dom-traverse/get-spec.d.ts +1 -4
  11. package/lib/dom-traverse/has-required-owned-elements.d.ts +1 -7
  12. package/lib/dom-traverse/matches-context-role.d.ts +1 -6
  13. package/lib/specs/aria-specs.d.ts +4 -7
  14. package/lib/specs/content-model-category-to-tag-names.d.ts +1 -4
  15. package/lib/specs/get-aria.d.ts +1 -7
  16. package/lib/specs/get-attr-specs.d.ts +2 -6
  17. package/lib/specs/get-implicit-role.d.ts +1 -7
  18. package/lib/specs/get-permitted-roles.d.ts +3 -9
  19. package/lib/specs/get-role-spec.d.ts +3 -10
  20. package/lib/specs/get-spec-by-tag-name.d.ts +1 -5
  21. package/lib/specs/is-palpable-elements.d.ts +4 -8
  22. package/lib/specs/resolve-version.d.ts +1 -4
  23. package/lib/specs/schema-to-spec.d.ts +3 -3
  24. package/lib/types/aria.d.ts +133 -147
  25. package/lib/types/attributes.d.ts +110 -1490
  26. package/lib/types/index.d.ts +145 -173
  27. package/lib/types/permitted-structures.d.ts +35 -74
  28. package/lib/utils/merge-array.d.ts +4 -9
  29. package/lib/utils/resolve-namespace.d.ts +4 -4
  30. package/package.json +9 -9
  31. package/test/dom-traverse/get-computed-aria-props.spec.js +2 -2
  32. package/test/dom-traverse/get-computed-role.spec.js +25 -4
@@ -10,162 +10,148 @@ export type ImplicitRole = false | string;
10
10
  /**
11
11
  * If `true`, this mean is "Any". If `false`, this mean is "No".
12
12
  */
13
- export type PermittedRoles =
14
- | boolean
15
- | (
16
- | string
17
- | {
18
- name: string;
19
- deprecated?: true;
20
- [k: string]: unknown;
21
- }
22
- )[]
23
- | PermittedARIAAAMInfo;
13
+ export type PermittedRoles = boolean | (string | {
14
+ name: string;
15
+ deprecated?: true;
16
+ [k: string]: unknown;
17
+ })[] | PermittedARIAAAMInfo;
24
18
  /**
25
19
  * If set false:
26
20
  * > No role or aria-* attributes
27
21
  */
28
- export type PermittedARIAProperties =
29
- | false
30
- | {
31
- global?: true;
32
- /**
33
- * Set true if the spec says "and any aria-* attributes applicable to the allowed roles."
34
- */
35
- role?: true | string | [string, ...string[]];
36
- /**
37
- * @minItems 1
38
- */
39
- only?: [
40
- (
41
- | string
42
- | {
43
- name: string;
44
- value?: string;
45
- }
46
- ),
47
- ...(
48
- | string
49
- | {
50
- name: string;
51
- value?: string;
52
- }
53
- )[],
54
- ];
55
- /**
56
- * @minItems 1
57
- */
58
- without?: [
59
- {
60
- type: 'not-recommended' | 'should-not' | 'must-not';
61
- name: string;
62
- value?: string;
63
- alt?: {
64
- method: 'remove-attr' | 'set-attr';
65
- target: string;
66
- };
67
- },
68
- ...{
69
- type: 'not-recommended' | 'should-not' | 'must-not';
70
- name: string;
71
- value?: string;
72
- alt?: {
73
- method: 'remove-attr' | 'set-attr';
74
- target: string;
75
- };
76
- }[],
77
- ];
78
- };
22
+ export type PermittedARIAProperties = false | {
23
+ global?: true;
24
+ /**
25
+ * Set true if the spec says "and any aria-* attributes applicable to the allowed roles."
26
+ */
27
+ role?: true | string | [string, ...string[]];
28
+ /**
29
+ * @minItems 1
30
+ */
31
+ only?: [
32
+ (string | {
33
+ name: string;
34
+ value?: string;
35
+ }),
36
+ ...(string | {
37
+ name: string;
38
+ value?: string;
39
+ })[]
40
+ ];
41
+ /**
42
+ * @minItems 1
43
+ */
44
+ without?: [
45
+ {
46
+ type: 'not-recommended' | 'should-not' | 'must-not';
47
+ name: string;
48
+ value?: string;
49
+ alt?: {
50
+ method: 'remove-attr' | 'set-attr';
51
+ target: string;
52
+ };
53
+ },
54
+ ...{
55
+ type: 'not-recommended' | 'should-not' | 'must-not';
56
+ name: string;
57
+ value?: string;
58
+ alt?: {
59
+ method: 'remove-attr' | 'set-attr';
60
+ target: string;
61
+ };
62
+ }[]
63
+ ];
64
+ };
79
65
  export interface AriaSchema {
80
- _?: ARIA;
81
- [k: string]: unknown;
66
+ _?: ARIA;
67
+ [k: string]: unknown;
82
68
  }
83
69
  export interface ARIA {
84
- implicitRole: ImplicitRole;
85
- permittedRoles: PermittedRoles;
86
- namingProhibited?: true;
87
- implicitProperties?: ImplicitProperties;
88
- properties?: PermittedARIAProperties;
89
- conditions?: {
90
- /**
91
- * This interface was referenced by `undefined`'s JSON-Schema definition
92
- * via the `patternProperty` ".+".
93
- */
94
- [k: string]: {
95
- implicitRole?: ImplicitRole;
96
- permittedRoles?: PermittedRoles;
97
- namingProhibited?: true;
98
- implicitProperties?: ImplicitProperties;
99
- properties?: PermittedARIAProperties;
100
- };
101
- };
102
- '1.3'?: {
103
- implicitRole?: ImplicitRole;
104
- permittedRoles?: PermittedRoles;
105
- namingProhibited?: true;
106
- implicitProperties?: ImplicitProperties;
107
- properties?: PermittedARIAProperties;
108
- conditions?: {
109
- /**
110
- * This interface was referenced by `undefined`'s JSON-Schema definition
111
- * via the `patternProperty` ".+".
112
- */
113
- [k: string]: {
114
- implicitRole?: ImplicitRole;
115
- permittedRoles?: PermittedRoles;
116
- namingProhibited?: true;
117
- implicitProperties?: ImplicitProperties;
118
- properties?: PermittedARIAProperties;
119
- };
120
- };
121
- };
122
- '1.2'?: {
123
- implicitRole?: ImplicitRole;
124
- permittedRoles?: PermittedRoles;
125
- namingProhibited?: true;
126
- implicitProperties?: ImplicitProperties;
127
- properties?: PermittedARIAProperties;
128
- conditions?: {
129
- /**
130
- * This interface was referenced by `undefined`'s JSON-Schema definition
131
- * via the `patternProperty` ".+".
132
- */
133
- [k: string]: {
134
- implicitRole?: ImplicitRole;
135
- permittedRoles?: PermittedRoles;
136
- namingProhibited?: true;
137
- implicitProperties?: ImplicitProperties;
138
- properties?: PermittedARIAProperties;
139
- };
140
- };
141
- };
142
- '1.1'?: {
143
- implicitRole?: ImplicitRole;
144
- permittedRoles?: PermittedRoles;
145
- implicitProperties?: ImplicitProperties;
146
- properties?: PermittedARIAProperties;
147
- conditions?: {
148
- /**
149
- * This interface was referenced by `undefined`'s JSON-Schema definition
150
- * via the `patternProperty` ".+".
151
- */
152
- [k: string]: {
153
- implicitRole?: ImplicitRole;
154
- permittedRoles?: PermittedRoles;
155
- implicitProperties?: ImplicitProperties;
156
- properties?: PermittedARIAProperties;
157
- };
158
- };
159
- };
70
+ implicitRole: ImplicitRole;
71
+ permittedRoles: PermittedRoles;
72
+ namingProhibited?: true;
73
+ implicitProperties?: ImplicitProperties;
74
+ properties?: PermittedARIAProperties;
75
+ conditions?: {
76
+ /**
77
+ * This interface was referenced by `undefined`'s JSON-Schema definition
78
+ * via the `patternProperty` ".+".
79
+ */
80
+ [k: string]: {
81
+ implicitRole?: ImplicitRole;
82
+ permittedRoles?: PermittedRoles;
83
+ namingProhibited?: true;
84
+ implicitProperties?: ImplicitProperties;
85
+ properties?: PermittedARIAProperties;
86
+ };
87
+ };
88
+ '1.3'?: {
89
+ implicitRole?: ImplicitRole;
90
+ permittedRoles?: PermittedRoles;
91
+ namingProhibited?: true;
92
+ implicitProperties?: ImplicitProperties;
93
+ properties?: PermittedARIAProperties;
94
+ conditions?: {
95
+ /**
96
+ * This interface was referenced by `undefined`'s JSON-Schema definition
97
+ * via the `patternProperty` ".+".
98
+ */
99
+ [k: string]: {
100
+ implicitRole?: ImplicitRole;
101
+ permittedRoles?: PermittedRoles;
102
+ namingProhibited?: true;
103
+ implicitProperties?: ImplicitProperties;
104
+ properties?: PermittedARIAProperties;
105
+ };
106
+ };
107
+ };
108
+ '1.2'?: {
109
+ implicitRole?: ImplicitRole;
110
+ permittedRoles?: PermittedRoles;
111
+ namingProhibited?: true;
112
+ implicitProperties?: ImplicitProperties;
113
+ properties?: PermittedARIAProperties;
114
+ conditions?: {
115
+ /**
116
+ * This interface was referenced by `undefined`'s JSON-Schema definition
117
+ * via the `patternProperty` ".+".
118
+ */
119
+ [k: string]: {
120
+ implicitRole?: ImplicitRole;
121
+ permittedRoles?: PermittedRoles;
122
+ namingProhibited?: true;
123
+ implicitProperties?: ImplicitProperties;
124
+ properties?: PermittedARIAProperties;
125
+ };
126
+ };
127
+ };
128
+ '1.1'?: {
129
+ implicitRole?: ImplicitRole;
130
+ permittedRoles?: PermittedRoles;
131
+ implicitProperties?: ImplicitProperties;
132
+ properties?: PermittedARIAProperties;
133
+ conditions?: {
134
+ /**
135
+ * This interface was referenced by `undefined`'s JSON-Schema definition
136
+ * via the `patternProperty` ".+".
137
+ */
138
+ [k: string]: {
139
+ implicitRole?: ImplicitRole;
140
+ permittedRoles?: PermittedRoles;
141
+ implicitProperties?: ImplicitProperties;
142
+ properties?: PermittedARIAProperties;
143
+ };
144
+ };
145
+ };
160
146
  }
161
147
  export interface PermittedARIAAAMInfo {
162
- 'core-aam'?: true;
163
- 'graphics-aam'?: true;
148
+ 'core-aam'?: true;
149
+ 'graphics-aam'?: true;
164
150
  }
165
151
  export interface ImplicitProperties {
166
- /**
167
- * This interface was referenced by `ImplicitProperties`'s JSON-Schema definition
168
- * via the `patternProperty` "^aria-.+".
169
- */
170
- [k: string]: string;
152
+ /**
153
+ * This interface was referenced by `ImplicitProperties`'s JSON-Schema definition
154
+ * via the `patternProperty` "^aria-.+".
155
+ */
156
+ [k: string]: string;
171
157
  }