index.d.ts 5.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. export { A as AsyncFactoryFn, g as AsyncOptionPredicate, f as AsyncPredicate, B as BaseHarnessFilters, C as ComponentHarness, e as ComponentHarnessConstructor, j as ContentContainerComponentHarness, E as ElementDimensions, c as EventData, H as HarnessEnvironment, d as HarnessLoader, k as HarnessPredicate, h as HarnessQuery, i as LocatorFactory, L as LocatorFnResult, M as ModifierKeys, T as TestElement, a as TestKey, b as TextOptions } from '../harness-environment.d-BbFzIFDE.js';
  2. /**
  3. * Returns an error which reports that no keys have been specified.
  4. * @docs-private
  5. */
  6. declare function getNoKeysSpecifiedError(): Error;
  7. /**
  8. * Gets text of element excluding certain selectors within the element.
  9. * @param element Element to get text from,
  10. * @param excludeSelector Selector identifying which elements to exclude,
  11. */
  12. declare function _getTextWithExcludedElements(element: Element, excludeSelector: string): string;
  13. /**
  14. * The status of the test harness auto change detection. If not diabled test harnesses will
  15. * automatically trigger change detection after every action (such as a click) and before every read
  16. * (such as getting the text of an element).
  17. */
  18. interface AutoChangeDetectionStatus {
  19. /** Whether auto change detection is disabled. */
  20. isDisabled: boolean;
  21. /**
  22. * An optional callback, if present it indicates that change detection should be run immediately,
  23. * while handling the status change. The callback should then be called as soon as change
  24. * detection is done.
  25. */
  26. onDetectChangesNow?: () => void;
  27. }
  28. /**
  29. * Allows a test `HarnessEnvironment` to install its own handler for auto change detection status
  30. * changes.
  31. * @param handler The handler for the auto change detection status.
  32. */
  33. declare function handleAutoChangeDetectionStatus(handler: (status: AutoChangeDetectionStatus) => void): void;
  34. /** Allows a `HarnessEnvironment` to stop handling auto change detection status changes. */
  35. declare function stopHandlingAutoChangeDetectionStatus(): void;
  36. /**
  37. * Disables the harness system's auto change detection for the duration of the given function.
  38. * @param fn The function to disable auto change detection for.
  39. * @return The result of the given function.
  40. */
  41. declare function manualChangeDetection<T>(fn: () => Promise<T>): Promise<T>;
  42. /**
  43. * Resolves the given list of async values in parallel (i.e. via Promise.all) while batching change
  44. * detection over the entire operation such that change detection occurs exactly once before
  45. * resolving the values and once after.
  46. * @param values A getter for the async values to resolve in parallel with batched change detection.
  47. * @return The resolved values.
  48. */
  49. declare function parallel<T1, T2, T3, T4, T5>(values: () => [
  50. T1 | PromiseLike<T1>,
  51. T2 | PromiseLike<T2>,
  52. T3 | PromiseLike<T3>,
  53. T4 | PromiseLike<T4>,
  54. T5 | PromiseLike<T5>
  55. ]): Promise<[T1, T2, T3, T4, T5]>;
  56. /**
  57. * Resolves the given list of async values in parallel (i.e. via Promise.all) while batching change
  58. * detection over the entire operation such that change detection occurs exactly once before
  59. * resolving the values and once after.
  60. * @param values A getter for the async values to resolve in parallel with batched change detection.
  61. * @return The resolved values.
  62. */
  63. declare function parallel<T1, T2, T3, T4>(values: () => [
  64. T1 | PromiseLike<T1>,
  65. T2 | PromiseLike<T2>,
  66. T3 | PromiseLike<T3>,
  67. T4 | PromiseLike<T4>
  68. ]): Promise<[T1, T2, T3, T4]>;
  69. /**
  70. * Resolves the given list of async values in parallel (i.e. via Promise.all) while batching change
  71. * detection over the entire operation such that change detection occurs exactly once before
  72. * resolving the values and once after.
  73. * @param values A getter for the async values to resolve in parallel with batched change detection.
  74. * @return The resolved values.
  75. */
  76. declare function parallel<T1, T2, T3>(values: () => [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>]): Promise<[T1, T2, T3]>;
  77. /**
  78. * Resolves the given list of async values in parallel (i.e. via Promise.all) while batching change
  79. * detection over the entire operation such that change detection occurs exactly once before
  80. * resolving the values and once after.
  81. * @param values A getter for the async values to resolve in parallel with batched change detection.
  82. * @return The resolved values.
  83. */
  84. declare function parallel<T1, T2>(values: () => [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>]): Promise<[T1, T2]>;
  85. /**
  86. * Resolves the given list of async values in parallel (i.e. via Promise.all) while batching change
  87. * detection over the entire operation such that change detection occurs exactly once before
  88. * resolving the values and once after.
  89. * @param values A getter for the async values to resolve in parallel with batched change detection.
  90. * @return The resolved values.
  91. */
  92. declare function parallel<T>(values: () => (T | PromiseLike<T>)[]): Promise<T[]>;
  93. export { _getTextWithExcludedElements, getNoKeysSpecifiedError, handleAutoChangeDetectionStatus, manualChangeDetection, parallel, stopHandlingAutoChangeDetectionStatus };
  94. export type { AutoChangeDetectionStatus };