From e29b244aeab08ea36fb385c7beb2ad0560217039 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Sun, 13 Oct 2024 10:37:19 +0800 Subject: =?UTF-8?q?bump:=20@babel/cli=207.25.6=20=E2=86=92=207.25.7,=20@ba?= =?UTF-8?q?bel/core=207.25.2=20=E2=86=92=207.25.8,=20@babel/preset-env=207?= =?UTF-8?q?.25.4=20=E2=86=92=207.25.8,=20postcss=208.4.41=20=E2=86=92=208.?= =?UTF-8?q?4.47,=20swup=204.7.0=20=E2=86=92=204.8.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- node_modules/postcss/lib/container.d.ts | 95 +++++++++++++++------------------ 1 file changed, 44 insertions(+), 51 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 dfe55f20..692bd696 100644 --- a/node_modules/postcss/lib/container.d.ts +++ b/node_modules/postcss/lib/container.d.ts @@ -20,13 +20,26 @@ declare namespace Container { /** * An array of property names. */ - props?: string[] + props?: readonly string[] } export interface ContainerProps extends NodeProps { - nodes?: (Node | ChildProps)[] + nodes?: readonly (ChildProps | Node)[] } + /** + * All types that can be passed into container methods to create or add a new + * child node. + */ + export type NewChild = + | ChildProps + | Node + | readonly ChildProps[] + | readonly Node[] + | readonly string[] + | string + | undefined + // eslint-disable-next-line @typescript-eslint/no-use-before-define export { Container_ as default } } @@ -51,6 +64,26 @@ declare abstract class Container_ extends Node { */ nodes: Child[] | undefined + /** + * An internal method that converts a {@link NewChild} into a list of actual + * child nodes that can then be added to this container. + * + * This ensures that the nodes' parent is set to this container, that they use + * the correct prototype chain, and that they're marked as dirty. + * + * @param mnodes The new node or nodes to add. + * @param sample A node from whose raws the new node's `before` raw should be + * taken. + * @param type This should be set to `'prepend'` if the new nodes will be + * inserted at the beginning of the container. + * @hidden + */ + protected normalize( + nodes: Container.NewChild, + sample: Node | undefined, + type?: 'prepend' | false + ): Child[] + /** * Inserts new nodes to the end of the container. * @@ -71,21 +104,11 @@ declare abstract class Container_ extends Node { * @param nodes New nodes. * @return This node for methods chain. */ - append( - ...nodes: ( - | ChildProps - | ChildProps[] - | Node - | Node[] - | string - | string[] - | undefined - )[] - ): this - + append(...nodes: Container.NewChild[]): this assign(overrides: Container.ContainerProps | object): this clone(overrides?: Partial): this cloneAfter(overrides?: Partial): this + cloneBefore(overrides?: Partial): this /** @@ -124,7 +147,6 @@ declare abstract class Container_ extends Node { each( callback: (node: Child, index: number) => false | void ): false | undefined - /** * Returns `true` if callback returns `true` * for all of the container’s children. @@ -139,6 +161,7 @@ declare abstract class Container_ extends Node { every( condition: (node: Child, index: number, nodes: Child[]) => boolean ): boolean + /** * Returns a `child`’s index within the `Container#nodes` array. * @@ -150,7 +173,6 @@ declare abstract class Container_ extends Node { * @return Child index. */ index(child: Child | number): number - /** * Insert new node after old node within the container. * @@ -158,17 +180,8 @@ declare abstract class Container_ extends Node { * @param newNode New node. * @return This node for methods chain. */ - insertAfter( - oldNode: Child | number, - newNode: - | Node - | Node[] - | ChildProps - | ChildProps[] - | string - | string[] - | undefined - ): this + insertAfter(oldNode: Child | number, newNode: Container.NewChild): this + /** * Insert new node before old node within the container. * @@ -180,17 +193,7 @@ declare abstract class Container_ extends Node { * @param newNode New node. * @return This node for methods chain. */ - insertBefore( - oldNode: Child | number, - newNode: - | Node - | Node[] - | ChildProps - | ChildProps[] - | string - | string[] - | undefined - ): this + insertBefore(oldNode: Child | number, newNode: Container.NewChild): this /** * Traverses the container’s descendant nodes, calling callback @@ -229,17 +232,7 @@ declare abstract class Container_ extends Node { * @param nodes New nodes. * @return This node for methods chain. */ - prepend( - ...nodes: ( - | ChildProps - | ChildProps[] - | Node - | Node[] - | string - | string[] - | undefined - )[] - ): this + prepend(...nodes: Container.NewChild[]): this /** * Add child to the end of the node. * @@ -301,8 +294,8 @@ declare abstract class Container_ extends Node { * ``` * * @param pattern Replace pattern. - * @param {object} opts Options to speed up the search. - * @param callback String to replace pattern or callback + * @param {object} options Options to speed up the search. + * @param replaced String to replace pattern or callback * that returns a new value. The callback * will receive the same arguments * as those passed to a function parameter -- cgit v1.2.3