UNPKG

@exadel/esl

Version:

Exadel Smart Library (ESL) is the lightweight custom elements library that provide a set of super-flexible components

33 lines (32 loc) 1.31 kB
import { MediaQueryStaticCondition } from '../conditions/media-query-static'; import type { IMediaQueryCondition } from '../conditions/media-query-base'; declare const SHORTCUTS_STORE: unique symbol; /** * Static shortcuts' preprocessor. Used to store device related shortcuts. * @author Alexey Stsefanovich (ala'n) * * @implements IMediaQueryPreprocessor statically */ export declare class ESLMediaShortcuts { /** Returns shortcuts map, ensures there is a single instance */ protected static get shortcuts(): Map<string, MediaQueryStaticCondition>; /** Resolve shortcut by name. If not found, creates new instance */ protected static resolve(name: string): MediaQueryStaticCondition; /** * Add mapping * @param shortcut - term to find in query * @param value - media query string or boolean result (that represents `all` or `not all` conditions) */ static set(shortcut: string, value: boolean | string | IMediaQueryCondition): void; /** Replaces shortcut to registered result */ static process(match: string): IMediaQueryCondition; } declare global { export interface Window { [SHORTCUTS_STORE]: Map<string, MediaQueryStaticCondition>; } export interface ESLLibrary { MediaShortcuts: typeof ESLMediaShortcuts; } } export {};