@dugararchit/cdk 0.0.0-dugararchit

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (206) hide show
  1. package/_index.scss +8 -0
  2. package/a11y/_index.import.scss +2 -0
  3. package/a11y/_index.scss +102 -0
  4. package/a11y/a11y-prebuilt.scss +3 -0
  5. package/fesm2022/stagefright5-cdk-a11y.mjs +2381 -0
  6. package/fesm2022/stagefright5-cdk-a11y.mjs.map +1 -0
  7. package/fesm2022/stagefright5-cdk-accordion.mjs +267 -0
  8. package/fesm2022/stagefright5-cdk-accordion.mjs.map +1 -0
  9. package/fesm2022/stagefright5-cdk-bidi.mjs +185 -0
  10. package/fesm2022/stagefright5-cdk-bidi.mjs.map +1 -0
  11. package/fesm2022/stagefright5-cdk-clipboard.mjs +250 -0
  12. package/fesm2022/stagefright5-cdk-clipboard.mjs.map +1 -0
  13. package/fesm2022/stagefright5-cdk-coercion.mjs +128 -0
  14. package/fesm2022/stagefright5-cdk-coercion.mjs.map +1 -0
  15. package/fesm2022/stagefright5-cdk-collections.mjs +472 -0
  16. package/fesm2022/stagefright5-cdk-collections.mjs.map +1 -0
  17. package/fesm2022/stagefright5-cdk-drag-drop.mjs +3690 -0
  18. package/fesm2022/stagefright5-cdk-drag-drop.mjs.map +1 -0
  19. package/fesm2022/stagefright5-cdk-keycodes.mjs +159 -0
  20. package/fesm2022/stagefright5-cdk-keycodes.mjs.map +1 -0
  21. package/fesm2022/stagefright5-cdk-layout.mjs +246 -0
  22. package/fesm2022/stagefright5-cdk-layout.mjs.map +1 -0
  23. package/fesm2022/stagefright5-cdk-observers.mjs +203 -0
  24. package/fesm2022/stagefright5-cdk-observers.mjs.map +1 -0
  25. package/fesm2022/stagefright5-cdk-overlay.mjs +3033 -0
  26. package/fesm2022/stagefright5-cdk-overlay.mjs.map +1 -0
  27. package/fesm2022/stagefright5-cdk-platform.mjs +375 -0
  28. package/fesm2022/stagefright5-cdk-platform.mjs.map +1 -0
  29. package/fesm2022/stagefright5-cdk-portal.mjs +672 -0
  30. package/fesm2022/stagefright5-cdk-portal.mjs.map +1 -0
  31. package/fesm2022/stagefright5-cdk-scrolling.mjs +1399 -0
  32. package/fesm2022/stagefright5-cdk-scrolling.mjs.map +1 -0
  33. package/fesm2022/stagefright5-cdk-stepper.mjs +624 -0
  34. package/fesm2022/stagefright5-cdk-stepper.mjs.map +1 -0
  35. package/fesm2022/stagefright5-cdk-table.mjs +2346 -0
  36. package/fesm2022/stagefright5-cdk-table.mjs.map +1 -0
  37. package/fesm2022/stagefright5-cdk-testing-protractor.mjs +324 -0
  38. package/fesm2022/stagefright5-cdk-testing-protractor.mjs.map +1 -0
  39. package/fesm2022/stagefright5-cdk-testing-selenium-webdriver.mjs +364 -0
  40. package/fesm2022/stagefright5-cdk-testing-selenium-webdriver.mjs.map +1 -0
  41. package/fesm2022/stagefright5-cdk-testing-testbed.mjs +806 -0
  42. package/fesm2022/stagefright5-cdk-testing-testbed.mjs.map +1 -0
  43. package/fesm2022/stagefright5-cdk-testing.mjs +740 -0
  44. package/fesm2022/stagefright5-cdk-testing.mjs.map +1 -0
  45. package/fesm2022/stagefright5-cdk-text-field.mjs +453 -0
  46. package/fesm2022/stagefright5-cdk-text-field.mjs.map +1 -0
  47. package/fesm2022/stagefright5-cdk-tree.mjs +945 -0
  48. package/fesm2022/stagefright5-cdk-tree.mjs.map +1 -0
  49. package/fesm2022/stagefright5-cdk.mjs +26 -0
  50. package/fesm2022/stagefright5-cdk.mjs.map +1 -0
  51. package/overlay/_index-deprecated.scss +13 -0
  52. package/overlay/_index.import.scss +13 -0
  53. package/overlay/_index.scss +148 -0
  54. package/overlay/overlay-prebuilt.scss +3 -0
  55. package/package.json +159 -0
  56. package/schematics/ng-update/test-cases/misc/global-stylesheets-test.scss +3 -0
  57. package/schematics/schematics/BUILD.bazel +104 -0
  58. package/schematics/schematics/README.md +4 -0
  59. package/schematics/schematics/collection.json +18 -0
  60. package/schematics/schematics/index.ts +22 -0
  61. package/schematics/schematics/migration.json +50 -0
  62. package/schematics/schematics/ng-add/index.spec.ts +50 -0
  63. package/schematics/schematics/ng-add/index.ts +39 -0
  64. package/schematics/schematics/ng-add/package-config.ts +62 -0
  65. package/schematics/schematics/ng-add/schema.json +16 -0
  66. package/schematics/schematics/ng-add/schema.ts +12 -0
  67. package/schematics/schematics/ng-generate/drag-drop/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.__style__.template +53 -0
  68. package/schematics/schematics/ng-generate/drag-drop/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template +17 -0
  69. package/schematics/schematics/ng-generate/drag-drop/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.spec.ts.template +29 -0
  70. package/schematics/schematics/ng-generate/drag-drop/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts.template +43 -0
  71. package/schematics/schematics/ng-generate/drag-drop/index.spec.ts +205 -0
  72. package/schematics/schematics/ng-generate/drag-drop/index.ts +35 -0
  73. package/schematics/schematics/ng-generate/drag-drop/schema.json +93 -0
  74. package/schematics/schematics/ng-generate/drag-drop/schema.ts +11 -0
  75. package/schematics/schematics/ng-update/data/attribute-selectors.ts +29 -0
  76. package/schematics/schematics/ng-update/data/class-names.ts +50 -0
  77. package/schematics/schematics/ng-update/data/constructor-checks.ts +75 -0
  78. package/schematics/schematics/ng-update/data/css-selectors.ts +33 -0
  79. package/schematics/schematics/ng-update/data/element-selectors.ts +21 -0
  80. package/schematics/schematics/ng-update/data/index.ts +18 -0
  81. package/schematics/schematics/ng-update/data/input-names.ts +118 -0
  82. package/schematics/schematics/ng-update/data/method-call-checks.ts +63 -0
  83. package/schematics/schematics/ng-update/data/output-names.ts +42 -0
  84. package/schematics/schematics/ng-update/data/property-names.ts +151 -0
  85. package/schematics/schematics/ng-update/data/symbol-removal.ts +22 -0
  86. package/schematics/schematics/ng-update/devkit-file-system.ts +87 -0
  87. package/schematics/schematics/ng-update/devkit-migration-rule.ts +185 -0
  88. package/schematics/schematics/ng-update/devkit-migration.ts +47 -0
  89. package/schematics/schematics/ng-update/find-stylesheets.ts +43 -0
  90. package/schematics/schematics/ng-update/html-parsing/angular.ts +49 -0
  91. package/schematics/schematics/ng-update/html-parsing/elements.ts +66 -0
  92. package/schematics/schematics/ng-update/index.ts +113 -0
  93. package/schematics/schematics/ng-update/migrations/attribute-selectors.ts +83 -0
  94. package/schematics/schematics/ng-update/migrations/class-inheritance.ts +63 -0
  95. package/schematics/schematics/ng-update/migrations/class-names.ts +107 -0
  96. package/schematics/schematics/ng-update/migrations/constructor-signature.ts +170 -0
  97. package/schematics/schematics/ng-update/migrations/css-selectors.ts +83 -0
  98. package/schematics/schematics/ng-update/migrations/element-selectors.ts +75 -0
  99. package/schematics/schematics/ng-update/migrations/input-names.ts +83 -0
  100. package/schematics/schematics/ng-update/migrations/method-call-arguments.ts +70 -0
  101. package/schematics/schematics/ng-update/migrations/misc-template.ts +36 -0
  102. package/schematics/schematics/ng-update/migrations/output-names.ts +61 -0
  103. package/schematics/schematics/ng-update/migrations/property-names.ts +61 -0
  104. package/schematics/schematics/ng-update/migrations/symbol-removal.ts +51 -0
  105. package/schematics/schematics/ng-update/migrations/tilde-import-v13/tilde-import-migration.ts +40 -0
  106. package/schematics/schematics/ng-update/public-api.ts +18 -0
  107. package/schematics/schematics/ng-update/test-cases/index.spec.ts +18 -0
  108. package/schematics/schematics/ng-update/test-cases/misc/external-resource-resolution.spec.ts +32 -0
  109. package/schematics/schematics/ng-update/test-cases/misc/external-resource-resolution_input.ts +22 -0
  110. package/schematics/schematics/ng-update/test-cases/misc/global-stylesheets-test.scss +3 -0
  111. package/schematics/schematics/ng-update/test-cases/misc/global-stylesheets.spec.ts +50 -0
  112. package/schematics/schematics/ng-update/test-cases/misc/global-stylesheets_input.ts +8 -0
  113. package/schematics/schematics/ng-update/test-cases/misc/method-call-checks.spec.ts +20 -0
  114. package/schematics/schematics/ng-update/test-cases/misc/method-call-checks_input.ts +18 -0
  115. package/schematics/schematics/ng-update/test-cases/misc/module-resolution.spec.ts +27 -0
  116. package/schematics/schematics/ng-update/test-cases/v13/misc/tilde-import-v13.spec.ts +149 -0
  117. package/schematics/schematics/ng-update/test-cases/v6/attribute-selectors_expected_output.ts +36 -0
  118. package/schematics/schematics/ng-update/test-cases/v6/attribute-selectors_input.ts +36 -0
  119. package/schematics/schematics/ng-update/test-cases/v6/class-names_expected_output.ts +8 -0
  120. package/schematics/schematics/ng-update/test-cases/v6/class-names_input.ts +8 -0
  121. package/schematics/schematics/ng-update/test-cases/v6/input-names_expected_output.ts +22 -0
  122. package/schematics/schematics/ng-update/test-cases/v6/input-names_input.ts +22 -0
  123. package/schematics/schematics/ng-update/test-cases/v6/property-names_expected_output.ts +64 -0
  124. package/schematics/schematics/ng-update/test-cases/v6/property-names_input.ts +64 -0
  125. package/schematics/schematics/ng-update/test-cases/v7/property-names_expected_output.ts +28 -0
  126. package/schematics/schematics/ng-update/test-cases/v7/property-names_input.ts +28 -0
  127. package/schematics/schematics/ng-update/typescript/base-types.ts +22 -0
  128. package/schematics/schematics/ng-update/typescript/imports.ts +54 -0
  129. package/schematics/schematics/ng-update/typescript/literal.ts +32 -0
  130. package/schematics/schematics/ng-update/typescript/module-specifiers.ts +39 -0
  131. package/schematics/schematics/ng-update/update-schematic.md +209 -0
  132. package/schematics/schematics/ng-update/upgrade-data.ts +79 -0
  133. package/schematics/schematics/paths.ts +15 -0
  134. package/schematics/schematics/testing/BUILD.bazel +27 -0
  135. package/schematics/schematics/testing/file-content.ts +20 -0
  136. package/schematics/schematics/testing/index.ts +14 -0
  137. package/schematics/schematics/testing/post-scheduled-tasks.ts +45 -0
  138. package/schematics/schematics/testing/resolve-bazel-path.ts +46 -0
  139. package/schematics/schematics/testing/test-app.ts +21 -0
  140. package/schematics/schematics/testing/test-case-setup.ts +236 -0
  141. package/schematics/schematics/testing/test-library.ts +21 -0
  142. package/schematics/schematics/testing/test-project.ts +40 -0
  143. package/schematics/schematics/testing/tsconfig.json +7 -0
  144. package/schematics/schematics/tsconfig.json +28 -0
  145. package/schematics/schematics/update-tool/BUILD.bazel +19 -0
  146. package/schematics/schematics/update-tool/component-resource-collector.ts +195 -0
  147. package/schematics/schematics/update-tool/file-system.ts +78 -0
  148. package/schematics/schematics/update-tool/index.ts +191 -0
  149. package/schematics/schematics/update-tool/logger.ts +23 -0
  150. package/schematics/schematics/update-tool/migration.ts +88 -0
  151. package/schematics/schematics/update-tool/public-api.ts +16 -0
  152. package/schematics/schematics/update-tool/target-version.ts +31 -0
  153. package/schematics/schematics/update-tool/tsconfig.json +7 -0
  154. package/schematics/schematics/update-tool/update-recorder.ts +14 -0
  155. package/schematics/schematics/update-tool/utils/decorators.ts +54 -0
  156. package/schematics/schematics/update-tool/utils/functions.ts +18 -0
  157. package/schematics/schematics/update-tool/utils/imports.ts +128 -0
  158. package/schematics/schematics/update-tool/utils/line-mappings.ts +84 -0
  159. package/schematics/schematics/update-tool/utils/parse-tsconfig.ts +25 -0
  160. package/schematics/schematics/update-tool/utils/property-name.ts +28 -0
  161. package/schematics/schematics/update-tool/utils/virtual-host.ts +116 -0
  162. package/schematics/schematics/update-tool/version-changes.ts +49 -0
  163. package/schematics/schematics/utils/ast/ng-module-imports.spec.ts +43 -0
  164. package/schematics/schematics/utils/ast/ng-module-imports.ts +102 -0
  165. package/schematics/schematics/utils/ast.ts +88 -0
  166. package/schematics/schematics/utils/build-component.ts +252 -0
  167. package/schematics/schematics/utils/get-project.ts +27 -0
  168. package/schematics/schematics/utils/html-manipulation.ts +105 -0
  169. package/schematics/schematics/utils/index.ts +19 -0
  170. package/schematics/schematics/utils/parse5-element.ts +34 -0
  171. package/schematics/schematics/utils/project-index-file.ts +21 -0
  172. package/schematics/schematics/utils/project-main-file.ts +26 -0
  173. package/schematics/schematics/utils/project-style-file.ts +53 -0
  174. package/schematics/schematics/utils/project-targets.ts +43 -0
  175. package/schematics/schematics/utils/project-tsconfig-paths.spec.ts +91 -0
  176. package/schematics/schematics/utils/project-tsconfig-paths.ts +49 -0
  177. package/schematics/schematics/utils/schematic-options.ts +65 -0
  178. package/schematics/schematics/utils/vendored-ast-utils/index.ts +599 -0
  179. package/scrolling/virtual-scroll-viewport.scss +87 -0
  180. package/table/table.scss +3 -0
  181. package/text-field/_index.import.scss +2 -0
  182. package/text-field/_index.scss +89 -0
  183. package/text-field/text-field-prebuilt.scss +4 -0
  184. package/types/stagefright5-cdk-a11y.d.ts +1160 -0
  185. package/types/stagefright5-cdk-accordion.d.ts +95 -0
  186. package/types/stagefright5-cdk-bidi.d.ts +95 -0
  187. package/types/stagefright5-cdk-clipboard.d.ts +116 -0
  188. package/types/stagefright5-cdk-coercion.d.ts +101 -0
  189. package/types/stagefright5-cdk-collections.d.ts +405 -0
  190. package/types/stagefright5-cdk-drag-drop.d.ts +1471 -0
  191. package/types/stagefright5-cdk-keycodes.d.ts +142 -0
  192. package/types/stagefright5-cdk-layout.d.ts +96 -0
  193. package/types/stagefright5-cdk-observers.d.ts +91 -0
  194. package/types/stagefright5-cdk-overlay.d.ts +1258 -0
  195. package/types/stagefright5-cdk-platform.d.ts +130 -0
  196. package/types/stagefright5-cdk-portal.d.ts +327 -0
  197. package/types/stagefright5-cdk-scrolling.d.ts +631 -0
  198. package/types/stagefright5-cdk-stepper.d.ts +302 -0
  199. package/types/stagefright5-cdk-table.d.ts +1128 -0
  200. package/types/stagefright5-cdk-testing-protractor.d.ts +146 -0
  201. package/types/stagefright5-cdk-testing-selenium-webdriver.d.ts +161 -0
  202. package/types/stagefright5-cdk-testing-testbed.d.ts +168 -0
  203. package/types/stagefright5-cdk-testing.d.ts +735 -0
  204. package/types/stagefright5-cdk-text-field.d.ts +171 -0
  205. package/types/stagefright5-cdk-tree.d.ts +522 -0
  206. package/types/stagefright5-cdk.d.ts +14 -0
