From 1c0387549700d9ce64918fb5536e37350757c7dd Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Wed, 27 Mar 2024 15:44:30 +0800 Subject: updates --- node_modules/postcss/lib/container.d.ts | 50 +++++++++++++++++++++++++++++---- 1 file changed, 44 insertions(+), 6 deletions(-) (limited to 'node_modules/postcss/lib/container.d.ts') 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_ { + 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_ 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_ 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_ 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_ 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_ 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_ extends Node { get last(): Child | undefined } -declare class Container extends Container_ {} +declare class Container< + Child extends Node = ChildNode +> extends Container_ {} export = Container -- cgit v1.2.3