123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- import Container, {
- ContainerProps,
- ContainerWithChildren
- } from './container.js'
- declare namespace Rule {
- export interface RuleRaws extends Record<string, unknown> {
-
- after?: string
-
- before?: string
-
- between?: string
-
- ownSemicolon?: string
-
- selector?: {
- raw: string
- value: string
- }
-
- semicolon?: boolean
- }
- export type RuleProps = {
-
- raws?: RuleRaws
- } & (
- | {
-
- selector: string
- selectors?: never
- }
- | {
- selector?: never
-
- selectors: readonly string[]
- }
- ) & ContainerProps
-
- export { Rule_ as default }
- }
- declare class Rule_ extends Container {
- nodes: NonNullable<Container['nodes']>
- parent: ContainerWithChildren | undefined
- raws: Rule.RuleRaws
- type: 'rule'
- constructor(defaults?: Rule.RuleProps)
- assign(overrides: object | Rule.RuleProps): this
- clone(overrides?: Partial<Rule.RuleProps>): this
- cloneAfter(overrides?: Partial<Rule.RuleProps>): this
- cloneBefore(overrides?: Partial<Rule.RuleProps>): this
- /**
- * The rule’s full selector represented as a string.
- *
- * ```js
- * const root = postcss.parse('a, b { }')
- * const rule = root.first
- * rule.selector //=> 'a, b'
- * ```
- */
- get selector(): string
- set selector(value: string)
- /**
- * An array containing the rule’s individual selectors.
- * Groups of selectors are split at commas.
- *
- * ```js
- * const root = postcss.parse('a, b { }')
- * const rule = root.first
- *
- * rule.selector //=> 'a, b'
- * rule.selectors //=> ['a', 'b']
- *
- * rule.selectors = ['a', 'strong']
- * rule.selector //=> 'a, strong'
- * ```
- */
- get selectors(): string[]
- set selectors(values: string[])
- }
- declare class Rule extends Rule_ {}
- export = Rule
|