import * as postcss from 'postcss'; import { Interpolation, InterpolationProps } from '../interpolation'; import type { AnyNode, NodeProps } from '../node'; import type { AnyStatement } from '../statement'; import * as sassInternal from '../sass-internal'; import { SelectorList, SelectorListProps } from './list'; import { SimpleSelector } from './index'; /** * The initializer properties for {@link PseudoSelector}. * * @category Selector */ export type PseudoSelectorProps = NodeProps & { pseudo: Interpolation | InterpolationProps; argument?: Interpolation | InterpolationProps; selector?: SelectorList | SelectorListProps; raws?: PseudoSelectorRaws; } & ({ isClass?: boolean; } | { isElement?: boolean; }); /** * Raws indicating how to precisely serialize a {@PseudoSelector}. * * @category Selector */ export interface PseudoSelectorRaws { /** * The whitespace after the opening parenthesis in the selector's argument. * * This is ignored unless {@link PseudoSelector.argument} and/or {@link * PseudoSelector.selector} is defined. */ afterOpen?: string; /** * The whitespace before the closing parenthesis in the selector's argument. * * This is ignored unless {@link PseudoSelector.argument} and/or {@link * PseudoSelector.selector} is defined. */ beforeClose?: string; /** * The whitespace between {@link PseudoSelector.argument} and {#link * PseudoSelector.selector}. * * This is ignored unless {@link PseudoSelector.argument} is defined. * It's not assigned by default unless both {@link * PseudoSelector.argument} and {@link PseudoSelector.selector} are * both defined. */ afterArgument?: string; } /** * A pseudo-class or pseudo-element selector. * * The semantics of a specific pseudo selector depends on its name. Some * selectors take arguments, including other selectors. * * @category Selector */ export declare class PseudoSelector extends SimpleSelector { readonly sassType: "pseudo"; raws: PseudoSelectorRaws; /** The name of the pseudo-selector or pseudo-element. */ get pseudo(): Interpolation; set pseudo(pseudo: Interpolation | InterpolationProps); private _pseudo; /** * Whether this is syntactically written as a pseudo-class (as opposed to a * pseudo-element). * * This defaults to `true`. */ get isClass(): boolean; set isClass(isClass: boolean); /** * Whether this is syntactically written as a pseudo-element (as opposed to a * pseudo-class). * * This defaults to `false`. */ get isElement(): boolean; set isElement(isElement: boolean); private _isElement; /** * The non-selector argument passed to this selector. * * This is `undefined` if there's no argument. If {@link argument} and {@link * selector} are both non-`undefined`, the selector follows the argument. */ get argument(): Interpolation | undefined; set argument(argument: Interpolation | InterpolationProps | undefined); private _argument; /** * The non-selector argument passed to this selector. * * This is `undefined` if there's no argument. If {@link argument} and {@link * selector} are both non-`undefined`, the selector follows the argument. */ get selector(): SelectorList | undefined; set selector(selector: SelectorList | SelectorListProps | undefined); private _selector; constructor(defaults: PseudoSelectorProps); /** @hidden */ constructor(_: undefined, inner: sassInternal.PseudoSelector); clone(overrides?: Partial): this; toJSON(): object; /** @hidden */ toJSON(_: string, inputs: Map): object; /** @hidden */ toString(): string; /** @hidden */ get nonStatementChildren(): ReadonlyArray>; }