Comparing version 8.4.25 to 8.4.27
@@ -108,5 +108,5 @@ import Container, { ContainerProps } from './container.js' | ||
assign(overrides: AtRule.AtRuleProps | object): this | ||
clone(overrides?: Partial<AtRule.AtRuleProps>): this | ||
cloneAfter(overrides?: Partial<AtRule.AtRuleProps>): this | ||
cloneBefore(overrides?: Partial<AtRule.AtRuleProps>): this | ||
clone(overrides?: Partial<AtRule.AtRuleProps>): AtRule | ||
cloneAfter(overrides?: Partial<AtRule.AtRuleProps>): AtRule | ||
cloneBefore(overrides?: Partial<AtRule.AtRuleProps>): AtRule | ||
} | ||
@@ -113,0 +113,0 @@ |
@@ -60,5 +60,5 @@ import Container from './container.js' | ||
assign(overrides: Comment.CommentProps | object): this | ||
clone(overrides?: Partial<Comment.CommentProps>): this | ||
cloneAfter(overrides?: Partial<Comment.CommentProps>): this | ||
cloneBefore(overrides?: Partial<Comment.CommentProps>): this | ||
clone(overrides?: Partial<Comment.CommentProps>): Comment | ||
cloneAfter(overrides?: Partial<Comment.CommentProps>): Comment | ||
cloneBefore(overrides?: Partial<Comment.CommentProps>): Comment | ||
} | ||
@@ -65,0 +65,0 @@ |
@@ -35,5 +35,3 @@ import AtRule from './at-rule.js' | ||
*/ | ||
declare abstract class Container_< | ||
Child extends Node = ChildNode | ||
> extends Node { | ||
declare abstract class Container_<Child extends Node = ChildNode> extends Node { | ||
/** | ||
@@ -75,2 +73,7 @@ * An array containing the container’s children. | ||
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> | ||
/** | ||
@@ -127,3 +130,2 @@ * Iterates through the container’s immediate children, | ||
): boolean | ||
/** | ||
@@ -162,2 +164,19 @@ * The container’s first child. | ||
/** | ||
* Traverses the container’s descendant nodes, calling callback | ||
* for each comment node. | ||
* | ||
* Like `Container#each`, this method is safe | ||
* to use if you are mutating arrays during iteration. | ||
* | ||
* ```js | ||
* root.walkComments(comment => { | ||
* comment.remove() | ||
* }) | ||
* ``` | ||
* | ||
* @param callback Iterator receives each node and index. | ||
* @return Returns `false` if iteration was broke. | ||
*/ | ||
/** | ||
* Insert new node before old node within the container. | ||
@@ -209,2 +228,3 @@ * | ||
): this | ||
/** | ||
@@ -223,19 +243,2 @@ * Add child to the end of the node. | ||
/** | ||
* Traverses the container’s descendant nodes, calling callback | ||
* for each comment node. | ||
* | ||
* Like `Container#each`, this method is safe | ||
* to use if you are mutating arrays during iteration. | ||
* | ||
* ```js | ||
* root.walkComments(comment => { | ||
* comment.remove() | ||
* }) | ||
* ``` | ||
* | ||
* @param callback Iterator receives each node and index. | ||
* @return Returns `false` if iteration was broke. | ||
*/ | ||
/** | ||
* Removes all children from the container | ||
@@ -252,2 +255,3 @@ * and cleans their parent properties. | ||
removeAll(): this | ||
/** | ||
@@ -269,2 +273,7 @@ * Removes node from the container and cleans the parent properties | ||
replaceValues( | ||
pattern: RegExp | string, | ||
replaced: { (substring: string, ...args: any[]): string } | string | ||
): this | ||
/** | ||
@@ -299,7 +308,2 @@ * Passes all declaration values within the container that match pattern | ||
replaceValues( | ||
pattern: RegExp | string, | ||
replaced: { (substring: string, ...args: any[]): string } | string | ||
): this | ||
/** | ||
@@ -342,7 +346,2 @@ * Returns `true` if callback returns `true` for (at least) one | ||
): false | undefined | ||
walkAtRules( | ||
callback: (atRule: AtRule, index: number) => false | void | ||
): false | undefined | ||
/** | ||
@@ -382,2 +381,6 @@ * Traverses the container’s descendant nodes, calling callback | ||
walkAtRules( | ||
callback: (atRule: AtRule, index: number) => false | void | ||
): false | undefined | ||
walkComments( | ||
@@ -390,5 +393,2 @@ callback: (comment: Comment, indexed: number) => false | void | ||
): false | undefined | ||
walkDecls( | ||
callback: (decl: Declaration, index: number) => false | void | ||
): false | undefined | ||
@@ -428,7 +428,5 @@ /** | ||
): false | undefined | ||
walkRules( | ||
callback: (rule: Rule, index: number) => false | void | ||
walkDecls( | ||
callback: (decl: Declaration, index: number) => false | void | ||
): false | undefined | ||
/** | ||
@@ -460,2 +458,5 @@ * Traverses the container’s descendant nodes, calling callback | ||
): false | undefined | ||
walkRules( | ||
callback: (rule: Rule, index: number) => false | void | ||
): false | undefined | ||
} | ||
@@ -462,0 +463,0 @@ |
@@ -61,4 +61,4 @@ import Container from './container.js' | ||
* | ||
* console.log(decl.type) //=> 'decl' | ||
* console.log(decl.toString()) //=> ' color: black' | ||
* decl.type //=> 'decl' | ||
* decl.toString() //=> ' color: black' | ||
* ``` | ||
@@ -77,8 +77,10 @@ */ | ||
* | ||
* console.log(root.first?.first?.important) //=> true | ||
* console.log(root.first?.last?.important) //=> undefined | ||
* root.first.first.important //=> true | ||
* root.first.last.important //=> undefined | ||
* ``` | ||
*/ | ||
important: boolean | ||
parent: Container | undefined | ||
/** | ||
@@ -89,5 +91,5 @@ * The property name for a CSS declaration. | ||
* const root = postcss.parse('a { color: black }') | ||
* const decl = root.first?.first | ||
* const decl = root.first.first | ||
* | ||
* console.log(decl.prop) //=> 'color' | ||
* decl.prop //=> 'color' | ||
* ``` | ||
@@ -113,5 +115,5 @@ */ | ||
* const root = postcss.parse('a { color: black }') | ||
* const decl = root.first?.first | ||
* const decl = root.first.first | ||
* | ||
* console.log(decl.value) //=> 'black' | ||
* decl.value //=> 'black' | ||
* ``` | ||
@@ -127,5 +129,5 @@ */ | ||
* const root = postcss.parse(':root { --one: 1 }') | ||
* const one = root.first?.first | ||
* const one = root.first.first | ||
* | ||
* console.log(one?.variable) //=> true | ||
* one.variable //=> true | ||
* ``` | ||
@@ -137,3 +139,3 @@ * | ||
* | ||
* console.log(one?.variable) //=> true | ||
* one.variable //=> true | ||
* ``` | ||
@@ -145,5 +147,5 @@ */ | ||
assign(overrides: Declaration.DeclarationProps | object): this | ||
clone(overrides?: Partial<Declaration.DeclarationProps>): this | ||
cloneAfter(overrides?: Partial<Declaration.DeclarationProps>): this | ||
cloneBefore(overrides?: Partial<Declaration.DeclarationProps>): this | ||
clone(overrides?: Partial<Declaration.DeclarationProps>): Declaration | ||
cloneAfter(overrides?: Partial<Declaration.DeclarationProps>): Declaration | ||
cloneBefore(overrides?: Partial<Declaration.DeclarationProps>): Declaration | ||
} | ||
@@ -150,0 +152,0 @@ |
@@ -43,2 +43,7 @@ import Container, { ContainerProps } from './container.js' | ||
assign(overrides: Document.DocumentProps | object): this | ||
clone(overrides?: Partial<Document.DocumentProps>): Document | ||
cloneAfter(overrides?: Partial<Document.DocumentProps>): Document | ||
cloneBefore(overrides?: Partial<Document.DocumentProps>): Document | ||
/** | ||
@@ -45,0 +50,0 @@ * Returns a `Result` instance representing the document’s CSS roots. |
@@ -131,3 +131,3 @@ import AtRule = require('./at-rule.js') | ||
* ```js | ||
* console.log(root.nodes[0].parent === root) //=> true | ||
* root.nodes[0].parent === root //=> true | ||
* ``` | ||
@@ -168,3 +168,3 @@ */ | ||
* const root = postcss.parse('a {\n color:black\n}') | ||
* console.log(root.first.first.raws) //=> { before: '\n ', between: ':' } | ||
* root.first.first.raws //=> { before: '\n ', between: ':' } | ||
* ``` | ||
@@ -188,5 +188,5 @@ */ | ||
* ```js | ||
* console.log(decl.source.input.from) //=> '/home/ai/source.css' | ||
* console.log(decl.source.start) //=> { line: 10, column: 2 } | ||
* console.log(decl.source.end) //=> { line: 10, column: 12 } | ||
* decl.source.input.from //=> '/home/ai/source.css' | ||
* decl.source.start //=> { line: 10, column: 2 } | ||
* decl.source.end //=> { line: 10, column: 12 } | ||
* ``` | ||
@@ -233,3 +233,3 @@ * | ||
* | ||
* console.log(declaration.type) //=> 'decl' | ||
* declaration.type //=> 'decl' | ||
* ``` | ||
@@ -310,3 +310,3 @@ */ | ||
*/ | ||
clone(overrides?: object): Node_ | ||
clone(overrides?: object): Node | ||
@@ -320,3 +320,3 @@ /** | ||
*/ | ||
cloneAfter(overrides?: object): this | ||
cloneAfter(overrides?: object): Node | ||
@@ -335,3 +335,3 @@ /** | ||
*/ | ||
cloneBefore(overrides?: object): this | ||
cloneBefore(overrides?: object): Node | ||
@@ -512,3 +512,3 @@ /** | ||
* ```js | ||
* console.log(new Rule({ selector: 'a' }).toString()) //=> "a {}" | ||
* new Rule({ selector: 'a' }).toString() //=> "a {}" | ||
* ``` | ||
@@ -515,0 +515,0 @@ * |
@@ -10,3 +10,3 @@ 'use strict' | ||
constructor(plugins = []) { | ||
this.version = '8.4.25' | ||
this.version = '8.4.27' | ||
this.plugins = this.normalize(plugins) | ||
@@ -13,0 +13,0 @@ } |
@@ -64,2 +64,6 @@ import Container, { ContainerProps } from './container.js' | ||
assign(overrides: object | Root.RootProps): this | ||
clone(overrides?: Partial<Root.RootProps>): Root | ||
cloneAfter(overrides?: Partial<Root.RootProps>): Root | ||
cloneBefore(overrides?: Partial<Root.RootProps>): Root | ||
/** | ||
@@ -78,3 +82,3 @@ * Returns a `Result` instance representing the root’s CSS. | ||
*/ | ||
toResult(options?: ProcessOptions): Result | ||
toResult(options?: ProcessOptions): Result | ||
} | ||
@@ -81,0 +85,0 @@ |
@@ -106,5 +106,5 @@ import Container, { ContainerProps } from './container.js' | ||
assign(overrides: object | Rule.RuleProps): this | ||
clone(overrides?: Partial<Rule.RuleProps>): this | ||
cloneAfter(overrides?: Partial<Rule.RuleProps>): this | ||
cloneBefore(overrides?: Partial<Rule.RuleProps>): this | ||
clone(overrides?: Partial<Rule.RuleProps>): Rule | ||
cloneAfter(overrides?: Partial<Rule.RuleProps>): Rule | ||
cloneBefore(overrides?: Partial<Rule.RuleProps>): Rule | ||
} | ||
@@ -111,0 +111,0 @@ |
{ | ||
"name": "postcss", | ||
"version": "8.4.25", | ||
"version": "8.4.27", | ||
"description": "Tool for transforming styles with JS plugins", | ||
@@ -5,0 +5,0 @@ "engines": { |
@@ -1,2 +0,2 @@ | ||
# PostCSS [![Gitter][chat-img]][chat] | ||
# PostCSS | ||
@@ -7,5 +7,2 @@ <img align="right" width="95" height="95" | ||
[chat-img]: https://img.shields.io/badge/Gitter-Join_the_PostCSS_chat-brightgreen.svg | ||
[chat]: https://gitter.im/postcss/postcss | ||
PostCSS is a tool for transforming styles with JS plugins. | ||
@@ -24,6 +21,4 @@ These plugins can lint your CSS, support variables and mixins, | ||
**Support / Discussion:** [Gitter](https://gitter.im/postcss/postcss)<br> | ||
**Twitter account:** [@postcss](https://twitter.com/postcss)<br> | ||
**VK.com page:** [postcss](https://vk.com/postcss)<br> | ||
**中文翻译**: [`docs/README-cn.md`](./docs/README-cn.md) | ||
**Twitter account:** [@postcss](https://twitter.com/postcss)<br> | ||
**中文翻译**: [`docs/README-cn.md`](./docs/README-cn.md) | ||
@@ -30,0 +25,0 @@ For PostCSS commercial support (consulting, improving the front-end culture |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
195586
6715
40