🔧 npm update
This commit is contained in:
132
node_modules/postcss/lib/container.d.ts
generated
vendored
132
node_modules/postcss/lib/container.d.ts
generated
vendored
@@ -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.
|
||||
@@ -14,13 +20,26 @@ declare namespace Container {
|
||||
/**
|
||||
* An array of property names.
|
||||
*/
|
||||
props?: string[]
|
||||
props?: readonly string[]
|
||||
}
|
||||
|
||||
export interface ContainerProps extends NodeProps {
|
||||
nodes?: (ChildNode | 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 }
|
||||
}
|
||||
@@ -43,8 +62,25 @@ declare abstract class Container_<Child extends Node = ChildNode> extends Node {
|
||||
* root.nodes[0].nodes[0].prop //=> 'color'
|
||||
* ```
|
||||
*/
|
||||
nodes: Child[]
|
||||
nodes: Child[] | undefined
|
||||
|
||||
/**
|
||||
* The container’s first child.
|
||||
*
|
||||
* ```js
|
||||
* rule.first === rules.nodes[0]
|
||||
* ```
|
||||
*/
|
||||
get first(): Child | undefined
|
||||
|
||||
/**
|
||||
* The container’s last child.
|
||||
*
|
||||
* ```js
|
||||
* rule.last === rule.nodes[rule.nodes.length - 1]
|
||||
* ```
|
||||
*/
|
||||
get last(): Child | undefined
|
||||
/**
|
||||
* Inserts new nodes to the end of the container.
|
||||
*
|
||||
@@ -65,15 +101,13 @@ declare abstract class Container_<Child extends Node = ChildNode> extends Node {
|
||||
* @param nodes New nodes.
|
||||
* @return This node for methods chain.
|
||||
*/
|
||||
append(
|
||||
...nodes: (ChildProps | ChildProps[] | Node | Node[] | string | string[])[]
|
||||
): this
|
||||
|
||||
append(...nodes: Container.NewChild[]): this
|
||||
assign(overrides: Container.ContainerProps | object): this
|
||||
clone(overrides?: Partial<Container.ContainerProps>): Container<Child>
|
||||
cloneAfter(overrides?: Partial<Container.ContainerProps>): Container<Child>
|
||||
cloneBefore(overrides?: Partial<Container.ContainerProps>): Container<Child>
|
||||
clone(overrides?: Partial<Container.ContainerProps>): this
|
||||
|
||||
cloneAfter(overrides?: Partial<Container.ContainerProps>): this
|
||||
|
||||
cloneBefore(overrides?: Partial<Container.ContainerProps>): this
|
||||
/**
|
||||
* Iterates through the container’s immediate children,
|
||||
* calling `callback` for each child.
|
||||
@@ -144,25 +178,7 @@ declare abstract class Container_<Child extends Node = ChildNode> extends Node {
|
||||
* @param newNode New node.
|
||||
* @return This node for methods chain.
|
||||
*/
|
||||
insertAfter(
|
||||
oldNode: Child | number,
|
||||
newNode: Child | Child[] | ChildProps | ChildProps[] | string | string[]
|
||||
): this
|
||||
/**
|
||||
* Insert new node before old node within the container.
|
||||
*
|
||||
* ```js
|
||||
* rule.insertBefore(decl, decl.clone({ prop: '-webkit-' + decl.prop }))
|
||||
* ```
|
||||
*
|
||||
* @param oldNode Child or child’s index.
|
||||
* @param newNode New node.
|
||||
* @return This node for methods chain.
|
||||
*/
|
||||
insertBefore(
|
||||
oldNode: Child | number,
|
||||
newNode: Child | Child[] | ChildProps | ChildProps[] | string | string[]
|
||||
): this
|
||||
insertAfter(oldNode: Child | number, newNode: Container.NewChild): this
|
||||
|
||||
/**
|
||||
* Traverses the container’s descendant nodes, calling callback
|
||||
@@ -181,6 +197,18 @@ declare abstract class Container_<Child extends Node = ChildNode> extends Node {
|
||||
* @return Returns `false` if iteration was broke.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Insert new node before old node within the container.
|
||||
*
|
||||
* ```js
|
||||
* rule.insertBefore(decl, decl.clone({ prop: '-webkit-' + decl.prop }))
|
||||
* ```
|
||||
*
|
||||
* @param oldNode Child or child’s index.
|
||||
* @param newNode New node.
|
||||
* @return This node for methods chain.
|
||||
*/
|
||||
insertBefore(oldNode: Child | number, newNode: Container.NewChild): this
|
||||
/**
|
||||
* Inserts new nodes to the start of the container.
|
||||
*
|
||||
@@ -201,9 +229,8 @@ declare abstract class Container_<Child extends Node = ChildNode> extends Node {
|
||||
* @param nodes New nodes.
|
||||
* @return This node for methods chain.
|
||||
*/
|
||||
prepend(
|
||||
...nodes: (ChildProps | ChildProps[] | Node | Node[] | string | string[])[]
|
||||
): this
|
||||
prepend(...nodes: Container.NewChild[]): this
|
||||
|
||||
/**
|
||||
* Add child to the end of the node.
|
||||
*
|
||||
@@ -249,7 +276,6 @@ declare abstract class Container_<Child extends Node = ChildNode> extends Node {
|
||||
pattern: RegExp | string,
|
||||
replaced: { (substring: string, ...args: any[]): string } | string
|
||||
): this
|
||||
|
||||
/**
|
||||
* Passes all declaration values within the container that match pattern
|
||||
* through callback, replacing those values with the returned result
|
||||
@@ -265,8 +291,8 @@ declare abstract class Container_<Child extends Node = ChildNode> 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
|
||||
@@ -350,14 +376,13 @@ declare abstract class Container_<Child extends Node = ChildNode> extends Node {
|
||||
nameFilter: RegExp | string,
|
||||
callback: (atRule: AtRule, index: number) => false | void
|
||||
): false | undefined
|
||||
|
||||
walkAtRules(
|
||||
callback: (atRule: AtRule, index: number) => false | void
|
||||
): false | undefined
|
||||
|
||||
walkComments(
|
||||
callback: (comment: Comment, indexed: number) => false | void
|
||||
): false | undefined
|
||||
|
||||
walkComments(
|
||||
callback: (comment: Comment, indexed: number) => false | void
|
||||
): false | undefined
|
||||
@@ -395,11 +420,9 @@ declare abstract class Container_<Child extends Node = ChildNode> extends Node {
|
||||
propFilter: RegExp | string,
|
||||
callback: (decl: Declaration, index: number) => false | void
|
||||
): false | undefined
|
||||
|
||||
walkDecls(
|
||||
callback: (decl: Declaration, index: number) => false | void
|
||||
): false | undefined
|
||||
|
||||
/**
|
||||
* Traverses the container’s descendant nodes, calling callback
|
||||
* for each rule node.
|
||||
@@ -430,23 +453,28 @@ declare abstract class Container_<Child extends Node = ChildNode> extends Node {
|
||||
callback: (rule: Rule, index: number) => false | void
|
||||
): false | undefined
|
||||
/**
|
||||
* The container’s first child.
|
||||
* An internal method that converts a {@link NewChild} into a list of actual
|
||||
* child nodes that can then be added to this container.
|
||||
*
|
||||
* ```js
|
||||
* rule.first === rules.nodes[0]
|
||||
* ```
|
||||
*/
|
||||
get first(): Child | undefined
|
||||
/**
|
||||
* The container’s last child.
|
||||
* 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.
|
||||
*
|
||||
* ```js
|
||||
* rule.last === rule.nodes[rule.nodes.length - 1]
|
||||
* ```
|
||||
* @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
|
||||
*/
|
||||
get last(): Child | undefined
|
||||
protected normalize(
|
||||
nodes: Container.NewChild,
|
||||
sample: Node | undefined,
|
||||
type?: 'prepend' | false
|
||||
): Child[]
|
||||
}
|
||||
|
||||
declare class Container<Child extends Node = ChildNode> extends Container_<Child> {}
|
||||
declare class Container<
|
||||
Child extends Node = ChildNode
|
||||
> extends Container_<Child> {}
|
||||
|
||||
export = Container
|
||||
|
||||
Reference in New Issue
Block a user