1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | import { NgZone, OnDestroy } from '@angular/core';
|
9 | import { BehaviorSubject, Observable } from 'rxjs';
|
10 | import { MediaChange } from '../media-change';
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 | export declare class MatchMedia implements OnDestroy {
|
19 | protected _zone: NgZone;
|
20 | protected _platformId: Object;
|
21 | protected _document: any;
|
22 |
|
23 | readonly source: BehaviorSubject<MediaChange>;
|
24 | registry: Map<string, MediaQueryList>;
|
25 | private readonly pendingRemoveListenerFns;
|
26 | constructor(_zone: NgZone, _platformId: Object, _document: any);
|
27 | /**
|
28 | * Publish list of all current activations
|
29 | */
|
30 | get activations(): string[];
|
31 | /**
|
32 | * For the specified mediaQuery?
|
33 | */
|
34 | isActive(mediaQuery: string): boolean;
|
35 | /**
|
36 | * External observers can watch for all (or a specific) mql changes.
|
37 | *
|
38 | * If a mediaQuery is not specified, then ALL mediaQuery activations will
|
39 | * be announced.
|
40 | */
|
41 | observe(): Observable<MediaChange>;
|
42 | observe(mediaQueries: string[]): Observable<MediaChange>;
|
43 | observe(mediaQueries: string[], filterOthers: boolean): Observable<MediaChange>;
|
44 | /**
|
45 | * Based on the BreakPointRegistry provider, register internal listeners for each unique
|
46 | * mediaQuery. Each listener emits specific MediaChange data to observers
|
47 | */
|
48 | registerQuery(mediaQuery: string | string[]): MediaChange[];
|
49 | ngOnDestroy(): void;
|
50 | /**
|
51 | * Call window.matchMedia() to build a MediaQueryList; which
|
52 | * supports 0..n listeners for activation/deactivation
|
53 | */
|
54 | protected buildMQL(query: string): MediaQueryList;
|
55 | protected _observable$: Observable<MediaChange>;
|
56 | }
|