Skip to content

Commit

Permalink
Clean up docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ai committed Jul 6, 2023
1 parent 4b2190b commit 8b54e60
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 26 deletions.
5 changes: 2 additions & 3 deletions lib/declaration.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,8 @@ declare class Declaration_ extends Node {
important: boolean

/**
* The `variable` method represents a getter that returns true
* if a declaration starts with `--` or `$`, which are used to
* declare variables in CSS and SASS/SCSS.
* It represents a getter that returns `true` if a declaration starts with
* `--` or `$`, which are used to declare variables in CSS and SASS/SCSS.
*
* ```js
* const root = postcss.parse(':root { --one: 1 }')
Expand Down
39 changes: 16 additions & 23 deletions lib/node.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ declare namespace Node {
}

/**
* NodeProps represents an interface for an object received
* Interface represents an interface for an object received
* as parameter by Node class constructor.
*/
export interface NodeProps {
Expand Down Expand Up @@ -124,7 +124,7 @@ declare namespace Node {
*/
declare abstract class Node_ {
/**
* The property `type` represents type of a node in
* It represents type of a node in
* an abstract syntax tree.
*
* A type of node helps in identification of a node
Expand All @@ -142,8 +142,7 @@ declare abstract class Node_ {
type: string

/**
* The property `parent` represents parent of the
* current node.
* It represents parent of the current node.
*
* ```js
* console.log(root.nodes[0].parent === root) //=> true
Expand All @@ -152,9 +151,8 @@ declare abstract class Node_ {
parent: Document | Container | undefined

/**
* The property `source` represents information related
* to origin of a node and is required for generating
* source maps.
* It represents information related to origin of a node and is required
* for generating source maps.
*
* The nodes that are created manually using the public APIs
* provided by PostCSS will have `source` undefined and
Expand Down Expand Up @@ -198,8 +196,8 @@ declare abstract class Node_ {
source?: Node.Source

/**
* The property `raws` represents unnecessary whitespace
* and characters present in the css source code.
* It represents unnecessary whitespace and characters present
* in the css source code.
*
* Information to generate byte-to-byte equal node string as it was
* in the origin input.
Expand Down Expand Up @@ -236,9 +234,8 @@ declare abstract class Node_ {
constructor(defaults?: object)

/**
* The Node.error method creates an instance of the
* class `CssSyntaxError` and parameters passed to
* this method are assigned to the error instance.
* It creates an instance of the class `CssSyntaxError` and parameters passed
* to this method are assigned to the error instance.
*
* The error instance will have description for the
* error, original position of the node in the
Expand Down Expand Up @@ -273,8 +270,8 @@ declare abstract class Node_ {
error(message: string, options?: Node.NodeErrorOptions): CssSyntaxError

/**
* The `warn` method is a wrapper for Result#warn,
* providing convenient way of generating warnings.
* It is a wrapper for {@link Result#warn}, providing convenient
* way of generating warnings.
*
* ```js
* Declaration: {
Expand All @@ -293,8 +290,7 @@ declare abstract class Node_ {
warn(result: Result, message: string, options?: WarningOptions): Warning

/**
* The `remove` method removes the node from its parent
* and deletes its parent property.
* It removes the node from its parent and deletes its parent property.
*
* ```js
* if (decl.prop.match(/^-webkit-/)) {
Expand All @@ -307,8 +303,7 @@ declare abstract class Node_ {
remove(): this

/**
* The `toString` method compiles the node to
* browser readable cascading style sheets string
* It compiles the node to browser readable cascading style sheets string
* depending on it's type.
*
* ```js
Expand All @@ -321,8 +316,7 @@ declare abstract class Node_ {
toString(stringifier?: Stringifier | Syntax): string

/**
* The `assign` method assigns properties to an existing
* node instance.
* It assigns properties to an existing node instance.
*
* ```js
* decl.assign({ prop: 'word-wrap', value: 'break-word' })
Expand All @@ -335,9 +329,8 @@ declare abstract class Node_ {
assign(overrides: object): this

/**
* The `clone` method creates clone of an existing node,
* which includes all the properties and their values, that
* includes `raws` but not `type`.
* It creates clone of an existing node, which includes all the properties
* and their values, that includes `raws` but not `type`.
*
* ```js
* decl.raws.before //=> "\n "
Expand Down

0 comments on commit 8b54e60

Please sign in to comment.