1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | import { OnDestroy } from '@angular/core';
|
9 | import { Observable } from 'rxjs';
|
10 | import { MediaChange } from '../media-change';
|
11 | import { MatchMedia } from '../match-media/match-media';
|
12 | import { PrintHook } from '../media-marshaller/print-hook';
|
13 | import { BreakPointRegistry } from '../breakpoints/break-point-registry';
|
14 | import * as i0 from "@angular/core";
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 |
|
44 |
|
45 |
|
46 |
|
47 |
|
48 |
|
49 |
|
50 |
|
51 |
|
52 |
|
53 |
|
54 |
|
55 |
|
56 | export declare class MediaObserver implements OnDestroy {
|
57 | protected breakpoints: BreakPointRegistry;
|
58 | protected matchMedia: MatchMedia;
|
59 | protected hook: PrintHook;
|
60 |
|
61 | filterOverlaps: boolean;
|
62 | constructor(breakpoints: BreakPointRegistry, matchMedia: MatchMedia, hook: PrintHook);
|
63 | /**
|
64 | * Completes the active subject, signalling to all complete for all
|
65 | * MediaObserver subscribers
|
66 | */
|
67 | ngOnDestroy(): void;
|
68 | /**
|
69 | * Observe changes to current activation 'list'
|
70 | */
|
71 | asObservable(): Observable<MediaChange[]>;
|
72 | /**
|
73 | * Allow programmatic query to determine if one or more media query/alias match
|
74 | * the current viewport size.
|
75 | * @param value One or more media queries (or aliases) to check.
|
76 | * @returns Whether any of the media queries match.
|
77 | */
|
78 | isActive(value: string | string[]): boolean;
|
79 | /**
|
80 | * Register all the mediaQueries registered in the BreakPointRegistry
|
81 | * This is needed so subscribers can be auto-notified of all standard, registered
|
82 | * mediaQuery activations
|
83 | */
|
84 | private watchActivations;
|
85 | /**
|
86 | * Only pass/announce activations (not de-activations)
|
87 | *
|
88 | * Since multiple-mediaQueries can be activation in a cycle,
|
89 | * gather all current activations into a single list of changes to observers
|
90 | *
|
91 | * Inject associated (if any) alias information into the MediaChange event
|
92 | * - Exclude mediaQuery activations for overlapping mQs. List bounded mQ ranges only
|
93 | * - Exclude print activations that do not have an associated mediaQuery
|
94 | *
|
95 | * NOTE: the raw MediaChange events [from MatchMedia] do not
|
96 | * contain important alias information; as such this info
|
97 | * must be injected into the MediaChange
|
98 | */
|
99 | private buildObservable;
|
100 | /**
|
101 | * Find all current activations and prepare single list of activations
|
102 | * sorted by descending priority.
|
103 | */
|
104 | private findAllActivations;
|
105 | private readonly _media$;
|
106 | private readonly destroyed$;
|
107 | static ɵfac: i0.ɵɵFactoryDeclaration<MediaObserver, never>;
|
108 | static ɵprov: i0.ɵɵInjectableDeclaration<MediaObserver>;
|
109 | }
|