@exadel/esl
Version:
Exadel Smart Library (ESL) is the lightweight custom elements library that provide a set of super-flexible components
44 lines (43 loc) • 1.95 kB
TypeScript
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;
/** @deprecated use `set` method instead (Going to be removed in ESL 6.0.0)*/
static add: typeof ESLMediaShortcuts.set;
/**
* Remove mapping for passed shortcut term.
* @deprecated use `ESLEnvShortcuts.set(shortcut, false)` instead (Going to be removed in ESL 6.0.0)
*/
static remove(shortcut: string): boolean;
}
/** @deprecated use `ESLMediaShortcuts` instead (Going to be removed in ESL 6.0.0) */
export declare const ESLEnvShortcuts: typeof ESLMediaShortcuts;
declare global {
export interface Window {
[SHORTCUTS_STORE]: Map<string, MediaQueryStaticCondition>;
}
export interface ESLLibrary {
/** @deprecated use `ESLMediaShortcuts` instead (Going to be removed in ESL 6.0.0) */
EnvShortcuts: typeof ESLMediaShortcuts;
MediaShortcuts: typeof ESLMediaShortcuts;
}
}
export {};