@markuplint/ml-spec 3.0.0-alpha.0 → 3.0.0-alpha.2

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 (58) hide show
  1. package/lib/dom-traverse/get-content-model.d.ts +3 -0
  2. package/lib/dom-traverse/get-content-model.js +28 -0
  3. package/lib/dom-traverse/get-spec.d.ts +2 -2
  4. package/lib/dom-traverse/get-spec.js +2 -2
  5. package/lib/index.d.ts +2 -1
  6. package/lib/index.js +2 -1
  7. package/lib/specs/content-model-category-to-tag-names.d.ts +2 -2
  8. package/lib/specs/content-model-category-to-tag-names.js +2 -2
  9. package/lib/specs/get-aria.js +3 -3
  10. package/lib/specs/get-attr-specs.d.ts +1 -1
  11. package/lib/specs/get-selectors-by-content-model-category.d.ts +1 -1
  12. package/lib/specs/get-spec-by-tag-name.d.ts +2 -2
  13. package/lib/specs/get-spec-by-tag-name.js +1 -1
  14. package/lib/specs/schema-to-spec.d.ts +1 -1
  15. package/lib/specs/schema-to-spec.js +1 -1
  16. package/lib/types/aria.d.ts +7 -1
  17. package/lib/types/attributes.d.ts +93 -38
  18. package/lib/types/index.d.ts +8 -8
  19. package/lib/types/permitted-structres.d.ts +21 -27
  20. package/lib/types/permitted-structures.d.ts +54 -0
  21. package/lib/types/permitted-structures.js +8 -0
  22. package/package.json +7 -7
  23. package/schema.json +6 -6
  24. package/schemas/aria.schema.json +1 -1
  25. package/schemas/content-models.schema.json +32 -47
  26. package/src/dom-traverse/accname-computation.spec.ts +3 -3
  27. package/src/dom-traverse/get-computed-role.spec.ts +1 -1
  28. package/src/dom-traverse/get-content-model.ts +32 -0
  29. package/src/dom-traverse/get-spec.ts +3 -3
  30. package/src/index.ts +2 -1
  31. package/src/specs/content-model-category-to-tag-names.ts +3 -3
  32. package/src/specs/get-aria.ts +3 -3
  33. package/src/specs/get-selectors-by-content-model-category.ts +1 -1
  34. package/src/specs/get-spec-by-tag-name.spec.ts +10 -10
  35. package/src/specs/get-spec-by-tag-name.ts +9 -5
  36. package/src/specs/schema-to-spec.ts +1 -1
  37. package/src/types/aria.ts +7 -1
  38. package/src/types/attributes.ts +160 -105
  39. package/src/types/index.ts +8 -8
  40. package/src/types/permitted-structres.ts +23 -30
  41. package/src/types/permitted-structures.ts +97 -0
  42. package/tsconfig.tsbuildinfo +1 -1
  43. package/lib/dom-traverse/focusability-computation.d.ts +0 -1
  44. package/lib/dom-traverse/focusability-computation.js +0 -8
  45. package/lib/dom-traverse/get-aria.d.ts +0 -9
  46. package/lib/dom-traverse/get-aria.js +0 -54
  47. package/lib/specs/aria-spec.d.ts +0 -5
  48. package/lib/specs/aria-spec.js +0 -12
  49. package/lib/specs/get-spec.d.ts +0 -13
  50. package/lib/specs/get-spec.js +0 -85
  51. package/lib/specs/html-spec.d.ts +0 -6
  52. package/lib/specs/html-spec.js +0 -16
  53. package/lib/specs/resolve-namespace.d.ts +0 -9
  54. package/lib/specs/resolve-namespace.js +0 -26
  55. package/lib/utils/cache.d.ts +0 -10
  56. package/lib/utils/cache.js +0 -42
  57. package/lib/utils.d.ts +0 -8
  58. package/lib/utils.js +0 -50
@@ -1,16 +1,20 @@
1
- import type { ElementSpec, MLMLSpec } from '../types';
1
+ import type { ElementSpec } from '../types';
2
2
 
3
3
  import { resolveNamespace } from '../utils/resolve-namespace';
