@@ -4,13 +4,6 @@ export type PseudoClassType = Exclude<'NoArgument' | AstPseudoClassArgument['typ
4
4
export type PseudoElementType = Exclude < 'NoArgument' | AstPseudoElementArgument [ 'type' ] , 'Substitution' > ;
5
5
export type CssLevel = 'css1' | 'css2' | 'css3' | 'selectors-3' | 'selectors-4' | 'latest' | 'progressive' ;
6
6
7
- /**
8
- * CSS Feature module name.
9
- * @example 'css-position-3'
10
- * @example 'css-scoping-1'
11
- */
12
- export type CssFeature = string ;
13
-
14
7
/**
15
8
* CSS Selector Syntax Definition can be used to define custom CSS selector parsing rules.
16
9
*/
@@ -415,12 +408,12 @@ export const cssSyntaxDefinitions: Record<CssLevel, SyntaxDefinition> = {
415
408
/**
416
409
* CSS Feature modules with their syntax definitions.
417
410
* These can be used to extend the parser with specific CSS features.
418
- *
411
+ *
419
412
* @example
420
413
* // Using the css-position-3 feature
421
414
* createParser({ features: ['css-position-3'] })
422
415
*/
423
- export const cssFeatures : Record < string , SyntaxDefinition > = {
416
+ export const cssFeatures = {
424
417
'css-position-3' : {
425
418
pseudoClasses : {
426
419
definitions : {
@@ -446,4 +439,11 @@ export const cssFeatures: Record<string, SyntaxDefinition> = {
446
439
definitions : [ 'slotted' ]
447
440
}
448
441
}
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