@markuplint/ml-spec
Advanced tools
Comparing version 1.7.0 to 2.0.0-alpha.0
@@ -1,2 +0,2 @@ | ||
import { MLDOMElementSpec, MLMLSpec } from './types'; | ||
export declare function getSpecByTagName(tagName: string, specs: MLMLSpec): MLDOMElementSpec | null; | ||
import type { MLDOMElementSpec, MLMLSpec } from './types'; | ||
export declare function getSpecByTagName(nameWithNS: string, specs: MLMLSpec): MLDOMElementSpec | null; |
@@ -19,7 +19,6 @@ "use strict"; | ||
} | ||
function getSpecByTagName(tagName, specs) { | ||
function getSpecByTagName(nameWithNS, specs) { | ||
const specOM = getSpecOM(specs); | ||
tagName = tagName.toLowerCase(); | ||
return specOM[tagName] || null; | ||
return specOM[nameWithNS] || null; | ||
} | ||
exports.getSpecByTagName = getSpecByTagName; |
@@ -1,2 +0,2 @@ | ||
import { ElementSpec, ExtendedSpec, MLMLSpec } from '@markuplint/ml-spec'; | ||
import type { ElementSpec, ExtendedSpec, MLMLSpec } from './types'; | ||
/** | ||
@@ -10,5 +10,5 @@ * Merging HTML-spec schema and extended spec schemas | ||
export declare function getSpec(schemas: readonly [MLMLSpec, ...ExtendedSpec[]]): { | ||
cites: import("@markuplint/ml-spec").Cites; | ||
def: import("@markuplint/ml-spec").SpecDefs; | ||
cites: import("./types").Cites; | ||
def: import("./types").SpecDefs; | ||
specs: ElementSpec[]; | ||
}; |
@@ -13,4 +13,5 @@ "use strict"; | ||
function getSpec(schemas) { | ||
var _a, _b, _c; | ||
const [main, ...extendedSpecs] = schemas; | ||
const result = Object.assign({}, main); | ||
const result = { ...main }; | ||
for (const extendedSpec of extendedSpecs) { | ||
@@ -24,4 +25,7 @@ if (extendedSpec.cites) { | ||
} | ||
if (extendedSpec.def['#globalAttrs']) { | ||
result.def['#globalAttrs'] = [...result.def['#globalAttrs'], ...extendedSpec.def['#globalAttrs']]; | ||
if ((_a = extendedSpec.def['#globalAttrs']) === null || _a === void 0 ? void 0 : _a['#extends']) { | ||
result.def['#globalAttrs']['#HTMLGlobalAttrs'] = [ | ||
...(((_b = result.def['#globalAttrs']) === null || _b === void 0 ? void 0 : _b['#HTMLGlobalAttrs']) || []), | ||
...(((_c = extendedSpec.def['#globalAttrs']) === null || _c === void 0 ? void 0 : _c['#extends']) || []), | ||
]; | ||
} | ||
@@ -54,3 +58,8 @@ if (extendedSpec.def['#roles']) { | ||
const exSpec = exSpecs.splice(index, 1)[0]; | ||
specs.push(Object.assign(Object.assign(Object.assign({}, elSpec), exSpec), { attributes: utils_1.mergeArray(elSpec.attributes, exSpec.attributes), categories: utils_1.mergeArray(elSpec.categories, exSpec.categories) })); | ||
specs.push({ | ||
...elSpec, | ||
...exSpec, | ||
attributes: (0, utils_1.mergeArray)(elSpec.attributes, exSpec.attributes), | ||
categories: (0, utils_1.mergeArray)(elSpec.categories, exSpec.categories), | ||
}); | ||
} | ||
@@ -57,0 +66,0 @@ result.specs = specs; |
export * from './permitted-structres'; | ||
export * from './attributes'; | ||
export * from './get-spec-by-tag-name'; | ||
export * from './get-spec'; | ||
export * from './get-ns'; | ||
export * from './types'; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
tslib_1.__exportStar(require("./permitted-structres"), exports); | ||
tslib_1.__exportStar(require("./get-spec-by-tag-name"), exports); | ||
tslib_1.__exportStar(require("./get-spec"), exports); | ||
tslib_1.__exportStar(require("./types"), exports); | ||
(0, tslib_1.__exportStar)(require("./permitted-structres"), exports); | ||
(0, tslib_1.__exportStar)(require("./attributes"), exports); | ||
(0, tslib_1.__exportStar)(require("./get-spec-by-tag-name"), exports); | ||
(0, tslib_1.__exportStar)(require("./get-spec"), exports); | ||
(0, tslib_1.__exportStar)(require("./get-ns"), exports); | ||
(0, tslib_1.__exportStar)(require("./types"), exports); |
@@ -9,3 +9,3 @@ /** | ||
export declare type Node = string | '#text' | ContentModel; | ||
export declare type ContentModel = '#phrasing' | '#flow' | '#interactive' | '#heading' | '#sectioning' | '#metadata' | '#transparent' | '#embedded' | '#palpable' | '#script-supporting'; | ||
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'; | ||
export declare type PermittedContentSpec = PermittedContent[]; | ||
@@ -12,0 +12,0 @@ export interface PermittedStructuresSchema { |
@@ -1,2 +0,3 @@ | ||
import { ContentModel, PermittedStructuresSchema } from './permitted-structres'; | ||
import type { AttributeCondition, AttributeType } from './attributes'; | ||
import type { ContentModel, PermittedStructuresSchema } from './permitted-structres'; | ||
/** | ||
@@ -23,5 +24,9 @@ * markuplit Markup-language spec | ||
export declare type SpecDefs = { | ||
'#globalAttrs': Attribute[]; | ||
'#globalAttrs': Partial<{ | ||
'#extends': Attribute[]; | ||
'#HTMLGlobalAttrs': Attribute[]; | ||
[OtherGlobalAttrs: string]: Attribute[]; | ||
}>; | ||
'#ariaAttrs': ARIAAttribute[]; | ||
'#roles': ARIRRoleAttribute[]; | ||
'#ariaAttrs': ARIAAttribute[]; | ||
'#contentModels': { | ||
@@ -40,2 +45,7 @@ [model in ContentModel]?: string[]; | ||
/** | ||
* Namespaces in XML | ||
* @see https://www.w3.org/TR/xml-names/ | ||
*/ | ||
namespace?: 'http://www.w3.org/1999/xhtml' | 'http://www.w3.org/2000/svg' | 'http://www.w3.org/1998/Math/MathML'; | ||
/** | ||
* Reference URL | ||
@@ -124,3 +134,3 @@ */ | ||
name: string; | ||
type: AttributeType; | ||
type: AttributeType | [AttributeType, ...AttributeType[]]; | ||
description: string; | ||
@@ -130,15 +140,9 @@ caseSensitive?: true; | ||
obsolete?: true; | ||
deprecated?: true; | ||
deprecated?: boolean; | ||
nonStandard?: true; | ||
required?: true | AttributeCondition; | ||
required?: boolean | AttributeCondition; | ||
requiredEither?: string[]; | ||
enum?: string[]; | ||
noUse?: boolean; | ||
condition?: AttributeCondition; | ||
}; | ||
export declare type AttributeCondition = { | ||
ancestor?: string; | ||
self?: string | string[]; | ||
}; | ||
export declare type AttributeType = 'String' | 'NonEmptyString' | 'Boolean' | 'Function' | 'Date' | 'Int' | 'Uint' | 'Float' | 'NonZeroUint' | 'AcceptList' | 'AutoComplete' | 'BCP47' | 'Color' | 'ColSpan' | 'Coords' | 'DateTime' | 'Destination' | 'DOMID' | 'DOMIDList' | 'ItemType' | 'LinkSizes' | 'LinkType' | 'LinkTypeList' | 'MediaQuery' | 'MediaQueryList' | 'MIMEType' | 'ReferrerPolicy' | 'RowSpan' | 'SourceSizeList' | 'SrcSet' | 'TabIndex' | 'Target' | 'URL' | 'URLHash' | 'URLList'; | ||
export declare type ARIRRoleAttribute = { | ||
@@ -145,0 +149,0 @@ name: string; |
@@ -24,3 +24,6 @@ "use strict"; | ||
} | ||
const exItem = Object.assign(Object.assign({}, aItem), bItem); | ||
const exItem = { | ||
...aItem, | ||
...bItem, | ||
}; | ||
result.push(exItem); | ||
@@ -27,0 +30,0 @@ } |
{ | ||
"name": "@markuplint/ml-spec", | ||
"version": "1.7.0", | ||
"version": "2.0.0-alpha.0", | ||
"description": "Types and schema that specs of the Markup languages for markuplint", | ||
@@ -18,11 +18,13 @@ "repository": "git@github.com:markuplint/markuplint.git", | ||
"clean": "tsc --build --clean", | ||
"schema": "json2ts ./schemas/permitted-structures.schema.json > ./src/permitted-structres.ts; prettier --write ./src/permitted-structres.ts; eslint --fix --config ../../../.eslintrc ./src/permitted-structres.ts" | ||
"schema:structures": "json2ts ./schemas/permitted-structures.schema.json > ./src/permitted-structres.ts; prettier --write ./src/permitted-structres.ts; eslint --fix --config ../../../.eslintrc ./src/permitted-structres.ts", | ||
"schema:attributes": "json2ts ./schemas/attributes.schema.json > ./src/attributes.ts; prettier --write ./src/attributes.ts; eslint --fix --config ../../../.eslintrc ./src/attributes.ts", | ||
"schema": "yarn schema:structures; yarn schema:attributes;" | ||
}, | ||
"dependencies": { | ||
"tslib": "^2.3.0" | ||
"tslib": "^2.3.1" | ||
}, | ||
"devDependencies": { | ||
"json-schema-to-typescript": "^10.1.4" | ||
"json-schema-to-typescript": "^10.1.5" | ||
}, | ||
"gitHead": "ffef90a8232a7cdd0f4eb12b11c071c184042500" | ||
"gitHead": "2e5b7e616411588b01c098deb35c6aa0470dfadb" | ||
} |
{ | ||
"definitions": { | ||
"condition": { | ||
"AttributeCondition": { | ||
"oneOf": [ | ||
@@ -8,4 +8,7 @@ { | ||
"additionalProperties": false, | ||
"required": ["ancestor"], | ||
"properties": { | ||
"ancestor": { "type": "string" } | ||
"ancestor": { | ||
"type": "string" | ||
} | ||
} | ||
@@ -16,6 +19,10 @@ }, | ||
"additionalProperties": false, | ||
"required": ["self"], | ||
"properties": { | ||
"self": { | ||
"type": ["string", "array"], | ||
"items": { "type": "string", "minItems": 2 } | ||
"items": { | ||
"type": "string", | ||
"minItems": 2 | ||
} | ||
} | ||
@@ -25,2 +32,162 @@ } | ||
] | ||
}, | ||
"AttributeType": { | ||
"oneOf": [ | ||
{ | ||
"type": "string", | ||
"enum": [ | ||
"String", | ||
"NonEmptyString", | ||
"Boolean", | ||
"Function", | ||
"Date", | ||
"Int", | ||
"Uint", | ||
"Float", | ||
"NonZeroUint", | ||
"ZeroToOne", | ||
"AcceptList", | ||
"AutoComplete", | ||
"BCP47", | ||
"Color", | ||
"ColSpan", | ||
"Coords", | ||
"Crossorigin", | ||
"DateTime", | ||
"Destination", | ||
"DOMID", | ||
"DOMIDList", | ||
"IRI", | ||
"ItemType", | ||
"LinkSizes", | ||
"LinkType", | ||
"LinkTypeList", | ||
"MediaQuery", | ||
"MediaQueryList", | ||
"MIMEType", | ||
"ReferrerPolicy", | ||
"RowSpan", | ||
"SourceSizeList", | ||
"SrcSet", | ||
"TabIndex", | ||
"Target", | ||
"URL", | ||
"URLHash", | ||
"URLList", | ||
"CSSAngle", | ||
"CSSBlendMode", | ||
"CSSClipPath", | ||
"CSSCustomIdent", | ||
"CSSDisplay", | ||
"CSSFilter", | ||
"CSSFontFamily", | ||
"CSSFontSize", | ||
"CSSFontVariant", | ||
"CSSFontWeight", | ||
"CSSMask", | ||
"CSSOpacity", | ||
"CSSTextDecoration", | ||
"CSSTransformList", | ||
"CSSTransformOrigin", | ||
"CSSURL", | ||
"SVGAnimatableValue", | ||
"SVGBeginValueList", | ||
"SVGClockValue", | ||
"SVGColorMatrix", | ||
"SVGDashArray", | ||
"SVGEndValueList", | ||
"SVGFilterPrimitiveReference", | ||
"SVGKernelMatrix", | ||
"SVGKeyPoints", | ||
"SVGKeySplines", | ||
"SVGKeyTimes", | ||
"SVGLanguageTags", | ||
"SVGLength", | ||
"SVGLengthList", | ||
"SVGNumberList", | ||
"SVGNumberOptionalNumber", | ||
"SVGOrigin", | ||
"SVGPaint", | ||
"SVGPathCommands", | ||
"SVGPercentage", | ||
"SVGPercentageList", | ||
"SVGPoints", | ||
"SVGPreserveAspectRatio", | ||
"SVGViewBox" | ||
] | ||
}, | ||
{ | ||
"type": "object", | ||
"additionalProperties": false, | ||
"required": ["enum"], | ||
"properties": { | ||
"enum": { | ||
"type": "array", | ||
"minLength": 1, | ||
"uniqueItems": true, | ||
"items": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"AttributeJSON": { | ||
"type": "object", | ||
"additionalProperties": false, | ||
"required": ["name", "type"], | ||
"properties": { | ||
"name": { | ||
"type": "string" | ||
}, | ||
"type": { | ||
"oneOf": [ | ||
{ | ||
"$ref": "#/definitions/AttributeType" | ||
}, | ||
{ | ||
"type": "array", | ||
"minItems": 1, | ||
"uniqueItems": true, | ||
"items": { | ||
"$ref": "#/definitions/AttributeType" | ||
} | ||
} | ||
] | ||
}, | ||
"defaultValue": { "type": "string" }, | ||
"deprecated": { "type": "boolean" }, | ||
"required": { | ||
"oneOf": [ | ||
{ | ||
"type": "boolean" | ||
}, | ||
{ | ||
"$ref": "#/definitions/AttributeCondition" | ||
} | ||
] | ||
}, | ||
"requiredEither": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
"noUse": { | ||
"type": "boolean" | ||
}, | ||
"condition": { | ||
"$ref": "#/definitions/AttributeCondition" | ||
} | ||
} | ||
}, | ||
"DefineDefaultAttributeType": { | ||
"type": "object", | ||
"additionalProperties": false, | ||
"required": ["name", "defaultValue"], | ||
"properties": { | ||
"name": { "type": "string" }, | ||
"defaultValue": { "type": "string" } | ||
} | ||
} | ||
@@ -35,61 +202,35 @@ }, | ||
"type": "array", | ||
"uniqueItems": true, | ||
"items": { | ||
"type": "object", | ||
"additionalProperties": false, | ||
"required": ["name", "type"], | ||
"properties": { | ||
"name": { "type": "string" }, | ||
"type": { | ||
"anyOf": [ | ||
{ | ||
"type": "string", | ||
"enum": [ | ||
"String", | ||
"NonEmptyString", | ||
"Boolean", | ||
"Function", // JavaScript function body | ||
"Date", | ||
"Int", // Integer | ||
"Uint", // Non-negative integer | ||
"Float", // Floating-point number | ||
"NonZeroUint", // Non-negative integer greater than zero | ||
"AcceptList", // https://html.spec.whatwg.org/multipage/input.html#attr-input-accept | ||
"AutoComplete", // https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-detail-tokens | ||
"BCP47", // https://tools.ietf.org/html/bcp47 | ||
"Color", // https://drafts.csswg.org/css-color/#typedef-color | ||
"ColSpan", // https://html.spec.whatwg.org/multipage/tables.html#attr-tdth-colspan | ||
"Coords", // https://html.spec.whatwg.org/multipage/image-maps.html#attr-area-coords | ||
"DateTime", // https://html.spec.whatwg.org/multipage/text-level-semantics.html#datetime-value | ||
"Destination", // https://html.spec.whatwg.org/multipage/semantics.html#attr-link-as | ||
"DOMID", | ||
"DOMIDList", | ||
"ItemType", // https://html.spec.whatwg.org/multipage/microdata.html#attr-itemtype | ||
"LinkSizes", // https://html.spec.whatwg.org/multipage/semantics.html#attr-link-sizes | ||
"LinkType", // https://html.spec.whatwg.org/multipage/links.html#linkTypes | ||
"LinkTypeList", // https://html.spec.whatwg.org/multipage/links.html#linkTypes | ||
"MediaQuery", // https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#valid-media-query-list | ||
"MediaQueryList", // https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#valid-media-query-list | ||
"MIMEType", // https://mimesniff.spec.whatwg.org/#valid-mime-type | ||
"ReferrerPolicy", // https://html.spec.whatwg.org/multipage/urls-and-fetching.html#referrer-policy-attribute | ||
"RowSpan", // https://html.spec.whatwg.org/multipage/tables.html#attr-tdth-rowspan | ||
"SourceSizeList", // https://html.spec.whatwg.org/multipage/images.html#sizes-attributes | ||
"SrcSet", // https://html.spec.whatwg.org/multipage/images.html#srcset-attribute | ||
"TabIndex", // https://html.spec.whatwg.org/multipage/interaction.html#attr-tabindex | ||
"Target", // https://html.spec.whatwg.org/multipage/links.html#attr-hyperlink-target | ||
"URL", // https://html.spec.whatwg.org/multipage/urls-and-fetching.html#valid-url-potentially-surrounded-by-spaces | ||
"URLHash", // https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#valid-hash-name-reference | ||
"URLList" // https://html.spec.whatwg.org/multipage/urls-and-fetching.html#valid-url-potentially-surrounded-by-spaces | ||
"#globalAttrs", | ||
"#ariaAttrs", | ||
"#SVGAnimationAdditionAttrs", | ||
"#SVGAnimationAttributeTargetAttrs", | ||
"#SVGAnimationEventAttrs", | ||
"#SVGAnimationTargetElementAttrs", | ||
"#SVGAnimationTimingAttrs", | ||
"#SVGAnimationValueAttrs", | ||
"#SVGConditionalProcessingAttrs", | ||
"#SVGCoreAttrs", | ||
"#SVGDocumentElementEventAttrs", | ||
"#SVGDocumentEventAttrs", | ||
"#SVGFilterPrimitiveAttrs", | ||
"#SVGGlobalEventAttrs", | ||
"#SVGGraphicalEventAttrs", | ||
"#SVGPresentationAttrs", | ||
"#SVGTransferFunctionAttrs", | ||
"#XLinkAttrs" | ||
] | ||
}, | ||
"deprecated": { "type": "boolean" }, | ||
"required": { | ||
"oneOf": [{ "type": "boolean" }, { "$ref": "#/definitions/condition" }] | ||
{ | ||
"$ref": "#/definitions/AttributeJSON" | ||
}, | ||
"requiredEither": { "type": "array", "items": { "type": "string" } }, | ||
"enum": { "type": "array", "items": { "type": "string" }, "minLength": 1 }, | ||
"noUse": { | ||
"type": "boolean" | ||
}, | ||
"condition": { | ||
"$ref": "#/definitions/condition" | ||
{ | ||
"$ref": "#/definitions/DefineDefaultAttributeType" | ||
} | ||
} | ||
] | ||
} | ||
@@ -96,0 +237,0 @@ } |
@@ -6,7 +6,19 @@ { | ||
{ | ||
"description": "HTML Element", | ||
"type": "string", | ||
"pattern": "^[a-z][a-z0-9]+$" | ||
"pattern": "^[a-z][a-z0-9]*$" | ||
}, | ||
{ | ||
"description": "Namespaced HTML Element", | ||
"type": "string", | ||
"pattern": "^html:[a-z][a-z0-9]*$" | ||
}, | ||
{ | ||
"description": "SVG Element", | ||
"type": "string", | ||
"pattern": "^svg:(?:[a-z][a-zA-Z0-9]*|[a-z][a-z0-9]*-[a-z][a-z0-9]*)$" | ||
}, | ||
{ | ||
"description": "Text Node", | ||
"type": "string", | ||
"enum": ["#text"] | ||
@@ -29,3 +41,23 @@ }, | ||
"#palpable", | ||
"#script-supporting" | ||
"#script-supporting", | ||
"#SVGAnimation", | ||
"#SVGBasicShapes", | ||
"#SVGContainer", | ||
"#SVGDescriptive", | ||
"#SVGFilterPrimitive", | ||
"#SVGFont", | ||
"#SVGGradient", | ||
"#SVGGraphics", | ||
"#SVGGraphicsReferencing", | ||
"#SVGLightSource", | ||
"#SVGNeverRendered", | ||
"#SVGNone", | ||
"#SVGPaintServer", | ||
"#SVGRenderable", | ||
"#SVGShape", | ||
"#SVGStructural", | ||
"#SVGStructurallyExternal", | ||
"#SVGTextContent", | ||
"#SVGTextContentChild", | ||
"#SVGOtherXMLNamespace" | ||
] | ||
@@ -32,0 +64,0 @@ }, |
@@ -1,2 +0,2 @@ | ||
import { Attribute, MLDOMElementSpec, MLMLSpec, SpecOM } from './types'; | ||
import type { Attribute, MLDOMElementSpec, MLMLSpec, SpecOM } from './types'; | ||
@@ -21,6 +21,5 @@ function getSpecOM({ specs }: MLMLSpec): SpecOM { | ||
export function getSpecByTagName(tagName: string, specs: MLMLSpec): MLDOMElementSpec | null { | ||
export function getSpecByTagName(nameWithNS: string, specs: MLMLSpec): MLDOMElementSpec | null { | ||
const specOM = getSpecOM(specs); | ||
tagName = tagName.toLowerCase(); | ||
return specOM[tagName] || null; | ||
return specOM[nameWithNS] || null; | ||
} |
@@ -1,2 +0,5 @@ | ||
import htmlSpec, { Attribute } from '@markuplint/html-spec'; | ||
import type { Attribute } from '@markuplint/html-spec'; | ||
import htmlSpec from '@markuplint/html-spec'; | ||
import { getSpec } from './get-spec'; | ||
@@ -3,0 +6,0 @@ |
@@ -1,2 +0,3 @@ | ||
import { ElementSpec, ExtendedSpec, MLMLSpec } from '@markuplint/ml-spec'; | ||
import type { ElementSpec, ExtendedSpec, MLMLSpec } from './types'; | ||
import { mergeArray } from './utils'; | ||
@@ -22,4 +23,7 @@ | ||
} | ||
if (extendedSpec.def['#globalAttrs']) { | ||
result.def['#globalAttrs'] = [...result.def['#globalAttrs'], ...extendedSpec.def['#globalAttrs']]; | ||
if (extendedSpec.def['#globalAttrs']?.['#extends']) { | ||
result.def['#globalAttrs']['#HTMLGlobalAttrs'] = [ | ||
...(result.def['#globalAttrs']?.['#HTMLGlobalAttrs'] || []), | ||
...(extendedSpec.def['#globalAttrs']?.['#extends'] || []), | ||
]; | ||
} | ||
@@ -26,0 +30,0 @@ if (extendedSpec.def['#roles']) { |
export * from './permitted-structres'; | ||
export * from './attributes'; | ||
export * from './get-spec-by-tag-name'; | ||
export * from './get-spec'; | ||
export * from './get-ns'; | ||
export * from './types'; |
@@ -27,3 +27,23 @@ /* tslint:disable */ | ||
| '#palpable' | ||
| '#script-supporting'; | ||
| '#script-supporting' | ||
| '#SVGAnimation' | ||
| '#SVGBasicShapes' | ||
| '#SVGContainer' | ||
| '#SVGDescriptive' | ||
| '#SVGFilterPrimitive' | ||
| '#SVGFont' | ||
| '#SVGGradient' | ||
| '#SVGGraphics' | ||
| '#SVGGraphicsReferencing' | ||
| '#SVGLightSource' | ||
| '#SVGNeverRendered' | ||
| '#SVGNone' | ||
| '#SVGPaintServer' | ||
| '#SVGRenderable' | ||
| '#SVGShape' | ||
| '#SVGStructural' | ||
| '#SVGStructurallyExternal' | ||
| '#SVGTextContent' | ||
| '#SVGTextContentChild' | ||
| '#SVGOtherXMLNamespace'; | ||
export type PermittedContentSpec = PermittedContent[]; | ||
@@ -30,0 +50,0 @@ |
@@ -1,2 +0,3 @@ | ||
import { ContentModel, PermittedStructuresSchema } from './permitted-structres'; | ||
import type { AttributeCondition, AttributeType } from './attributes'; | ||
import type { ContentModel, PermittedStructuresSchema } from './permitted-structres'; | ||
@@ -26,5 +27,9 @@ /** | ||
export type SpecDefs = { | ||
'#globalAttrs': Attribute[]; | ||
'#globalAttrs': Partial<{ | ||
'#extends': Attribute[]; | ||
'#HTMLGlobalAttrs': Attribute[]; | ||
[OtherGlobalAttrs: string]: Attribute[]; | ||
}>; | ||
'#ariaAttrs': ARIAAttribute[]; | ||
'#roles': ARIRRoleAttribute[]; | ||
'#ariaAttrs': ARIAAttribute[]; | ||
'#contentModels': { [model in ContentModel]?: string[] }; | ||
@@ -43,2 +48,8 @@ }; | ||
/** | ||
* Namespaces in XML | ||
* @see https://www.w3.org/TR/xml-names/ | ||
*/ | ||
namespace?: 'http://www.w3.org/1999/xhtml' | 'http://www.w3.org/2000/svg' | 'http://www.w3.org/1998/Math/MathML'; | ||
/** | ||
* Reference URL | ||
@@ -146,3 +157,3 @@ */ | ||
name: string; | ||
type: AttributeType; | ||
type: AttributeType | [AttributeType, ...AttributeType[]]; | ||
description: string; | ||
@@ -152,7 +163,6 @@ caseSensitive?: true; | ||
obsolete?: true; | ||
deprecated?: true; | ||
deprecated?: boolean; | ||
nonStandard?: true; | ||
required?: true | AttributeCondition; | ||
required?: boolean | AttributeCondition; | ||
requiredEither?: string[]; | ||
enum?: string[]; | ||
noUse?: boolean; | ||
@@ -162,46 +172,2 @@ condition?: AttributeCondition; | ||
export type AttributeCondition = { | ||
ancestor?: string; | ||
self?: string | string[]; | ||
}; | ||
// type AttributeCtegory = 'global' | 'xml' | 'aria' | 'eventhandler' | 'form' | 'particular'; | ||
export type AttributeType = | ||
| 'String' | ||
| 'NonEmptyString' | ||
| 'Boolean' | ||
| 'Function' // JavaScript function body | ||
| 'Date' | ||
| 'Int' // Integer | ||
| 'Uint' // Non-negative integer | ||
| 'Float' // Floating-point number | ||
| 'NonZeroUint' // Non-negative integer greater than zero | ||
| 'AcceptList' // https://html.spec.whatwg.org/multipage/input.html#attr-input-accept | ||
| 'AutoComplete' // https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-detail-tokens | ||
| 'BCP47' // https://tools.ietf.org/html/bcp47 | ||
| 'Color' // https://drafts.csswg.org/css-color/#typedef-color | ||
| 'ColSpan' // https://html.spec.whatwg.org/multipage/tables.html#attr-tdth-colspan | ||
| 'Coords' // https://html.spec.whatwg.org/multipage/image-maps.html#attr-area-coords | ||
| 'DateTime' // https://html.spec.whatwg.org/multipage/text-level-semantics.html#datetime-value | ||
| 'Destination' // https://html.spec.whatwg.org/multipage/semantics.html#attr-link-as | ||
| 'DOMID' | ||
| 'DOMIDList' | ||
| 'ItemType' // https://html.spec.whatwg.org/multipage/microdata.html#attr-itemtype | ||
| 'LinkSizes' // https://html.spec.whatwg.org/multipage/semantics.html#attr-link-sizes | ||
| 'LinkType' // https://html.spec.whatwg.org/multipage/links.html#linkTypes | ||
| 'LinkTypeList' // https://html.spec.whatwg.org/multipage/links.html#linkTypes | ||
| 'MediaQuery' // https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#valid-media-query-list | ||
| 'MediaQueryList' // https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#valid-media-query-list | ||
| 'MIMEType' // https://mimesniff.spec.whatwg.org/#valid-mime-type | ||
| 'ReferrerPolicy' // https://html.spec.whatwg.org/multipage/urls-and-fetching.html#referrer-policy-attributes | ||
| 'RowSpan' // https://html.spec.whatwg.org/multipage/tables.html#attr-tdth-rowspan | ||
| 'SourceSizeList' // https://html.spec.whatwg.org/multipage/images.html#sizes-attributes | ||
| 'SrcSet' // https://html.spec.whatwg.org/multipage/images.html#srcset-attribute | ||
| 'TabIndex' // https://html.spec.whatwg.org/multipage/interaction.html#attr-tabindex | ||
| 'Target' // https://html.spec.whatwg.org/multipage/links.html#attr-hyperlink-target | ||
| 'URL' // https://html.spec.whatwg.org/multipage/urls-and-fetching.html#valid-url-potentially-surrounded-by-spaces | ||
| 'URLHash' // https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#valid-hash-name-reference | ||
| 'URLList'; // https://html.spec.whatwg.org/multipage/urls-and-fetching.html#valid-url-potentially-surrounded-by-spaces | ||
export type ARIRRoleAttribute = { | ||
@@ -208,0 +174,0 @@ name: string; |
{ | ||
"extends": "../../../tsconfig.json", | ||
"compilerOptions": { | ||
"composite": true | ||
}, | ||
"include": ["./src/**/*"], | ||
"exclude": ["node_modules"] | ||
"extends": "../../../tsconfig.json" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
99661
35
2349
2
Updatedtslib@^2.3.1