summaryrefslogtreecommitdiff
path: root/node_modules/@csstools/media-query-list-parser/dist/index.d.ts
blob: e97acc33b732d4e3dd0bbc353d273921525d37c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
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<T extends MediaQueryWithType | MediaQueryWithoutType | MediaQueryInvalid>(x: T): T;

export declare function comparisonFromTokens(tokens: [TokenDelim, TokenDelim] | [TokenDelim]): MediaFeatureComparison | false;

export declare class CustomMedia {
    type: NodeType;
    name: Array<CSSToken>;
    mediaQueryList: Array<MediaQuery> | null;
    trueOrFalseKeyword: Array<CSSToken> | null;
    constructor(name: Array<CSSToken>, mediaQueryList: Array<MediaQuery> | null, trueOrFalseKeyword?: Array<CSSToken>);
    getName(): string;
    getNameToken(): CSSToken | null;
    hasMediaQueryList(): boolean;
    hasTrueKeyword(): boolean;
    hasFalseKeyword(): boolean;
    tokens(): Array<CSSToken>;
    toString(): string;
    /**
     * @internal
     */
    toJSON(): Record<string, unknown>;
    /**
     * @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<CSSToken>;
    toString(): string;
    indexOf(item: ComponentValue): number | string;
    at(index: number | string): ComponentValue | undefined;
    walk<T extends Record<string, unknown>>(cb: (entry: {
        node: GeneralEnclosedWalkerEntry;
        parent: GeneralEnclosedWalkerParent;
        state?: T;
    }, index: number | string) => boolean | void, state?: T): false | undefined;
    /**
     * @internal
     */
    toJSON(): Record<string, unknown>;
    /**
     * @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<ComponentValue>): false | [number, number];

export declare function matchesRatio(componentValues: Array<ComponentValue>): -1 | [number, number];

export declare function matchesRatioExactly(componentValues: Array<ComponentValue>): -1 | [number, number];

export declare class MediaAnd {
    type: NodeType;
    modifier: Array<CSSToken>;
    media: MediaInParens;
    constructor(modifier: Array<CSSToken>, media: MediaInParens);
    tokens(): Array<CSSToken>;
    toString(): string;
    indexOf(item: MediaInParens): number | string;
    at(index: number | string): MediaInParens | null;
    walk<T extends Record<string, unknown>>(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<CSSToken>;
    toString(): string;
    indexOf(item: MediaNot | MediaInParens | MediaConditionListWithAnd | MediaConditionListWithOr): number | string;
    at(index: number | string): MediaNot | MediaInParens | MediaConditionListWithAnd | MediaConditionListWithOr | undefined;
    walk<T extends Record<string, unknown>>(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<MediaAnd>;
    before: Array<CSSToken>;
    after: Array<CSSToken>;
    constructor(leading: MediaInParens, list: Array<MediaAnd>, before?: Array<CSSToken>, after?: Array<CSSToken>);
    tokens(): Array<CSSToken>;
    toString(): string;
    indexOf(item: MediaInParens | MediaAnd): number | string;
    at(index: number | string): MediaInParens | MediaAnd | undefined;
    walk<T extends Record<string, unknown>>(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<MediaOr>;
    before: Array<CSSToken>;
    after: Array<CSSToken>;
    constructor(leading: MediaInParens, list: Array<MediaOr>, before?: Array<CSSToken>, after?: Array<CSSToken>);
    tokens(): Array<CSSToken>;
    toString(): string;
    indexOf(item: MediaInParens | MediaOr): number | string;
    at(index: number | string): MediaInParens | MediaOr | undefined;
    walk<T extends Record<string, unknown>>(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<CSSToken>;
    after: Array<CSSToken>;
    constructor(feature: MediaFeaturePlain | MediaFeatureBoolean | MediaFeatureRange, before?: Array<CSSToken>, after?: Array<CSSToken>);
    getName(): string;
    getNameToken(): CSSToken;
    tokens(): Array<CSSToken>;
    toString(): string;
    indexOf(item: MediaFeaturePlain | MediaFeatureBoolean | MediaFeatureRange): number | string;
    at(index: number | string): MediaFeatureBoolean | MediaFeaturePlain | MediaFeatureRange | undefined;
    walk<T extends Record<string, unknown>>(cb: (entry: {
        node: MediaFeatureWalkerEntry;
        parent: MediaFeatureWalkerParent;
        state?: T;
    }, index: number | string) => boolean | void, state?: T): false | undefined;
    /**
     * @internal
     */
    toJSON(): Record<string, unknown>;
    /**
     * @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<CSSToken>;
    toString(): string;
    indexOf(item: MediaFeatureName): number | string;
    at(index: number | string): MediaFeatureName | undefined;
    /**
     * @internal
     */
    toJSON(): Record<string, unknown>;
    /**
     * @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<CSSToken>;
    after: Array<CSSToken>;
    constructor(name: ComponentValue, before?: Array<CSSToken>, after?: Array<CSSToken>);
    getName(): string;
    getNameToken(): CSSToken;
    tokens(): Array<CSSToken>;
    toString(): string;
    indexOf(item: ComponentValue): number | string;
    at(index: number | string): ComponentValue | undefined;
    /**
     * @internal
     */
    toJSON(): Record<string, unknown>;
    /**
     * @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<CSSToken>;
    toString(): string;
    indexOf(item: MediaFeatureName | MediaFeatureValue): number | string;
    at(index: number | string): MediaFeatureName | MediaFeatureValue | undefined;
    walk<T extends Record<string, unknown>>(cb: (entry: {
        node: MediaFeaturePlainWalkerEntry;
        parent: MediaFeaturePlainWalkerParent;
        state?: T;
    }, index: number | string) => boolean | void, state?: T): false | undefined;
    /**
     * @internal
     */
    toJSON(): Record<string, unknown>;
    /**
     * @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<CSSToken>;
    toString(): string;
    indexOf(item: MediaFeatureName | MediaFeatureValue): number | string;
    at(index: number | string): MediaFeatureName | MediaFeatureValue | undefined;
    walk<T extends Record<string, unknown>>(cb: (entry: {
        node: MediaFeatureRangeWalkerEntry;
        parent: MediaFeatureRangeWalkerParent;
        state?: T;
    }, index: number | string) => boolean | void, state?: T): false | undefined;
    /**
     * @internal
     */
    toJSON(): Record<string, unknown>;
    /**
     * @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<CSSToken>;
    toString(): string;
    indexOf(item: MediaFeatureName | MediaFeatureValue): number | string;
    at(index: number | string): MediaFeatureName | MediaFeatureValue | undefined;
    walk<T extends Record<string, unknown>>(cb: (entry: {
        node: MediaFeatureRangeWalkerEntry;
        parent: MediaFeatureRangeWalkerParent;
        state?: T;
    }, index: number | string) => boolean | void, state?: T): false | undefined;
    /**
     * @internal
     */
    toJSON(): Record<string, unknown>;
    /**
     * @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<CSSToken>;
    toString(): string;
    indexOf(item: MediaFeatureName | MediaFeatureValue): number | string;
    at(index: number | string): MediaFeatureName | MediaFeatureValue | undefined;
    walk<T extends Record<string, unknown>>(cb: (entry: {
        node: MediaFeatureRangeWalkerEntry;
        parent: MediaFeatureRangeWalkerParent;
        state?: T;
    }, index: number | string) => boolean | void, state?: T): false | undefined;
    /**
     * @internal
     */
    toJSON(): Record<string, unknown>;
    /**
     * @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<ComponentValue>;
    before: Array<CSSToken>;
    after: Array<CSSToken>;
    constructor(value: ComponentValue | Array<ComponentValue>, before?: Array<CSSToken>, after?: Array<CSSToken>);
    tokens(): Array<CSSToken>;
    toString(): string;
    indexOf(item: ComponentValue): number | string;
    at(index: number | string): ComponentValue | Array<ComponentValue> | undefined;
    walk<T extends Record<string, unknown>>(cb: (entry: {
        node: MediaFeatureValueWalkerEntry;
        parent: MediaFeatureValueWalkerParent;
        state?: T;
    }, index: number | string) => boolean | void, state?: T): false | undefined;
    /**
     * @internal
     */
    toJSON(): Record<string, unknown>;
    /**
     * @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<CSSToken>;
    after: Array<CSSToken>;
    constructor(media: MediaCondition | MediaFeature | GeneralEnclosed, before?: Array<CSSToken>, after?: Array<CSSToken>);
    tokens(): Array<CSSToken>;
    toString(): string;
    indexOf(item: MediaCondition | MediaFeature | GeneralEnclosed): number | string;
    at(index: number | string): MediaCondition | MediaFeature | GeneralEnclosed | undefined;
    walk<T extends Record<string, unknown>>(cb: (entry: {
        node: MediaInParensWalkerEntry;
        parent: MediaInParensWalkerParent;
        state?: T;
    }, index: number | string) => boolean | void, state?: T): false | undefined;
    /**
     * @internal
     */
    toJSON(): Record<string, unknown>;
    /**
     * @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<CSSToken>;
    media: MediaInParens;
    constructor(modifier: Array<CSSToken>, media: MediaInParens);
    tokens(): Array<CSSToken>;
    toString(): string;
    indexOf(item: MediaInParens): number | string;
    at(index: number | string): MediaInParens | undefined;
    walk<T extends Record<string, unknown>>(cb: (entry: {
        node: MediaNotWalkerEntry;
        parent: MediaNotWalkerParent;
        state?: T;
    }, index: number | string) => boolean | void, state?: T): false | undefined;
    /**
     * @internal
     */
    toJSON(): Record<string, unknown>;
    /**
     * @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<CSSToken>;
    media: MediaInParens;
    constructor(modifier: Array<CSSToken>, media: MediaInParens);
    tokens(): Array<CSSToken>;
    toString(): string;
    indexOf(item: MediaInParens): number | string;
    at(index: number | string): MediaInParens | undefined;
    walk<T extends Record<string, unknown>>(cb: (entry: {
        node: MediaOrWalkerEntry;
        parent: MediaOrWalkerParent;
        state?: T;
    }, index: number | string) => boolean | void, state?: T): false | undefined;
    /**
     * @internal
     */
    toJSON(): Record<string, unknown>;
    /**
     * @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<ComponentValue>;
    constructor(media: Array<ComponentValue>);
    negateQuery(): MediaQuery;
    tokens(): Array<CSSToken>;
    toString(): string;
    walk<T extends Record<string, unknown>>(cb: (entry: {
        node: MediaQueryInvalidWalkerEntry;
        parent: MediaQueryInvalidWalkerParent;
        state?: T;
    }, index: number | string) => boolean | void, state?: T): false | undefined;
    /**
     * @internal
     */
    toJSON(): Record<string, unknown>;
    /**
     * @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<CSSToken>;
    toString(): string;
    indexOf(item: MediaCondition): number | string;
    at(index: number | string): MediaCondition | undefined;
    walk<T extends Record<string, unknown>>(cb: (entry: {
        node: MediaQueryWithoutTypeWalkerEntry;
        parent: MediaQueryWithoutTypeWalkerParent;
        state?: T;
    }, index: number | string) => boolean | void, state?: T): false | undefined;
    /**
     * @internal
     */
    toJSON(): Record<string, unknown>;
    /**
     * @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<CSSToken>;
    mediaType: Array<CSSToken>;
    and: Array<CSSToken> | undefined;
    media: MediaCondition | undefined;
    constructor(modifier: Array<CSSToken>, mediaType: Array<CSSToken>, and?: Array<CSSToken> | undefined, media?: MediaCondition | undefined);
    getModifier(): string;
    negateQuery(): MediaQuery;
    getMediaType(): string;
    tokens(): Array<CSSToken>;
    toString(): string;
    indexOf(item: MediaCondition): number | string;
    at(index: number | string): MediaCondition | undefined;
    walk<T extends Record<string, unknown>>(cb: (entry: {
        node: MediaQueryWithTypeWalkerEntry;
        parent: MediaQueryWithTypeWalkerParent;
        state?: T;
    }, index: number | string) => boolean | void, state?: T): false | undefined;
    /**
     * @internal
     */
    toJSON(): Record<string, unknown>;
    /**
     * @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<CSSToken>): 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<MediaQuery>;

export declare function parseCustomMedia(source: string, options?: {
    preserveInvalidMediaQueries?: boolean;
    onParseError?: (error: ParseError) => void;
}): CustomMedia | false;

export declare function parseCustomMediaFromTokens(tokens: Array<CSSToken>, options?: {
    preserveInvalidMediaQueries?: boolean;
    onParseError?: (error: ParseError) => void;
}): CustomMedia | false;

export declare function parseFromTokens(tokens: Array<CSSToken>, options?: {
    preserveInvalidMediaQueries?: boolean;
    onParseError?: (error: ParseError) => void;
}): Array<MediaQuery>;

export declare function typeFromToken(token: TokenIdent): MediaType | false;

export { }