dir-document-token.d.ts 963 B

1234567891011121314151617181920212223242526
  1. /**
  2. * @license
  3. * Copyright Google LLC All Rights Reserved.
  4. *
  5. * Use of this source code is governed by an MIT-style license that can be
  6. * found in the LICENSE file at https://angular.io/license
  7. */
  8. import { InjectionToken } from '@angular/core';
  9. /**
  10. * Injection token used to inject the document into Directionality.
  11. * This is used so that the value can be faked in tests.
  12. *
  13. * We can't use the real document in tests because changing the real `dir` causes geometry-based
  14. * tests in Safari to fail.
  15. *
  16. * We also can't re-provide the DOCUMENT token from platform-brower because the unit tests
  17. * themselves use things like `querySelector` in test code.
  18. *
  19. * This token is defined in a separate file from Directionality as a workaround for
  20. * https://github.com/angular/angular/issues/22559
  21. *
  22. * @docs-private
  23. */
  24. export declare const DIR_DOCUMENT: InjectionToken<Document>;
  25. /** @docs-private */
  26. export declare function DIR_DOCUMENT_FACTORY(): Document;