@markuplint/ml-spec 3.0.0-alpha.4 → 3.0.0-alpha.6

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 (47) hide show
  1. package/lib/dom-traverse/get-attr-specs.d.ts +1 -1
  2. package/lib/dom-traverse/get-computed-aria-props.d.ts +12 -0
  3. package/lib/dom-traverse/get-computed-aria-props.js +106 -0
  4. package/lib/dom-traverse/get-content-model.d.ts +4 -1
  5. package/lib/dom-traverse/get-implicit-role.d.ts +5 -1
  6. package/lib/dom-traverse/get-non-presentational-ancestor.d.ts +10 -4
  7. package/lib/dom-traverse/get-permitted-roles.d.ts +7 -3
  8. package/lib/dom-traverse/get-spec.d.ts +4 -1
  9. package/lib/dom-traverse/has-required-owned-elements.d.ts +6 -1
  10. package/lib/dom-traverse/is-exposed.d.ts +11 -0
  11. package/lib/dom-traverse/is-exposed.js +181 -0
  12. package/lib/index.d.ts +4 -0
  13. package/lib/index.js +4 -0
  14. package/lib/specs/aria-specs.d.ts +7 -4
  15. package/lib/specs/content-model-category-to-tag-names.d.ts +4 -1
  16. package/lib/specs/get-aria.d.ts +7 -1
  17. package/lib/specs/get-attr-specs.d.ts +7 -3
  18. package/lib/specs/get-implicit-role.d.ts +7 -1
  19. package/lib/specs/get-permitted-roles.d.ts +9 -3
  20. package/lib/specs/get-role-spec.d.ts +10 -3
  21. package/lib/specs/get-selectors-by-content-model-category.d.ts +4 -1
  22. package/lib/specs/get-spec-by-tag-name.d.ts +5 -1
  23. package/lib/specs/is-palpable-elements.d.ts +9 -0
  24. package/lib/specs/is-palpable-elements.js +47 -0
  25. package/lib/specs/is-void-element.d.ts +1 -0
  26. package/lib/specs/is-void-element.js +25 -0
  27. package/lib/specs/schema-to-spec.d.ts +3 -3
  28. package/lib/types/aria.d.ts +129 -115
  29. package/lib/types/attributes.d.ts +1437 -112
  30. package/lib/types/index.d.ts +192 -164
  31. package/lib/types/permitted-structres.d.ts +76 -37
  32. package/lib/types/permitted-structures.d.ts +72 -33
  33. package/lib/utils/merge-array.d.ts +5 -3
  34. package/lib/utils/resolve-namespace.d.ts +5 -5
  35. package/package.json +5 -5
  36. package/schemas/content-models.schema.json +1 -2
  37. package/src/dom-traverse/accname-computation.spec.ts +1 -1
  38. package/src/dom-traverse/get-computed-aria-props.spec.ts +368 -0
  39. package/src/dom-traverse/get-computed-aria-props.ts +130 -0
  40. package/src/dom-traverse/is-exposed.spec.ts +50 -0
  41. package/src/dom-traverse/is-exposed.ts +196 -0
  42. package/src/index.ts +4 -0
  43. package/src/specs/is-palpable-elements.ts +55 -0
  44. package/src/specs/is-void-element.ts +22 -0
  45. package/src/types/permitted-structres.ts +1 -2
  46. package/src/types/permitted-structures.ts +1 -2
  47. package/tsconfig.tsbuildinfo +1 -1
@@ -6,189 +6,217 @@ import type { NamespaceURI } from '@markuplint/ml-ast';
6
6
  * markuplint Markup-language spec
7
7
  */
8
8
  export interface MLMLSpec {
9
- cites: Cites;
10
- def: SpecDefs;
11
- specs: ElementSpec[];
9
+ cites: Cites;
10
+ def: SpecDefs;
11
+ specs: ElementSpec[];
12
12
  }