4
4
 
5
- const cache = new Map<string, ElementSpec | null>();
5
+ const cache = new Map<string, any>();
6
6
 
7
- export function getSpecByTagName(specs: Readonly<MLMLSpec>, localName: string, namespace: string | null) {
7
+ export function getSpecByTagName<K extends keyof ElementSpec = keyof ElementSpec>(
8
+ specs: Readonly<Pick<ElementSpec, 'name' | K>[]>,
9
+ localName: string,
10
+ namespace: string | null,
11
+ ) {
8
12
  const { localNameWithNS } = resolveNamespace(localName, namespace || undefined);
9
- let spec = cache.get(localNameWithNS);
13
+ let spec: Pick<ElementSpec, 'name' | K> | null | undefined = cache.get(localNameWithNS);
10
14
  if (spec !== undefined) {
11
15
  return spec;
12
16
  }
13
- spec = specs.specs.find(spec => spec.name === localNameWithNS) || null;
17
+ spec = specs.find(spec => spec.name === localNameWithNS) || null;
14
18
  cache.set(localNameWithNS, spec);
15
19
  return spec;
16
20
  }
@@ -5,7 +5,7 @@ import { mergeArray } from '../utils/merge-array';
5
5
  /**
6
6
  * Merging HTML-spec schema and extended spec schemas
7
7
  *
8
- * Ex: `@markuplint/html-spec` + `{ specs: ["@markuplint/vue-spec"] }` in cofigure files.
8
+ * Ex: `@markuplint/html-spec` + `{ specs: ["@markuplint/vue-spec"] }` in configure files.
9
9
  *
10
10
  * @param schemas `MLDocument.schemas`
11
11
  */
package/src/types/aria.ts CHANGED
@@ -38,6 +38,9 @@ export type PermittedARIAProperties =
38
38
  * Set true if the spec says "and any aria-* attributes applicable to the allowed roles."
39
39
  */
40
40
  role?: true | string | [string, ...string[]];
41
+ /**
42
+ * @minItems 1
43
+ */
41
44
  only?: [
42
45
  (
43
46
  | string
@@ -54,7 +57,10 @@ export type PermittedARIAProperties =
54
57
  }
55
58
  )[],
56
59
  ];
