UNPKG

901 BTypeScriptView Raw
1export declare enum MediaQueryType {
2 all = "all",
3 print = "print",
4 screen = "screen"
5}
6export type MediaQueryProperties = 'width' | 'height' | 'device-width' | 'device-height' | 'orientation' | 'prefers-color-scheme';
7export interface MediaQueryEnvironmentParams {
8 type?: MediaQueryType;
9 width?: number;
10 height?: number;
11 'device-width'?: number;
12 'device-height'?: number;
13 orientation?: string;
14 'prefers-color-scheme'?: string;
15}
16export interface MediaQueryExpression {
17 inverse: boolean;
18 type: MediaQueryType;
19 features: MediaQueryFeature[];
20}
21export interface MediaQueryFeature {
22 modifier: string;
23 property: MediaQueryProperties | string;
24 value: string;
25}
26export declare function matchQuery(mediaQuery: string, values: MediaQueryEnvironmentParams): boolean;
27export declare function parseQuery(mediaQuery: string): MediaQueryExpression[];