UNPKG

2.31 kBTypeScriptView Raw
1import { MatchMedia } from '../match-media/match-media';
2import { BreakPointRegistry } from '../breakpoints/break-point-registry';
3import { LayoutConfigOptions } from '../tokens/library-config';
4/**
5 * Class
6 */
7export declare class MediaTrigger {
8 protected breakpoints: BreakPointRegistry;
9 protected matchMedia: MatchMedia;
10 protected layoutConfig: LayoutConfigOptions;
11 protected _platformId: Object;
12 protected _document: any;
13 constructor(breakpoints: BreakPointRegistry, matchMedia: MatchMedia, layoutConfig: LayoutConfigOptions, _platformId: Object, _document: any);
14 /**
15 * Manually activate range of breakpoints
16 * @param list array of mediaQuery or alias strings
17 */
18 activate(list: string[]): void;
19 /**
20 * Restore original, 'real' breakpoints and emit events
21 * to trigger stream notification
22 */
23 restore(): void;
24 /**
25 * Whenever window resizes, immediately auto-restore original
26 * activations (if we are simulating activations)
27 */
28 private prepareAutoRestore;
29 /**
30 * Notify all matchMedia subscribers of de-activations
31 *
32 * Note: we must force 'matches' updates for
33 * future matchMedia::activation lookups
34 */
35 private deactivateAll;
36 /**
37 * Cache current activations as sorted, prioritized list of MediaChanges
38 */
39 private saveActivations;
40 /**
41 * Force set manual activations for specified mediaQuery list
42 */
43 private setActivations;
44 /**
45 * For specified mediaQuery list manually simulate activations or deactivations
46 */
47 private simulateMediaChanges;
48 /**
49 * Replace current registry with simulated registry...
50 * Note: this is required since MediaQueryList::matches is 'readOnly'
51 */
52 private forceRegistryMatches;
53 /**
54 * Save current MatchMedia::registry items.
55 */
56 private cacheRegistryMatches;
57 /**
58 * Restore original, 'true' registry
59 */
60 private restoreRegistryMatches;
61 /**
62 * Manually emit a MediaChange event via the MatchMedia to MediaMarshaller and MediaObserver
63 */
64 private emitChangeEvent;
65 private get currentActivations();
66 private hasCachedRegistryMatches;
67 private originalActivations;
68 private originalRegistry;
69 private resizeSubscription;
70}