@markuplint/ml-spec 2.1.1 → 3.0.0-alpha.1

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 (123) hide show
  1. package/lib/dom-traverse/accname-computation.d.ts +1 -0
  2. package/lib/dom-traverse/accname-computation.js +8 -0
  3. package/lib/dom-traverse/get-attr-specs.d.ts +2 -0
  4. package/lib/dom-traverse/get-attr-specs.js +8 -0
  5. package/lib/dom-traverse/get-computed-role.d.ts +2 -0
  6. package/lib/dom-traverse/get-computed-role.js +170 -0
  7. package/lib/dom-traverse/get-content-model.d.ts +3 -0
  8. package/lib/dom-traverse/get-content-model.js +28 -0
  9. package/lib/dom-traverse/get-explicit-role.d.ts +2 -0
  10. package/lib/dom-traverse/get-explicit-role.js +102 -0
  11. package/lib/dom-traverse/get-implicit-role.d.ts +3 -0
  12. package/lib/dom-traverse/get-implicit-role.js +37 -0
  13. package/lib/dom-traverse/get-non-presentational-ancestor.d.ts +5 -0
  14. package/lib/dom-traverse/get-non-presentational-ancestor.js +21 -0
  15. package/lib/dom-traverse/get-permitted-roles.d.ts +5 -0
  16. package/lib/dom-traverse/get-permitted-roles.js +8 -0
  17. package/lib/dom-traverse/get-spec.d.ts +2 -0
  18. package/lib/dom-traverse/get-spec.js +8 -0
  19. package/lib/dom-traverse/has-required-owned-elements.d.ts +3 -0
  20. package/lib/dom-traverse/has-required-owned-elements.js +81 -0
  21. package/lib/dom-traverse/may-be-focusable.d.ts +2 -0
  22. package/lib/dom-traverse/may-be-focusable.js +22 -0
  23. package/lib/index.d.ts +18 -6
  24. package/lib/index.js +18 -6
  25. package/lib/specs/aria-specs.d.ts +6 -0
  26. package/lib/specs/aria-specs.js +8 -0
  27. package/lib/specs/content-model-category-to-tag-names.d.ts +3 -0
  28. package/lib/specs/content-model-category-to-tag-names.js +15 -0
  29. package/lib/specs/get-aria.d.ts +3 -0
  30. package/lib/specs/get-aria.js +71 -0
  31. package/lib/specs/get-attr-specs.d.ts +8 -0
  32. package/lib/{get-attr-specs.js → specs/get-attr-specs.js} +8 -6
  33. package/lib/specs/get-implicit-role.d.ts +2 -0
  34. package/lib/specs/get-implicit-role.js +12 -0
  35. package/lib/specs/get-permitted-roles.d.ts +12 -0
  36. package/lib/specs/get-permitted-roles.js +61 -0
  37. package/lib/specs/get-role-spec.d.ts +5 -0
  38. package/lib/specs/get-role-spec.js +52 -0
  39. package/lib/specs/get-selectors-by-content-model-category.d.ts +3 -0
  40. package/lib/specs/get-selectors-by-content-model-category.js +8 -0
  41. package/lib/specs/get-spec-by-tag-name.d.ts +2 -0
  42. package/lib/specs/get-spec-by-tag-name.js +16 -0
  43. package/lib/specs/is-presentational.d.ts +1 -0
  44. package/lib/specs/is-presentational.js +10 -0
  45. package/lib/specs/resolve-version.d.ts +3 -0
  46. package/lib/specs/resolve-version.js +21 -0
  47. package/lib/specs/schema-to-spec.d.ts +13 -0
  48. package/lib/{get-spec.js → specs/schema-to-spec.js} +19 -11
  49. package/lib/types/aria.d.ts +136 -0
  50. package/lib/{attributes.js → types/aria.js} +0 -0
  51. package/lib/{attributes.d.ts → types/attributes.d.ts} +95 -48
  52. package/lib/{permitted-structres.js → types/attributes.js} +0 -0
  53. package/lib/{types.d.ts → types/index.d.ts} +55 -70
  54. package/lib/{types.js → types/index.js} +0 -0
  55. package/lib/types/permitted-structres.d.ts +58 -0
  56. package/lib/types/permitted-structres.js +8 -0
  57. package/lib/types/permitted-structures.d.ts +54 -0
  58. package/lib/types/permitted-structures.js +8 -0
  59. package/lib/utils/get-ns.d.ts +2 -0
  60. package/lib/{get-ns.js → utils/get-ns.js} +3 -0
  61. package/lib/{utils.d.ts → utils/merge-array.d.ts} +0 -0
  62. package/lib/{utils.js → utils/merge-array.js} +0 -0
  63. package/lib/utils/resolve-namespace.d.ts +9 -0
  64. package/lib/utils/resolve-namespace.js +31 -0
  65. package/package.json +12 -8
  66. package/schema.json +6 -6
  67. package/schemas/aria.schema.json +258 -0
  68. package/schemas/attributes.schema.json +3 -22
  69. package/schemas/content-models.schema.json +200 -0
  70. package/schemas/element.schema.json +11 -0
  71. package/src/dom-traverse/accname-computation.spec.ts +69 -0
  72. package/src/dom-traverse/accname-computation.ts +5 -0
  73. package/src/dom-traverse/get-attr-specs.ts +8 -0
  74. package/src/dom-traverse/get-computed-role.spec.ts +134 -0
  75. package/src/dom-traverse/get-computed-role.ts +181 -0
  76. package/src/dom-traverse/get-content-model.ts +32 -0
  77. package/src/dom-traverse/get-explicit-role.ts +112 -0
  78. package/src/dom-traverse/get-implicit-role.ts +36 -0
  79. package/src/dom-traverse/get-non-presentational-ancestor.ts +20 -0
  80. package/src/dom-traverse/get-permitted-roles.ts +7 -0
  81. package/src/dom-traverse/get-spec.ts +7 -0
  82. package/src/dom-traverse/has-required-owned-elements.spec.ts +36 -0
  83. package/src/dom-traverse/has-required-owned-elements.ts +85 -0
  84. package/src/dom-traverse/may-be-focusable.ts +21 -0
  85. package/src/index.ts +18 -6
  86. package/src/specs/aria-specs.ts +6 -0
  87. package/src/specs/content-model-category-to-tag-names.ts +15 -0
  88. package/src/specs/get-aria.ts +85 -0
  89. package/src/{get-attr-specs.spec.ts → specs/get-attr-specs.spec.ts} +4 -7
  90. package/src/{get-attr-specs.ts → specs/get-attr-specs.ts} +12 -7
  91. package/src/specs/get-implicit-role.spec.ts +81 -0
  92. package/src/specs/get-implicit-role.ts +17 -0
  93. package/src/specs/get-permitted-roles.spec.ts +420 -0
  94. package/src/specs/get-permitted-roles.ts +87 -0
  95. package/src/specs/get-role-spec.spec.ts +67 -0
  96. package/src/specs/get-role-spec.ts +72 -0
  97. package/src/specs/get-selectors-by-content-model-category.ts +10 -0
  98. package/src/specs/get-spec-by-tag-name.spec.ts +68 -0
  99. package/src/specs/get-spec-by-tag-name.ts +20 -0
  100. package/src/specs/is-presentational.ts +6 -0
  101. package/src/specs/resolve-version.ts +20 -0
  102. package/src/{get-spec.spec.ts → specs/schema-to-spec.spec.ts} +2 -2
  103. package/src/{get-spec.ts → specs/schema-to-spec.ts} +23 -9
  104. package/src/types/aria.ts +153 -0
  105. package/src/{attributes.ts → types/attributes.ts} +162 -117
  106. package/src/{types.ts → types/index.ts} +75 -74
  107. package/src/types/permitted-structres.ts +101 -0
  108. package/src/types/permitted-structures.ts +97 -0
  109. package/src/{get-ns.ts → utils/get-ns.ts} +6 -1
  110. package/src/{utils.ts → utils/merge-array.ts} +0 -0
  111. package/src/utils/resolve-namespace.spec.ts +37 -0
  112. package/src/utils/resolve-namespace.ts +40 -0
  113. package/tsconfig.tsbuildinfo +1 -1
  114. package/lib/get-attr-specs.d.ts +0 -7
  115. package/lib/get-ns.d.ts +0 -1
  116. package/lib/get-spec-by-tag-name.d.ts +0 -2
  117. package/lib/get-spec-by-tag-name.js +0 -31
  118. package/lib/get-spec.d.ts +0 -13
  119. package/lib/permitted-structres.d.ts +0 -73
  120. package/schemas/permitted-structures.schema.json +0 -244
  121. package/schemas/wai-aria.schema.json +0 -87
  122. package/src/get-spec-by-tag-name.ts +0 -32
  123. package/src/permitted-structres.ts +0 -118
