import { ComponentValue } from '@csstools/css-parser-algorithms'; import { ContainerNode } from '@csstools/css-parser-algorithms'; import { CSSToken } from '@csstools/css-tokenizer'; import { ParseError } from '@csstools/css-tokenizer'; import { TokenColon } from '@csstools/css-tokenizer'; import { TokenDelim } from '@csstools/css-tokenizer'; import { TokenIdent } from '@csstools/css-tokenizer'; export declare function cloneMediaQuery(x: T): T; export declare function comparisonFromTokens(tokens: [TokenDelim, TokenDelim] | [TokenDelim]): MediaFeatureComparison | false; export declare class CustomMedia { type: NodeType; name: Array; mediaQueryList: Array | null; trueOrFalseKeyword: Array | null; constructor(name: Array, mediaQueryList: Array | null, trueOrFalseKeyword?: Array); getName(): string; getNameToken(): CSSToken | null; hasMediaQueryList(): boolean; hasTrueKeyword(): boolean; hasFalseKeyword(): boolean; tokens(): Array; toString(): string; /** * @internal */ toJSON(): Record; /** * @internal */ isCustomMedia(): this is CustomMedia; static isCustomMedia(x: unknown): x is CustomMedia; } export declare class GeneralEnclosed { type: NodeType; value: ComponentValue; constructor(value: ComponentValue); tokens(): Array; toString(): string; indexOf(item: ComponentValue): number | string; at(index: number | string): ComponentValue | undefined; walk>(cb: (entry: { node: GeneralEnclosedWalkerEntry; parent: GeneralEnclosedWalkerParent; state?: T; }, index: number | string) => boolean | void, state?: T): false | undefined; /** * @internal */ toJSON(): Record; /** * @internal */ isGeneralEnclosed(): this is GeneralEnclosed; static isGeneralEnclosed(x: unknown): x is GeneralEnclosed; } export declare type GeneralEnclosedWalkerEntry = ComponentValue; export declare type GeneralEnclosedWalkerParent = ContainerNode | GeneralEnclosed; export declare function invertComparison(operator: MediaFeatureComparison): MediaFeatureComparison | false; export declare function isCustomMedia(x: unknown): x is GeneralEnclosed; export declare function isGeneralEnclosed(x: unknown): x is GeneralEnclosed; export declare function isMediaAnd(x: unknown): x is MediaAnd; export declare function isMediaCondition(x: unknown): x is MediaCondition; export declare function isMediaConditionList(x: unknown): x is MediaConditionList; export declare function isMediaConditionListWithAnd(x: unknown): x is MediaConditionListWithAnd; export declare function isMediaConditionListWithOr(x: unknown): x is MediaConditionListWithOr; export declare function isMediaFeature(x: unknown): x is MediaFeature; export declare function isMediaFeatureBoolean(x: unknown): x is MediaFeatureBoolean; export declare function isMediaFeatureName(x: unknown): x is MediaFeatureName; export declare function isMediaFeaturePlain(x: unknown): x is MediaFeaturePlain; export declare function isMediaFeatureRange(x: unknown): x is MediaFeatureRange; export declare function isMediaFeatureRangeNameValue(x: unknown): x is MediaFeatureRangeNameValue; export declare function isMediaFeatureRangeValueName(x: unknown): x is MediaFeatureRangeValueName; export declare function isMediaFeatureRangeValueNameValue(x: unknown): x is MediaFeatureRangeValueNameValue; export declare function isMediaFeatureValue(x: unknown): x is MediaFeatureValue; export declare function isMediaInParens(x: unknown): x is MediaInParens; export declare function isMediaNot(x: unknown): x is MediaNot; export declare function isMediaOr(x: unknown): x is MediaOr; export declare function isMediaQuery(x: unknown): x is MediaQuery; export declare function isMediaQueryInvalid(x: unknown): x is MediaQueryInvalid; export declare function isMediaQueryWithoutType(x: unknown): x is MediaQueryWithoutType; export declare function isMediaQueryWithType(x: unknown): x is MediaQueryWithType; export declare function matchesComparison(componentValues: Array): false | [number, number]; export declare function matchesRatio(componentValues: Array): -1 | [number, number]; export declare function matchesRatioExactly(componentValues: Array): -1 | [number, number]; export declare class MediaAnd { type: NodeType; modifier: Array; media: MediaInParens; constructor(modifier: Array, media: MediaInParens); tokens(): Array; toString(): string; indexOf(item: MediaInParens): number | string; at(index: number | string): MediaInParens | null; walk>(cb: (entry: { node: MediaAndWalkerEntry; parent: MediaAndWalkerParent; state?: T; }, index: number | string) => boolean | void, state?: T): false | undefined; /** * @internal */ toJSON(): unknown; /** * @internal */ isMediaAnd(): this is MediaAnd; static isMediaAnd(x: unknown): x is MediaAnd; } export declare type MediaAndWalkerEntry = MediaInParensWalkerEntry | MediaInParens; export declare type MediaAndWalkerParent = MediaInParensWalkerParent | MediaAnd; export declare class MediaCondition { type: NodeType; media: MediaNot | MediaInParens | MediaConditionListWithAnd | MediaConditionListWithOr; constructor(media: MediaNot | MediaInParens | MediaConditionListWithAnd | MediaConditionListWithOr); tokens(): Array; toString(): string; indexOf(item: MediaNot | MediaInParens | MediaConditionListWithAnd | MediaConditionListWithOr): number | string; at(index: number | string): MediaNot | MediaInParens | MediaConditionListWithAnd | MediaConditionListWithOr | undefined; walk>(cb: (entry: { node: MediaConditionWalkerEntry; parent: MediaConditionWalkerParent; state?: T; }, index: number | string) => boolean | void, state?: T): false | undefined; /** * @internal */ toJSON(): unknown; /** * @internal */ isMediaCondition(): this is MediaCondition; static isMediaCondition(x: unknown): x is MediaCondition; } export declare type MediaConditionList = MediaConditionListWithAnd | MediaConditionListWithOr; export declare class MediaConditionListWithAnd { type: NodeType; leading: MediaInParens; list: Array; before: Array; after: Array; constructor(leading: MediaInParens, list: Array, before?: Array, after?: Array); tokens(): Array; toString(): string; indexOf(item: MediaInParens | MediaAnd): number | string; at(index: number | string): MediaInParens | MediaAnd | undefined; walk>(cb: (entry: { node: MediaConditionListWithAndWalkerEntry; parent: MediaConditionListWithAndWalkerParent; state?: T; }, index: number | string) => boolean | void, state?: T): false | undefined; toJSON(): unknown; isMediaConditionListWithAnd(): this is MediaConditionListWithAnd; static isMediaConditionListWithAnd(x: unknown): x is MediaConditionListWithAnd; } export declare type MediaConditionListWithAndWalkerEntry = MediaAndWalkerEntry | MediaAnd; export declare type MediaConditionListWithAndWalkerParent = MediaAndWalkerParent | MediaConditionListWithAnd; export declare class MediaConditionListWithOr { type: NodeType; leading: MediaInParens; list: Array; before: Array; after: Array; constructor(leading: MediaInParens, list: Array, before?: Array, after?: Array); tokens(): Array; toString(): string; indexOf(item: MediaInParens | MediaOr): number | string; at(index: number | string): MediaInParens | MediaOr | undefined; walk>(cb: (entry: { node: MediaConditionListWithOrWalkerEntry; parent: MediaConditionListWithOrWalkerParent; state?: T; }, index: number | string) => boolean | void, state?: T): false | undefined; /** * @internal */ toJSON(): unknown; /** * @internal */ isMediaConditionListWithOr(): this is MediaConditionListWithOr; static isMediaConditionListWithOr(x: unknown): x is MediaConditionListWithOr; } export declare type MediaConditionListWithOrWalkerEntry = MediaOrWalkerEntry | MediaOr; export declare type MediaConditionListWithOrWalkerParent = MediaOrWalkerParent | MediaConditionListWithOr; export declare type MediaConditionWalkerEntry = MediaNotWalkerEntry | MediaConditionListWithAndWalkerEntry | MediaConditionListWithOrWalkerEntry | MediaNot | MediaConditionListWithAnd | MediaConditionListWithOr; export declare type MediaConditionWalkerParent = MediaNotWalkerParent | MediaConditionListWithAndWalkerParent | MediaConditionListWithOrWalkerParent | MediaCondition; export declare class MediaFeature { type: NodeType; feature: MediaFeaturePlain | MediaFeatureBoolean | MediaFeatureRange; before: Array; after: Array; constructor(feature: MediaFeaturePlain | MediaFeatureBoolean | MediaFeatureRange, before?: Array, after?: Array); getName(): string; getNameToken(): CSSToken; tokens(): Array; toString(): string; indexOf(item: MediaFeaturePlain | MediaFeatureBoolean | MediaFeatureRange): number | string; at(index: number | string): MediaFeatureBoolean | MediaFeaturePlain | MediaFeatureRange | undefined; walk>(cb: (entry: { node: MediaFeatureWalkerEntry; parent: MediaFeatureWalkerParent; state?: T; }, index: number | string) => boolean | void, state?: T): false | undefined; /** * @internal */ toJSON(): Record; /** * @internal */ isMediaFeature(): this is MediaFeature; static isMediaFeature(x: unknown): x is MediaFeature; } export declare class MediaFeatureBoolean { type: NodeType; name: MediaFeatureName; constructor(name: MediaFeatureName); getName(): string; getNameToken(): CSSToken; tokens(): Array; toString(): string; indexOf(item: MediaFeatureName): number | string; at(index: number | string): MediaFeatureName | undefined; /** * @internal */ toJSON(): Record; /** * @internal */ isMediaFeatureBoolean(): this is MediaFeatureBoolean; static isMediaFeatureBoolean(x: unknown): x is MediaFeatureBoolean; } export declare type MediaFeatureComparison = MediaFeatureLT | MediaFeatureGT | MediaFeatureEQ; export declare enum MediaFeatureEQ { EQ = "=" } export declare enum MediaFeatureGT { GT = ">", GT_OR_EQ = ">=" } export declare enum MediaFeatureLT { LT = "<", LT_OR_EQ = "<=" } export declare class MediaFeatureName { type: NodeType; name: ComponentValue; before: Array; after: Array; constructor(name: ComponentValue, before?: Array, after?: Array); getName(): string; getNameToken(): CSSToken; tokens(): Array; toString(): string; indexOf(item: ComponentValue): number | string; at(index: number | string): ComponentValue | undefined; /** * @internal */ toJSON(): Record; /** * @internal */ isMediaFeatureName(): this is MediaFeatureName; static isMediaFeatureName(x: unknown): x is MediaFeatureName; } export declare class MediaFeaturePlain { type: NodeType; name: MediaFeatureName; colon: TokenColon; value: MediaFeatureValue; constructor(name: MediaFeatureName, colon: TokenColon, value: MediaFeatureValue); getName(): string; getNameToken(): CSSToken; tokens(): Array; toString(): string; indexOf(item: MediaFeatureName | MediaFeatureValue): number | string; at(index: number | string): MediaFeatureName | MediaFeatureValue | undefined; walk>(cb: (entry: { node: MediaFeaturePlainWalkerEntry; parent: MediaFeaturePlainWalkerParent; state?: T; }, index: number | string) => boolean | void, state?: T): false | undefined; /** * @internal */ toJSON(): Record; /** * @internal */ isMediaFeaturePlain(): this is MediaFeaturePlain; static isMediaFeaturePlain(x: unknown): x is MediaFeaturePlain; } export declare type MediaFeaturePlainWalkerEntry = MediaFeatureValueWalkerEntry | MediaFeatureValue; export declare type MediaFeaturePlainWalkerParent = MediaFeatureValueWalkerParent | MediaFeaturePlain; export declare type MediaFeatureRange = MediaFeatureRangeNameValue | MediaFeatureRangeValueName | MediaFeatureRangeValueNameValue; export declare class MediaFeatureRangeNameValue { type: NodeType; name: MediaFeatureName; operator: [TokenDelim, TokenDelim] | [TokenDelim]; value: MediaFeatureValue; constructor(name: MediaFeatureName, operator: [TokenDelim, TokenDelim] | [TokenDelim], value: MediaFeatureValue); operatorKind(): MediaFeatureComparison | false; getName(): string; getNameToken(): CSSToken; tokens(): Array; toString(): string; indexOf(item: MediaFeatureName | MediaFeatureValue): number | string; at(index: number | string): MediaFeatureName | MediaFeatureValue | undefined; walk>(cb: (entry: { node: MediaFeatureRangeWalkerEntry; parent: MediaFeatureRangeWalkerParent; state?: T; }, index: number | string) => boolean | void, state?: T): false | undefined; /** * @internal */ toJSON(): Record; /** * @internal */ isMediaFeatureRangeNameValue(): this is MediaFeatureRangeNameValue; static isMediaFeatureRangeNameValue(x: unknown): x is MediaFeatureRangeNameValue; } export declare class MediaFeatureRangeValueName { type: NodeType; name: MediaFeatureName; operator: [TokenDelim, TokenDelim] | [TokenDelim]; value: MediaFeatureValue; constructor(name: MediaFeatureName, operator: [TokenDelim, TokenDelim] | [TokenDelim], value: MediaFeatureValue); operatorKind(): MediaFeatureComparison | false; getName(): string; getNameToken(): CSSToken; tokens(): Array; toString(): string; indexOf(item: MediaFeatureName | MediaFeatureValue): number | string; at(index: number | string): MediaFeatureName | MediaFeatureValue | undefined; walk>(cb: (entry: { node: MediaFeatureRangeWalkerEntry; parent: MediaFeatureRangeWalkerParent; state?: T; }, index: number | string) => boolean | void, state?: T): false | undefined; /** * @internal */ toJSON(): Record; /** * @internal */ isMediaFeatureRangeValueName(): this is MediaFeatureRangeValueName; static isMediaFeatureRangeValueName(x: unknown): x is MediaFeatureRangeValueName; } export declare class MediaFeatureRangeValueNameValue { type: NodeType; name: MediaFeatureName; valueOne: MediaFeatureValue; valueOneOperator: [TokenDelim, TokenDelim] | [TokenDelim]; valueTwo: MediaFeatureValue; valueTwoOperator: [TokenDelim, TokenDelim] | [TokenDelim]; constructor(name: MediaFeatureName, valueOne: MediaFeatureValue, valueOneOperator: [TokenDelim, TokenDelim] | [TokenDelim], valueTwo: MediaFeatureValue, valueTwoOperator: [TokenDelim, TokenDelim] | [TokenDelim]); valueOneOperatorKind(): MediaFeatureComparison | false; valueTwoOperatorKind(): MediaFeatureComparison | false; getName(): string; getNameToken(): CSSToken; tokens(): Array; toString(): string; indexOf(item: MediaFeatureName | MediaFeatureValue): number | string; at(index: number | string): MediaFeatureName | MediaFeatureValue | undefined; walk>(cb: (entry: { node: MediaFeatureRangeWalkerEntry; parent: MediaFeatureRangeWalkerParent; state?: T; }, index: number | string) => boolean | void, state?: T): false | undefined; /** * @internal */ toJSON(): Record; /** * @internal */ isMediaFeatureRangeValueNameValue(): this is MediaFeatureRangeValueNameValue; static isMediaFeatureRangeValueNameValue(x: unknown): x is MediaFeatureRangeValueNameValue; } export declare type MediaFeatureRangeWalkerEntry = MediaFeatureValueWalkerEntry | MediaFeatureValue; export declare type MediaFeatureRangeWalkerParent = MediaFeatureValueWalkerParent | MediaFeatureRange; export declare class MediaFeatureValue { type: NodeType; value: ComponentValue | Array; before: Array; after: Array; constructor(value: ComponentValue | Array, before?: Array, after?: Array); tokens(): Array; toString(): string; indexOf(item: ComponentValue): number | string; at(index: number | string): ComponentValue | Array | undefined; walk>(cb: (entry: { node: MediaFeatureValueWalkerEntry; parent: MediaFeatureValueWalkerParent; state?: T; }, index: number | string) => boolean | void, state?: T): false | undefined; /** * @internal */ toJSON(): Record; /** * @internal */ isMediaFeatureValue(): this is MediaFeatureValue; static isMediaFeatureValue(x: unknown): x is MediaFeatureValue; } export declare type MediaFeatureValueWalkerEntry = ComponentValue; export declare type MediaFeatureValueWalkerParent = ContainerNode | MediaFeatureValue; export declare type MediaFeatureWalkerEntry = MediaFeaturePlainWalkerEntry | MediaFeatureRangeWalkerEntry | MediaFeaturePlain | MediaFeatureBoolean | MediaFeatureRange; export declare type MediaFeatureWalkerParent = MediaFeaturePlainWalkerParent | MediaFeatureRangeWalkerParent | MediaFeature; export declare class MediaInParens { type: NodeType; media: MediaCondition | MediaFeature | GeneralEnclosed; before: Array; after: Array; constructor(media: MediaCondition | MediaFeature | GeneralEnclosed, before?: Array, after?: Array); tokens(): Array; toString(): string; indexOf(item: MediaCondition | MediaFeature | GeneralEnclosed): number | string; at(index: number | string): MediaCondition | MediaFeature | GeneralEnclosed | undefined; walk>(cb: (entry: { node: MediaInParensWalkerEntry; parent: MediaInParensWalkerParent; state?: T; }, index: number | string) => boolean | void, state?: T): false | undefined; /** * @internal */ toJSON(): Record; /** * @internal */ isMediaInParens(): this is MediaInParens; static isMediaInParens(x: unknown): x is MediaInParens; } export declare type MediaInParensWalkerEntry = ComponentValue | GeneralEnclosed | MediaAnd | MediaNot | MediaOr | MediaConditionList | MediaCondition | MediaFeatureBoolean | MediaFeatureName | MediaFeaturePlain | MediaFeatureRange | MediaFeatureValue | MediaFeature | GeneralEnclosed | MediaInParens; export declare type MediaInParensWalkerParent = ContainerNode | GeneralEnclosed | MediaAnd | MediaNot | MediaOr | MediaConditionList | MediaCondition | MediaFeatureBoolean | MediaFeatureName | MediaFeaturePlain | MediaFeatureRange | MediaFeatureValue | MediaFeature | GeneralEnclosed | MediaInParens; export declare class MediaNot { type: NodeType; modifier: Array; media: MediaInParens; constructor(modifier: Array, media: MediaInParens); tokens(): Array; toString(): string; indexOf(item: MediaInParens): number | string; at(index: number | string): MediaInParens | undefined; walk>(cb: (entry: { node: MediaNotWalkerEntry; parent: MediaNotWalkerParent; state?: T; }, index: number | string) => boolean | void, state?: T): false | undefined; /** * @internal */ toJSON(): Record; /** * @internal */ isMediaNot(): this is MediaNot; static isMediaNot(x: unknown): x is MediaNot; } export declare type MediaNotWalkerEntry = MediaInParensWalkerEntry | MediaInParens; export declare type MediaNotWalkerParent = MediaInParensWalkerParent | MediaNot; export declare class MediaOr { type: NodeType; modifier: Array; media: MediaInParens; constructor(modifier: Array, media: MediaInParens); tokens(): Array; toString(): string; indexOf(item: MediaInParens): number | string; at(index: number | string): MediaInParens | undefined; walk>(cb: (entry: { node: MediaOrWalkerEntry; parent: MediaOrWalkerParent; state?: T; }, index: number | string) => boolean | void, state?: T): false | undefined; /** * @internal */ toJSON(): Record; /** * @internal */ isMediaOr(): this is MediaOr; static isMediaOr(x: unknown): x is MediaOr; } export declare type MediaOrWalkerEntry = MediaInParensWalkerEntry | MediaInParens; export declare type MediaOrWalkerParent = MediaInParensWalkerParent | MediaOr; export declare type MediaQuery = MediaQueryWithType | MediaQueryWithoutType | MediaQueryInvalid; export declare class MediaQueryInvalid { type: NodeType; media: Array; constructor(media: Array); negateQuery(): MediaQuery; tokens(): Array; toString(): string; walk>(cb: (entry: { node: MediaQueryInvalidWalkerEntry; parent: MediaQueryInvalidWalkerParent; state?: T; }, index: number | string) => boolean | void, state?: T): false | undefined; /** * @internal */ toJSON(): Record; /** * @internal */ isMediaQueryInvalid(): this is MediaQueryInvalid; static isMediaQueryInvalid(x: unknown): x is MediaQueryInvalid; } export declare type MediaQueryInvalidWalkerEntry = ComponentValue; export declare type MediaQueryInvalidWalkerParent = ComponentValue | MediaQueryInvalid; export declare enum MediaQueryModifier { Not = "not", Only = "only" } export declare class MediaQueryWithoutType { type: NodeType; media: MediaCondition; constructor(media: MediaCondition); negateQuery(): MediaQuery; tokens(): Array; toString(): string; indexOf(item: MediaCondition): number | string; at(index: number | string): MediaCondition | undefined; walk>(cb: (entry: { node: MediaQueryWithoutTypeWalkerEntry; parent: MediaQueryWithoutTypeWalkerParent; state?: T; }, index: number | string) => boolean | void, state?: T): false | undefined; /** * @internal */ toJSON(): Record; /** * @internal */ isMediaQueryWithoutType(): this is MediaQueryWithoutType; static isMediaQueryWithoutType(x: unknown): x is MediaQueryWithoutType; } export declare type MediaQueryWithoutTypeWalkerEntry = MediaConditionWalkerEntry | MediaCondition; export declare type MediaQueryWithoutTypeWalkerParent = MediaConditionWalkerParent | MediaQueryWithoutType; export declare class MediaQueryWithType { type: NodeType; modifier: Array; mediaType: Array; and: Array | undefined; media: MediaCondition | undefined; constructor(modifier: Array, mediaType: Array, and?: Array | undefined, media?: MediaCondition | undefined); getModifier(): string; negateQuery(): MediaQuery; getMediaType(): string; tokens(): Array; toString(): string; indexOf(item: MediaCondition): number | string; at(index: number | string): MediaCondition | undefined; walk>(cb: (entry: { node: MediaQueryWithTypeWalkerEntry; parent: MediaQueryWithTypeWalkerParent; state?: T; }, index: number | string) => boolean | void, state?: T): false | undefined; /** * @internal */ toJSON(): Record; /** * @internal */ isMediaQueryWithType(): this is MediaQueryWithType; static isMediaQueryWithType(x: unknown): x is MediaQueryWithType; } export declare type MediaQueryWithTypeWalkerEntry = MediaConditionWalkerEntry | MediaCondition; export declare type MediaQueryWithTypeWalkerParent = MediaConditionWalkerParent | MediaQueryWithType; export declare enum MediaType { /** Always matches */ All = "all", Print = "print", Screen = "screen", /** Never matches */ Tty = "tty", /** Never matches */ Tv = "tv", /** Never matches */ Projection = "projection", /** Never matches */ Handheld = "handheld", /** Never matches */ Braille = "braille", /** Never matches */ Embossed = "embossed", /** Never matches */ Aural = "aural", /** Never matches */ Speech = "speech" } export declare function modifierFromToken(token: TokenIdent): MediaQueryModifier | false; export declare function newMediaFeatureBoolean(name: string): MediaFeature; export declare function newMediaFeaturePlain(name: string, ...value: Array): MediaFeature; export declare enum NodeType { CustomMedia = "custom-media", GeneralEnclosed = "general-enclosed", MediaAnd = "media-and", MediaCondition = "media-condition", MediaConditionListWithAnd = "media-condition-list-and", MediaConditionListWithOr = "media-condition-list-or", MediaFeature = "media-feature", MediaFeatureBoolean = "mf-boolean", MediaFeatureName = "mf-name", MediaFeaturePlain = "mf-plain", MediaFeatureRangeNameValue = "mf-range-name-value", MediaFeatureRangeValueName = "mf-range-value-name", MediaFeatureRangeValueNameValue = "mf-range-value-name-value", MediaFeatureValue = "mf-value", MediaInParens = "media-in-parens", MediaNot = "media-not", MediaOr = "media-or", MediaQueryWithType = "media-query-with-type", MediaQueryWithoutType = "media-query-without-type", MediaQueryInvalid = "media-query-invalid" } export declare function parse(source: string, options?: { preserveInvalidMediaQueries?: boolean; onParseError?: (error: ParseError) => void; }): Array; export declare function parseCustomMedia(source: string, options?: { preserveInvalidMediaQueries?: boolean; onParseError?: (error: ParseError) => void; }): CustomMedia | false; export declare function parseCustomMediaFromTokens(tokens: Array, options?: { preserveInvalidMediaQueries?: boolean; onParseError?: (error: ParseError) => void; }): CustomMedia | false; export declare function parseFromTokens(tokens: Array, options?: { preserveInvalidMediaQueries?: boolean; onParseError?: (error: ParseError) => void; }): Array; export declare function typeFromToken(token: TokenIdent): MediaType | false; export { }