PHP 8.2.30
Preview: declaration.d.ts Size: 3.81 KB
/home/byroehnu/.trash/node_modules11/postcss/lib/declaration.d.ts

import { ContainerWithChildren } from './container.js'
import Node from './node.js'

declare namespace Declaration {
  export interface DeclarationRaws extends Record<string, unknown> {
    /**
     * The space symbols before the node. It also stores `*`
     * and `_` symbols before the declaration (IE hack).
     */
    before?: string

    /**
     * The symbols between the property and value for declarations.
     */
    between?: string

    /**
     * The content of the important statement, if it is not just `!important`.
     */
    important?: string

    /**
     * Declaration value with comments.
     */
    value?: {
      raw: string
      value: string
    }
  }

  export interface DeclarationProps {
    /** Whether the declaration has an `!important` annotation. */
    important?: boolean
    /** Name of the declaration. */
    prop: string
    /** Information used to generate byte-to-byte equal node string as it was in the origin input. */
    raws?: DeclarationRaws
    /** Value of the declaration. */
    value: string
  }

  // eslint-disable-next-line @typescript-eslint/no-use-before-define
  export { Declaration_ as default }
}

/**
 * It represents a class that handles
 * [CSS declarations](https://developer.mozilla.org/en-US/docs/Web/CSS/Syntax#css_declarations)
 *
 * ```js
 * Once (root, { Declaration }) {
 *   const color = new Declaration({ prop: 'color', value: 'black' })
 *   root.append(color)
 * }
 * ```
 *
 * ```js
 * const root = postcss.parse('a { color: black }')
 * const decl = root.first?.first
 *
 * decl.type       //=> 'decl'
 * decl.toString() //=> ' color: black'
 * ```
 */
declare class Declaration_ extends Node {
  parent: ContainerWithChildren | undefined
  raws: Declaration.DeclarationRaws

  type: 'decl'

  constructor(defaults?: Declaration.DeclarationProps)
  assign(overrides: Declaration.DeclarationProps | object): this

  clone(overrides?: Partial<Declaration.DeclarationProps>): this

  cloneAfter(overrides?: Partial<Declaration.DeclarationProps>): this

  cloneBefore(overrides?: Partial<Declaration.DeclarationProps>): this
  /**
   * It represents a specificity of the declaration.
   *
   * If true, the CSS declaration will have an
   * [important](https://developer.mozilla.org/en-US/docs/Web/CSS/important)
   * specifier.
   *
   * ```js
   * const root = postcss.parse('a { color: black !important; color: red }')
   *
   * root.first.first.important //=> true
   * root.first.last.important  //=> undefined
   * ```
   */
  get important(): boolean

  set important(value: boolean)
  /**
   * The property name for a CSS declaration.
   *
   * ```js
   * const root = postcss.parse('a { color: black }')
   * const decl = root.first.first
   *
   * decl.prop //=> 'color'
   * ```
   */
  get prop(): string

  set prop(value: string)
  /**
   * The property value for a CSS declaration.
   *
   * Any CSS comments inside the value string will be filtered out.
   * CSS comments present in the source value will be available in
   * the `raws` property.
   *
   * Assigning new `value` would ignore the comments in `raws`
   * property while compiling node to string.
   *
   * ```js
   * const root = postcss.parse('a { color: black }')
   * const decl = root.first.first
   *
   * decl.value //=> 'black'
   * ```
   */
  get value(): string
  set value(value: string)
  /**
   * 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 }')
   * const one = root.first.first
   *
   * one.variable //=> true
   * ```
   *
   * ```js
   * const root = postcss.parse('$one: 1')
   * const one = root.first
   *
   * one.variable //=> true
   * ```
   */
  get variable(): boolean
}

declare class Declaration extends Declaration_ {}

export = Declaration

Directory Contents

Dirs: 0 × Files: 52

