index.d.ts 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. export { P as Platform } from '../platform.d-B3vREl3q.js';
  2. import * as i0 from '@angular/core';
  3. import { Renderer2 } from '@angular/core';
  4. declare class PlatformModule {
  5. static ɵfac: i0.ɵɵFactoryDeclaration<PlatformModule, never>;
  6. static ɵmod: i0.ɵɵNgModuleDeclaration<PlatformModule, never, never, never>;
  7. static ɵinj: i0.ɵɵInjectorDeclaration<PlatformModule>;
  8. }
  9. /** @returns The input types supported by this browser. */
  10. declare function getSupportedInputTypes(): Set<string>;
  11. /**
  12. * Checks whether the user's browser supports passive event listeners.
  13. * See: https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md
  14. */
  15. declare function supportsPassiveEventListeners(): boolean;
  16. /**
  17. * Normalizes an `AddEventListener` object to something that can be passed
  18. * to `addEventListener` on any browser, no matter whether it supports the
  19. * `options` parameter.
  20. * @param options Object to be normalized.
  21. */
  22. declare function normalizePassiveListenerOptions(options: AddEventListenerOptions): AddEventListenerOptions | boolean;
  23. /** The possible ways the browser may handle the horizontal scroll axis in RTL languages. */
  24. declare enum RtlScrollAxisType {
  25. /**
  26. * scrollLeft is 0 when scrolled all the way left and (scrollWidth - clientWidth) when scrolled
  27. * all the way right.
  28. */
  29. NORMAL = 0,
  30. /**
  31. * scrollLeft is -(scrollWidth - clientWidth) when scrolled all the way left and 0 when scrolled
  32. * all the way right.
  33. */
  34. NEGATED = 1,
  35. /**
  36. * scrollLeft is (scrollWidth - clientWidth) when scrolled all the way left and 0 when scrolled
  37. * all the way right.
  38. */
  39. INVERTED = 2
  40. }
  41. /** Check whether the browser supports scroll behaviors. */
  42. declare function supportsScrollBehavior(): boolean;
  43. /**
  44. * Checks the type of RTL scroll axis used by this browser. As of time of writing, Chrome is NORMAL,
  45. * Firefox & Safari are NEGATED, and IE & Edge are INVERTED.
  46. */
  47. declare function getRtlScrollAxisType(): RtlScrollAxisType;
  48. /** Checks whether the user's browser support Shadow DOM. */
  49. declare function _supportsShadowDom(): boolean;
  50. /** Gets the shadow root of an element, if supported and the element is inside the Shadow DOM. */
  51. declare function _getShadowRoot(element: HTMLElement): ShadowRoot | null;
  52. /**
  53. * Gets the currently-focused element on the page while
  54. * also piercing through Shadow DOM boundaries.
  55. */
  56. declare function _getFocusedElementPierceShadowDom(): HTMLElement | null;
  57. /** Gets the target of an event while accounting for Shadow DOM. */
  58. declare function _getEventTarget<T extends EventTarget>(event: Event): T | null;
  59. /** Gets whether the code is currently running in a test environment. */
  60. declare function _isTestEnvironment(): boolean;
  61. /** Options when binding events manually. */
  62. interface _ListenerOptions {
  63. capture?: boolean;
  64. once?: boolean;
  65. passive?: boolean;
  66. }
  67. /**
  68. * Binds an event listener with specific options in a backwards-compatible way.
  69. * This function is necessary, because `Renderer2.listen` only supports listener options
  70. * after 19.1 and during the v19 period we support any 19.x version.
  71. * @docs-private
  72. */
  73. declare function _bindEventWithOptions(renderer: Renderer2, target: EventTarget, eventName: string, callback: (event: any) => boolean | void, options: _ListenerOptions): () => void;
  74. export { PlatformModule, RtlScrollAxisType, _bindEventWithOptions, _getEventTarget, _getFocusedElementPierceShadowDom, _getShadowRoot, _isTestEnvironment, _supportsShadowDom, getRtlScrollAxisType, getSupportedInputTypes, normalizePassiveListenerOptions, supportsPassiveEventListeners, supportsScrollBehavior };
  75. export type { _ListenerOptions };