@@ -41,7 +41,7 @@ export class AngleMatcher extends matcherBase(AngleMatch) {
4141 override accepts ( propertyName : string ) : boolean {
4242 return cssMetadata ( ) . isAngleAwareProperty ( propertyName ) ;
4343 }
44- override matches ( node : CodeMirror . SyntaxNode , matching : BottomUpTreeMatching ) : Match | null {
44+ override matches ( node : CodeMirror . SyntaxNode , matching : BottomUpTreeMatching ) : AngleMatch | null {
4545 if ( node . name !== 'NumberLiteral' ) {
4646 return null ;
4747 }
@@ -77,7 +77,7 @@ export class ColorMixMatcher extends matcherBase(ColorMixMatch) {
7777 override accepts ( propertyName : string ) : boolean {
7878 return cssMetadata ( ) . isColorAwareProperty ( propertyName ) ;
7979 }
80- override matches ( node : CodeMirror . SyntaxNode , matching : BottomUpTreeMatching ) : Match | null {
80+ override matches ( node : CodeMirror . SyntaxNode , matching : BottomUpTreeMatching ) : ColorMixMatch | null {
8181 if ( node . name !== 'CallExpression' || matching . ast . text ( node . getChild ( 'Callee' ) ) !== 'color-mix' ) {
8282 return null ;
8383 }
@@ -136,7 +136,7 @@ export class URLMatch implements Match {
136136// clang-format off
137137export class URLMatcher extends matcherBase ( URLMatch ) {
138138 // clang-format on
139- override matches ( node : CodeMirror . SyntaxNode , matching : BottomUpTreeMatching ) : Match | null {
139+ override matches ( node : CodeMirror . SyntaxNode , matching : BottomUpTreeMatching ) : URLMatch | null {
140140 if ( node . name !== 'CallLiteral' ) {
141141 return null ;
142142 }
@@ -197,7 +197,7 @@ export class ColorMatcher extends matcherBase(ColorMatch) {
197197 return cssMetadata ( ) . isColorAwareProperty ( propertyName ) ;
198198 }
199199
200- override matches ( node : CodeMirror . SyntaxNode , matching : BottomUpTreeMatching ) : Match | null {
200+ override matches ( node : CodeMirror . SyntaxNode , matching : BottomUpTreeMatching ) : ColorMatch | null {
201201 const text = matching . ast . text ( node ) ;
202202 if ( node . name === 'ColorLiteral' ) {
203203 return new ColorMatch ( text , node ) ;
@@ -235,7 +235,7 @@ export class LightDarkColorMatcher extends matcherBase(LightDarkColorMatch) {
235235 return cssMetadata ( ) . isColorAwareProperty ( propertyName ) ;
236236 }
237237
238- override matches ( node : CodeMirror . SyntaxNode , matching : BottomUpTreeMatching ) : Match | null {
238+ override matches ( node : CodeMirror . SyntaxNode , matching : BottomUpTreeMatching ) : LightDarkColorMatch | null {
239239 if ( node . name !== 'CallExpression' || matching . ast . text ( node . getChild ( 'Callee' ) ) !== 'light-dark' ) {
240240 return null ;
241241 }
@@ -257,7 +257,7 @@ export class AutoBaseMatch implements Match {
257257// clang-format off
258258export class AutoBaseMatcher extends matcherBase ( AutoBaseMatch ) {
259259 // clang-format on
260- override matches ( node : CodeMirror . SyntaxNode , matching : BottomUpTreeMatching ) : Match | null {
260+ override matches ( node : CodeMirror . SyntaxNode , matching : BottomUpTreeMatching ) : AutoBaseMatch | null {
261261 if ( node . name !== 'CallExpression' || matching . ast . text ( node . getChild ( 'Callee' ) ) !== '-internal-auto-base' ) {
262262 return null ;
263263 }
@@ -331,7 +331,8 @@ export class LinkableNameMatcher extends matcherBase(LinkableNameMatch) {
331331 } ) ,
332332 ) ;
333333
334- private matchAnimationNameInShorthand ( node : CodeMirror . SyntaxNode , matching : BottomUpTreeMatching ) : Match | null {
334+ private matchAnimationNameInShorthand ( node : CodeMirror . SyntaxNode , matching : BottomUpTreeMatching ) : LinkableNameMatch |
335+ null {
335336 // Order is important within each animation definition for distinguishing <keyframes-name> values from other keywords.
336337 // When parsing, keywords that are valid for properties other than animation-name
337338 // whose values were not found earlier in the shorthand must be accepted for those properties rather than for animation-name.
@@ -381,7 +382,7 @@ export class LinkableNameMatcher extends matcherBase(LinkableNameMatch) {
381382 return LinkableNameMatcher . isLinkableNameProperty ( propertyName ) ;
382383 }
383384
384- override matches ( node : CodeMirror . SyntaxNode , matching : BottomUpTreeMatching ) : Match | null {
385+ override matches ( node : CodeMirror . SyntaxNode , matching : BottomUpTreeMatching ) : LinkableNameMatch | null {
385386 const { propertyName} = matching . ast ;
386387 const text = matching . ast . text ( node ) ;
387388 const parentNode = node . parent ;
@@ -466,7 +467,7 @@ export class ShadowMatcher extends matcherBase(ShadowMatch) {
466467 override accepts ( propertyName : string ) : boolean {
467468 return cssMetadata ( ) . isShadowProperty ( propertyName ) ;
468469 }
469- override matches ( node : CodeMirror . SyntaxNode , matching : BottomUpTreeMatching ) : Match | null {
470+ override matches ( node : CodeMirror . SyntaxNode , matching : BottomUpTreeMatching ) : ShadowMatch | null {
470471 if ( node . name !== 'Declaration' ) {
471472 return null ;
472473 }
@@ -519,7 +520,7 @@ export class LengthMatcher extends matcherBase(LengthMatch) {
519520 'dvb' , 'dvmin' , 'dvmax' , 'svw' , 'svh' , 'svi' , 'svb' , 'svmin' , 'svmax' , 'lvw' , 'lvh' , 'lvi' , 'lvb' , 'lvmin' ,
520521 'lvmax' , 'cqw' , 'cqh' , 'cqi' , 'cqb' , 'cqmin' , 'cqmax' , 'cqem' , 'cqlh' , 'cqex' , 'cqch' ,
521522 ] ) ;
522- override matches ( node : CodeMirror . SyntaxNode , matching : BottomUpTreeMatching ) : Match | null {
523+ override matches ( node : CodeMirror . SyntaxNode , matching : BottomUpTreeMatching ) : LengthMatch | null {
523524 if ( node . name !== 'NumberLiteral' ) {
524525 return null ;
525526 }
@@ -542,7 +543,7 @@ export class SelectFunctionMatch implements Match {
542543// clang-format off
543544export class SelectFunctionMatcher extends matcherBase ( SelectFunctionMatch ) {
544545 // clang-format on
545- override matches ( node : CodeMirror . SyntaxNode , matching : BottomUpTreeMatching ) : Match | null {
546+ override matches ( node : CodeMirror . SyntaxNode , matching : BottomUpTreeMatching ) : SelectFunctionMatch | null {
546547 if ( node . name !== 'CallExpression' ) {
547548 return null ;
548549 }
@@ -573,7 +574,7 @@ export class FlexGridMatcher extends matcherBase(FlexGridMatch) {
573574 return propertyName === 'display' ;
574575 }
575576
576- override matches ( node : CodeMirror . SyntaxNode , matching : BottomUpTreeMatching ) : Match | null {
577+ override matches ( node : CodeMirror . SyntaxNode , matching : BottomUpTreeMatching ) : FlexGridMatch | null {
577578 if ( node . name !== 'Declaration' ) {
578579 return null ;
579580 }
@@ -606,7 +607,7 @@ export class GridTemplateMatcher extends matcherBase(GridTemplateMatch) {
606607 override accepts ( propertyName : string ) : boolean {
607608 return cssMetadata ( ) . isGridAreaDefiningProperty ( propertyName ) ;
608609 }
609- override matches ( node : CodeMirror . SyntaxNode , matching : BottomUpTreeMatching ) : Match | null {
610+ override matches ( node : CodeMirror . SyntaxNode , matching : BottomUpTreeMatching ) : GridTemplateMatch | null {
610611 if ( node . name !== 'Declaration' || matching . hasUnresolvedVars ( node ) ) {
611612 return null ;
612613 }
@@ -705,7 +706,7 @@ export class AnchorFunctionMatcher extends matcherBase(AnchorFunctionMatch) {
705706 return null ;
706707 }
707708
708- override matches ( node : CodeMirror . SyntaxNode , matching : BottomUpTreeMatching ) : Match | null {
709+ override matches ( node : CodeMirror . SyntaxNode , matching : BottomUpTreeMatching ) : AnchorFunctionMatch | null {
709710 if ( node . name === 'VariableName' ) {
710711 // Double-dashed anchor reference to be rendered with a link to its matching anchor.
711712 let parent = node . parent ;
@@ -748,7 +749,7 @@ export class PositionAnchorMatcher extends matcherBase(PositionAnchorMatch) {
748749 return propertyName === 'position-anchor' ;
749750 }
750751
751- override matches ( node : CodeMirror . SyntaxNode , matching : BottomUpTreeMatching ) : Match | null {
752+ override matches ( node : CodeMirror . SyntaxNode , matching : BottomUpTreeMatching ) : PositionAnchorMatch | null {
752753 if ( node . name !== 'VariableName' ) {
753754 return null ;
754755 }
@@ -778,7 +779,7 @@ export class CSSWideKeywordMatcher extends matcherBase(CSSWideKeywordMatch) {
778779 super ( ) ;
779780 }
780781
781- override matches ( node : CodeMirror . SyntaxNode , matching : BottomUpTreeMatching ) : Match | null {
782+ override matches ( node : CodeMirror . SyntaxNode , matching : BottomUpTreeMatching ) : CSSWideKeywordMatch | null {
782783 const parentNode = node . parent ;
783784 if ( node . name !== 'ValueName' || parentNode ?. name !== 'Declaration' ) {
784785 return null ;
@@ -813,7 +814,7 @@ export class PositionTryMatcher extends matcherBase(PositionTryMatch) {
813814 propertyName === LinkableNameProperties . POSITION_TRY_FALLBACKS ;
814815 }
815816
816- override matches ( node : CodeMirror . SyntaxNode , matching : BottomUpTreeMatching ) : Match | null {
817+ override matches ( node : CodeMirror . SyntaxNode , matching : BottomUpTreeMatching ) : PositionTryMatch | null {
817818 if ( node . name !== 'Declaration' ) {
818819 return null ;
819820 }
0 commit comments