@markuplint/ml-spec 3.0.0-rc.4 → 3.0.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/lib/dom-traverse/get-attr-specs.d.ts +1 -1
- package/lib/dom-traverse/get-computed-aria-props.d.ts +5 -5
- package/lib/dom-traverse/get-content-model.d.ts +1 -4
- package/lib/dom-traverse/get-implicit-role.d.ts +1 -5
- package/lib/dom-traverse/get-non-presentational-ancestor.d.ts +4 -10
- package/lib/dom-traverse/get-permitted-roles.d.ts +3 -7
- package/lib/dom-traverse/get-spec.d.ts +1 -4
- package/lib/dom-traverse/has-required-owned-elements.d.ts +1 -6
- package/lib/dom-traverse/is-exposed.js +8 -0
- package/lib/specs/aria-specs.d.ts +4 -7
- package/lib/specs/content-model-category-to-tag-names.d.ts +1 -4
- package/lib/specs/get-aria.d.ts +1 -7
- package/lib/specs/get-attr-specs.d.ts +2 -6
- package/lib/specs/get-implicit-role.d.ts +1 -7
- package/lib/specs/get-permitted-roles.d.ts +3 -9
- package/lib/specs/get-role-spec.d.ts +3 -10
- package/lib/specs/get-selectors-by-content-model-category.d.ts +1 -4
- package/lib/specs/get-spec-by-tag-name.d.ts +1 -5
- package/lib/specs/is-palpable-elements.d.ts +4 -8
- package/lib/specs/schema-to-spec.d.ts +3 -3
- package/lib/types/aria.d.ts +114 -128
- package/lib/types/attributes.d.ts +111 -1436
- package/lib/types/index.d.ts +146 -174
- package/lib/types/permitted-structres.d.ts +35 -74
- package/lib/types/permitted-structures.d.ts +31 -70
- package/lib/utils/merge-array.d.ts +3 -5
- package/lib/utils/resolve-namespace.d.ts +4 -4
- package/package.json +5 -5
- package/schemas/aria.schema.json +0 -258
- package/schemas/attributes.schema.json +0 -204
- package/schemas/content-models.schema.json +0 -199
- package/schemas/element.schema.json +0 -11
- package/schemas/global-attributes.schema.json +0 -761
- package/src/dom-traverse/accname-computation.spec.ts +0 -69
- package/src/dom-traverse/accname-computation.ts +0 -5
- package/src/dom-traverse/get-attr-specs.ts +0 -8
- package/src/dom-traverse/get-computed-aria-props.spec.ts +0 -368
- package/src/dom-traverse/get-computed-aria-props.ts +0 -130
- package/src/dom-traverse/get-computed-role.spec.ts +0 -134
- package/src/dom-traverse/get-computed-role.ts +0 -181
- package/src/dom-traverse/get-content-model.ts +0 -32
- package/src/dom-traverse/get-explicit-role.ts +0 -112
- package/src/dom-traverse/get-implicit-role.ts +0 -36
- package/src/dom-traverse/get-non-presentational-ancestor.ts +0 -20
- package/src/dom-traverse/get-permitted-roles.ts +0 -7
- package/src/dom-traverse/get-spec.ts +0 -7
- package/src/dom-traverse/has-required-owned-elements.spec.ts +0 -36
- package/src/dom-traverse/has-required-owned-elements.ts +0 -85
- package/src/dom-traverse/is-exposed.spec.ts +0 -50
- package/src/dom-traverse/is-exposed.ts +0 -196
- package/src/dom-traverse/may-be-focusable.ts +0 -21
- package/src/index.ts +0 -24
- package/src/specs/aria-specs.ts +0 -6
- package/src/specs/content-model-category-to-tag-names.ts +0 -15
- package/src/specs/get-aria.ts +0 -85
- package/src/specs/get-attr-specs.spec.ts +0 -47
- package/src/specs/get-attr-specs.ts +0 -116
- package/src/specs/get-implicit-role.spec.ts +0 -81
- package/src/specs/get-implicit-role.ts +0 -17
- package/src/specs/get-permitted-roles.spec.ts +0 -420
- package/src/specs/get-permitted-roles.ts +0 -87
- package/src/specs/get-role-spec.spec.ts +0 -67
- package/src/specs/get-role-spec.ts +0 -72
- package/src/specs/get-selectors-by-content-model-category.ts +0 -10
- package/src/specs/get-spec-by-tag-name.spec.ts +0 -68
- package/src/specs/get-spec-by-tag-name.ts +0 -20
- package/src/specs/is-nothing-content-model.ts +0 -9
- package/src/specs/is-palpable-elements.ts +0 -55
- package/src/specs/is-presentational.ts +0 -6
- package/src/specs/is-void-element.ts +0 -22
- package/src/specs/resolve-version.ts +0 -20
- package/src/specs/schema-to-spec.spec.ts +0 -39
- package/src/specs/schema-to-spec.ts +0 -103
- package/src/types/aria.ts +0 -153
- package/src/types/attributes.ts +0 -1473
- package/src/types/index.ts +0 -255
- package/src/types/permitted-structres.ts +0 -100
- package/src/types/permitted-structures.ts +0 -96
- package/src/utils/get-ns.ts +0 -18
- package/src/utils/merge-array.ts +0 -35
- package/src/utils/resolve-namespace.spec.ts +0 -37
- package/src/utils/resolve-namespace.ts +0 -40
- package/tsconfig.test.json +0 -3
- package/tsconfig.tsbuildinfo +0 -1
package/lib/types/index.d.ts
CHANGED
|
@@ -6,217 +6,189 @@ import type { NamespaceURI } from '@markuplint/ml-ast';
|
|
|
6
6
|
* markuplint Markup-language spec
|
|
7
7
|
*/
|
|
8
8
|
export interface MLMLSpec {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
cites: Cites;
|
|
10
|
+
def: SpecDefs;
|
|
11
|
+
specs: ElementSpec[];
|
|
12
12
|
}
|
|
13
13
|
export type ExtendedElementSpec = Partial<Omit<ElementSpec, 'name' | 'attributes'>> & {
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
name: ElementSpec['name'];
|
|
15
|
+
attributes?: Record<string, Partial<Attribute>>;
|
|
16
16
|
};
|
|
17
17
|
export type ExtendedSpec = {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
cites?: Cites;
|
|
19
|
+
def?: Partial<SpecDefs>;
|
|
20
|
+
specs?: ExtendedElementSpec[];
|
|
21
21
|
};
|
|
22
22
|
/**
|
|
23
23
|
* Reference URLs
|
|
24
24
|
*/
|
|
25
25
|
export type Cites = string[];
|
|
26
26
|
export type SpecDefs = {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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
40
|
type ARIASpec = {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
roles: ARIARoleInSchema[];
|
|
42
|
+
graphicsRoles: ARIARoleInSchema[];
|
|
43
|
+
props: ARIAProperty[];
|
|
44
44
|
};
|
|
45
45
|
/**
|
|
46
46
|
* Element spec
|
|
47
47
|
*/
|
|
48
48
|
export type ElementSpec = {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
*/
|
|
118
|
-
possibleToAddProperties?: true;
|
|
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;
|
|
119
117
|
};
|
|
120
118
|
type ElementSpecOmission = false | ElementSpecOmissionTags;
|
|
121
119
|
type ElementSpecOmissionTags = {
|
|
122
|
-
|
|
123
|
-
|
|
120
|
+
startTag: boolean | ElementCondition;
|
|
121
|
+
endTag: boolean | ElementCondition;
|
|
124
122
|
};
|
|
125
123
|
type ElementCondition = {
|
|
126
|
-
|
|
124
|
+
__WIP__: 'WORK_IN_PROGRESS';
|
|
127
125
|
};
|
|
128
126
|
export type Attribute = {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
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;
|
|
137
135
|
} & ExtendableAttributeSpec;
|
|
138
136
|
type ExtendableAttributeSpec = Omit<AttributeJSON, 'type'>;
|
|
139
137
|
export type ARIARole = {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
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[];
|
|
151
149
|
};
|
|
152
|
-
export type ARIARoleInSchema = Partial<
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
> & {
|
|
158
|
-
name: string;
|
|
150
|
+
export type ARIARoleInSchema = Partial<ARIARole & {
|
|
151
|
+
description: string;
|
|
152
|
+
generalization: string[];
|
|
153
|
+
}> & {
|
|
154
|
+
name: string;
|
|
159
155
|
};
|
|
160
156
|
export type ARIARoleOwnedProperties = {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
157
|
+
name: string;
|
|
158
|
+
inherited?: true;
|
|
159
|
+
required?: true;
|
|
160
|
+
deprecated?: true;
|
|
165
161
|
};
|
|
166
162
|
export type ARIAProperty = {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
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>;
|
|
180
176
|
};
|
|
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';
|
|
177
|
+
export type ARIAAttributeValue = 'true/false' | 'tristate' | 'true/false/undefined' | 'ID reference' | 'ID reference list' | 'integer' | 'number' | 'string' | 'token' | 'token list' | 'URI';
|
|
193
178
|
export type ARIAVersion = '1.1' | '1.2';
|
|
194
179
|
export type EquivalentHtmlAttr = {
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
180
|
+
htmlAttrName: string;
|
|
181
|
+
isNotStrictEquivalent?: true;
|
|
182
|
+
value: string | null;
|
|
198
183
|
};
|
|
199
184
|
export type Matches = (selector: string) => boolean;
|
|
200
185
|
export type ComputedRole = {
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
| null;
|
|
208
|
-
errorType?: RoleComputationError;
|
|
186
|
+
el: Element;
|
|
187
|
+
role: (ARIARole & {
|
|
188
|
+
superClassRoles: ARIARoleInSchema[];
|
|
189
|
+
isImplicit?: boolean;
|
|
190
|
+
}) | null;
|
|
191
|
+
errorType?: RoleComputationError;
|
|
209
192
|
};
|
|
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';
|
|
193
|
+
export 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';
|
|
222
194
|
export {};
|
|
@@ -3,95 +3,56 @@
|
|
|
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 type PermittedContentPattern =
|
|
7
|
-
| PermittedContentRequire
|
|
8
|
-
| PermittedContentOptional
|
|
9
|
-
| PermittedContentOneOrMore
|
|
10
|
-
| PermittedContentZeroOrMore
|
|
11
|
-
| PermittedContentChoice
|
|
12
|
-
| PermittedContentTransparent;
|
|
6
|
+
export type PermittedContentPattern = PermittedContentRequire | PermittedContentOptional | PermittedContentOneOrMore | PermittedContentZeroOrMore | PermittedContentChoice | PermittedContentTransparent;
|
|
13
7
|
export type Model = ContentType | ContentType[];
|
|
14
8
|
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';
|
|
9
|
+
export 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';
|
|
45
10
|
export interface ContentModelsSchema {
|
|
46
|
-
|
|
11
|
+
__contentModel?: ContentModel;
|
|
47
12
|
}
|
|
48
13
|
export interface ContentModel {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
14
|
+
contents: PermittedContentPattern[] | boolean;
|
|
15
|
+
descendantOf?: string;
|
|
16
|
+
conditional?: {
|
|
17
|
+
condition: string;
|
|
18
|
+
contents: PermittedContentPattern[] | boolean;
|
|
19
|
+
}[];
|
|
55
20
|
}
|
|
56
21
|
export interface PermittedContentRequire {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
22
|
+
require: Model;
|
|
23
|
+
max?: number;
|
|
24
|
+
min?: number;
|
|
25
|
+
_TODO_?: string;
|
|
61
26
|
}
|
|
62
27
|
export interface PermittedContentOptional {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
28
|
+
optional: Model;
|
|
29
|
+
max?: number;
|
|
30
|
+
_TODO_?: string;
|
|
66
31
|
}
|
|
67
32
|
export interface PermittedContentOneOrMore {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
33
|
+
oneOrMore: Model | PermittedContentPattern[];
|
|
34
|
+
max?: number;
|
|
35
|
+
_TODO_?: string;
|
|
71
36
|
}
|
|
72
37
|
export interface PermittedContentZeroOrMore {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
38
|
+
zeroOrMore: Model | PermittedContentPattern[];
|
|
39
|
+
max?: number;
|
|
40
|
+
_TODO_?: string;
|
|
76
41
|
}
|
|
77
42
|
export interface PermittedContentChoice {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
PermittedContentPattern[],
|
|
91
|
-
PermittedContentPattern[],
|
|
92
|
-
];
|
|
93
|
-
_TODO_?: string;
|
|
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;
|
|
94
55
|
}
|
|
95
56
|
export interface PermittedContentTransparent {
|
|
96
|
-
|
|
57
|
+
transparent: string;
|
|
97
58
|
}
|
|
@@ -3,91 +3,52 @@
|
|
|
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 type PermittedContentPattern =
|
|
7
|
-
| PermittedContentRequire
|
|
8
|
-
| PermittedContentOptional
|
|
9
|
-
| PermittedContentOneOrMore
|
|
10
|
-
| PermittedContentZeroOrMore
|
|
11
|
-
| PermittedContentChoice
|
|
12
|
-
| PermittedContentTransparent;
|
|
6
|
+
export type PermittedContentPattern = PermittedContentRequire | PermittedContentOptional | PermittedContentOneOrMore | PermittedContentZeroOrMore | PermittedContentChoice | PermittedContentTransparent;
|
|
13
7
|
export type Model = ContentType | ContentType[];
|
|
14
8
|
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';
|
|
9
|
+
export 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';
|
|
45
10
|
export interface ContentModelsSchema {
|
|
46
|
-
|
|
11
|
+
__contentModel?: ContentModel;
|
|
47
12
|
}
|
|
48
13
|
export interface ContentModel {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
14
|
+
contents: PermittedContentPattern[] | boolean;
|
|
15
|
+
descendantOf?: string;
|
|
16
|
+
conditional?: {
|
|
17
|
+
condition: string;
|
|
18
|
+
contents: PermittedContentPattern[] | boolean;
|
|
19
|
+
}[];
|
|
55
20
|
}
|
|
56
21
|
export interface PermittedContentRequire {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
22
|
+
require: Model;
|
|
23
|
+
max?: number;
|
|
24
|
+
min?: number;
|
|
25
|
+
_TODO_?: string;
|
|
61
26
|
}
|
|
62
27
|
export interface PermittedContentOptional {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
28
|
+
optional: Model;
|
|
29
|
+
max?: number;
|
|
30
|
+
_TODO_?: string;
|
|
66
31
|
}
|
|
67
32
|
export interface PermittedContentOneOrMore {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
33
|
+
oneOrMore: Model | PermittedContentPattern[];
|
|
34
|
+
max?: number;
|
|
35
|
+
_TODO_?: string;
|
|
71
36
|
}
|
|
72
37
|
export interface PermittedContentZeroOrMore {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
38
|
+
zeroOrMore: Model | PermittedContentPattern[];
|
|
39
|
+
max?: number;
|
|
40
|
+
_TODO_?: string;
|
|
76
41
|
}
|
|
77
42
|
export interface PermittedContentChoice {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
PermittedContentPattern[],
|
|
87
|
-
PermittedContentPattern[],
|
|
88
|
-
];
|
|
89
|
-
_TODO_?: string;
|
|
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;
|
|
90
51
|
}
|
|
91
52
|
export interface PermittedContentTransparent {
|
|
92
|
-
|
|
53
|
+
transparent: string;
|
|
93
54
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { NamespaceURI, Namespace } from '@markuplint/ml-ast';
|
|
2
2
|
type NamespacedElementName = {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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 {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@markuplint/ml-spec",
|
|
3
|
-
"version": "3.0.0
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Types and schema that specs of the Markup languages for markuplint",
|
|
5
5
|
"repository": "git@github.com:markuplint/markuplint.git",
|
|
6
6
|
"author": "Yusuke Hirao <yusukehirao@me.com>",
|
|
@@ -22,14 +22,14 @@
|
|
|
22
22
|
"schema": "run-s schema:*"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@markuplint/ml-ast": "3.0.0-rc.
|
|
25
|
+
"@markuplint/ml-ast": "3.0.0-rc.5",
|
|
26
26
|
"dom-accessibility-api": "^0.5.14",
|
|
27
27
|
"tslib": "^2.4.1"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@markuplint/test-tools": "3.0.0-rc.
|
|
31
|
-
"@markuplint/types": "3.0.0
|
|
30
|
+
"@markuplint/test-tools": "3.0.0-rc.5",
|
|
31
|
+
"@markuplint/types": "3.0.0",
|
|
32
32
|
"json-schema-to-typescript": "^11.0.2"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "51af6a64bb8da54376a138f19e3f15a2f759a967"
|
|
35
35
|
}
|