13
- export declare type ExtendedElementSpec = Partial<Omit<ElementSpec, 'name' | 'attributes'>> & {
14
- name: ElementSpec['name'];
15
- attributes?: Record<string, Partial<Attribute>>;
13
+ export type ExtendedElementSpec = Partial<Omit<ElementSpec, 'name' | 'attributes'>> & {
14
+ name: ElementSpec['name'];
15
+ attributes?: Record<string, Partial<Attribute>>;
16
16
  };
17
- export declare type ExtendedSpec = {
18
- cites?: Cites;
19
- def?: Partial<SpecDefs>;
20
- specs?: ExtendedElementSpec[];
17
+ export type ExtendedSpec = {
18
+ cites?: Cites;
19
+ def?: Partial<SpecDefs>;
20
+ specs?: ExtendedElementSpec[];
21
21
  };
22
22
  /**
23
23
  * Reference URLs
24
24
  */
25
- export declare type Cites = string[];
26
- export declare type SpecDefs = {
27
- '#globalAttrs': Partial<{
28
- '#extends': Record<string, Partial<Attribute>>;
29
- '#HTMLGlobalAttrs': Record<string, Partial<Attribute>>;
30
- [OtherGlobalAttrs: string]: Record<string, Partial<Attribute>>;
31
- }>;
32
- '#aria': {
33
- '1.2': ARIASpec;
34
- '1.1': ARIASpec;
35
- };
36
- '#contentModels': {
37
- [model in Category]?: string[];
38
- };
25
+ export type Cites = string[];
26
+ export type SpecDefs = {
27
+ '#globalAttrs': Partial<{
28
+ '#extends': Record<string, Partial<Attribute>>;
29
+ '#HTMLGlobalAttrs': Record<string, Partial<Attribute>>;
30
+ [OtherGlobalAttrs: string]: Record<string, Partial<Attribute>>;
31
+ }>;
32
+ '#aria': {
33
+ '1.2': ARIASpec;
34
+ '1.1': ARIASpec;
35
+ };
36
+ '#contentModels': {
37
+ [model in Category]?: string[];
38
+ };
39
39
  };
40
- declare type ARIASpec = {
41
- roles: ARIARoleInSchema[];
42
- graphicsRoles: ARIARoleInSchema[];
43
- props: ARIAProperty[];
40
+ type ARIASpec = {
41
+ roles: ARIARoleInSchema[];
42
+ graphicsRoles: ARIARoleInSchema[];
43
+ props: ARIAProperty[];
44
44
  };
45
45
  /**
46
46
  * Element spec
47
47
  */
48
- export declare type ElementSpec = {
49
- /**
50
- * Tag name
51
- */
52
- name: string;
53
- /**
54
- * Namespaces in XML
55
- * @see https://www.w3.org/TR/xml-names/
56
- */
57
- namespace?: NamespaceURI;
58
- /**
59
- * Reference URL
60
- */
61
- cite: string;
62
- /**
63
- * Description
64
- */
65
- description?: string;
66
- /**
67
- * Experimental technology
68
- */
69
- experimental?: true;
70
- /**
71
- * Obsolete or alternative elements
72
- */
73
- obsolete?: true | {
74
- alt: string;
75
- };
76
- /**
77
- * Deprecated
78
- */
79
- deprecated?: true;
80
- /**
81
- * Non-standard
82
- */
83
- nonStandard?: true;
84
- /**
85
- * Element categories
86
- */
87
- categories: Category[];
88
- /**
89
- * Permitted contents and permitted parents
90
- */
91
- contentModel: ContentModel;
92
- /**
93
- * Tag omission
94
- */
95
- omission: ElementSpecOmission;
96
- /**
97
- * Global Attributes
98
- */
99
- globalAttrs: GlobalAttributes;
100
- /**
101
- * Attributes
102
- */
103
- attributes: Record<string, Attribute>;
104
- /**
105
- * WAI-ARIA role and properties
106
- */
107
- aria: ARIA;
108
- /**
109
- * If true, it is possible to add any properties as attributes,
110
- * for example, when using a template engine or a view language.
111
- *
112
- * @see https://v2.vuejs.org/v2/guide/components-slots.html#Scoped-Slots
113
- *
114
- * **It assumes to specify it on the parser plugin.**
115
- */
116
- possibleToAddProperties?: true;
48
+ export type ElementSpec = {
49
+ /**
50
+ * Tag name
51
+ */
52
+ name: string;
53
+ /**
54
+ * Namespaces in XML
55
+ * @see https://www.w3.org/TR/xml-names/
56
+ */
57
+ namespace?: NamespaceURI;
58
+ /**
59
+ * Reference URL
60
+ */
61
+ cite: string;
62
+ /**
63
+ * Description
64
+ */
65
+ description?: string;
66
+ /**
67
+ * Experimental technology
68
+ */
69
+ experimental?: true;
70
+ /**
71
+ * Obsolete or alternative elements
72
+ */
73
+ obsolete?:
74
+ | true
75
+ | {
76
+ alt: string;
77
+ };
78
+ /**
79
+ * Deprecated
80
+ */
81
+ deprecated?: true;
82
+ /**
83
+ * Non-standard
84
+ */
85
+ nonStandard?: true;
86
+ /**
87
+ * Element categories
88
+ */
89
+ categories: Category[];
90
+ /**
91
+ * Permitted contents and permitted parents
92
+ */
93
+ contentModel: ContentModel;
94
+ /**
95
+ * Tag omission
96
+ */
97
+ omission: ElementSpecOmission;
98
+ /**
99
+ * Global Attributes
100
+ */
101
+ globalAttrs: GlobalAttributes;
102
+ /**
103
+ * Attributes
104
+ */
105
+ attributes: Record<string, Attribute>;
106
+ /**
107
+ * WAI-ARIA role and properties
108
+ */
109
+ aria: ARIA;
110
+ /**
111
+ * If true, it is possible to add any properties as attributes,
112
+ * for example, when using a template engine or a view language.
113
+ *
114
+ * @see https://v2.vuejs.org/v2/guide/components-slots.html#Scoped-Slots
115
+ *
116
+ * **It assumes to specify it on the parser plugin.**
117
+ */
118
+ possibleToAddProperties?: true;
117
119
  };
118
- declare type ElementSpecOmission = false | ElementSpecOmissionTags;
119
- declare type ElementSpecOmissionTags = {
120
- startTag: boolean | ElementCondition;
121
- endTag: boolean | ElementCondition;
120
+ type ElementSpecOmission = false | ElementSpecOmissionTags;
121
+ type ElementSpecOmissionTags = {
122
+ startTag: boolean | ElementCondition;
123
+ endTag: boolean | ElementCondition;
122
124
  };
123
- declare type ElementCondition = {
124
- __WIP__: 'WORK_IN_PROGRESS';
125
+ type ElementCondition = {
126
+ __WIP__: 'WORK_IN_PROGRESS';
125
127
  };
126
- export declare type Attribute = {
127
- name: string;
128
- type: AttributeType | AttributeType[];
129
- description?: string;
130
- caseSensitive?: true;
131
- experimental?: boolean;
132
- obsolete?: true;
133
- deprecated?: boolean;
134
- nonStandard?: true;
128
+ export type Attribute = {
129
+ name: string;
130
+ type: AttributeType | AttributeType[];
131
+ description?: string;
132
+ caseSensitive?: true;
133
+ experimental?: boolean;
134
+ obsolete?: true;
135
+ deprecated?: boolean;
136
+ nonStandard?: true;
135
137
  } & ExtendableAttributeSpec;
136
- declare type ExtendableAttributeSpec = Omit<AttributeJSON, 'type'>;
137
- export declare type ARIARole = {
138
- name: string;
139
- isAbstract: boolean;
140
- requiredContextRole: string[];
141
- requiredOwnedElements: string[];
142
- accessibleNameRequired: boolean;
143
- accessibleNameFromAuthor: boolean;
144
- accessibleNameFromContent: boolean;
145
- accessibleNameProhibited: boolean;
146
- childrenPresentational: boolean;
147
- ownedProperties: ARIARoleOwnedProperties[];
148
- prohibitedProperties: string[];
138
+ type ExtendableAttributeSpec = Omit<AttributeJSON, 'type'>;
139
+ export type ARIARole = {
140
+ name: string;
141
+ isAbstract: boolean;
142
+ requiredContextRole: string[];
143
+ requiredOwnedElements: string[];
144
+ accessibleNameRequired: boolean;
145
+ accessibleNameFromAuthor: boolean;
146
+ accessibleNameFromContent: boolean;
147
+ accessibleNameProhibited: boolean;
148
+ childrenPresentational: boolean;
149
+ ownedProperties: ARIARoleOwnedProperties[];
150
+ prohibitedProperties: string[];
149
151
  };
150
- export declare type ARIARoleInSchema = Partial<ARIARole & {
151
- description: string;
152
- generalization: string[];
153
- }> & {
154
- name: string;
152
+ export type ARIARoleInSchema = Partial<
153
+ ARIARole & {
154
+ description: string;
155
+ generalization: string[];
156
+ }
157
+ > & {
158
+ name: string;
155
159
  };
156
- export declare type ARIARoleOwnedProperties = {
157
- name: string;
158
- inherited?: true;
159
- required?: true;
160
- deprecated?: true;
160
+ export type ARIARoleOwnedProperties = {
161
+ name: string;
162
+ inherited?: true;
163
+ required?: true;
164
+ deprecated?: true;
161
165
  };
162
- export declare type ARIAProperty = {
163
- name: string;
164
- type: 'property' | 'state';
165
- deprecated?: true;
166
- isGlobal?: true;
167
- value: ARIAAttributeValue;
168
- conditionalValue?: {
169
- role: string[];
170
- value: ARIAAttributeValue;
171
- }[];
172
- enum: string[];
173
- defaultValue?: string;
174
- equivalentHtmlAttrs?: EquivalentHtmlAttr[];
175
- valueDescriptions?: Record<string, string>;
166
+ export type ARIAProperty = {
167
+ name: string;
168
+ type: 'property' | 'state';
169
+ deprecated?: true;
170
+ isGlobal?: true;
171
+ value: ARIAAttributeValue;
172
+ conditionalValue?: {
173
+ role: string[];
174
+ value: ARIAAttributeValue;
175
+ }[];
176
+ enum: string[];
177
+ defaultValue?: string;
178
+ equivalentHtmlAttrs?: EquivalentHtmlAttr[];
179
+ valueDescriptions?: Record<string, string>;
176
180
  };
177
- export declare type ARIAAttributeValue = 'true/false' | 'tristate' | 'true/false/undefined' | 'ID reference' | 'ID reference list' | 'integer' | 'number' | 'string' | 'token' | 'token list' | 'URI';
178
- export declare type ARIAVersion = '1.1' | '1.2';
179
- export declare type EquivalentHtmlAttr = {
180
- htmlAttrName: string;
181
- isNotStrictEquivalent?: true;
182
- value: string | null;
181
+ export type ARIAAttributeValue =
182
+ | 'true/false'
183
+ | 'tristate'
184
+ | 'true/false/undefined'
185
+ | 'ID reference'
186
+ | 'ID reference list'
187
+ | 'integer'
188
+ | 'number'
189
+ | 'string'
190
+ | 'token'
191
+ | 'token list'
192
+ | 'URI';
193
+ export type ARIAVersion = '1.1' | '1.2';
194
+ export type EquivalentHtmlAttr = {
195
+ htmlAttrName: string;
196
+ isNotStrictEquivalent?: true;
197
+ value: string | null;
183
198
  };
184
- export declare type Matches = (selector: string) => boolean;
185
- export declare type ComputedRole = {
186
- el: Element;
187
- role: (ARIARole & {
188
- superClassRoles: ARIARoleInSchema[];
189
- isImplicit?: boolean;
190
- }) | null;
191
- errorType?: RoleComputationError;
199
+ export type Matches = (selector: string) => boolean;
200
+ export type ComputedRole = {
201
+ el: Element;
202
+ role:
203
+ | (ARIARole & {
204
+ superClassRoles: ARIARoleInSchema[];
205
+ isImplicit?: boolean;
206
+ })
207
+ | null;
208
+ errorType?: RoleComputationError;
192
209
  };
193
- export declare type RoleComputationError = 'ABSTRACT' | 'GLOBAL_PROP_MUST_NOT_BE_PRESENTATIONAL' | 'IMPLICIT_ROLE_NAMESPACE_ERROR' | 'INTERACTIVE_ELEMENT_MUST_NOT_BE_PRESENTATIONAL' | 'INVALID_LANDMARK' | 'INVALID_REQUIRED_CONTEXT_ROLE' | 'NO_EXPLICIT' | 'NO_OWNER' | 'NO_PERMITTED' | 'REQUIRED_OWNED_ELEMENT_MUST_NOT_BE_PRESENTATIONAL' | 'ROLE_NO_EXISTS';
210
+ export type RoleComputationError =
211
+ | 'ABSTRACT'
212
+ | 'GLOBAL_PROP_MUST_NOT_BE_PRESENTATIONAL'
213
+ | 'IMPLICIT_ROLE_NAMESPACE_ERROR'
214
+ | 'INTERACTIVE_ELEMENT_MUST_NOT_BE_PRESENTATIONAL'
215
+ | 'INVALID_LANDMARK'
216
+ | 'INVALID_REQUIRED_CONTEXT_ROLE'
217
+ | 'NO_EXPLICIT'
218
+ | 'NO_OWNER'
219
+ | 'NO_PERMITTED'
220
+ | 'REQUIRED_OWNED_ELEMENT_MUST_NOT_BE_PRESENTATIONAL'
221
+ | 'ROLE_NO_EXISTS';
194
222
  export {};
@@ -3,56 +3,95 @@
3
3
  * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
4
4
  * and run json-schema-to-typescript to regenerate this file.
5
5
  */
6
- export declare type PermittedContentPattern = PermittedContentRequire | PermittedContentOptional | PermittedContentOneOrMore | PermittedContentZeroOrMore | PermittedContentChoice | PermittedContentTransparent;
7
- export declare type Model = ContentType | ContentType[];
8
- export declare type ContentType = string | Category;
9
- export declare type Category = '#text' | '#phrasing' | '#flow' | '#interactive' | '#heading' | '#sectioning' | '#metadata' | '#embedded' | '#palpable' | '#script-supporting' | '#SVGAnimation' | '#SVGBasicShapes' | '#SVGContainer' | '#SVGDescriptive' | '#SVGFilterPrimitive' | '#SVGFont' | '#SVGGradient' | '#SVGGraphics' | '#SVGGraphicsReferencing' | '#SVGLightSource' | '#SVGNeverRendered' | '#SVGNone' | '#SVGPaintServer' | '#SVGRenderable' | '#SVGShape' | '#SVGStructural' | '#SVGStructurallyExternal' | '#SVGTextContent' | '#SVGTextContentChild' | '#SVGOtherXMLNamespace';
6
+ export type PermittedContentPattern =
7
+ | PermittedContentRequire
8
+ | PermittedContentOptional
9
+ | PermittedContentOneOrMore
10
+ | PermittedContentZeroOrMore
11
+ | PermittedContentChoice
12
+ | PermittedContentTransparent;
13
+ export type Model = ContentType | ContentType[];
14
+ export type ContentType = string | Category;
15
+ export type Category =
16
+ | '#text'
17
+ | '#phrasing'
18
+ | '#flow'
19
+ | '#interactive'
20
+ | '#heading'
21
+ | '#sectioning'
22
+ | '#metadata'
23
+ | '#embedded'
24
+ | '#palpable'
25
+ | '#script-supporting'
26
+ | '#SVGAnimation'
27
+ | '#SVGBasicShapes'
28
+ | '#SVGContainer'
29
+ | '#SVGDescriptive'
30
+ | '#SVGFilterPrimitive'
31
+ | '#SVGFont'
32
+ | '#SVGGradient'
33
+ | '#SVGGraphics'
34
+ | '#SVGGraphicsReferencing'
35
+ | '#SVGLightSource'
36
+ | '#SVGNeverRendered'
37
+ | '#SVGNone'
38
+ | '#SVGPaintServer'
39
+ | '#SVGRenderable'
40
+ | '#SVGShape'
41
+ | '#SVGStructural'
42
+ | '#SVGStructurallyExternal'
43
+ | '#SVGTextContent'
44
+ | '#SVGTextContentChild';
10
45
  export interface ContentModelsSchema {
11
- __contentModel?: ContentModel;
46
+ __contentModel?: ContentModel;
12
47
  }
13
48
  export interface ContentModel {
14
- contents: PermittedContentPattern[] | boolean;
15
- descendantOf?: string;
16
- conditional?: {
17
- condition: string;
18
- contents: PermittedContentPattern[] | boolean;
19
- }[];
49
+ contents: PermittedContentPattern[] | boolean;
50
+ descendantOf?: string;
51
+ conditional?: {
52
+ condition: string;
53
+ contents: PermittedContentPattern[] | boolean;
54
+ }[];
20
55
  }
21
56
  export interface PermittedContentRequire {
22
- require: Model;
23
- max?: number;
24
- min?: number;
25
- _TODO_?: string;
57
+ require: Model;
58
+ max?: number;
59
+ min?: number;
60
+ _TODO_?: string;
26
61
  }
27
62
  export interface PermittedContentOptional {
28
- optional: Model;
29
- max?: number;
30
- _TODO_?: string;
63
+ optional: Model;
64
+ max?: number;
65
+ _TODO_?: string;
31
66
  }
32
67
  export interface PermittedContentOneOrMore {
33
- oneOrMore: Model | PermittedContentPattern[];
34
- max?: number;
35
- _TODO_?: string;
68
+ oneOrMore: Model | PermittedContentPattern[];
69
+ max?: number;
70
+ _TODO_?: string;
36
71
  }
37
72
  export interface PermittedContentZeroOrMore {
38
- zeroOrMore: Model | PermittedContentPattern[];
39
- max?: number;
40
- _TODO_?: string;
73
+ zeroOrMore: Model | PermittedContentPattern[];
74
+ max?: number;
75
+ _TODO_?: string;
41
76
  }
42
77
  export interface PermittedContentChoice {
43
- /**
44
- * @minItems 2
45
- * @maxItems 5
46
- */
47
- choice: [PermittedContentPattern[], PermittedContentPattern[]] | [PermittedContentPattern[], PermittedContentPattern[], PermittedContentPattern[]] | [PermittedContentPattern[], PermittedContentPattern[], PermittedContentPattern[], PermittedContentPattern[]] | [
48
- PermittedContentPattern[],
49
- PermittedContentPattern[],
50
- PermittedContentPattern[],
51
- PermittedContentPattern[],
52
- PermittedContentPattern[]
53
- ];
54
- _TODO_?: string;
78
+ /**
79
+ * @minItems 2
80
+ * @maxItems 5
81
+ */
82
+ choice:
83
+ | [PermittedContentPattern[], PermittedContentPattern[]]
84
+ | [PermittedContentPattern[], PermittedContentPattern[], PermittedContentPattern[]]
85
+ | [PermittedContentPattern[], PermittedContentPattern[], PermittedContentPattern[], PermittedContentPattern[]]
86
+ | [
87
+ PermittedContentPattern[],
88
+ PermittedContentPattern[],
89
+ PermittedContentPattern[],
90
+ PermittedContentPattern[],
91
+ PermittedContentPattern[],
92
+ ];
93
+ _TODO_?: string;
55
94
  }
56
95
  export interface PermittedContentTransparent {
57
- transparent: string;
96
+ transparent: string;
58
97
  }
@@ -3,52 +3,91 @@
3
3
  * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
4
4
  * and run json-schema-to-typescript to regenerate this file.
5
5
  */
6
- export declare type PermittedContentPattern = PermittedContentRequire | PermittedContentOptional | PermittedContentOneOrMore | PermittedContentZeroOrMore | PermittedContentChoice | PermittedContentTransparent;
7
- export declare type Model = ContentType | ContentType[];
8
- export declare type ContentType = string | Category;
9
- export declare type Category = '#text' | '#phrasing' | '#flow' | '#interactive' | '#heading' | '#sectioning' | '#metadata' | '#embedded' | '#palpable' | '#script-supporting' | '#SVGAnimation' | '#SVGBasicShapes' | '#SVGContainer' | '#SVGDescriptive' | '#SVGFilterPrimitive' | '#SVGFont' | '#SVGGradient' | '#SVGGraphics' | '#SVGGraphicsReferencing' | '#SVGLightSource' | '#SVGNeverRendered' | '#SVGNone' | '#SVGPaintServer' | '#SVGRenderable' | '#SVGShape' | '#SVGStructural' | '#SVGStructurallyExternal' | '#SVGTextContent' | '#SVGTextContentChild' | '#SVGOtherXMLNamespace';
6
+ export type PermittedContentPattern =
7
+ | PermittedContentRequire
8
+ | PermittedContentOptional
9
+ | PermittedContentOneOrMore
10
+ | PermittedContentZeroOrMore
11
+ | PermittedContentChoice
12
+ | PermittedContentTransparent;
13
+ export type Model = ContentType | ContentType[];
14
+ export type ContentType = string | Category;
15
+ export type Category =
16
+ | '#text'
17
+ | '#phrasing'
18
+ | '#flow'
19
+ | '#interactive'
20
+ | '#heading'
21
+ | '#sectioning'
22
+ | '#metadata'
23
+ | '#embedded'
24
+ | '#palpable'
25
+ | '#script-supporting'
26
+ | '#SVGAnimation'
27
+ | '#SVGBasicShapes'
28
+ | '#SVGContainer'
29
+ | '#SVGDescriptive'
30
+ | '#SVGFilterPrimitive'
31
+ | '#SVGFont'
32
+ | '#SVGGradient'
33
+ | '#SVGGraphics'
34
+ | '#SVGGraphicsReferencing'
35
+ | '#SVGLightSource'
36
+ | '#SVGNeverRendered'
37
+ | '#SVGNone'
38
+ | '#SVGPaintServer'
39
+ | '#SVGRenderable'
40
+ | '#SVGShape'
41
+ | '#SVGStructural'
42
+ | '#SVGStructurallyExternal'
43
+ | '#SVGTextContent'
44
+ | '#SVGTextContentChild';
10
45
  export interface ContentModelsSchema {
11
- __contentModel?: ContentModel;
46
+ __contentModel?: ContentModel;
12
47
  }
13
48
  export interface ContentModel {
14
- contents: PermittedContentPattern[] | boolean;
15
- descendantOf?: string;
16
- conditional?: {
17
- condition: string;
18
- contents: PermittedContentPattern[] | boolean;
19
- }[];
49
+ contents: PermittedContentPattern[] | boolean;
50
+ descendantOf?: string;
51
+ conditional?: {
52
+ condition: string;
53
+ contents: PermittedContentPattern[] | boolean;
54
+ }[];
20
55
  }
21
56
  export interface PermittedContentRequire {
22
- require: Model;
23
- max?: number;
24
- min?: number;
25
- _TODO_?: string;
57
+ require: Model;
58
+ max?: number;
59
+ min?: number;
60
+ _TODO_?: string;
26
61
  }
27
62
  export interface PermittedContentOptional {
28
- optional: Model;
29
- max?: number;
30
- _TODO_?: string;
63
+ optional: Model;
64
+ max?: number;
65
+ _TODO_?: string;
31
66
  }
32
67
  export interface PermittedContentOneOrMore {
33
- oneOrMore: Model | PermittedContentPattern[];
34
- max?: number;
35
- _TODO_?: string;
68
+ oneOrMore: Model | PermittedContentPattern[];
69
+ max?: number;
70
+ _TODO_?: string;
36
71
  }
37
72
  export interface PermittedContentZeroOrMore {
38
- zeroOrMore: Model | PermittedContentPattern[];
39
- max?: number;
40
- _TODO_?: string;
73
+ zeroOrMore: Model | PermittedContentPattern[];
74
+ max?: number;
75
+ _TODO_?: string;
41
76
  }
42
77
  export interface PermittedContentChoice {
43
- choice: [PermittedContentPattern[], PermittedContentPattern[]] | [PermittedContentPattern[], PermittedContentPattern[], PermittedContentPattern[]] | [PermittedContentPattern[], PermittedContentPattern[], PermittedContentPattern[], PermittedContentPattern[]] | [
44
- PermittedContentPattern[],
45
- PermittedContentPattern[],
46
- PermittedContentPattern[],
47
- PermittedContentPattern[],
48
- PermittedContentPattern[]
49
- ];
50
- _TODO_?: string;
78
+ choice:
79
+ | [PermittedContentPattern[], PermittedContentPattern[]]
80
+ | [PermittedContentPattern[], PermittedContentPattern[], PermittedContentPattern[]]
81
+ | [PermittedContentPattern[], PermittedContentPattern[], PermittedContentPattern[], PermittedContentPattern[]]
82
+ | [
83
+ PermittedContentPattern[],
84
+ PermittedContentPattern[],
85
+ PermittedContentPattern[],
86
+ PermittedContentPattern[],
87
+ PermittedContentPattern[],
88
+ ];
89
+ _TODO_?: string;
51
90
  }
52
91
  export interface PermittedContentTransparent {
53
- transparent: string;
92
+ transparent: string;
54
93
  }
@@ -1,5 +1,7 @@
1
- declare type NamedDefinition = string | {
2
- name: string;
3
- };
1
+ type NamedDefinition =
2
+ | string
3
+ | {
4
+ name: string;
5
+ };
4
6
  export declare function mergeArray<T extends NamedDefinition>(a: T[], b: T[] | null | undefined): T[];
5
7
  export {};
@@ -1,9 +1,9 @@
1
1
  import type { NamespaceURI, Namespace } from '@markuplint/ml-ast';
2
- declare type NamespacedElementName = {
3
- localNameWithNS: string;
4
- localName: string;
5
- namespace: Namespace;
6
- namespaceURI: NamespaceURI;
2
+ type NamespacedElementName = {
3
+ localNameWithNS: string;
4
+ localName: string;
5
+ namespace: Namespace;
6
+ namespaceURI: NamespaceURI;
7
7
  };
8
8
  export declare function resolveNamespace(name: string, namespaceURI?: string | null): NamespacedElementName;
9
9
  export {};