@@ -0,0 +1,735 @@
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
+ /**
9
+ * Dimensions for element size and its position relative to the viewport.
10
+ */
11
+ interface ElementDimensions {
12
+ top: number;
13
+ left: number;
14
+ width: number;
15
+ height: number;
16
+ }
17
+
18
+ /**
19
+ * @license
20
+ * Copyright Google LLC All Rights Reserved.
21
+ *
22
+ * Use of this source code is governed by an MIT-style license that can be
23
+ * found in the LICENSE file at https://angular.io/license
24
+ */
25
+
26
+ /** Modifier keys that may be held while typing. */
27
+ interface ModifierKeys {
28
+ control?: boolean;
29
+ alt?: boolean;
30
+ shift?: boolean;
31
+ meta?: boolean;
32
+ }
33
+ /** Data that can be attached to a custom event dispatched from a `TestElement`. */
34
+ type EventData = string | number | boolean | undefined | null | EventData[] | {
35
+ [key: string]: EventData;
36
+ };
37
+ /** An enum of non-text keys that can be used with the `sendKeys` method. */
38
+ declare enum TestKey {
39
+ BACKSPACE = 0,
40
+ TAB = 1,
41
+ ENTER = 2,
42
+ SHIFT = 3,
43
+ CONTROL = 4,
44
+ ALT = 5,
45
+ ESCAPE = 6,
46
+ PAGE_UP = 7,
47
+ PAGE_DOWN = 8,
48
+ END = 9,
49
+ HOME = 10,
50
+ LEFT_ARROW = 11,
51
+ UP_ARROW = 12,
52
+ RIGHT_ARROW = 13,
53
+ DOWN_ARROW = 14,
54
+ INSERT = 15,
55
+ DELETE = 16,
56
+ F1 = 17,
57
+ F2 = 18,
58
+ F3 = 19,
59
+ F4 = 20,
60
+ F5 = 21,
61
+ F6 = 22,
62
+ F7 = 23,
63
+ F8 = 24,
64
+ F9 = 25,
65
+ F10 = 26,
66
+ F11 = 27,
67
+ F12 = 28,
68
+ META = 29
69
+ }
70
+ /**
71
+ * This acts as a common interface for DOM elements across both unit and e2e tests. It is the
72
+ * interface through which the ComponentHarness interacts with the component's DOM.
73
+ */
74
+ interface TestElement {
75
+ /** Blur the element. */
76
+ blur(): Promise<void>;
77
+ /** Clear the element's input (for input and textarea elements only). */
78
+ clear(): Promise<void>;
79
+ /**
80
+ * Click the element at the default location for the current environment. If you need to guarantee
81
+ * the element is clicked at a specific location, consider using `click('center')` or
82
+ * `click(x, y)` instead.
83
+ */
84
+ click(modifiers?: ModifierKeys): Promise<void>;
85
+ /** Click the element at the element's center. */
86
+ click(location: 'center', modifiers?: ModifierKeys): Promise<void>;
87
+ /**
88
+ * Click the element at the specified coordinates relative to the top-left of the element.
89
+ * @param relativeX Coordinate within the element, along the X-axis at which to click.
90
+ * @param relativeY Coordinate within the element, along the Y-axis at which to click.
91
+ * @param modifiers Modifier keys held while clicking
92
+ */
93
+ click(relativeX: number, relativeY: number, modifiers?: ModifierKeys): Promise<void>;
94
+ /**
95
+ * Right clicks on the element at the specified coordinates relative to the top-left of it.
96
+ * @param relativeX Coordinate within the element, along the X-axis at which to click.
97
+ * @param relativeY Coordinate within the element, along the Y-axis at which to click.
98
+ * @param modifiers Modifier keys held while clicking
99
+ */
100
+ rightClick(relativeX: number, relativeY: number, modifiers?: ModifierKeys): Promise<void>;
101
+ /** Focus the element. */
102
+ focus(): Promise<void>;
103
+ /** Get the computed value of the given CSS property for the element. */
104
+ getCssValue(property: string): Promise<string>;
105
+ /** Hovers the mouse over the element. */
106
+ hover(): Promise<void>;
107
+ /** Moves the mouse away from the element. */
108
+ mouseAway(): Promise<void>;
109
+ /**
110
+ * Sends the given string to the input as a series of key presses. Also fires input events
111
+ * and attempts to add the string to the Element's value. Note that some environments cannot
112
+ * reproduce native browser behavior for keyboard shortcuts such as Tab, Ctrl + A, etc.
113
+ * @throws An error if no keys have been specified.
114
+ */
115
+ sendKeys(...keys: (string | TestKey)[]): Promise<void>;
116
+ /**
117
+ * Sends the given string to the input as a series of key presses. Also fires input
118
+ * events and attempts to add the string to the Element's value.
119
+ * @throws An error if no keys have been specified.
120
+ */
121
+ sendKeys(modifiers: ModifierKeys, ...keys: (string | TestKey)[]): Promise<void>;
122
+ /**
123
+ * Gets the text from the element.
124
+ * @param options Options that affect what text is included.
125
+ */
126
+ text(options?: TextOptions): Promise<string>;
127
+ /** Gets the value for the given attribute from the element. */
128
+ getAttribute(name: string): Promise<string | null>;
129
+ /** Checks whether the element has the given class. */
130
+ hasClass(name: string): Promise<boolean>;
131
+ /** Gets the dimensions of the element. */
132
+ getDimensions(): Promise<ElementDimensions>;
133
+ /** Gets the value of a property of an element. */
134
+ getProperty<T = any>(name: string): Promise<T>;
135
+ /** Checks whether this element matches the given selector. */
136
+ matchesSelector(selector: string): Promise<boolean>;
137
+ /** Checks whether the element is focused. */
138
+ isFocused(): Promise<boolean>;
139
+ /** Sets the value of a property of an input. */
140
+ setInputValue(value: string): Promise<void>;
141
+ /** Selects the options at the specified indexes inside of a native `select` element. */
142
+ selectOptions(...optionIndexes: number[]): Promise<void>;
143
+ /**
144
+ * Dispatches an event with a particular name.
145
+ * @param name Name of the event to be dispatched.
146
+ */
147
+ dispatchEvent(name: string, data?: Record<string, EventData>): Promise<void>;
148
+ }
149
+ interface TextOptions {
150
+ /** Optional selector for elements to exclude. */
151
+ exclude?: string;
152
+ }
153
+
154
+ /**
155
+ * @license
156
+ * Copyright Google LLC All Rights Reserved.
157
+ *
158
+ * Use of this source code is governed by an MIT-style license that can be
159
+ * found in the LICENSE file at https://angular.io/license
160
+ */
161
+
162
+ /** An async function that returns a promise when called. */
163
+ type AsyncFactoryFn<T> = () => Promise<T>;
164
+ /** An async function that takes an item and returns a boolean promise */
165
+ type AsyncPredicate<T> = (item: T) => Promise<boolean>;
166
+ /** An async function that takes an item and an option value and returns a boolean promise. */
167
+ type AsyncOptionPredicate<T, O> = (item: T, option: O) => Promise<boolean>;
168
+ /**
169
+ * A query for a `ComponentHarness`, which is expressed as either a `ComponentHarnessConstructor` or
170
+ * a `HarnessPredicate`.
171
+ */
172
+ type HarnessQuery<T extends ComponentHarness> = ComponentHarnessConstructor<T> | HarnessPredicate<T>;
173
+ /**
174
+ * The result type obtained when searching using a particular list of queries. This type depends on
175
+ * the particular items being queried.
176
+ * - If one of the queries is for a `ComponentHarnessConstructor<C1>`, it means that the result
177
+ * might be a harness of type `C1`
178
+ * - If one of the queries is for a `HarnessPredicate<C2>`, it means that the result might be a
179
+ * harness of type `C2`
180
+ * - If one of the queries is for a `string`, it means that the result might be a `TestElement`.
181
+ *
182
+ * Since we don't know for sure which query will match, the result type if the union of the types
183
+ * for all possible results.
184
+ *
185
+ * e.g.
186
+ * The type:
187
+ * `LocatorFnResult&lt;[
188
+ * ComponentHarnessConstructor&lt;MyHarness&gt;,
189
+ * HarnessPredicate&lt;MyOtherHarness&gt;,
190
+ * string
191
+ * ]&gt;`
192
+ * is equivalent to:
193
+ * `MyHarness | MyOtherHarness | TestElement`.
194
+ */
195
+ type LocatorFnResult<T extends (HarnessQuery<any> | string)[]> = {
196
+ [I in keyof T]: T[I] extends new (...args: any[]) => infer C ? C : T[I] extends {
197
+ harnessType: new (...args: any[]) => infer C;
198
+ } ? C : T[I] extends string ? TestElement : never;
199
+ }[number];
200
+ /**
201
+ * Interface used to load ComponentHarness objects. This interface is used by test authors to
202
+ * instantiate `ComponentHarness`es.
203
+ */
204
+ interface HarnessLoader {
205
+ /**
206
+ * Searches for an element with the given selector under the current instances's root element,
207
+ * and returns a `HarnessLoader` rooted at the matching element. If multiple elements match the
208
+ * selector, the first is used. If no elements match, an error is thrown.
209
+ * @param selector The selector for the root element of the new `HarnessLoader`
210
+ * @return A `HarnessLoader` rooted at the element matching the given selector.
211
+ * @throws If a matching element can't be found.
212
+ */
213
+ getChildLoader(selector: string): Promise<HarnessLoader>;
214
+ /**
215
+ * Searches for all elements with the given selector under the current instances's root element,
216
+ * and returns an array of `HarnessLoader`s, one for each matching element, rooted at that
217
+ * element.
218
+ * @param selector The selector for the root element of the new `HarnessLoader`
219
+ * @return A list of `HarnessLoader`s, one for each matching element, rooted at that element.
220
+ */
221
+ getAllChildLoaders(selector: string): Promise<HarnessLoader[]>;
222
+ /**
223
+ * Searches for an instance of the component corresponding to the given harness type under the
224
+ * `HarnessLoader`'s root element, and returns a `ComponentHarness` for that instance. If multiple
225
+ * matching components are found, a harness for the first one is returned. If no matching
226
+ * component is found, an error is thrown.
227
+ * @param query A query for a harness to create
228
+ * @return An instance of the given harness type
229
+ * @throws If a matching component instance can't be found.
230
+ */
231
+ getHarness<T extends ComponentHarness>(query: HarnessQuery<T>): Promise<T>;
232
+ /**
233
+ * Searches for all instances of the component corresponding to the given harness type under the
234
+ * `HarnessLoader`'s root element, and returns a list `ComponentHarness` for each instance.
235
+ * @param query A query for a harness to create
236
+ * @return A list instances of the given harness type.
237
+ */
238
+ getAllHarnesses<T extends ComponentHarness>(query: HarnessQuery<T>): Promise<T[]>;
239
+ }
240
+ /**
241
+ * Interface used to create asynchronous locator functions used find elements and component
242
+ * harnesses. This interface is used by `ComponentHarness` authors to create locator functions for
243
+ * their `ComponentHarness` subclass.
244
+ */
245
+ interface LocatorFactory {
246
+ /** Gets a locator factory rooted at the document root. */
247
+ documentRootLocatorFactory(): LocatorFactory;
248
+ /** The root element of this `LocatorFactory` as a `TestElement`. */
249
+ rootElement: TestElement;
250
+ /**
251
+ * Creates an asynchronous locator function that can be used to find a `ComponentHarness` instance
252
+ * or element under the root element of this `LocatorFactory`.
253
+ * @param queries A list of queries specifying which harnesses and elements to search for:
254
+ * - A `string` searches for elements matching the CSS selector specified by the string.
255
+ * - A `ComponentHarness` constructor searches for `ComponentHarness` instances matching the
256
+ * given class.
257
+ * - A `HarnessPredicate` searches for `ComponentHarness` instances matching the given
258
+ * predicate.
259
+ * @return An asynchronous locator function that searches for and returns a `Promise` for the
260
+ * first element or harness matching the given search criteria. Matches are ordered first by
261
+ * order in the DOM, and second by order in the queries list. If no matches are found, the
262
+ * `Promise` rejects. The type that the `Promise` resolves to is a union of all result types for
263
+ * each query.
264
+ *
265
+ * e.g. Given the following DOM: `<div id="d1" /><div id="d2" />`, and assuming
266
+ * `DivHarness.hostSelector === 'div'`:
267
+ * - `await lf.locatorFor(DivHarness, 'div')()` gets a `DivHarness` instance for `#d1`
268
+ * - `await lf.locatorFor('div', DivHarness)()` gets a `TestElement` instance for `#d1`
269
+ * - `await lf.locatorFor('span')()` throws because the `Promise` rejects.
270
+ */
271
+ locatorFor<T extends (HarnessQuery<any> | string)[]>(...queries: T): AsyncFactoryFn<LocatorFnResult<T>>;
272
+ /**
273
+ * Creates an asynchronous locator function that can be used to find a `ComponentHarness` instance
274
+ * or element under the root element of this `LocatorFactory`.
275
+ * @param queries A list of queries specifying which harnesses and elements to search for:
276
+ * - A `string` searches for elements matching the CSS selector specified by the string.
277
+ * - A `ComponentHarness` constructor searches for `ComponentHarness` instances matching the
278
+ * given class.
279
+ * - A `HarnessPredicate` searches for `ComponentHarness` instances matching the given
280
+ * predicate.
281
+ * @return An asynchronous locator function that searches for and returns a `Promise` for the
282
+ * first element or harness matching the given search criteria. Matches are ordered first by
283
+ * order in the DOM, and second by order in the queries list. If no matches are found, the
284
+ * `Promise` is resolved with `null`. The type that the `Promise` resolves to is a union of all
285
+ * result types for each query or null.
286
+ *
287
+ * e.g. Given the following DOM: `<div id="d1" /><div id="d2" />`, and assuming
288
+ * `DivHarness.hostSelector === 'div'`:
289
+ * - `await lf.locatorForOptional(DivHarness, 'div')()` gets a `DivHarness` instance for `#d1`
290
+ * - `await lf.locatorForOptional('div', DivHarness)()` gets a `TestElement` instance for `#d1`
291
+ * - `await lf.locatorForOptional('span')()` gets `null`.
292
+ */
293
+ locatorForOptional<T extends (HarnessQuery<any> | string)[]>(...queries: T): AsyncFactoryFn<LocatorFnResult<T> | null>;
294
+ /**
295
+ * Creates an asynchronous locator function that can be used to find `ComponentHarness` instances
296
+ * or elements under the root element of this `LocatorFactory`.
297
+ * @param queries A list of queries specifying which harnesses and elements to search for:
298
+ * - A `string` searches for elements matching the CSS selector specified by the string.
299
+ * - A `ComponentHarness` constructor searches for `ComponentHarness` instances matching the
300
+ * given class.
301
+ * - A `HarnessPredicate` searches for `ComponentHarness` instances matching the given
302
+ * predicate.
303
+ * @return An asynchronous locator function that searches for and returns a `Promise` for all
304
+ * elements and harnesses matching the given search criteria. Matches are ordered first by
305
+ * order in the DOM, and second by order in the queries list. If an element matches more than
306
+ * one `ComponentHarness` class, the locator gets an instance of each for the same element. If
307
+ * an element matches multiple `string` selectors, only one `TestElement` instance is returned
308
+ * for that element. The type that the `Promise` resolves to is an array where each element is
309
+ * the union of all result types for each query.
310
+ *
311
+ * e.g. Given the following DOM: `<div id="d1" /><div id="d2" />`, and assuming
312
+ * `DivHarness.hostSelector === 'div'` and `IdIsD1Harness.hostSelector === '#d1'`:
313
+ * - `await lf.locatorForAll(DivHarness, 'div')()` gets `[
314
+ * DivHarness, // for #d1
315
+ * TestElement, // for #d1
316
+ * DivHarness, // for #d2
317
+ * TestElement // for #d2
318
+ * ]`
319
+ * - `await lf.locatorForAll('div', '#d1')()` gets `[
320
+ * TestElement, // for #d1
321
+ * TestElement // for #d2
322
+ * ]`
323
+ * - `await lf.locatorForAll(DivHarness, IdIsD1Harness)()` gets `[
324
+ * DivHarness, // for #d1
325
+ * IdIsD1Harness, // for #d1
326
+ * DivHarness // for #d2
327
+ * ]`
328
+ * - `await lf.locatorForAll('span')()` gets `[]`.
329
+ */
330
+ locatorForAll<T extends (HarnessQuery<any> | string)[]>(...queries: T): AsyncFactoryFn<LocatorFnResult<T>[]>;
331
+ /** @return A `HarnessLoader` rooted at the root element of this `LocatorFactory`. */
332
+ rootHarnessLoader(): Promise<HarnessLoader>;
333
+ /**
334
+ * Gets a `HarnessLoader` instance for an element under the root of this `LocatorFactory`.
335
+ * @param selector The selector for the root element.
336
+ * @return A `HarnessLoader` rooted at the first element matching the given selector.
337
+ * @throws If no matching element is found for the given selector.
338
+ */
339
+ harnessLoaderFor(selector: string): Promise<HarnessLoader>;
340
+ /**
341
+ * Gets a `HarnessLoader` instance for an element under the root of this `LocatorFactory`
342
+ * @param selector The selector for the root element.
343
+ * @return A `HarnessLoader` rooted at the first element matching the given selector, or null if
344
+ * no matching element is found.
345
+ */
346
+ harnessLoaderForOptional(selector: string): Promise<HarnessLoader | null>;
347
+ /**
348
+ * Gets a list of `HarnessLoader` instances, one for each matching element.
349
+ * @param selector The selector for the root element.
350
+ * @return A list of `HarnessLoader`, one rooted at each element matching the given selector.
351
+ */
352
+ harnessLoaderForAll(selector: string): Promise<HarnessLoader[]>;
353
+ /**
354
+ * Flushes change detection and async tasks captured in the Angular zone.
355
+ * In most cases it should not be necessary to call this manually. However, there may be some edge
356
+ * cases where it is needed to fully flush animation events.
357
+ */
358
+ forceStabilize(): Promise<void>;
359
+ /**
360
+ * Waits for all scheduled or running async tasks to complete. This allows harness
361
+ * authors to wait for async tasks outside of the Angular zone.
362
+ */
363
+ waitForTasksOutsideAngular(): Promise<void>;
364
+ }
365
+ /**
366
+ * Base class for component harnesses that all component harness authors should extend. This base
367
+ * component harness provides the basic ability to locate element and sub-component harness. It
368
+ * should be inherited when defining user's own harness.
369
+ */
370
+ declare abstract class ComponentHarness {
371
+ protected readonly locatorFactory: LocatorFactory;
372
+ constructor(locatorFactory: LocatorFactory);
373
+ /** Gets a `Promise` for the `TestElement` representing the host element of the component. */
374
+ host(): Promise<TestElement>;
375
+ /**
376
+ * Gets a `LocatorFactory` for the document root element. This factory can be used to create
377
+ * locators for elements that a component creates outside of its own root element. (e.g. by
378
+ * appending to document.body).
379
+ */
380
+ protected documentRootLocatorFactory(): LocatorFactory;
381
+ /**
382
+ * Creates an asynchronous locator function that can be used to find a `ComponentHarness` instance
383
+ * or element under the host element of this `ComponentHarness`.
384
+ * @param queries A list of queries specifying which harnesses and elements to search for:
385
+ * - A `string` searches for elements matching the CSS selector specified by the string.
386
+ * - A `ComponentHarness` constructor searches for `ComponentHarness` instances matching the
387
+ * given class.
388
+ * - A `HarnessPredicate` searches for `ComponentHarness` instances matching the given
389
+ * predicate.
390
+ * @return An asynchronous locator function that searches for and returns a `Promise` for the
391
+ * first element or harness matching the given search criteria. Matches are ordered first by
392
+ * order in the DOM, and second by order in the queries list. If no matches are found, the
393
+ * `Promise` rejects. The type that the `Promise` resolves to is a union of all result types for
394
+ * each query.
395
+ *
396
+ * e.g. Given the following DOM: `<div id="d1" /><div id="d2" />`, and assuming
397
+ * `DivHarness.hostSelector === 'div'`:
398
+ * - `await ch.locatorFor(DivHarness, 'div')()` gets a `DivHarness` instance for `#d1`
399
+ * - `await ch.locatorFor('div', DivHarness)()` gets a `TestElement` instance for `#d1`
400
+ * - `await ch.locatorFor('span')()` throws because the `Promise` rejects.
401
+ */
402
+ protected locatorFor<T extends (HarnessQuery<any> | string)[]>(...queries: T): AsyncFactoryFn<LocatorFnResult<T>>;
403
+ /**
404
+ * Creates an asynchronous locator function that can be used to find a `ComponentHarness` instance
405
+ * or element under the host element of this `ComponentHarness`.
406
+ * @param queries A list of queries specifying which harnesses and elements to search for:
407
+ * - A `string` searches for elements matching the CSS selector specified by the string.
408
+ * - A `ComponentHarness` constructor searches for `ComponentHarness` instances matching the
409
+ * given class.
410
+ * - A `HarnessPredicate` searches for `ComponentHarness` instances matching the given
411
+ * predicate.
412
+ * @return An asynchronous locator function that searches for and returns a `Promise` for the
413
+ * first element or harness matching the given search criteria. Matches are ordered first by
414
+ * order in the DOM, and second by order in the queries list. If no matches are found, the
415
+ * `Promise` is resolved with `null`. The type that the `Promise` resolves to is a union of all
416
+ * result types for each query or null.
417
+ *
418
+ * e.g. Given the following DOM: `<div id="d1" /><div id="d2" />`, and assuming
419
+ * `DivHarness.hostSelector === 'div'`:
420
+ * - `await ch.locatorForOptional(DivHarness, 'div')()` gets a `DivHarness` instance for `#d1`
421
+ * - `await ch.locatorForOptional('div', DivHarness)()` gets a `TestElement` instance for `#d1`
422
+ * - `await ch.locatorForOptional('span')()` gets `null`.
423
+ */
424
+ protected locatorForOptional<T extends (HarnessQuery<any> | string)[]>(...queries: T): AsyncFactoryFn<LocatorFnResult<T> | null>;
425
+ /**
426
+ * Creates an asynchronous locator function that can be used to find `ComponentHarness` instances
427
+ * or elements under the host element of this `ComponentHarness`.
428
+ * @param queries A list of queries specifying which harnesses and elements to search for:
429
+ * - A `string` searches for elements matching the CSS selector specified by the string.
430
+ * - A `ComponentHarness` constructor searches for `ComponentHarness` instances matching the
431
+ * given class.
432
+ * - A `HarnessPredicate` searches for `ComponentHarness` instances matching the given
433
+ * predicate.
434
+ * @return An asynchronous locator function that searches for and returns a `Promise` for all
435
+ * elements and harnesses matching the given search criteria. Matches are ordered first by
436
+ * order in the DOM, and second by order in the queries list. If an element matches more than
437
+ * one `ComponentHarness` class, the locator gets an instance of each for the same element. If
438
+ * an element matches multiple `string` selectors, only one `TestElement` instance is returned
439
+ * for that element. The type that the `Promise` resolves to is an array where each element is
440
+ * the union of all result types for each query.
441
+ *
442
+ * e.g. Given the following DOM: `<div id="d1" /><div id="d2" />`, and assuming
443
+ * `DivHarness.hostSelector === 'div'` and `IdIsD1Harness.hostSelector === '#d1'`:
444
+ * - `await ch.locatorForAll(DivHarness, 'div')()` gets `[
445
+ * DivHarness, // for #d1
446
+ * TestElement, // for #d1
447
+ * DivHarness, // for #d2
448
+ * TestElement // for #d2
449
+ * ]`
450
+ * - `await ch.locatorForAll('div', '#d1')()` gets `[
451
+ * TestElement, // for #d1
452
+ * TestElement // for #d2
453
+ * ]`
454
+ * - `await ch.locatorForAll(DivHarness, IdIsD1Harness)()` gets `[
455
+ * DivHarness, // for #d1
456
+ * IdIsD1Harness, // for #d1
457
+ * DivHarness // for #d2
458
+ * ]`
459
+ * - `await ch.locatorForAll('span')()` gets `[]`.
460
+ */
461
+ protected locatorForAll<T extends (HarnessQuery<any> | string)[]>(...queries: T): AsyncFactoryFn<LocatorFnResult<T>[]>;
462
+ /**
463
+ * Flushes change detection and async tasks in the Angular zone.
464
+ * In most cases it should not be necessary to call this manually. However, there may be some edge
465
+ * cases where it is needed to fully flush animation events.
466
+ */
467
+ protected forceStabilize(): Promise<void>;
468
+ /**
469
+ * Waits for all scheduled or running async tasks to complete. This allows harness
470
+ * authors to wait for async tasks outside of the Angular zone.
471
+ */
472
+ protected waitForTasksOutsideAngular(): Promise<void>;
473
+ }
474
+ /**
475
+ * Base class for component harnesses that authors should extend if they anticipate that consumers
476
+ * of the harness may want to access other harnesses within the `<ng-content>` of the component.
477
+ */
478
+ declare abstract class ContentContainerComponentHarness<S extends string = string> extends ComponentHarness implements HarnessLoader {
479
+ getChildLoader(selector: S): Promise<HarnessLoader>;
480
+ getAllChildLoaders(selector: S): Promise<HarnessLoader[]>;
481
+ getHarness<T extends ComponentHarness>(query: HarnessQuery<T>): Promise<T>;
482
+ getAllHarnesses<T extends ComponentHarness>(query: HarnessQuery<T>): Promise<T[]>;
483
+ /**
484
+ * Gets the root harness loader from which to start
485
+ * searching for content contained by this harness.
486
+ */
487
+ protected getRootHarnessLoader(): Promise<HarnessLoader>;
488
+ }
489
+ /** Constructor for a ComponentHarness subclass. */
490
+ interface ComponentHarnessConstructor<T extends ComponentHarness> {
491
+ new (locatorFactory: LocatorFactory): T;
492
+ /**
493
+ * `ComponentHarness` subclasses must specify a static `hostSelector` property that is used to
494
+ * find the host element for the corresponding component. This property should match the selector
495
+ * for the Angular component.
496
+ */
497
+ hostSelector: string;
498
+ }
499
+ /** A set of criteria that can be used to filter a list of `ComponentHarness` instances. */
500
+ interface BaseHarnessFilters {
501
+ /** Only find instances whose host element matches the given selector. */
502
+ selector?: string;
503
+ /** Only find instances that are nested under an element with the given selector. */
504
+ ancestor?: string;
505
+ }
506
+ /**
507
+ * A class used to associate a ComponentHarness class with predicates functions that can be used to
508
+ * filter instances of the class.
509
+ */
510
+ declare class HarnessPredicate<T extends ComponentHarness> {
511
+ harnessType: ComponentHarnessConstructor<T>;
512
+ private _predicates;
513
+ private _descriptions;
514
+ private _ancestor;
515
+ constructor(harnessType: ComponentHarnessConstructor<T>, options: BaseHarnessFilters);
516
+ /**
517
+ * Checks if the specified nullable string value matches the given pattern.
518
+ * @param value The nullable string value to check, or a Promise resolving to the
519
+ * nullable string value.
520
+ * @param pattern The pattern the value is expected to match. If `pattern` is a string,
521
+ * `value` is expected to match exactly. If `pattern` is a regex, a partial match is
522
+ * allowed. If `pattern` is `null`, the value is expected to be `null`.
523
+ * @return Whether the value matches the pattern.
524
+ */
525
+ static stringMatches(value: string | null | Promise<string | null>, pattern: string | RegExp | null): Promise<boolean>;
526
+ /**
527
+ * Adds a predicate function to be run against candidate harnesses.
528
+ * @param description A description of this predicate that may be used in error messages.
529
+ * @param predicate An async predicate function.
530
+ * @return this (for method chaining).
531
+ */
532
+ add(description: string, predicate: AsyncPredicate<T>): this;
533
+ /**
534
+ * Adds a predicate function that depends on an option value to be run against candidate
535
+ * harnesses. If the option value is undefined, the predicate will be ignored.
536
+ * @param name The name of the option (may be used in error messages).
537
+ * @param option The option value.
538
+ * @param predicate The predicate function to run if the option value is not undefined.
539
+ * @return this (for method chaining).
540
+ */
541
+ addOption<O>(name: string, option: O | undefined, predicate: AsyncOptionPredicate<T, O>): this;
542
+ /**
543
+ * Filters a list of harnesses on this predicate.
544
+ * @param harnesses The list of harnesses to filter.
545
+ * @return A list of harnesses that satisfy this predicate.
546
+ */
547
+ filter(harnesses: T[]): Promise<T[]>;
548
+ /**
549
+ * Evaluates whether the given harness satisfies this predicate.
550
+ * @param harness The harness to check
551
+ * @return A promise that resolves to true if the harness satisfies this predicate,
552
+ * and resolves to false otherwise.
553
+ */
554
+ evaluate(harness: T): Promise<boolean>;
555
+ /** Gets a description of this predicate for use in error messages. */
556
+ getDescription(): string;
557
+ /** Gets the selector used to find candidate elements. */
558
+ getSelector(): string;
559
+ /** Adds base options common to all harness types. */
560
+ private _addBaseOptions;
561
+ }
562
+
563
+ /**
564
+ * @license
565
+ * Copyright Google LLC All Rights Reserved.
566
+ *
567
+ * Use of this source code is governed by an MIT-style license that can be
568
+ * found in the LICENSE file at https://angular.io/license
569
+ */
570
+
571
+ /**
572
+ * Base harness environment class that can be extended to allow `ComponentHarness`es to be used in
573
+ * different test environments (e.g. testbed, protractor, etc.). This class implements the
574
+ * functionality of both a `HarnessLoader` and `LocatorFactory`. This class is generic on the raw
575
+ * element type, `E`, used by the particular test environment.
576
+ */
577
+ declare abstract class HarnessEnvironment<E> implements HarnessLoader, LocatorFactory {
578
+ protected rawRootElement: E;
579
+ get rootElement(): TestElement;
580
+ set rootElement(element: TestElement);
581
+ private _rootElement;
582
+ protected constructor(rawRootElement: E);
583
+ documentRootLocatorFactory(): LocatorFactory;
584
+ locatorFor<T extends (HarnessQuery<any> | string)[]>(...queries: T): AsyncFactoryFn<LocatorFnResult<T>>;
585
+ locatorForOptional<T extends (HarnessQuery<any> | string)[]>(...queries: T): AsyncFactoryFn<LocatorFnResult<T> | null>;
586
+ locatorForAll<T extends (HarnessQuery<any> | string)[]>(...queries: T): AsyncFactoryFn<LocatorFnResult<T>[]>;
587
+ rootHarnessLoader(): Promise<HarnessLoader>;
588
+ harnessLoaderFor(selector: string): Promise<HarnessLoader>;
589
+ harnessLoaderForOptional(selector: string): Promise<HarnessLoader | null>;
590
+ harnessLoaderForAll(selector: string): Promise<HarnessLoader[]>;
591
+ getHarness<T extends ComponentHarness>(query: HarnessQuery<T>): Promise<T>;
592
+ getAllHarnesses<T extends ComponentHarness>(query: HarnessQuery<T>): Promise<T[]>;
593
+ getChildLoader(selector: string): Promise<HarnessLoader>;
594
+ getAllChildLoaders(selector: string): Promise<HarnessLoader[]>;
595
+ /** Creates a `ComponentHarness` for the given harness type with the given raw host element. */
596
+ protected createComponentHarness<T extends ComponentHarness>(harnessType: ComponentHarnessConstructor<T>, element: E): T;
597
+ abstract forceStabilize(): Promise<void>;
598
+ abstract waitForTasksOutsideAngular(): Promise<void>;
599
+ /** Gets the root element for the document. */
600
+ protected abstract getDocumentRoot(): E;
601
+ /** Creates a `TestElement` from a raw element. */
602
+ protected abstract createTestElement(element: E): TestElement;
603
+ /** Creates a `HarnessLoader` rooted at the given raw element. */
604
+ protected abstract createEnvironment(element: E): HarnessEnvironment<E>;
605
+ /**
606
+ * Gets a list of all elements matching the given selector under this environment's root element.
607
+ */
608
+ protected abstract getAllRawElements(selector: string): Promise<E[]>;
609
+ /**
610
+ * Matches the given raw elements with the given list of element and harness queries to produce a
611
+ * list of matched harnesses and test elements.
612
+ */
613
+ private _getAllHarnessesAndTestElements;
614
+ /**
615
+ * Check whether the given query matches the given element, if it does return the matched
616
+ * `TestElement` or `ComponentHarness`, if it does not, return null. In cases where the caller
617
+ * knows for sure that the query matches the element's selector, `skipSelectorCheck` can be used
618
+ * to skip verification and optimize performance.
619
+ */
620
+ private _getQueryResultForElement;
621
+ }
622
+
623
+ /**
624
+ * @license
625
+ * Copyright Google LLC All Rights Reserved.
626
+ *
627
+ * Use of this source code is governed by an MIT-style license that can be
628
+ * found in the LICENSE file at https://angular.io/license
629
+ */
630
+ /**
631
+ * Returns an error which reports that no keys have been specified.
632
+ * @docs-private
633
+ */
634
+ declare function getNoKeysSpecifiedError(): Error;
635
+
636
+ /**
637
+ * @license
638
+ * Copyright Google LLC All Rights Reserved.
639
+ *
640
+ * Use of this source code is governed by an MIT-style license that can be
641
+ * found in the LICENSE file at https://angular.io/license
642
+ */
643
+ /**
644
+ * Gets text of element excluding certain selectors within the element.
645
+ * @param element Element to get text from,
646
+ * @param excludeSelector Selector identifying which elements to exclude,
647
+ */
648
+ declare function _getTextWithExcludedElements(element: Element, excludeSelector: string): string;
649
+
650
+ /**
651
+ * @license
652
+ * Copyright Google LLC All Rights Reserved.
653
+ *
654
+ * Use of this source code is governed by an MIT-style license that can be
655
+ * found in the LICENSE file at https://angular.io/license
656
+ */
657
+ /** Represents the status of auto change detection. */
658
+ interface AutoChangeDetectionStatus {
659
+ /** Whether auto change detection is disabled. */
660
+ isDisabled: boolean;
661
+ /**
662
+ * An optional callback, if present it indicates that change detection should be run immediately,
663
+ * while handling the status change. The callback should then be called as soon as change
664
+ * detection is done.
665
+ */
666
+ onDetectChangesNow?: () => void;
667
+ }
668
+ /**
669
+ * Allows a test `HarnessEnvironment` to install its own handler for auto change detection status
670
+ * changes.
671
+ * @param handler The handler for the auto change detection status.
672
+ */
673
+ declare function handleAutoChangeDetectionStatus(handler: (status: AutoChangeDetectionStatus) => void): void;
674
+ /** Allows a `HarnessEnvironment` to stop handling auto change detection status changes. */
675
+ declare function stopHandlingAutoChangeDetectionStatus(): void;
676
+ /**
677
+ * Disables the harness system's auto change detection for the duration of the given function.
678
+ * @param fn The function to disable auto change detection for.
679
+ * @return The result of the given function.
680
+ */
681
+ declare function manualChangeDetection<T>(fn: () => Promise<T>): Promise<T>;
682
+ /**
683
+ * Resolves the given list of async values in parallel (i.e. via Promise.all) while batching change
684
+ * detection over the entire operation such that change detection occurs exactly once before
685
+ * resolving the values and once after.
686
+ * @param values A getter for the async values to resolve in parallel with batched change detection.
687
+ * @return The resolved values.
688
+ */
689
+ declare function parallel<T1, T2, T3, T4, T5>(values: () => [
690
+ T1 | PromiseLike<T1>,
691
+ T2 | PromiseLike<T2>,
692
+ T3 | PromiseLike<T3>,
693
+ T4 | PromiseLike<T4>,
694
+ T5 | PromiseLike<T5>
695
+ ]): Promise<[T1, T2, T3, T4, T5]>;
696
+ /**
697
+ * Resolves the given list of async values in parallel (i.e. via Promise.all) while batching change
698
+ * detection over the entire operation such that change detection occurs exactly once before
699
+ * resolving the values and once after.
700
+ * @param values A getter for the async values to resolve in parallel with batched change detection.
701
+ * @return The resolved values.
702
+ */
703
+ declare function parallel<T1, T2, T3, T4>(values: () => [
704
+ T1 | PromiseLike<T1>,
705
+ T2 | PromiseLike<T2>,
706
+ T3 | PromiseLike<T3>,
707
+ T4 | PromiseLike<T4>
708
+ ]): Promise<[T1, T2, T3, T4]>;
709
+ /**
710
+ * Resolves the given list of async values in parallel (i.e. via Promise.all) while batching change
711
+ * detection over the entire operation such that change detection occurs exactly once before
712
+ * resolving the values and once after.
713
+ * @param values A getter for the async values to resolve in parallel with batched change detection.
714
+ * @return The resolved values.
715
+ */
716
+ declare function parallel<T1, T2, T3>(values: () => [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>]): Promise<[T1, T2, T3]>;
717
+ /**
718
+ * Resolves the given list of async values in parallel (i.e. via Promise.all) while batching change
719
+ * detection over the entire operation such that change detection occurs exactly once before
720
+ * resolving the values and once after.
721
+ * @param values A getter for the async values to resolve in parallel with batched change detection.
722
+ * @return The resolved values.
723
+ */
724
+ declare function parallel<T1, T2>(values: () => [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>]): Promise<[T1, T2]>;
725
+ /**
726
+ * Resolves the given list of async values in parallel (i.e. via Promise.all) while batching change
727
+ * detection over the entire operation such that change detection occurs exactly once before
728
+ * resolving the values and once after.
729
+ * @param values A getter for the async values to resolve in parallel with batched change detection.
730
+ * @return The resolved values.
731
+ */
732
+ declare function parallel<T>(values: () => (T | PromiseLike<T>)[]): Promise<T[]>;
733
+
734
+ export { ComponentHarness, ContentContainerComponentHarness, HarnessEnvironment, HarnessPredicate, TestKey, _getTextWithExcludedElements, getNoKeysSpecifiedError, handleAutoChangeDetectionStatus, manualChangeDetection, parallel, stopHandlingAutoChangeDetectionStatus };
735
+ export type { AsyncFactoryFn, AsyncOptionPredicate, AsyncPredicate, AutoChangeDetectionStatus, BaseHarnessFilters, ComponentHarnessConstructor, ElementDimensions, EventData, HarnessLoader, HarnessQuery, LocatorFactory, LocatorFnResult, ModifierKeys, TestElement, TextOptions };