index.d.ts 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. import { AfterContentInit } from '@angular/core';
  2. import { EventEmitter } from '@angular/core';
  3. import * as i0 from '@angular/core';
  4. import { InjectionToken } from '@angular/core';
  5. import { OnDestroy } from '@angular/core';
  6. export declare class BidiModule {
  7. static ɵfac: i0.ɵɵFactoryDeclaration<BidiModule, never>;
  8. static ɵmod: i0.ɵɵNgModuleDeclaration<BidiModule, [typeof i1.Dir], never, [typeof i1.Dir]>;
  9. static ɵinj: i0.ɵɵInjectorDeclaration<BidiModule>;
  10. }
  11. /**
  12. * Directive to listen for changes of direction of part of the DOM.
  13. *
  14. * Provides itself as Directionality such that descendant directives only need to ever inject
  15. * Directionality to get the closest direction.
  16. */
  17. export declare class Dir implements Directionality, AfterContentInit, OnDestroy {
  18. /** Normalized direction that accounts for invalid/unsupported values. */
  19. private _dir;
  20. /** Whether the `value` has been set to its initial value. */
  21. private _isInitialized;
  22. /** Direction as passed in by the consumer. */
  23. _rawDir: string;
  24. /** Event emitted when the direction changes. */
  25. readonly change: EventEmitter<Direction>;
  26. /** @docs-private */
  27. get dir(): Direction;
  28. set dir(value: Direction | 'auto');
  29. /** Current layout direction of the element. */
  30. get value(): Direction;
  31. /** Initialize once default value has been set. */
  32. ngAfterContentInit(): void;
  33. ngOnDestroy(): void;
  34. static ɵfac: i0.ɵɵFactoryDeclaration<Dir, never>;
  35. static ɵdir: i0.ɵɵDirectiveDeclaration<Dir, "[dir]", ["dir"], { "dir": { "alias": "dir"; "required": false; }; }, { "change": "dirChange"; }, never, never, false, never>;
  36. }
  37. /**
  38. * Injection token used to inject the document into Directionality.
  39. * This is used so that the value can be faked in tests.
  40. *
  41. * We can't use the real document in tests because changing the real `dir` causes geometry-based
  42. * tests in Safari to fail.
  43. *
  44. * We also can't re-provide the DOCUMENT token from platform-browser because the unit tests
  45. * themselves use things like `querySelector` in test code.
  46. *
  47. * This token is defined in a separate file from Directionality as a workaround for
  48. * https://github.com/angular/angular/issues/22559
  49. *
  50. * @docs-private
  51. */
  52. export declare const DIR_DOCUMENT: InjectionToken<Document>;
  53. export declare type Direction = 'ltr' | 'rtl';
  54. /**
  55. * The directionality (LTR / RTL) context for the application (or a subtree of it).
  56. * Exposes the current direction and a stream of direction changes.
  57. */
  58. export declare class Directionality implements OnDestroy {
  59. /** The current 'ltr' or 'rtl' value. */
  60. readonly value: Direction;
  61. /** Stream that emits whenever the 'ltr' / 'rtl' state changes. */
  62. readonly change: EventEmitter<Direction>;
  63. constructor(_document?: any);
  64. ngOnDestroy(): void;
  65. static ɵfac: i0.ɵɵFactoryDeclaration<Directionality, [{ optional: true; }]>;
  66. static ɵprov: i0.ɵɵInjectableDeclaration<Directionality>;
  67. }
  68. declare namespace i1 {
  69. export {
  70. Dir
  71. }
  72. }
  73. export { }