57
- whithout?: [
60
+ /**
61
+ * @minItems 1
62
+ */
63
+ without?: [
58
64
  {
59
65
  type: 'not-recommended' | 'should-not' | 'must-not';
60
66
  name: string;
@@ -1013,111 +1013,9 @@ export type AttributeType =
1013
1013
  )
1014
1014
  | 'Boolean'
1015
1015
  )
1016
- | {
1017
- token:
1018
- | (
1019
- | 'Any'
1020
- | 'NoEmptyAny'
1021
- | 'OneLineAny'
1022
- | 'Zero'
1023
- | 'Number'
1024
- | 'Int'
1025
- | 'Uint'
1026
- | 'XMLName'
1027
- | 'DOMID'
1028
- | 'FunctionBody'
1029
- | 'Pattern'
1030
- | 'DateTime'
1031
- | 'TabIndex'
1032
- | 'BCP47'
1033
- | 'URL'
1034
- | 'AbsoluteURL'
1035
- | 'HashName'
1036
- | 'OneCodePointChar'
1037
- | 'CustomElementName'
1038
- | 'BrowsingContextName'
1039
- | 'BrowsingContextNameOrKeyword'
1040
- | 'HTTPSchemaURL'
1041
- | 'MIMEType'
1042
- | 'ItemProp'
1043
- | 'Srcset'
1044
- | 'SourceSizeList'
1045
- | 'IconSize'
1046
- | 'AutoComplete'
1047
- | 'Accept'
1048
- | 'SerializedPermissionsPolicy'
1049
- | '<css-declaration-list>'
1050
- | '<class-list>'
1051
- | '<svg-font-size>'
1052
- | '<svg-font-size-adjust>'
1053
- | "<'color-profile'>"
1054
- | "<'color-rendering'>"
1055
- | "<'enable-background'>"
1056
- | '<list-of-svg-feature-string>'
1057
- | '<animatable-value>'
1058
- | '<begin-value-list>'
1059
- | '<end-value-list>'
1060
- | '<list-of-value>'
1061
- | '<clock-value>'
1062
- | '<color-matrix>'
1063
- | '<dasharray>'
1064
- | '<key-points>'
1065
- | '<key-splines>'
1066
- | '<key-times>'
1067
- | '<system-language>'
1068
- | '<origin>'
1069
- | '<svg-path>'
1070
- | '<points>'
1071
- | '<preserve-aspect-ratio>'
1072
- | '<view-box>'
1073
- | '<rotate>'
1074
- | '<text-coordinate>'
1075
- | '<list-of-lengths>'
1076
- | '<list-of-numbers>'
1077
- | '<list-of-percentages>'
1078
- | '<number-optional-number>'
1079
- )
1080
- | {
1081
- enum: [string, ...string[]];
1082
- disallowToSurroundBySpaces?: boolean;
1083
- caseInsensitive?: boolean;
1084
- invalidValueDefault?: string;
1085
- missingValueDefault?: string;
1086
- sameStates?: {
1087
- [k: string]: unknown;
1088
- };
1089
- };
1090
- disallowToSurroundBySpaces?: boolean;
1091
- allowEmpty?: boolean;
1092
- ordered?: boolean;
1093
- unique?: boolean;
1094
- caseInsensitive?: boolean;
1095
- number?:
1096
- | ('zeroOrMore' | 'oneOrMore')
1097
- | {
1098
- min: number;
1099
- max: number;
1100
- };
1101
- separator: 'space' | 'comma';
1102
- }
1103
- | {
1104
- enum: [string, ...string[]];
1105
- disallowToSurroundBySpaces?: boolean;
1106
- caseInsensitive?: boolean;
1107
- invalidValueDefault?: string;
1108
- missingValueDefault?: string;
1109
- sameStates?: {
1110
- [k: string]: unknown;
1111
- };
1112
- }
1113
- | {
1114
- type: 'float' | 'integer';
1115
- gt?: number;
1116
- gte?: number;
1117
- lt?: number;
1118
- lte?: number;
1119
- clampable?: boolean;
1120
- };
1016
+ | List
1017
+ | Enum
1018
+ | Number;
1121
1019
  export type AttributeCondition = string | [string, string, ...string[]];
1122
1020
 
1123
1021
  export interface AttributesSchema {
@@ -1208,6 +1106,9 @@ export interface GlobalAttributes {
1208
1106
  | 'onwheel'
1209
1107
  )[];
1210
1108
  '#DocumentElementEventAttrs'?: boolean | ('oncopy' | 'oncut' | 'onpaste')[];
1109
+ /**
1110
+ * @minItems 0
1111
+ */
1211
1112
  '#HTMLLinkAndFetchingAttrs'?: (
1212
1113
  | 'crossorigin'
1213
1114
  | 'download'
@@ -1223,6 +1124,9 @@ export interface GlobalAttributes {
1223
1124
  | 'type'
1224
1125
  | 'fetchpriority'
1225
1126
  )[];
1127
+ /**
1128
+ * @minItems 0
1129
+ */
1226
1130
  '#HTMLEmbededAndMediaContentAttrs'?: (
1227
1131
  | 'autoplay'
1228
1132
  | 'controls'
@@ -1235,6 +1139,9 @@ export interface GlobalAttributes {
1235
1139
  | 'srcset'
1236
1140
  | 'width'
1237
1141
  )[];
1142
+ /**
1143
+ * @minItems 0
1144
+ */
1238
1145
  '#HTMLFormControlElementAttrs'?: (
1239
1146
  | 'autocomplete'
1240
1147
  | 'dirname'
@@ -1251,12 +1158,30 @@ export interface GlobalAttributes {
1251
1158
  | 'readonly'
1252
1159
  | 'required'
1253
1160
  )[];
1161
+ /**
1162
+ * @minItems 0
1163
+ */
1254
1164
  '#HTMLTableCellElementAttrs'?: ('colspan' | 'headers' | 'rowspan')[];
1255
1165
  '#ARIAAttrs'?: boolean;
1166
+ /**
1167
+ * @minItems 0
1168
+ */
1256
1169
  '#SVGAnimationAdditionAttrs'?: ('additive' | 'accumulate')[];
1170
+ /**
1171
+ * @minItems 0
1172
+ */
1257
1173
  '#SVGAnimationAttributeTargetAttrs'?: ('attributeName' | 'attributeType')[];
1174
+ /**
1175
+ * @minItems 0
1176
+ */
1258
1177
  '#SVGAnimationEventAttrs'?: ('onbegin' | 'onend' | 'onrepeat')[];
1178
+ /**
1179
+ * @minItems 0
1180
+ */
1259
1181
  '#SVGAnimationTargetElementAttrs'?: ('href' | 'xlink:href')[];
1182
+ /**
1183
+ * @minItems 0
1184
+ */
1260
1185
  '#SVGAnimationTimingAttrs'?: (
1261
1186
  | 'begin'
1262
1187
  | 'dur'
@@ -1268,6 +1193,9 @@ export interface GlobalAttributes {
1268
1193
  | 'repeatDur'
1269
1194
  | 'fill'
1270
1195
  )[];
1196
+ /**
1197
+ * @minItems 0
1198
+ */
1271
1199
  '#SVGAnimationValueAttrs'?: (
1272
1200
  | 'calcMode'
1273
1201
  | 'values'
@@ -1281,7 +1209,13 @@ export interface GlobalAttributes {
1281
1209
  | 'autoReverse'
1282
1210
  | 'speed'
1283
1211
  )[];
1212
+ /**
1213
+ * @minItems 0
1214
+ */
1284
1215
  '#SVGConditionalProcessingAttrs'?: ('requiredExtensions' | 'systemLanguage' | 'requiredFeatures')[];
1216
+ /**
1217
+ * @minItems 0
1218
+ */
1285
1219
  '#SVGCoreAttrs'?: (
1286
1220
  | 'id'
1287
1221
  | 'tabindex'
@@ -1294,7 +1228,13 @@ export interface GlobalAttributes {
1294
1228
  | 'xml:lang'
1295
1229
  | 'xml:base'
1296
1230
  )[];
1231
+ /**
1232
+ * @minItems 0
1233
+ */
1297
1234
  '#SVGFilterPrimitiveAttrs'?: ('x' | 'y' | 'width' | 'height' | 'result' | 'in')[];
1235
+ /**
1236
+ * @minItems 0
1237
+ */
1298
1238
  '#SVGPresentationAttrs'?: (
1299
1239
  | 'cx'
1300
1240
  | 'cy'
@@ -1378,6 +1318,9 @@ export interface GlobalAttributes {
1378
1318
  | 'enable-background'
1379
1319
  | 'kerning'
1380
1320
  )[];
1321
+ /**
1322
+ * @minItems 0
1323
+ */
1381
1324
  '#SVGTransferFunctionAttrs'?: (
1382
1325
  | 'type'
1383
1326
  | 'tableValues'
@@ -1387,6 +1330,9 @@ export interface GlobalAttributes {
1387
1330
  | 'exponent'
1388
1331
  | 'offset'
1389
1332
  )[];
1333
+ /**
1334
+ * @minItems 0
1335
+ */
1390
1336
  '#XLinkAttrs'?: (
1391
1337
  | 'xlink:href'
1392
1338
  | 'xlink:title'
@@ -1416,3 +1362,112 @@ export interface AttributeJSON {
1416
1362
  animatable?: boolean;
1417
1363
  experimental?: boolean;
1418
1364
  }
1365
+ /**
1366
+ * - [Space-separated tokens](https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#space-separated-tokens)
1367
+ * - [Comma-separated tokens](https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#comma-separated-tokens)
1368
+ */
1369
+ export interface List {
1370
+ token:
1371
+ | (
1372
+ | 'Any'
1373
+ | 'NoEmptyAny'
1374
+ | 'OneLineAny'
1375
+ | 'Zero'
1376
+ | 'Number'
1377
+ | 'Int'
1378
+ | 'Uint'
1379
+ | 'XMLName'
1380
+ | 'DOMID'
1381
+ | 'FunctionBody'
1382
+ | 'Pattern'
1383
+ | 'DateTime'
1384
+ | 'TabIndex'
1385
+ | 'BCP47'
1386
+ | 'URL'
1387
+ | 'AbsoluteURL'
1388
+ | 'HashName'
1389
+ | 'OneCodePointChar'
1390
+ | 'CustomElementName'
1391
+ | 'BrowsingContextName'
1392
+ | 'BrowsingContextNameOrKeyword'
1393
+ | 'HTTPSchemaURL'
1394
+ | 'MIMEType'
1395
+ | 'ItemProp'
1396
+ | 'Srcset'
1397
+ | 'SourceSizeList'
1398
+ | 'IconSize'
1399
+ | 'AutoComplete'
1400
+ | 'Accept'
1401
+ | 'SerializedPermissionsPolicy'
1402
+ | '<css-declaration-list>'
1403
+ | '<class-list>'
1404
+ | '<svg-font-size>'
1405
+ | '<svg-font-size-adjust>'
1406
+ | "<'color-profile'>"
1407
+ | "<'color-rendering'>"
1408
+ | "<'enable-background'>"
1409
+ | '<list-of-svg-feature-string>'
1410
+ | '<animatable-value>'
1411
+ | '<begin-value-list>'
1412
+ | '<end-value-list>'
1413
+ | '<list-of-value>'
1414
+ | '<clock-value>'
1415
+ | '<color-matrix>'
1416
+ | '<dasharray>'
1417
+ | '<key-points>'
1418
+ | '<key-splines>'
1419
+ | '<key-times>'
1420
+ | '<system-language>'
1421
+ | '<origin>'
1422
+ | '<svg-path>'
1423
+ | '<points>'
1424
+ | '<preserve-aspect-ratio>'
1425
+ | '<view-box>'
1426
+ | '<rotate>'
1427
+ | '<text-coordinate>'
1428
+ | '<list-of-lengths>'
1429
+ | '<list-of-numbers>'
1430
+ | '<list-of-percentages>'
1431
+ | '<number-optional-number>'
1432
+ )
1433
+ | Enum;
1434
+ disallowToSurroundBySpaces?: boolean;
1435
+ allowEmpty?: boolean;
1436
+ ordered?: boolean;
1437
+ unique?: boolean;
1438
+ caseInsensitive?: boolean;
1439
+ number?:
1440
+ | ('zeroOrMore' | 'oneOrMore')
1441
+ | {
1442
+ min: number;
1443
+ max: number;
1444
+ };
1445
+ separator: 'space' | 'comma';
1446
+ }
1447
+ /**
1448
+ * [Enumerated attributes](https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#enumerated-attribute)
1449
+ */
1450
+ export interface Enum {
1451
+ /**
1452
+ * @minItems 1
1453
+ */
1454
+ enum: [string, ...string[]];
1455
+ disallowToSurroundBySpaces?: boolean;
1456
+ caseInsensitive?: boolean;
1457
+ invalidValueDefault?: string;
1458
+ missingValueDefault?: string;
1459
+ sameStates?: {
1460
+ [k: string]: unknown;
1461
+ };
1462
+ }
1463
+ /**
1464
+ * [Numbers](https://html.spec.whatwg.org/dev/common-microsyntaxes.html#numbers)
1465
+ */
1466
+ export interface Number {
1467
+ type: 'float' | 'integer';
1468
+ gt?: number;
1469
+ gte?: number;
1470
+ lt?: number;
1471
+ lte?: number;
1472
+ clampable?: boolean;
1473
+ }
@@ -1,10 +1,10 @@
1
1
  import type { ARIA } from './aria';
2
2
  import type { AttributeJSON, AttributeType, GlobalAttributes } from './attributes';
3
- import type { ContentModel, Category } from './permitted-structres';
3
+ import type { ContentModel, Category } from './permitted-structures';
4
4
  import type { NamespaceURI } from '@markuplint/ml-ast';
5
5
 
6
6
  /**
7
- * markuplit Markup-language spec
7
+ * markuplint Markup-language spec
8
8
  */
9
9
  export interface MLMLSpec {
10
10
  cites: Cites;
@@ -97,7 +97,7 @@ export type ElementSpec = {
97
97
  nonStandard?: true;
98
98
 
99
99
  /**
100
- * Element cateogries
100
+ * Element categories
101
101
  */
102
102
  categories: Category[];
103
103
 
@@ -107,9 +107,9 @@ export type ElementSpec = {
107
107
  contentModel: ContentModel;
108
108
 
109
109
  /**
110
- * Tag omittion
110
+ * Tag omission
111
111
  */
112
- omittion: ElementSpecOmittion;
112
+ omission: ElementSpecOmission;
113
113
 
114
114
  /**
115
115
  * Global Attributes
@@ -122,7 +122,7 @@ export type ElementSpec = {
122
122
  attributes: Record<string, Attribute>;
123
123
 
124
124
  /**
125
- * WAI-ARIA role and properies
125
+ * WAI-ARIA role and properties
126
126
  */
127
127
  aria: ARIA;
128
128
 
@@ -137,9 +137,9 @@ export type ElementSpec = {
137
137
  possibleToAddProperties?: true;
138
138
  };
139
139
 
140
- type ElementSpecOmittion = false | ElementSpecOmittionTags;
140
+ type ElementSpecOmission = false | ElementSpecOmissionTags;
141
141
 
142
- type ElementSpecOmittionTags = {
142
+ type ElementSpecOmissionTags = {
143
143
  startTag: boolean | ElementCondition;
144
144
  endTag: boolean | ElementCondition;
145
145
  };
@@ -5,14 +5,14 @@
5
5
  * and run json-schema-to-typescript to regenerate this file.
6
6
  */
7
7
 
8
- export type PermittedContent =
8
+ export type PermittedContentPattern =
9
9
  | PermittedContentRequire
10
10
  | PermittedContentOptional
11
11
  | PermittedContentOneOrMore
12
12
  | PermittedContentZeroOrMore
13
13
  | PermittedContentChoice
14
- | PermittedContentInterleave;
15
- export type Target = ContentType | ContentType[];
14
+ | PermittedContentTransparent;
15
+ export type Model = ContentType | ContentType[];
16
16
  export type ContentType = string | Category;
17
17
  export type Category =
18
18
  | '#text'
@@ -22,7 +22,6 @@ export type Category =
22
22
  | '#heading'
23
23
  | '#sectioning'
24
24
  | '#metadata'
25
- | '#transparent'
26
25
  | '#embedded'
27
26
  | '#palpable'
28
27
  | '#script-supporting'
@@ -46,63 +45,57 @@ export type Category =
46
45
  | '#SVGTextContent'
47
46
  | '#SVGTextContentChild'
48
47
  | '#SVGOtherXMLNamespace';
49
- export type PermittedContentSpec = PermittedContent[];
50
48
 
51
49
  export interface ContentModelsSchema {
52
50
  __contentModel?: ContentModel;
53
51
  }
54
52
  export interface ContentModel {
55
- contents: PermittedContentSpec | boolean;
53
+ contents: PermittedContentPattern[] | boolean;
56
54
  descendantOf?: string;
57
55
  conditional?: {
58
56
  condition: string;
59
- contents: PermittedContentSpec | boolean;
57
+ contents: PermittedContentPattern[] | boolean;
60
58
  }[];
61
59
  }
62
60
  export interface PermittedContentRequire {
63
- require: Target;
64
- ignore?: Target;
65
- notAllowedDescendants?: ContentType[];
61
+ require: Model;
66
62
  max?: number;
67
63
  min?: number;
68
64
  _TODO_?: string;
69
65
  }
70
66
  export interface PermittedContentOptional {
71
- optional: Target;
72
- ignore?: Target;
73
- notAllowedDescendants?: ContentType[];
67
+ optional: Model;
74
68
  max?: number;
75
69
  _TODO_?: string;
76
70
  }
77
71
  export interface PermittedContentOneOrMore {
78
- oneOrMore: Target | PermittedContentSpec;
79
- ignore?: Target;
80
- notAllowedDescendants?: ContentType[];
72
+ oneOrMore: Model | PermittedContentPattern[];
81
73
  max?: number;
82
74
  _TODO_?: string;
83
75
  }
84
76
  export interface PermittedContentZeroOrMore {
85
- zeroOrMore: Target | PermittedContentSpec;
86
- ignore?: Target;
87
- notAllowedDescendants?: ContentType[];
77
+ zeroOrMore: Model | PermittedContentPattern[];
88
78
  max?: number;
89
79
  _TODO_?: string;
90
80
  }
91
81
  export interface PermittedContentChoice {
82
+ /**
83
+ * @minItems 2
84
+ * @maxItems 5
85
+ */
92
86
  choice:
93
- | [PermittedContentSpec, PermittedContentSpec]
94
- | [PermittedContentSpec, PermittedContentSpec, PermittedContentSpec]
95
- | [PermittedContentSpec, PermittedContentSpec, PermittedContentSpec, PermittedContentSpec]
87
+ | [PermittedContentPattern[], PermittedContentPattern[]]
88
+ | [PermittedContentPattern[], PermittedContentPattern[], PermittedContentPattern[]]
89
+ | [PermittedContentPattern[], PermittedContentPattern[], PermittedContentPattern[], PermittedContentPattern[]]
96
90
  | [
97
- PermittedContentSpec,
98
- PermittedContentSpec,
99
- PermittedContentSpec,
100
- PermittedContentSpec,
101
- PermittedContentSpec,
91
+ PermittedContentPattern[],
92
+ PermittedContentPattern[],
93
+ PermittedContentPattern[],
94
+ PermittedContentPattern[],
95
+ PermittedContentPattern[],
102
96
  ];
103
97
  _TODO_?: string;
104
98
  }
105
- export interface PermittedContentInterleave {
106
- interleave: [PermittedContentSpec, PermittedContentSpec, ...PermittedContentSpec[]];
107
- _TODO_?: string;
99
+ export interface PermittedContentTransparent {
100
+ transparent: string;
108
101
  }
@@ -0,0 +1,97 @@
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 PermittedContentPattern =
9
+ | PermittedContentRequire
10
+ | PermittedContentOptional
11
+ | PermittedContentOneOrMore
12
+ | PermittedContentZeroOrMore
13
+ | PermittedContentChoice
14
+ | PermittedContentTransparent;
15
+ export type Model = ContentType | ContentType[];
16
+ export type ContentType = string | Category;
17
+ export type Category =
18
+ | '#text'
19
+ | '#phrasing'
20
+ | '#flow'
21
+ | '#interactive'
22
+ | '#heading'
23
+ | '#sectioning'
24
+ | '#metadata'
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
+
49
+ export interface ContentModelsSchema {
50
+ __contentModel?: ContentModel;
51
+ }
52
+ export interface ContentModel {
53
+ contents: PermittedContentPattern[] | boolean;
54
+ descendantOf?: string;
55
+ conditional?: {
56
+ condition: string;
57
+ contents: PermittedContentPattern[] | boolean;
58
+ }[];
59
+ }
60
+ export interface PermittedContentRequire {
61
+ require: Model;
62
+ max?: number;
63
+ min?: number;
64
+ _TODO_?: string;
65
+ }
66
+ export interface PermittedContentOptional {
67
+ optional: Model;
68
+ max?: number;
69
+ _TODO_?: string;
70
+ }
71
+ export interface PermittedContentOneOrMore {
72
+ oneOrMore: Model | PermittedContentPattern[];
73
+ max?: number;
74
+ _TODO_?: string;
75
+ }
76
+ export interface PermittedContentZeroOrMore {
77
+ zeroOrMore: Model | PermittedContentPattern[];
78
+ max?: number;
79
+ _TODO_?: string;
80
+ }
81
+ export interface PermittedContentChoice {
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;
94
+ }
95
+ export interface PermittedContentTransparent {
96
+ transparent: string;
97
+ }