diff options
Diffstat (limited to 'node_modules/postcss/lib/container.d.ts')
| -rw-r--r-- | node_modules/postcss/lib/container.d.ts | 50 |
1 files changed, 44 insertions, 6 deletions
diff --git a/node_modules/postcss/lib/container.d.ts b/node_modules/postcss/lib/container.d.ts index bd6b1ba0..d16b85d0 100644 --- a/node_modules/postcss/lib/container.d.ts +++ b/node_modules/postcss/lib/container.d.ts @@ -5,6 +5,12 @@ import Node, { ChildNode, ChildProps, NodeProps } from './node.js' import Rule from './rule.js' declare namespace Container { + export class ContainerWithChildren< + Child extends Node = ChildNode + > extends Container_<Child> { + nodes: Child[] + } + export interface ValueOptions { /** * String that’s used to narrow down values and speed up the regexp search. @@ -43,7 +49,7 @@ declare abstract class Container_<Child extends Node = ChildNode> extends Node { * root.nodes[0].nodes[0].prop //=> 'color' * ``` */ - nodes: Child[] + nodes: Child[] | undefined /** * Inserts new nodes to the end of the container. @@ -66,7 +72,15 @@ declare abstract class Container_<Child extends Node = ChildNode> extends Node { * @return This node for methods chain. */ append( - ...nodes: (ChildProps | ChildProps[] | Node | Node[] | string | string[])[] + ...nodes: ( + | ChildProps + | ChildProps[] + | Node + | Node[] + | string + | string[] + | undefined + )[] ): this assign(overrides: Container.ContainerProps | object): this @@ -146,7 +160,14 @@ declare abstract class Container_<Child extends Node = ChildNode> extends Node { */ insertAfter( oldNode: Child | number, - newNode: Child | Child[] | ChildProps | ChildProps[] | string | string[] + newNode: + | Child + | Child[] + | ChildProps + | ChildProps[] + | string + | string[] + | undefined ): this /** * Insert new node before old node within the container. @@ -161,7 +182,14 @@ declare abstract class Container_<Child extends Node = ChildNode> extends Node { */ insertBefore( oldNode: Child | number, - newNode: Child | Child[] | ChildProps | ChildProps[] | string | string[] + newNode: + | Child + | Child[] + | ChildProps + | ChildProps[] + | string + | string[] + | undefined ): this /** @@ -202,7 +230,15 @@ declare abstract class Container_<Child extends Node = ChildNode> extends Node { * @return This node for methods chain. */ prepend( - ...nodes: (ChildProps | ChildProps[] | Node | Node[] | string | string[])[] + ...nodes: ( + | ChildProps + | ChildProps[] + | Node + | Node[] + | string + | string[] + | undefined + )[] ): this /** * Add child to the end of the node. @@ -447,6 +483,8 @@ declare abstract class Container_<Child extends Node = ChildNode> extends Node { get last(): Child | undefined } -declare class Container<Child extends Node = ChildNode> extends Container_<Child> {} +declare class Container< + Child extends Node = ChildNode +> extends Container_<Child> {} export = Container |
