diff --git a/index.d.ts b/index.d.ts index 3192a97..28573cf 100644 --- a/index.d.ts +++ b/index.d.ts @@ -3161,53 +3161,57 @@ export interface CounterStyleHyphenFallback { } export interface FontFace { + MozFontFeatureSettings?: FontFaceFontFeatureSettingsProperty; fontDisplay?: FontFaceFontDisplayProperty; fontFamily?: string; fontFeatureSettings?: FontFaceFontFeatureSettingsProperty; - fontVariationSettings?: FontFaceFontVariationSettingsProperty; fontStretch?: FontFaceFontStretchProperty; fontStyle?: FontFaceFontStyleProperty; - fontWeight?: FontFaceFontWeightProperty; fontVariant?: FontFaceFontVariantProperty; + fontVariationSettings?: FontFaceFontVariationSettingsProperty; + fontWeight?: FontFaceFontWeightProperty; src?: string; unicodeRange?: string; } export interface FontFaceHyphen { + "-moz-font-feature-settings"?: FontFaceFontFeatureSettingsProperty; "font-display"?: FontFaceFontDisplayProperty; "font-family"?: string; "font-feature-settings"?: FontFaceFontFeatureSettingsProperty; - "font-variation-settings"?: FontFaceFontVariationSettingsProperty; "font-stretch"?: FontFaceFontStretchProperty; "font-style"?: FontFaceFontStyleProperty; - "font-weight"?: FontFaceFontWeightProperty; "font-variant"?: FontFaceFontVariantProperty; + "font-variation-settings"?: FontFaceFontVariationSettingsProperty; + "font-weight"?: FontFaceFontWeightProperty; src?: string; "unicode-range"?: string; } export interface FontFaceFallback { + MozFontFeatureSettings?: FontFaceFontFeatureSettingsProperty | FontFaceFontFeatureSettingsProperty[]; fontDisplay?: FontFaceFontDisplayProperty | FontFaceFontDisplayProperty[]; fontFamily?: string | string[]; fontFeatureSettings?: FontFaceFontFeatureSettingsProperty | FontFaceFontFeatureSettingsProperty[]; - fontVariationSettings?: FontFaceFontVariationSettingsProperty | FontFaceFontVariationSettingsProperty[]; fontStretch?: FontFaceFontStretchProperty | FontFaceFontStretchProperty[]; fontStyle?: FontFaceFontStyleProperty | FontFaceFontStyleProperty[]; - fontWeight?: FontFaceFontWeightProperty | FontFaceFontWeightProperty[]; fontVariant?: FontFaceFontVariantProperty | FontFaceFontVariantProperty[]; + fontVariationSettings?: FontFaceFontVariationSettingsProperty | FontFaceFontVariationSettingsProperty[]; + fontWeight?: FontFaceFontWeightProperty | FontFaceFontWeightProperty[]; src?: string | string[]; unicodeRange?: string | string[]; } export interface FontFaceHyphenFallback { + "-moz-font-feature-settings"?: FontFaceFontFeatureSettingsProperty | FontFaceFontFeatureSettingsProperty[]; "font-display"?: FontFaceFontDisplayProperty | FontFaceFontDisplayProperty[]; "font-family"?: string | string[]; "font-feature-settings"?: FontFaceFontFeatureSettingsProperty | FontFaceFontFeatureSettingsProperty[]; - "font-variation-settings"?: FontFaceFontVariationSettingsProperty | FontFaceFontVariationSettingsProperty[]; "font-stretch"?: FontFaceFontStretchProperty | FontFaceFontStretchProperty[]; "font-style"?: FontFaceFontStyleProperty | FontFaceFontStyleProperty[]; - "font-weight"?: FontFaceFontWeightProperty | FontFaceFontWeightProperty[]; "font-variant"?: FontFaceFontVariantProperty | FontFaceFontVariantProperty[]; + "font-variation-settings"?: FontFaceFontVariationSettingsProperty | FontFaceFontVariationSettingsProperty[]; + "font-weight"?: FontFaceFontWeightProperty | FontFaceFontWeightProperty[]; src?: string | string[]; "unicode-range"?: string | string[]; } @@ -3233,6 +3237,15 @@ export interface PageHyphenFallback { } export interface Viewport { + msHeight?: ViewportHeightProperty; + msMaxHeight?: ViewportMaxHeightProperty; + msMaxWidth?: ViewportMaxWidthProperty; + msMinHeight?: ViewportMinHeightProperty; + msMinWidth?: ViewportMinWidthProperty; + msOrientation?: ViewportOrientationProperty; + msWidth?: ViewportWidthProperty; + msZoom?: ViewportZoomProperty; + OOrientation?: ViewportOrientationProperty; height?: ViewportHeightProperty; maxHeight?: ViewportMaxHeightProperty; maxWidth?: ViewportMaxWidthProperty; @@ -3247,6 +3260,15 @@ export interface Viewport { } export interface ViewportHyphen { + "-ms-height"?: ViewportHeightProperty; + "-ms-max-height"?: ViewportMaxHeightProperty; + "-ms-max-width"?: ViewportMaxWidthProperty; + "-ms-min-height"?: ViewportMinHeightProperty; + "-ms-min-width"?: ViewportMinWidthProperty; + "-ms-orientation"?: ViewportOrientationProperty; + "-ms-width"?: ViewportWidthProperty; + "-ms-zoom"?: ViewportZoomProperty; + "-o-orientation"?: ViewportOrientationProperty; height?: ViewportHeightProperty; "max-height"?: ViewportMaxHeightProperty; "max-width"?: ViewportMaxWidthProperty; @@ -3261,6 +3283,15 @@ export interface ViewportHyphen { } export interface ViewportFallback { + msHeight?: ViewportHeightProperty | ViewportHeightProperty[]; + msMaxHeight?: ViewportMaxHeightProperty | ViewportMaxHeightProperty[]; + msMaxWidth?: ViewportMaxWidthProperty | ViewportMaxWidthProperty[]; + msMinHeight?: ViewportMinHeightProperty | ViewportMinHeightProperty[]; + msMinWidth?: ViewportMinWidthProperty | ViewportMinWidthProperty[]; + msOrientation?: ViewportOrientationProperty | ViewportOrientationProperty[]; + msWidth?: ViewportWidthProperty | ViewportWidthProperty[]; + msZoom?: ViewportZoomProperty | ViewportZoomProperty[]; + OOrientation?: ViewportOrientationProperty | ViewportOrientationProperty[]; height?: ViewportHeightProperty | ViewportHeightProperty[]; maxHeight?: ViewportMaxHeightProperty | ViewportMaxHeightProperty[]; maxWidth?: ViewportMaxWidthProperty | ViewportMaxWidthProperty[]; @@ -3275,6 +3306,15 @@ export interface ViewportFallback { } export interface ViewportHyphenFallback { + "-ms-height"?: ViewportHeightProperty | ViewportHeightProperty[]; + "-ms-max-height"?: ViewportMaxHeightProperty | ViewportMaxHeightProperty[]; + "-ms-max-width"?: ViewportMaxWidthProperty | ViewportMaxWidthProperty[]; + "-ms-min-height"?: ViewportMinHeightProperty | ViewportMinHeightProperty[]; + "-ms-min-width"?: ViewportMinWidthProperty | ViewportMinWidthProperty[]; + "-ms-orientation"?: ViewportOrientationProperty | ViewportOrientationProperty[]; + "-ms-width"?: ViewportWidthProperty | ViewportWidthProperty[]; + "-ms-zoom"?: ViewportZoomProperty | ViewportZoomProperty[]; + "-o-orientation"?: ViewportOrientationProperty | ViewportOrientationProperty[]; height?: ViewportHeightProperty | ViewportHeightProperty[]; "max-height"?: ViewportMaxHeightProperty | ViewportMaxHeightProperty[]; "max-width"?: ViewportMaxWidthProperty | ViewportMaxWidthProperty[]; @@ -4545,11 +4585,9 @@ type CounterStyleSpeakAsProperty = "auto" | "bullets" | "numbers" | "spell-out" type CounterStyleSystemProperty = "additive" | "alphabetic" | "cyclic" | "fixed" | "numeric" | "symbolic" | string; -type FontFaceFontDisplayProperty = "auto" | "block" | "fallback" | "optional" | "swap"; - type FontFaceFontFeatureSettingsProperty = "normal" | string; -type FontFaceFontVariationSettingsProperty = "normal"; +type FontFaceFontDisplayProperty = "auto" | "block" | "fallback" | "optional" | "swap"; type FontFaceFontStretchProperty = | "condensed" @@ -4564,8 +4602,6 @@ type FontFaceFontStretchProperty = type FontFaceFontStyleProperty = "italic" | "normal" | "oblique"; -type FontFaceFontWeightProperty = "bold" | "normal" | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900; - type FontFaceFontVariantProperty = | EastAsianVariantValues | "all-petite-caps" @@ -4598,6 +4634,10 @@ type FontFaceFontVariantProperty = | "unicase" | string; +type FontFaceFontVariationSettingsProperty = "normal"; + +type FontFaceFontWeightProperty = "bold" | "normal" | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900; + type PageBleedProperty = TLength | "auto"; type PageMarksProperty = "crop" | "cross" | "none" | string; @@ -4608,22 +4648,22 @@ type ViewportMaxHeightProperty = ViewportLength; type ViewportMaxWidthProperty = ViewportLength; -type ViewportMaxZoomProperty = "auto" | string | number; - type ViewportMinHeightProperty = ViewportLength; type ViewportMinWidthProperty = ViewportLength; -type ViewportMinZoomProperty = "auto" | string | number; - type ViewportOrientationProperty = "auto" | "landscape" | "portrait"; -type ViewportUserZoomProperty = "fixed" | "zoom"; - type ViewportWidthProperty = ViewportLength | string; type ViewportZoomProperty = "auto" | string | number; +type ViewportMaxZoomProperty = "auto" | string | number; + +type ViewportMinZoomProperty = "auto" | string | number; + +type ViewportUserZoomProperty = "fixed" | "zoom"; + type AbsoluteSize = "large" | "medium" | "small" | "x-large" | "x-small" | "xx-large" | "xx-small"; type AnimateableFeature = "contents" | "scroll-position" | string; diff --git a/index.js.flow b/index.js.flow index 757fd97..d23788e 100644 --- a/index.js.flow +++ b/index.js.flow @@ -2925,53 +2925,57 @@ export type CounterStyleHyphenFallback = { }; export type FontFace = { + MozFontFeatureSettings?: FontFaceFontFeatureSettingsProperty, fontDisplay?: FontFaceFontDisplayProperty, fontFamily?: string, fontFeatureSettings?: FontFaceFontFeatureSettingsProperty, - fontVariationSettings?: FontFaceFontVariationSettingsProperty, fontStretch?: FontFaceFontStretchProperty, fontStyle?: FontFaceFontStyleProperty, - fontWeight?: FontFaceFontWeightProperty, fontVariant?: FontFaceFontVariantProperty, + fontVariationSettings?: FontFaceFontVariationSettingsProperty, + fontWeight?: FontFaceFontWeightProperty, src?: string, unicodeRange?: string, }; export type FontFaceHyphen = { + "-moz-font-feature-settings"?: FontFaceFontFeatureSettingsProperty, "font-display"?: FontFaceFontDisplayProperty, "font-family"?: string, "font-feature-settings"?: FontFaceFontFeatureSettingsProperty, - "font-variation-settings"?: FontFaceFontVariationSettingsProperty, "font-stretch"?: FontFaceFontStretchProperty, "font-style"?: FontFaceFontStyleProperty, - "font-weight"?: FontFaceFontWeightProperty, "font-variant"?: FontFaceFontVariantProperty, + "font-variation-settings"?: FontFaceFontVariationSettingsProperty, + "font-weight"?: FontFaceFontWeightProperty, src?: string, "unicode-range"?: string, }; export type FontFaceFallback = { + MozFontFeatureSettings?: FontFaceFontFeatureSettingsProperty | FontFaceFontFeatureSettingsProperty[], fontDisplay?: FontFaceFontDisplayProperty | FontFaceFontDisplayProperty[], fontFamily?: string | string[], fontFeatureSettings?: FontFaceFontFeatureSettingsProperty | FontFaceFontFeatureSettingsProperty[], - fontVariationSettings?: FontFaceFontVariationSettingsProperty | FontFaceFontVariationSettingsProperty[], fontStretch?: FontFaceFontStretchProperty | FontFaceFontStretchProperty[], fontStyle?: FontFaceFontStyleProperty | FontFaceFontStyleProperty[], - fontWeight?: FontFaceFontWeightProperty | FontFaceFontWeightProperty[], fontVariant?: FontFaceFontVariantProperty | FontFaceFontVariantProperty[], + fontVariationSettings?: FontFaceFontVariationSettingsProperty | FontFaceFontVariationSettingsProperty[], + fontWeight?: FontFaceFontWeightProperty | FontFaceFontWeightProperty[], src?: string | string[], unicodeRange?: string | string[], }; export type FontFaceHyphenFallback = { + "-moz-font-feature-settings"?: FontFaceFontFeatureSettingsProperty | FontFaceFontFeatureSettingsProperty[], "font-display"?: FontFaceFontDisplayProperty | FontFaceFontDisplayProperty[], "font-family"?: string | string[], "font-feature-settings"?: FontFaceFontFeatureSettingsProperty | FontFaceFontFeatureSettingsProperty[], - "font-variation-settings"?: FontFaceFontVariationSettingsProperty | FontFaceFontVariationSettingsProperty[], "font-stretch"?: FontFaceFontStretchProperty | FontFaceFontStretchProperty[], "font-style"?: FontFaceFontStyleProperty | FontFaceFontStyleProperty[], - "font-weight"?: FontFaceFontWeightProperty | FontFaceFontWeightProperty[], "font-variant"?: FontFaceFontVariantProperty | FontFaceFontVariantProperty[], + "font-variation-settings"?: FontFaceFontVariationSettingsProperty | FontFaceFontVariationSettingsProperty[], + "font-weight"?: FontFaceFontWeightProperty | FontFaceFontWeightProperty[], src?: string | string[], "unicode-range"?: string | string[], }; @@ -2997,6 +3001,15 @@ export type PageHyphenFallback = { }; export type Viewport = { + msHeight?: ViewportHeightProperty, + msMaxHeight?: ViewportMaxHeightProperty, + msMaxWidth?: ViewportMaxWidthProperty, + msMinHeight?: ViewportMinHeightProperty, + msMinWidth?: ViewportMinWidthProperty, + msOrientation?: ViewportOrientationProperty, + msWidth?: ViewportWidthProperty, + msZoom?: ViewportZoomProperty, + OOrientation?: ViewportOrientationProperty, height?: ViewportHeightProperty, maxHeight?: ViewportMaxHeightProperty, maxWidth?: ViewportMaxWidthProperty, @@ -3011,6 +3024,15 @@ export type Viewport = { }; export type ViewportHyphen = { + "-ms-height"?: ViewportHeightProperty, + "-ms-max-height"?: ViewportMaxHeightProperty, + "-ms-max-width"?: ViewportMaxWidthProperty, + "-ms-min-height"?: ViewportMinHeightProperty, + "-ms-min-width"?: ViewportMinWidthProperty, + "-ms-orientation"?: ViewportOrientationProperty, + "-ms-width"?: ViewportWidthProperty, + "-ms-zoom"?: ViewportZoomProperty, + "-o-orientation"?: ViewportOrientationProperty, height?: ViewportHeightProperty, "max-height"?: ViewportMaxHeightProperty, "max-width"?: ViewportMaxWidthProperty, @@ -3025,6 +3047,15 @@ export type ViewportHyphen = { }; export type ViewportFallback = { + msHeight?: ViewportHeightProperty | ViewportHeightProperty[], + msMaxHeight?: ViewportMaxHeightProperty | ViewportMaxHeightProperty[], + msMaxWidth?: ViewportMaxWidthProperty | ViewportMaxWidthProperty[], + msMinHeight?: ViewportMinHeightProperty | ViewportMinHeightProperty[], + msMinWidth?: ViewportMinWidthProperty | ViewportMinWidthProperty[], + msOrientation?: ViewportOrientationProperty | ViewportOrientationProperty[], + msWidth?: ViewportWidthProperty | ViewportWidthProperty[], + msZoom?: ViewportZoomProperty | ViewportZoomProperty[], + OOrientation?: ViewportOrientationProperty | ViewportOrientationProperty[], height?: ViewportHeightProperty | ViewportHeightProperty[], maxHeight?: ViewportMaxHeightProperty | ViewportMaxHeightProperty[], maxWidth?: ViewportMaxWidthProperty | ViewportMaxWidthProperty[], @@ -3039,6 +3070,15 @@ export type ViewportFallback = { }; export type ViewportHyphenFallback = { + "-ms-height"?: ViewportHeightProperty | ViewportHeightProperty[], + "-ms-max-height"?: ViewportMaxHeightProperty | ViewportMaxHeightProperty[], + "-ms-max-width"?: ViewportMaxWidthProperty | ViewportMaxWidthProperty[], + "-ms-min-height"?: ViewportMinHeightProperty | ViewportMinHeightProperty[], + "-ms-min-width"?: ViewportMinWidthProperty | ViewportMinWidthProperty[], + "-ms-orientation"?: ViewportOrientationProperty | ViewportOrientationProperty[], + "-ms-width"?: ViewportWidthProperty | ViewportWidthProperty[], + "-ms-zoom"?: ViewportZoomProperty | ViewportZoomProperty[], + "-o-orientation"?: ViewportOrientationProperty | ViewportOrientationProperty[], height?: ViewportHeightProperty | ViewportHeightProperty[], "max-height"?: ViewportMaxHeightProperty | ViewportMaxHeightProperty[], "max-width"?: ViewportMaxWidthProperty | ViewportMaxWidthProperty[], @@ -4309,11 +4349,9 @@ type CounterStyleSpeakAsProperty = "auto" | "bullets" | "numbers" | "spell-out" type CounterStyleSystemProperty = "additive" | "alphabetic" | "cyclic" | "fixed" | "numeric" | "symbolic" | string; -type FontFaceFontDisplayProperty = "auto" | "block" | "fallback" | "optional" | "swap"; - type FontFaceFontFeatureSettingsProperty = "normal" | string; -type FontFaceFontVariationSettingsProperty = "normal"; +type FontFaceFontDisplayProperty = "auto" | "block" | "fallback" | "optional" | "swap"; type FontFaceFontStretchProperty = | "condensed" @@ -4328,8 +4366,6 @@ type FontFaceFontStretchProperty = type FontFaceFontStyleProperty = "italic" | "normal" | "oblique"; -type FontFaceFontWeightProperty = "bold" | "normal" | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900; - type FontFaceFontVariantProperty = | EastAsianVariantValues | "all-petite-caps" @@ -4362,6 +4398,10 @@ type FontFaceFontVariantProperty = | "unicase" | string; +type FontFaceFontVariationSettingsProperty = "normal"; + +type FontFaceFontWeightProperty = "bold" | "normal" | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900; + type PageBleedProperty = TLength | "auto"; type PageMarksProperty = "crop" | "cross" | "none" | string; @@ -4372,22 +4412,22 @@ type ViewportMaxHeightProperty = ViewportLength; type ViewportMaxWidthProperty = ViewportLength; -type ViewportMaxZoomProperty = "auto" | string | number; - type ViewportMinHeightProperty = ViewportLength; type ViewportMinWidthProperty = ViewportLength; -type ViewportMinZoomProperty = "auto" | string | number; - type ViewportOrientationProperty = "auto" | "landscape" | "portrait"; -type ViewportUserZoomProperty = "fixed" | "zoom"; - type ViewportWidthProperty = ViewportLength | string; type ViewportZoomProperty = "auto" | string | number; +type ViewportMaxZoomProperty = "auto" | string | number; + +type ViewportMinZoomProperty = "auto" | string | number; + +type ViewportUserZoomProperty = "fixed" | "zoom"; + type AbsoluteSize = "large" | "medium" | "small" | "x-large" | "x-small" | "xx-large" | "xx-small"; type AnimateableFeature = "contents" | "scroll-position" | string; diff --git a/src/at-rules.ts b/src/at-rules.ts index 7d25c68..8cb99c6 100644 --- a/src/at-rules.ts +++ b/src/at-rules.ts @@ -1,28 +1,65 @@ import * as atRules from 'mdn-data/css/at-rules.json'; +import { compatNames, compatSyntax, getAtRuleData, getCompat, isAddedBySome } from './compat'; import { resolveDataTypes } from './data-types'; import parse from './parser'; import typing, { IStringLiteral, ResolvedType, Type } from './typer'; +interface IDescriptor { + name: string; + types: ResolvedType[]; +} + export interface IAtRuleDescriptors { - [descriptor: string]: ResolvedType[]; + [descriptor: string]: IDescriptor; } export const atRuleList: IStringLiteral[] = []; export const atRuleDescriptors: { [name: string]: IAtRuleDescriptors } = {}; -for (const name in atRules) { - const atRule = atRules[name]; +for (const atName in atRules) { + const atRule = atRules[atName]; + + // Without the `@` + const name = atName.slice(1); atRuleList.push({ type: Type.StringLiteral, - literal: name, + literal: atName, }); if ('descriptors' in atRule) { const descriptors: IAtRuleDescriptors = {}; + const compatibilityData = getAtRuleData(name); for (const descriptor in atRule.descriptors) { - descriptors[descriptor] = resolveDataTypes(typing(parse(atRule.descriptors[descriptor].syntax))); + let entities = parse(atRule.descriptors[descriptor].syntax); + let properties = [descriptor]; + + if (compatibilityData && descriptor in compatibilityData) { + const compat = getCompat(compatibilityData[descriptor]); + + if (!isAddedBySome(compat)) { + // The property needs to be added by some browsers + continue; + } + + entities = compatSyntax(compatibilityData, entities); + properties = properties.concat( + // We mix current and obsolete for now + compatNames(compat, descriptor) + .concat(compatNames(compat, descriptor, true)) + .filter(property => !(property in atRule.descriptors)), + ); + } + + const types = resolveDataTypes(typing(entities)); + + for (const property of properties) { + descriptors[property] = { + name: descriptor, + types, + }; + } } atRuleDescriptors[name] = descriptors; diff --git a/src/compat.ts b/src/compat.ts index 70dccc8..6df0a77 100644 --- a/src/compat.ts +++ b/src/compat.ts @@ -30,6 +30,16 @@ export function getTypesData(name: string): MDN.CompatData | null { return null; } +export function getAtRuleData(name: string): MDN.CompatData | null { + const data = getData('at-rules/' + name); + + if (data) { + return data.css['at-rules'][name]; + } + + return null; +} + function getData(cssPath: string): any { if (cssPath in importsCache) { return importsCache[cssPath]; diff --git a/src/declarator.ts b/src/declarator.ts index 238edc7..326bc7e 100644 --- a/src/declarator.ts +++ b/src/declarator.ts @@ -254,12 +254,13 @@ for (const properties of [ const atRuleDefinitions: { [name: string]: PropertyType[] } = {}; const atRuleHyphenDefinitions: { [name: string]: PropertyType[] } = {}; -for (const name in atRuleDescriptors) { +for (const name of Object.keys(atRuleDescriptors).sort()) { atRuleDefinitions[name] = []; atRuleHyphenDefinitions[name] = []; - for (const property in atRuleDescriptors[name]) { - const types = atRuleDescriptors[name][property]; + for (const property of Object.keys(atRuleDescriptors[name]).sort()) { + const descriptor = atRuleDescriptors[name][property]; + const types = descriptor.types; const generics = lengthIn(types) ? [lengthGeneric] : []; if (onlyContainsString(types) || onlyContainsNumber(types)) { @@ -268,7 +269,7 @@ for (const name in atRuleDescriptors) { }; atRuleDefinitions[name].push({ - name: toCamelCase(property), + name: isVendorProperty(property) ? toVendorPrefixCase(property) : toCamelCase(property), type, obsolete: false, }); @@ -278,17 +279,23 @@ for (const name in atRuleDescriptors) { obsolete: false, }); } else { - const declaration: IDeclaration = { - name: toPascalCase(name.slice(1)) + toPropertyDeclarationName(property), - export: false, - types: declarable(types), - generics, - }; + // Some properties are prefixed and share the same type so we + // make sure to reuse the same declaration of that type + let declaration = declarations.get(types); + + if (!declaration) { + declaration = { + name: toPascalCase(name) + toPropertyDeclarationName(descriptor.name), + export: false, + types: declarable(types), + generics, + }; - declarations.set(types, declaration); + declarations.set(types, declaration); + } atRuleDefinitions[name].push({ - name: toCamelCase(property), + name: isVendorProperty(property) ? toVendorPrefixCase(property) : toCamelCase(property), generics, alias: aliasOf(declaration), obsolete: false, @@ -667,7 +674,7 @@ const atRuleInterfaces: Interface[] = []; // Loop in alphabetical order for (const name of Object.keys(atRuleDefinitions).sort()) { - const pascalName = toPascalCase(name.slice(1)); + const pascalName = toPascalCase(name); const generics = genericsOf(atRuleDefinitions[name].filter(isAliasProperty)); atRuleInterfaces.push( { diff --git a/src/properties.ts b/src/properties.ts index 6ce6eb6..4218375 100644 --- a/src/properties.ts +++ b/src/properties.ts @@ -126,7 +126,7 @@ export function isVendorProperty(name: string) { return REGEX_VENDOR_PROPERTY.test(name); } -export function filterMissingProperties(names: string[]) { +function filterMissingProperties(names: string[]) { // Filter only those which isn't defined in MDN data return names.filter(name => !(name in properties)); }