import * as postcss from 'postcss'; import type { AnyNode, NodeProps } from '../node'; import type { AnyStatement } from '../statement'; import { Interpolation, InterpolationProps } from '../interpolation'; import * as sassInternal from '../sass-internal'; import { QualifiedName, QualifiedNameProps } from './qualified-name'; import { SimpleSelector } from './index'; /** * An operator that defines the meaning of a {@link AttributeSelector}. * * @category Selector */ export type AttributeSelectorOperator = '=' | '~=' | '|=' | '^=' | '$=' | '*='; /** * The initializer properties for {@link AttributeSelector}. * * @category Selector */ export interface AttributeSelectorProps extends NodeProps { attribute: QualifiedName | QualifiedNameProps; operator?: AttributeSelectorOperator; value?: Interpolation | InterpolationProps; modifier?: Interpolation | InterpolationProps; raws?: AttributeSelectorRaws; } /** * Raws indicating how to precisely serialize an {@AttributeSelector}. * * @category Selector */ export interface AttributeSelectorRaws { /** The whitespace between the opening bracket and the attribute name. */ afterOpen?: string; /** * The whitespace between the final component of the selector and the closing * bracket. */ beforeClose?: string; /** The whitespace before the operator. */ beforeOperator?: string; /** The whitespace after the operator. */ afterOperator?: string; /** * The whitespace after the value. * * This is only set automatically when the selector has a modifier. */ afterValue?: string; } /** * An attribute selector. * * This selects for elements with the given attribute, and optionally with a * value matching certain conditions as well. * * @category Selector */ export declare class AttributeSelector extends SimpleSelector { readonly sassType: "attribute"; raws: AttributeSelectorRaws; /** The name of the attribute being selected for. */ get attribute(): QualifiedName; set attribute(attribute: QualifiedName | QualifiedNameProps); private _attribute; /** * The operator that defines the semantics of {@link value}. * * If this is `undefined`, this matches any element with the given property, * regardless of this value. It's ignored if {@link value} is `undefined`. */ get operator(): AttributeSelectorOperator | undefined; set operator(operator: AttributeSelectorOperator | undefined); private _operator; /** * An assertion about the value of {@link attribute}. * * The precise semantics of this string are defined by {@link operator}. * * This may be a quoted or unquoted string. If it's quoted, the quotes and any * escape sequences are included as part of the value's text. * * If this is `undefined`, this matches any element with the given property, * regardless of this value. It's ignored if {@link operator} is `undefined`. */ get value(): Interpolation | undefined; set value(value: Interpolation | InterpolationProps | undefined); private _value; /** * The modifier which indicates how the attribute selector should be * processed. * * See for example [case-sensitivity] modifiers. * * [case-sensitivity]: https://www.w3.org/TR/selectors-4/#attribute-case * * This is ignored if {@link operator} or {@link this.value} is `undefined`. */ get modifier(): Interpolation | undefined; set modifier(modifier: Interpolation | InterpolationProps | undefined); private _modifier; constructor(defaults: AttributeSelectorProps); /** @hidden */ constructor(_: undefined, inner: sassInternal.AttributeSelector); clone(overrides?: Partial): this; toJSON(): object; /** @hidden */ toJSON(_: string, inputs: Map): object; /** @hidden */ toString(): string; /** @hidden */ get nonStatementChildren(): ReadonlyArray>; }