index.d.ts 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. import * as i0 from '@angular/core';
  2. import { NgZone } from '@angular/core';
  3. import { Observable } from 'rxjs';
  4. import { OnDestroy } from '@angular/core';
  5. import { Platform } from '@angular/cdk/platform';
  6. /** Utility for checking the matching state of @media queries. */
  7. export declare class BreakpointObserver implements OnDestroy {
  8. private _mediaMatcher;
  9. private _zone;
  10. /** A map of all media queries currently being listened for. */
  11. private _queries;
  12. /** A subject for all other observables to takeUntil based on. */
  13. private readonly _destroySubject;
  14. constructor(_mediaMatcher: MediaMatcher, _zone: NgZone);
  15. /** Completes the active subject, signalling to all other observables to complete. */
  16. ngOnDestroy(): void;
  17. /**
  18. * Whether one or more media queries match the current viewport size.
  19. * @param value One or more media queries to check.
  20. * @returns Whether any of the media queries match.
  21. */
  22. isMatched(value: string | readonly string[]): boolean;
  23. /**
  24. * Gets an observable of results for the given queries that will emit new results for any changes
  25. * in matching of the given queries.
  26. * @param value One or more media queries to check.
  27. * @returns A stream of matches for the given queries.
  28. */
  29. observe(value: string | readonly string[]): Observable<BreakpointState>;
  30. /** Registers a specific query to be listened for. */
  31. private _registerQuery;
  32. static ɵfac: i0.ɵɵFactoryDeclaration<BreakpointObserver, never>;
  33. static ɵprov: i0.ɵɵInjectableDeclaration<BreakpointObserver>;
  34. }
  35. export declare const Breakpoints: {
  36. XSmall: string;
  37. Small: string;
  38. Medium: string;
  39. Large: string;
  40. XLarge: string;
  41. Handset: string;
  42. Tablet: string;
  43. Web: string;
  44. HandsetPortrait: string;
  45. TabletPortrait: string;
  46. WebPortrait: string;
  47. HandsetLandscape: string;
  48. TabletLandscape: string;
  49. WebLandscape: string;
  50. };
  51. /** The current state of a layout breakpoint. */
  52. export declare interface BreakpointState {
  53. /** Whether the breakpoint is currently matching. */
  54. matches: boolean;
  55. /**
  56. * A key boolean pair for each query provided to the observe method,
  57. * with its current matched state.
  58. */
  59. breakpoints: {
  60. [key: string]: boolean;
  61. };
  62. }
  63. export declare class LayoutModule {
  64. static ɵfac: i0.ɵɵFactoryDeclaration<LayoutModule, never>;
  65. static ɵmod: i0.ɵɵNgModuleDeclaration<LayoutModule, never, never, never>;
  66. static ɵinj: i0.ɵɵInjectorDeclaration<LayoutModule>;
  67. }
  68. /** A utility for calling matchMedia queries. */
  69. export declare class MediaMatcher {
  70. private _platform;
  71. private _nonce?;
  72. /** The internal matchMedia method to return back a MediaQueryList like object. */
  73. private _matchMedia;
  74. constructor(_platform: Platform, _nonce?: string | null | undefined);
  75. /**
  76. * Evaluates the given media query and returns the native MediaQueryList from which results
  77. * can be retrieved.
  78. * Confirms the layout engine will trigger for the selector query provided and returns the
  79. * MediaQueryList for the query provided.
  80. */
  81. matchMedia(query: string): MediaQueryList;
  82. static ɵfac: i0.ɵɵFactoryDeclaration<MediaMatcher, [null, { optional: true; }]>;
  83. static ɵprov: i0.ɵɵInjectableDeclaration<MediaMatcher>;
  84. }
  85. export { }