Name Size Perms Modified Actions
3.33 KB lrw-r--r-- 2026-02-28 11:42:44
Edit Download
471 B lrw-r--r-- 2026-02-28 11:42:20
Edit Download
1.71 KB lrw-r--r-- 2026-02-28 11:42:44
Edit Download
203 B lrw-r--r-- 2026-02-28 11:42:20
Edit Download
13.74 KB lrw-r--r-- 2026-02-28 11:42:46
Edit Download
10.40 KB lrw-r--r-- 2026-02-28 11:42:22
Edit Download
6.36 KB lrw-r--r-- 2026-02-28 11:42:46
Edit Download
3.32 KB lrw-r--r-- 2026-02-28 11:42:22
Edit Download
3.81 KB lrw-r--r-- 2026-02-28 11:42:46
Edit Download
495 B lrw-r--r-- 2026-02-28 11:42:22
Edit Download
1.91 KB lrw-r--r-- 2026-02-28 11:42:46
Edit Download
654 B lrw-r--r-- 2026-02-28 11:42:22
Edit Download
162 B lrw-r--r-- 2026-02-28 11:42:46
Edit Download
1.47 KB lrw-r--r-- 2026-02-28 11:42:26
Edit Download
4.40 KB lrw-r--r-- 2026-02-28 11:42:46
Edit Download
6.04 KB lrw-r--r-- 2026-02-28 11:42:26
Edit Download
4.89 KB lrw-r--r-- 2026-02-28 11:42:46
Edit Download
13.24 KB lrw-r--r-- 2026-02-28 11:42:28
Edit Download
1.39 KB lrw-r--r-- 2026-02-28 11:42:46
Edit Download
1.20 KB lrw-r--r-- 2026-02-28 11:42:28
Edit Download
9.49 KB lrw-r--r-- 2026-02-28 11:42:28
Edit Download
1.54 KB lrw-r--r-- 2026-02-28 11:42:46
Edit Download
2.56 KB lrw-r--r-- 2026-02-28 11:42:30
Edit Download
13.78 KB lrw-r--r-- 2026-02-28 11:42:46
Edit Download
9.41 KB lrw-r--r-- 2026-02-28 11:42:32
Edit Download
135 B lrw-r--r-- 2026-02-28 11:42:46
Edit Download
1.12 KB lrw-r--r-- 2026-02-28 11:42:32
Edit Download
14.37 KB lrw-r--r-- 2026-02-28 11:42:32
Edit Download
1.02 KB lrw-r--r-- 2026-02-28 11:42:44
Edit Download
11.04 KB lrw-r--r-- 2026-02-28 11:42:46
Edit Download
2.83 KB lrw-r--r-- 2026-02-28 11:42:34
Edit Download
980 B lrw-r--r-- 2026-02-28 11:42:42
Edit Download
1.78 KB lrw-r--r-- 2026-02-28 11:42:46
Edit Download
3.89 KB lrw-r--r-- 2026-02-28 11:42:34
Edit Download
3.33 KB lrw-r--r-- 2026-02-28 11:42:46
Edit Download
1.70 KB lrw-r--r-- 2026-02-28 11:42:34
Edit Download
4.31 KB lrw-r--r-- 2026-02-28 11:42:48
Edit Download
745 B lrw-r--r-- 2026-02-28 11:42:34
Edit Download
2.27 KB lrw-r--r-- 2026-02-28 11:42:48
Edit Download
1.21 KB lrw-r--r-- 2026-02-28 11:42:36
Edit Download
2.90 KB lrw-r--r-- 2026-02-28 11:42:48
Edit Download
569 B lrw-r--r-- 2026-02-28 11:42:36
Edit Download
1.38 KB lrw-r--r-- 2026-02-28 11:42:48
Edit Download
8.03 KB lrw-r--r-- 2026-02-28 11:42:36
Edit Download
165 B lrw-r--r-- 2026-02-28 11:42:48
Edit Download
213 B lrw-r--r-- 2026-02-28 11:42:36
Edit Download
91 B lrw-r--r-- 2026-02-28 11:42:36
Edit Download
1.37 KB lrw-r--r-- 2026-02-28 11:42:36
Edit Download
6.38 KB lrw-r--r-- 2026-02-28 11:42:36
Edit Download
256 B lrw-r--r-- 2026-02-28 11:42:38
Edit Download
2.92 KB lrw-r--r-- 2026-02-28 11:42:48
Edit Download
739 B lrw-r--r-- 2026-02-28 11:42:38
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).