@@ -4,13 +4,6 @@ export type PseudoClassType = Exclude<'NoArgument' | AstPseudoClassArgument['typ
44export type PseudoElementType = Exclude < 'NoArgument' | AstPseudoElementArgument [ 'type' ] , 'Substitution' > ;
55export type CssLevel = 'css1' | 'css2' | 'css3' | 'selectors-3' | 'selectors-4' | 'latest' | 'progressive' ;
66
7- /**
8- * CSS Feature module name.
9- * @example 'css-position-3'
10- * @example 'css-scoping-1'
11- */
12- export type CssFeature = string ;
13-
147/**
158 * CSS Selector Syntax Definition can be used to define custom CSS selector parsing rules.
169 */
@@ -415,12 +408,12 @@ export const cssSyntaxDefinitions: Record<CssLevel, SyntaxDefinition> = {
415408/**
416409 * CSS Feature modules with their syntax definitions.
417410 * These can be used to extend the parser with specific CSS features.
418- *
411+ *
419412 * @example
420413 * // Using the css-position-3 feature
421414 * createParser({ features: ['css-position-3'] })
422415 */
423- export const cssFeatures : Record < string , SyntaxDefinition > = {
416+ export const cssFeatures = {
424417 'css-position-3' : {
425418 pseudoClasses : {
426419 definitions : {
@@ -446,4 +439,11 @@ export const cssFeatures: Record<string, SyntaxDefinition> = {
446439 definitions : [ 'slotted' ]
447440 }
448441 }
449- } ;
442+ } satisfies Record < string , SyntaxDefinition > ;
443+
444+ /**
445+ * CSS Feature module name.
446+ * @example 'css-position-3'
447+ * @example 'css-scoping-1'
448+ */
449+ export type CssFeature = keyof typeof cssFeatures ;
0 commit comments