@@ -1,73 +0,0 @@
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 PermittedContent = PermittedContentRequire | PermittedContentOptional | PermittedContentOneOrMore | PermittedContentZeroOrMore | PermittedContentChoice | PermittedContentInterleave;
7
- export declare type Target = Node | Node[];
8
- export declare type Node = string | '#text' | ContentModel;
9
- export declare type ContentModel = '#phrasing' | '#flow' | '#interactive' | '#heading' | '#sectioning' | '#metadata' | '#transparent' | '#embedded' | '#palpable' | '#script-supporting' | '#SVGAnimation' | '#SVGBasicShapes' | '#SVGContainer' | '#SVGDescriptive' | '#SVGFilterPrimitive' | '#SVGFont' | '#SVGGradient' | '#SVGGraphics' | '#SVGGraphicsReferencing' | '#SVGLightSource' | '#SVGNeverRendered' | '#SVGNone' | '#SVGPaintServer' | '#SVGRenderable' | '#SVGShape' | '#SVGStructural' | '#SVGStructurallyExternal' | '#SVGTextContent' | '#SVGTextContentChild' | '#SVGOtherXMLNamespace';
10
- export declare type PermittedContentSpec = PermittedContent[];
11
- export interface PermittedStructuresSchema {
12
- summary?: string;
13
- tag: string;
14
- conditional?: {
15
- condition: {
16
- hasAttr: string;
17
- } | {
18
- parent: string;
19
- /**
20
- * Not support yet
21
- */
22
- hasNotAttr?: string;
23
- _TODO_?: string;
24
- _parent?: string;
25
- };
26
- contents: PermittedContentSpec | boolean;
27
- }[];
28
- contents: PermittedContentSpec | boolean;
29
- ancestor?: Node;
30
- }
31
- export interface PermittedContentRequire {
32
- require: Target;
33
- ignore?: Target;
34
- notAllowedDescendants?: Node[];
35
- max?: number;
36
- min?: number;
37
- _TODO_?: string;
38
- }
39
- export interface PermittedContentOptional {
40
- optional: Target;
41
- ignore?: Target;
42
- notAllowedDescendants?: Node[];
43
- max?: number;
44
- _TODO_?: string;
45
- }
46
- export interface PermittedContentOneOrMore {
47
- oneOrMore: Target | PermittedContentSpec;
48
- ignore?: Target;
49
- notAllowedDescendants?: Node[];
50
- max?: number;
51
- _TODO_?: string;
52
- }
53
- export interface PermittedContentZeroOrMore {
54
- zeroOrMore: Target | PermittedContentSpec;
55
- ignore?: Target;
56
- notAllowedDescendants?: Node[];
57
- max?: number;
58
- _TODO_?: string;
59
- }
60
- export interface PermittedContentChoice {
61
- choice: [PermittedContentSpec, PermittedContentSpec] | [PermittedContentSpec, PermittedContentSpec, PermittedContentSpec] | [PermittedContentSpec, PermittedContentSpec, PermittedContentSpec, PermittedContentSpec] | [
62
- PermittedContentSpec,
63
- PermittedContentSpec,
64
- PermittedContentSpec,
65
- PermittedContentSpec,
66
- PermittedContentSpec
67
- ];
68
- _TODO_?: string;
69
- }
70
- export interface PermittedContentInterleave {
71
- interleave: [PermittedContentSpec, PermittedContentSpec, ...PermittedContentSpec[]];
72
- _TODO_?: string;
73
- }
@@ -1,244 +0,0 @@
1
- {
2
- "definitions": {
3
- "Node": {
4
- "oneOf": [
5
- {
6
- "description": "HTML Element",
7
- "type": "string",
8
- "pattern": "^[a-z][a-z0-9]*$"
9
- },
10
- {
11
- "description": "Namespaced HTML Element",
12
- "type": "string",
13
- "pattern": "^html:[a-z][a-z0-9]*$"
14
- },
15
- {
16
- "description": "SVG Element",
17
- "type": "string",
18
- "pattern": "^svg:(?:[a-z][a-zA-Z0-9]*|[a-z][a-z0-9]*-[a-z][a-z0-9]*)$"
19
- },
20
- {
21
- "description": "Text Node",
22
- "type": "string",
23
- "enum": ["#text"]
24
- },
25
- { "$ref": "#/definitions/ContentModel" }
26
- ]
27
- },
28
- "ContentModel": {
29
- "type": "string",
30
- "enum": [
31
- "#phrasing",
32
- "#flow",
33
- "#interactive",
34
- "#heading",
35
- "#sectioning",
36
- "#metadata",
37
- "#transparent",
38
- "#embedded",
39
- "#palpable",
40
- "#script-supporting",
41
- "#SVGAnimation",
42
- "#SVGBasicShapes",
43
- "#SVGContainer",
44
- "#SVGDescriptive",
45
- "#SVGFilterPrimitive",
46
- "#SVGFont",
47
- "#SVGGradient",
48
- "#SVGGraphics",
49
- "#SVGGraphicsReferencing",
50
- "#SVGLightSource",
51
- "#SVGNeverRendered",
52
- "#SVGNone",
53
- "#SVGPaintServer",
54
- "#SVGRenderable",
55
- "#SVGShape",
56
- "#SVGStructural",
57
- "#SVGStructurallyExternal",
58
- "#SVGTextContent",
59
- "#SVGTextContentChild",
60
- "#SVGOtherXMLNamespace"
61
- ]
62
- },
63
- "Target": {
64
- "oneOf": [
65
- { "$ref": "#/definitions/Node" },
66
- {
67
- "type": "array",
68
- "items": { "$ref": "#/definitions/Node" },
69
- "uniqueItems": true
70
- }
71
- ]
72
- },
73
- "PermittedContentSpec": {
74
- "type": "array",
75
- "items": { "$ref": "#/definitions/PermittedContent" }
76
- },
77
- "PermittedContent": {
78
- "type": "object",
79
- "oneOf": [
80
- { "$ref": "#/definitions/PermittedContentRequire" },
81
- { "$ref": "#/definitions/PermittedContentOptional" },
82
- { "$ref": "#/definitions/PermittedContentOneOrMore" },
83
- { "$ref": "#/definitions/PermittedContentZeroOrMore" },
84
- { "$ref": "#/definitions/PermittedContentChoice" },
85
- { "$ref": "#/definitions/PermittedContentInterleave" }
86
- ]
87
- },
88
- "PermittedContentRequire": {
89
- "type": "object",
90
- "additionalProperties": false,
91
- "required": ["require"],
92
- "properties": {
93
- "require": { "$ref": "#/definitions/Target" },
94
- "ignore": { "$ref": "#/definitions/Target" },
95
- "notAllowedDescendants": {
96
- "type": "array",
97
- "items": { "$ref": "#/definitions/Node" },
98
- "uniqueItems": true
99
- },
100
- "max": { "type": "number" },
101
- "min": { "type": "number" },
102
- "_TODO_": { "type": "string" }
103
- }
104
- },
105
- "PermittedContentOptional": {
106
- "type": "object",
107
- "additionalProperties": false,
108
- "required": ["optional"],
109
- "properties": {
110
- "optional": { "$ref": "#/definitions/Target" },
111
- "ignore": { "$ref": "#/definitions/Target" },
112
- "notAllowedDescendants": {
113
- "type": "array",
114
- "items": { "$ref": "#/definitions/Node" },
115
- "uniqueItems": true
116
- },
117
- "max": { "type": "number" },
118
- "_TODO_": { "type": "string" }
119
- }
120
- },
121
- "PermittedContentOneOrMore": {
122
- "type": "object",
123
- "additionalProperties": false,
124
- "required": ["oneOrMore"],
125
- "properties": {
126
- "oneOrMore": {
127
- "oneOf": [{ "$ref": "#/definitions/Target" }, { "$ref": "#/definitions/PermittedContentSpec" }]
128
- },
129
- "ignore": { "$ref": "#/definitions/Target" },
130
- "notAllowedDescendants": {
131
- "type": "array",
132
- "items": { "$ref": "#/definitions/Node" },
133
- "uniqueItems": true
134
- },
135
- "max": { "type": "number" },
136
- "_TODO_": { "type": "string" }
137
- }
138
- },
139
- "PermittedContentZeroOrMore": {
140
- "type": "object",
141
- "additionalProperties": false,
142
- "required": ["zeroOrMore"],
143
- "properties": {
144
- "zeroOrMore": {
145
- "oneOf": [{ "$ref": "#/definitions/Target" }, { "$ref": "#/definitions/PermittedContentSpec" }]
146
- },
147
- "ignore": { "$ref": "#/definitions/Target" },
148
- "notAllowedDescendants": {
149
- "type": "array",
150
- "items": { "$ref": "#/definitions/Node" },
151
- "uniqueItems": true
152
- },
153
- "max": { "type": "number" },
154
- "_TODO_": { "type": "string" }
155
- }
156
- },
157
- "PermittedContentChoice": {
158
- "type": "object",
159
- "additionalProperties": false,
160
- "required": ["choice"],
161
- "properties": {
162
- "choice": {
163
- "type": "array",
164
- "items": { "$ref": "#/definitions/PermittedContentSpec" },
165
- "minItems": 2,
166
- "maxItems": 5
167
- },
168
- "_TODO_": { "type": "string" }
169
- }
170
- },
171
- "PermittedContentInterleave": {
172
- "type": "object",
173
- "additionalProperties": false,
174
- "required": ["interleave"],
175
- "properties": {
176
- "interleave": {
177
- "type": "array",
178
- "items": { "$ref": "#/definitions/PermittedContentSpec" },
179
- "minItems": 2
180
- },
181
- "_TODO_": { "type": "string" }
182
- }
183
- }
184
- },
185
- "type": "object",
186
- "additionalProperties": false,
187
- "required": ["tag", "contents"],
188
- "properties": {
189
- "summary": { "type": "string" },
190
- "tag": { "type": "string" },
191
- "conditional": {
192
- "type": "array",
193
- "items": {
194
- "type": "object",
195
- "additionalProperties": false,
196
- "required": ["condition", "contents"],
197
- "properties": {
198
- "condition": {
199
- "type": "object",
200
- "oneOf": [
201
- {
202
- "additionalProperties": false,
203
- "required": ["hasAttr"],
204
- "properties": {
205
- "hasAttr": { "type": "string" }
206
- }
207
- },
208
- {
209
- "additionalProperties": false,
210
- "required": ["parent"],
211
- "properties": {
212
- "parent": { "type": "string" },
213
- "hasNotAttr": {
214
- "type": "string",
215
- "description": "Not support yet"
216
- },
217
- "_TODO_": { "type": "string" },
218
- "_parent": { "type": "string" }
219
- }
220
- }
221
- ]
222
- },
223
- "contents": {
224
- "oneOf": [
225
- {
226
- "$ref": "#/definitions/PermittedContentSpec"
227
- },
228
- { "type": "boolean" }
229
- ]
230
- }
231
- }
232
- }
233
- },
234
- "contents": {
235
- "oneOf": [
236
- {
237
- "$ref": "#/definitions/PermittedContentSpec"
238
- },
239
- { "type": "boolean" }
240
- ]
241
- },
242
- "ancestor": { "$ref": "#/definitions/Node" }
243
- }
244
- }
@@ -1,87 +0,0 @@
1
- {
2
- "definitions": {
3
- "permittedRoles": {
4
- "description": "If `true`, this mean is \"Any\". If `false`, this mean is \"No\".",
5
- "oneOf": [
6
- {
7
- "type": "boolean"
8
- },
9
- {
10
- "type": "array",
11
- "items": {
12
- "type": "string"
13
- }
14
- }
15
- ]
16
- },
17
- "implicitRole": {
18
- "description": "If `false`, this mean is \"No corresponding role\".",
19
- "oneOf": [
20
- {
21
- "type": "boolean",
22
- "enum": [false]
23
- },
24
- {
25
- "type": "string"
26
- }
27
- ]
28
- }
29
- },
30
- "type": "object",
31
- "required": ["permittedRoles", "implicitRole"],
32
- "additionalProperties": false,
33
- "properties": {
34
- "permittedRoles": {
35
- "type": "object",
36
- "required": ["roles"],
37
- "additionalProperties": false,
38
- "properties": {
39
- "roles": {
40
- "$ref": "#/definitions/permittedRoles"
41
- },
42
- "conditions": {
43
- "type": "array",
44
- "items": {
45
- "type": "object",
46
- "required": ["condition", "roles"],
47
- "additionalProperties": false,
48
- "properties": {
49
- "condition": {
50
- "type": "string"
51
- },
52
- "roles": {
53
- "$ref": "#/definitions/permittedRoles"
54
- }
55
- }
56
- }
57
- }
58
- }
59
- },
60
- "implicitRole": {
61
- "type": "object",
62
- "required": ["role"],
63
- "additionalProperties": false,
64
- "properties": {
65
- "role": {
66
- "$ref": "#/definitions/implicitRole"
67
- },
68
- "conditions": {
69
- "type": "array",
70
- "items": {
71
- "type": "object",
72
- "required": ["condition", "role"],
73
- "additionalProperties": false,
74
- "properties": {
75
- "condition": {
76
- "type": "string"
77
- },
78
- "role": {
79
- "$ref": "#/definitions/implicitRole"
80
- }
81
- }
82
- }
83
- }
84
- }
85
- }
86
- }
87
- }
@@ -1,32 +0,0 @@
1
- import type { MLDOMElementSpec, MLMLSpec, SpecOM } from './types';
2
-
3
- import { getAttrSpecs } from './get-attr-specs';
4
-
5
- const cacheMap = new WeakMap<MLMLSpec, SpecOM>();
6
-
7
- function getSpecOM(spec: MLMLSpec): SpecOM {
8
- const cache = cacheMap.get(spec);
9
- if (cache) {
10
- return cache;
11
- }
12
- const som: SpecOM = {};
13
- for (const el of spec.specs) {
14
- const attributes = getAttrSpecs(el.name, spec);
15
- som[el.name] = {
16
- experimental: !!el.experimental,
17
- obsolete: typeof el.obsolete === 'boolean' ? !!el.obsolete : el.obsolete ? el.obsolete.alt : false,
18
- deprecated: !!el.deprecated,
19
- nonStandard: !!el.nonStandard,
20
- categories: el.categories,
21
- permittedStructures: el.permittedStructures,
22
- attributes: Object.values(attributes || {}),
23
- };
24
- }
25
- cacheMap.set(spec, som);
26
- return som;
27
- }
28
-
29
- export function getSpecByTagName(nameWithNS: string, specs: MLMLSpec): MLDOMElementSpec | null {
30
- const specOM = getSpecOM(specs);
31
- return specOM[nameWithNS] || null;
32
- }
@@ -1,118 +0,0 @@
1
- /* tslint:disable */
2
- /**
3
- * This file was automatically generated by json-schema-to-typescript.
4
- * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
5
- * and run json-schema-to-typescript to regenerate this file.
6
- */
7
-
8
- export type PermittedContent =
9
- | PermittedContentRequire
10
- | PermittedContentOptional
11
- | PermittedContentOneOrMore
12
- | PermittedContentZeroOrMore
13
- | PermittedContentChoice
14
- | PermittedContentInterleave;
15
- export type Target = Node | Node[];
16
- export type Node = string | '#text' | ContentModel;
17
- export type ContentModel =
18
- | '#phrasing'
19
- | '#flow'
20
- | '#interactive'
21
- | '#heading'
22
- | '#sectioning'
23
- | '#metadata'
24
- | '#transparent'
25
- | '#embedded'
26
- | '#palpable'
27
- | '#script-supporting'
28
- | '#SVGAnimation'
29
- | '#SVGBasicShapes'
30
- | '#SVGContainer'
31
- | '#SVGDescriptive'
32
- | '#SVGFilterPrimitive'
33
- | '#SVGFont'
34
- | '#SVGGradient'
35
- | '#SVGGraphics'
36
- | '#SVGGraphicsReferencing'
37
- | '#SVGLightSource'
38
- | '#SVGNeverRendered'
39
- | '#SVGNone'
40
- | '#SVGPaintServer'
41
- | '#SVGRenderable'
42
- | '#SVGShape'
43
- | '#SVGStructural'
44
- | '#SVGStructurallyExternal'
45
- | '#SVGTextContent'
46
- | '#SVGTextContentChild'
47
- | '#SVGOtherXMLNamespace';
48
- export type PermittedContentSpec = PermittedContent[];
49
-
50
- export interface PermittedStructuresSchema {
51
- summary?: string;
52
- tag: string;
53
- conditional?: {
54
- condition:
55
- | {
56
- hasAttr: string;
57
- }
58
- | {
59
- parent: string;
60
- /**
61
- * Not support yet
62
- */
63
- hasNotAttr?: string;
64
- _TODO_?: string;
65
- _parent?: string;
66
- };
67
- contents: PermittedContentSpec | boolean;
68
- }[];
69
- contents: PermittedContentSpec | boolean;
70
- ancestor?: Node;
71
- }
72
- export interface PermittedContentRequire {
73
- require: Target;
74
- ignore?: Target;
75
- notAllowedDescendants?: Node[];
76
- max?: number;
77
- min?: number;
78
- _TODO_?: string;
79
- }
80
- export interface PermittedContentOptional {
81
- optional: Target;
82
- ignore?: Target;
83
- notAllowedDescendants?: Node[];
84
- max?: number;
85
- _TODO_?: string;
86
- }
87
- export interface PermittedContentOneOrMore {
88
- oneOrMore: Target | PermittedContentSpec;
89
- ignore?: Target;
90
- notAllowedDescendants?: Node[];
91
- max?: number;
92
- _TODO_?: string;
93
- }
94
- export interface PermittedContentZeroOrMore {
95
- zeroOrMore: Target | PermittedContentSpec;
96
- ignore?: Target;
97
- notAllowedDescendants?: Node[];
98
- max?: number;
99
- _TODO_?: string;
100
- }
101
- export interface PermittedContentChoice {
102
- choice:
103
- | [PermittedContentSpec, PermittedContentSpec]
104
- | [PermittedContentSpec, PermittedContentSpec, PermittedContentSpec]
105
- | [PermittedContentSpec, PermittedContentSpec, PermittedContentSpec, PermittedContentSpec]
106
- | [
107
- PermittedContentSpec,
108
- PermittedContentSpec,
109
- PermittedContentSpec,
110
- PermittedContentSpec,
111
- PermittedContentSpec,
112
- ];
113
- _TODO_?: string;
114
- }
115
- export interface PermittedContentInterleave {
116
- interleave: [PermittedContentSpec, PermittedContentSpec, ...PermittedContentSpec[]];
117
- _TODO_?: string;
118
- }