@@ -125,15 +125,6 @@ declare abstract class Container_<Child extends Node = ChildNode> extends Node {
125125 every (
126126 condition : ( node : Child , index : number , nodes : Child [ ] ) => boolean
127127 ) : boolean
128- /**
129- * The container’s first child.
130- *
131- * ```js
132- * rule.first === rules.nodes[0]
133- * ```
134- */
135- get first ( ) : Child | undefined
136-
137128 /**
138129 * Returns a `child`’s index within the `Container#nodes` array.
139130 *
@@ -145,6 +136,7 @@ declare abstract class Container_<Child extends Node = ChildNode> extends Node {
145136 * @return Child index.
146137 */
147138 index ( child : Child | number ) : number
139+
148140 /**
149141 * Insert new node after old node within the container.
150142 *
@@ -156,24 +148,6 @@ declare abstract class Container_<Child extends Node = ChildNode> extends Node {
156148 oldNode : Child | number ,
157149 newNode : Child | Child [ ] | ChildProps | ChildProps [ ] | string | string [ ]
158150 ) : this
159-
160- /**
161- * Traverses the container’s descendant nodes, calling callback
162- * for each comment node.
163- *
164- * Like `Container#each`, this method is safe
165- * to use if you are mutating arrays during iteration.
166- *
167- * ```js
168- * root.walkComments(comment => {
169- * comment.remove()
170- * })
171- * ```
172- *
173- * @param callback Iterator receives each node and index.
174- * @return Returns `false` if iteration was broke.
175- */
176-
177151 /**
178152 * Insert new node before old node within the container.
179153 *
@@ -189,14 +163,23 @@ declare abstract class Container_<Child extends Node = ChildNode> extends Node {
189163 oldNode : Child | number ,
190164 newNode : Child | Child [ ] | ChildProps | ChildProps [ ] | string | string [ ]
191165 ) : this
166+
192167 /**
193- * The container’s last child.
168+ * Traverses the container’s descendant nodes, calling callback
169+ * for each comment node.
170+ *
171+ * Like `Container#each`, this method is safe
172+ * to use if you are mutating arrays during iteration.
194173 *
195174 * ```js
196- * rule.last === rule.nodes[rule.nodes.length - 1]
175+ * root.walkComments(comment => {
176+ * comment.remove()
177+ * })
197178 * ```
179+ *
180+ * @param callback Iterator receives each node and index.
181+ * @return Returns `false` if iteration was broke.
198182 */
199- get last ( ) : Child | undefined
200183
201184 /**
202185 * Inserts new nodes to the start of the container.
@@ -221,7 +204,6 @@ declare abstract class Container_<Child extends Node = ChildNode> extends Node {
221204 prepend (
222205 ...nodes : ( ChildProps | ChildProps [ ] | Node | Node [ ] | string | string [ ] ) [ ]
223206 ) : this
224-
225207 /**
226208 * Add child to the end of the node.
227209 *
@@ -334,6 +316,7 @@ declare abstract class Container_<Child extends Node = ChildNode> extends Node {
334316 walk (
335317 callback : ( node : ChildNode , index : number ) => false | void
336318 ) : false | undefined
319+
337320 /**
338321 * Traverses the container’s descendant nodes, calling callback
339322 * for each at-rule node.
@@ -371,7 +354,6 @@ declare abstract class Container_<Child extends Node = ChildNode> extends Node {
371354 walkAtRules (
372355 callback : ( atRule : AtRule , index : number ) => false | void
373356 ) : false | undefined
374-
375357 walkComments (
376358 callback : ( comment : Comment , indexed : number ) => false | void
377359 ) : false | undefined
@@ -413,9 +395,11 @@ declare abstract class Container_<Child extends Node = ChildNode> extends Node {
413395 propFilter : RegExp | string ,
414396 callback : ( decl : Declaration , index : number ) => false | void
415397 ) : false | undefined
398+
416399 walkDecls (
417400 callback : ( decl : Declaration , index : number ) => false | void
418401 ) : false | undefined
402+
419403 /**
420404 * Traverses the container’s descendant nodes, calling callback
421405 * for each rule node.
@@ -445,6 +429,22 @@ declare abstract class Container_<Child extends Node = ChildNode> extends Node {
445429 walkRules (
446430 callback : ( rule : Rule , index : number ) => false | void
447431 ) : false | undefined
432+ /**
433+ * The container’s first child.
434+ *
435+ * ```js
436+ * rule.first === rules.nodes[0]
437+ * ```
438+ */
439+ get first ( ) : Child | undefined
440+ /**
441+ * The container’s last child.
442+ *
443+ * ```js
444+ * rule.last === rule.nodes[rule.nodes.length - 1]
445+ * ```
446+ */
447+ get last ( ) : Child | undefined
448448}
449449
450450declare class Container < Child extends Node = ChildNode > extends Container_ < Child > { }
0 commit comments