File tree Expand file tree Collapse file tree 2 files changed +26
-8
lines changed
Expand file tree Collapse file tree 2 files changed +26
-8
lines changed Original file line number Diff line number Diff line change @@ -237,7 +237,9 @@ declare namespace parser {
237237 empty ( ) : this;
238238 insertAfter ( oldNode : Child , newNode : Child , ...restNode : Child [ ] ) : this;
239239 insertBefore ( oldNode : Child , newNode : Child , ...restNode : Child [ ] ) : this;
240- each ( callback : ( node : Child , index : number ) => boolean | void ) : boolean | undefined ;
240+ each (
241+ callback : ( node : Child , index : number ) => boolean | void
242+ ) : boolean | undefined ;
241243 walk (
242244 callback : ( node : Node , index : number ) => boolean | void
243245 ) : boolean | undefined ;
@@ -262,9 +264,18 @@ declare namespace parser {
262264 walkPseudos (
263265 callback : ( node : Pseudo ) => boolean | void
264266 ) : boolean | undefined ;
265- walkTags ( callback : ( node : Tag ) => boolean | void ) : boolean | undefined ;
266- split ( callback : ( node : Child ) => boolean ) : [ Child [ ] , Child [ ] ] ;
267- map < T > ( callback : ( node : Child ) => T ) : T [ ] ;
267+ walkTags (
268+ callback : ( node : Tag ) => boolean | void
269+ ) : boolean | undefined ;
270+ walkUniversals (
271+ callback : ( node : Universal ) => boolean | void
272+ ) : boolean | undefined ;
273+ split (
274+ callback : ( node : Child ) => boolean
275+ ) : [ Child [ ] , Child [ ] ] ;
276+ map < T > (
277+ callback : ( node : Child ) => T
278+ ) : T [ ] ;
268279 reduce (
269280 callback : (
270281 previousValue : Child ,
Original file line number Diff line number Diff line change @@ -2,11 +2,18 @@ import * as parser from './postcss-selector-parser';
22
33parser ( ( root ) => {
44 root . each ( ( node , index ) => {
5- node as parser . Selector ;
6- index as number ;
5+ node satisfies parser . Selector ;
6+ index satisfies number ;
77 } ) ;
88 root . walk ( ( node , index ) => {
9- node as parser . Selector ;
10- index as number ;
9+ node satisfies parser . Node ;
10+ index satisfies number ;
11+
12+ if ( node . type === 'selector' ) {
13+ node satisfies parser . Selector ;
14+ }
15+ } ) ;
16+ root . walkUniversals ( ( node ) => {
17+ node satisfies parser . Universal ;
1118 } ) ;
1219} ) . processSync ( "a b > c" ) ;
You can’t perform that action at this time.
0 commit comments