@arcgis/lumina-compiler 5.2.0-next.2 → 5.2.0-next.21

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 (102) hide show
  1. package/dist/context/index.d.ts +158 -296
  2. package/dist/context/types.d.ts +18 -34
  3. package/dist/defaultAssetsUrl.d.ts +6 -6
  4. package/dist/dependencies/discover.d.ts +43 -35
  5. package/dist/dependencies/updateLumina.d.ts +10 -11
  6. package/dist/docs/vsCodeCustomData/types.d.ts +5 -42
  7. package/dist/docs/webTypes/types.d.ts +5 -76
  8. package/dist/index.d.ts +20 -20
  9. package/dist/index.js +12 -8
  10. package/dist/jsxToLitHtml/config.d.ts +93 -121
  11. package/dist/options.d.ts +675 -0
  12. package/dist/puppeteerTesting/index.d.ts +18 -11
  13. package/dist/puppeteerTesting/index.js +104 -7
  14. package/dist/puppeteerTesting/puppeteer/element.d.ts +250 -217
  15. package/dist/puppeteerTesting/puppeteer/events.d.ts +15 -21
  16. package/dist/puppeteerTesting/puppeteer/page.d.ts +8 -5
  17. package/dist/puppeteerTesting/puppeteer/types.d.ts +130 -132
  18. package/dist/puppeteerTesting/vitest/matchers/index.d.ts +33 -30
  19. package/dist/testing/index.d.ts +4 -11
  20. package/dist/testing/mount.d.ts +113 -93
  21. package/dist/testing/wrapController.d.ts +5 -11
  22. package/dist/useLumina.d.ts +5 -2
  23. package/package.json +15 -7
  24. package/dist/context/logger.d.ts +0 -8
  25. package/dist/context/typeScript.d.ts +0 -6
  26. package/dist/context/utils.d.ts +0 -4
  27. package/dist/dependencies/arcgisCore.d.ts +0 -30
  28. package/dist/dependencies/index.d.ts +0 -12
  29. package/dist/dependencies/loaders.d.ts +0 -5
  30. package/dist/dependencies/lumina.d.ts +0 -3
  31. package/dist/dependencies/stencil.d.ts +0 -17
  32. package/dist/dependencies/testSetupFiles.d.ts +0 -13
  33. package/dist/dependencies/utils.d.ts +0 -15
  34. package/dist/docs/config.d.ts +0 -9
  35. package/dist/docs/index.d.ts +0 -10
  36. package/dist/docs/stencilDocsJson.d.ts +0 -130
  37. package/dist/docs/types.d.ts +0 -1
  38. package/dist/docs/vsCodeCustomData/index.d.ts +0 -16
  39. package/dist/docs/vsCodeCustomData/utils.d.ts +0 -3
  40. package/dist/docs/webTypes/description.d.ts +0 -2
  41. package/dist/docs/webTypes/index.d.ts +0 -19
  42. package/dist/docs/webTypes/utils.d.ts +0 -6
  43. package/dist/entrypoints/addNonLazyImports.d.ts +0 -13
  44. package/dist/entrypoints/config.d.ts +0 -17
  45. package/dist/entrypoints/dtsUtils.d.ts +0 -19
  46. package/dist/entrypoints/findUtils.d.ts +0 -6
  47. package/dist/entrypoints/handleComponentImports.d.ts +0 -13
  48. package/dist/entrypoints/resolveTagName.d.ts +0 -18
  49. package/dist/jsxToLitHtml/autoAddNothing.d.ts +0 -8
  50. package/dist/jsxToLitHtml/comments.d.ts +0 -19
  51. package/dist/jsxToLitHtml/convertProps.d.ts +0 -10
  52. package/dist/jsxToLitHtml/imports.d.ts +0 -27
  53. package/dist/jsxToLitHtml/importsConfig.d.ts +0 -17
  54. package/dist/jsxToLitHtml/index.d.ts +0 -20
  55. package/dist/jsxToLitHtml/inferPropType.d.ts +0 -40
  56. package/dist/jsxToLitHtml/insertRepeatCall.d.ts +0 -51
  57. package/dist/jsxToLitHtml/jsxVisitor.d.ts +0 -15
  58. package/dist/jsxToLitHtml/templateParts.d.ts +0 -17
  59. package/dist/jsxToLitHtml/throwOnImportingExternalized.d.ts +0 -10
  60. package/dist/jsxToLitHtml/types.d.ts +0 -74
  61. package/dist/jsxToLitHtml/utils.d.ts +0 -14
  62. package/dist/loader/css.d.ts +0 -20
  63. package/dist/loader/extractor.d.ts +0 -2
  64. package/dist/loader/index.d.ts +0 -21
  65. package/dist/loader/lazy.d.ts +0 -21
  66. package/dist/loader/storybookApiJson.d.ts +0 -6
  67. package/dist/plugins/buildCdn.d.ts +0 -73
  68. package/dist/plugins/buildWebApp.d.ts +0 -3
  69. package/dist/plugins/buildWrappers.d.ts +0 -4
  70. package/dist/plugins/configureVite.d.ts +0 -20
  71. package/dist/plugins/externalizeDependencies.d.ts +0 -30
  72. package/dist/plugins/handleDynamicAssets.d.ts +0 -8
  73. package/dist/plugins/handleStaticAssets.d.ts +0 -9
  74. package/dist/plugins/loadLitCss.d.ts +0 -127
  75. package/dist/plugins/printTotalBuildSize.d.ts +0 -7
  76. package/dist/plugins/provideAssets.d.ts +0 -35
  77. package/dist/plugins/setAssetsPath.d.ts +0 -10
  78. package/dist/plugins/updatePackageJson.d.ts +0 -14
  79. package/dist/publicTypes.d.ts +0 -653
  80. package/dist/puppeteerTesting/globalSetup.d.ts +0 -73
  81. package/dist/puppeteerTesting/injected.d.ts +0 -8
  82. package/dist/puppeteerTesting/puppeteer/browser.d.ts +0 -6
  83. package/dist/puppeteerTesting/vitest/matchers/attributes.d.ts +0 -4
  84. package/dist/puppeteerTesting/vitest/matchers/classList.d.ts +0 -4
  85. package/dist/puppeteerTesting/vitest/matchers/events.d.ts +0 -7
  86. package/dist/puppeteerTesting/vitest/matchers/text.d.ts +0 -2
  87. package/dist/puppeteerTesting/vitest/matchers/utils.d.ts +0 -1
  88. package/dist/puppeteerTesting/vitest/runner.d.ts +0 -19
  89. package/dist/puppeteerTesting/vitest/setupFile.d.ts +0 -1
  90. package/dist/puppeteerTesting/vitest/types.d.ts +0 -6
  91. package/dist/testing/failOnConsole.d.ts +0 -6
  92. package/dist/testing/setupFile.d.ts +0 -1
  93. package/dist/testing/snapshotSerializer.d.ts +0 -12
  94. package/dist/tests/utils.d.ts +0 -4
  95. package/dist/transformers/customElementDeclaration.d.ts +0 -2
  96. package/dist/transformers/index.d.ts +0 -20
  97. package/dist/transformers/injectRuntimeOptions.d.ts +0 -18
  98. package/dist/transformers/liftDecorators.d.ts +0 -21
  99. package/dist/transformers/members.d.ts +0 -10
  100. package/dist/transformers/property.d.ts +0 -10
  101. package/dist/transformers/propertyOptions.d.ts +0 -110
  102. package/dist/transformers/utils.d.ts +0 -9
@@ -1,220 +1,253 @@
1
- import { ClickOptions, ElementHandle, KeyInput } from 'puppeteer';
2
- import { EventSpy } from './events.ts';
3
- import { E2EPage, FindSelector, SerializedEvent } from './types.ts';
1
+ import type { ClickOptions, ElementHandle, KeyInput } from "puppeteer";
2
+ import type { EventSpy } from "./events.js";
3
+ import type { E2EPage, FindSelector, SerializedEvent } from "./types.js";
4
+
4
5
  /**
5
- * This file is part of the puppeteerTesting bundle. That bundle may be
6
- * imported even before happy-dom is setup.
6
+ * @internal
7
+ * @knipIgnore
7
8
  */
8
- declare const Superclass: {
9
- new (): HTMLElement;
10
- prototype: HTMLElement;
11
- };
12
- export declare class E2EElement extends Superclass {
13
- /**
14
- * The '2500' value that we default to is the value of `jasmine.DEFAULT_TIMEOUT_INTERVAL` (5000) divided by 2.
15
- */
16
- static defaultTimeout: number;
17
- private static _page;
18
- private static _handle;
19
- /**
20
- * We can't directly call `new E22Element()` since it extends HTMLElement
21
- * which is not directly constructable. Instead, we register it as a custom
22
- * element.
23
- */
24
- static create(page: E2EPage, handle: ElementHandle): E2EElement;
25
- private _queuedActions;
26
- private _temporaryDisableValidation;
27
- private _page;
28
- handle: ElementHandle;
29
- constructor(_page?: E2EPage, handle?: ElementHandle);
30
- /**
31
- * Find a child element that matches the selector, which is the same as
32
- * `element.querySelector(selector)`. Use `>>>` within the
33
- * selector to find an element within a host element's shadow root.
34
- * For example, to select the first `div` inside of the component
35
- * `my-cmp`, which is a child of this element, the call would be
36
- * `element.find('my-cmp >>> div')`. Returns `null` if no
37
- * elements were found.
38
- */
39
- find(selector: FindSelector): Promise<E2EElement>;
40
- /**
41
- * Find all child elements that match the selector, which is the same as
42
- * `element.querySelectorAll(selector)`. Use `>>>` within the
43
- * selector to find elements within a host element's shadow root.
44
- * For example, to select all `li` elements inside of the component
45
- * `my-cmp`, which is a child of this element, the call would be
46
- * `element.findAll('my-cmp >>> li')`. Returns an empty array if
47
- * no elements were found.
48
- */
49
- findAll(selector: FindSelector): Promise<E2EElement[]>;
50
- /**
51
- * Used to call a method on a component. For example, if a component
52
- * has the method `cmp.myMethod(arg1, arg2)`, calling this method
53
- * from a e2e test could be `cmp.callMethod('myMethod', arg1, arg2)`.
54
- */
55
- callMethod(methodName: string, ...methodArgs: unknown[]): Promise<unknown>;
56
- /**
57
- * This is a convenience method to easily create a `CustomEvent`,
58
- * and dispatch it from the element, to include any custom event
59
- * `detail` data as the second argument.
60
- */
61
- triggerEvent(eventName: string, eventInitDict?: EventInit): void;
62
- /**
63
- * Used to test if an event was, or was not dispatched. This method
64
- * returns a promise, that resolves with an EventSpy. The EventSpy
65
- * can be used along with `expect(spy).toHaveReceivedEvent()`,
66
- * `expect(spy).toHaveReceivedEventTimes(x)` and
67
- * `expect(spy).toHaveReceivedEventDetail({...})`.
68
- */
69
- spyOnEvent<Detail = unknown>(eventName: string): Promise<EventSpy<Detail>>;
70
- /**
71
- * Calling `click()` on an element scrolls it into view if needed, and
72
- * then uses `page.mouse` to click in the center of the element.
73
- * Please see the puppeteer docs for more information.
74
- */
75
- click(options?: ClickOptions): Promise<void>;
76
- /**
77
- * Sets focus on the element.
78
- */
79
- focus(): Promise<void>;
80
- /**
81
- * Sets hover on the element.
82
- */
83
- hover(): Promise<void>;
84
- /**
85
- * Resolves `true` when the element's style is `display !== 'none'`,
86
- * `visibility !== 'hidden'` and `opacity !== '0'`.
87
- */
88
- isVisible(): Promise<boolean>;
89
- /**
90
- * Waits until the given event is listened in the element.
91
- */
92
- waitForEvent<Detail = unknown>(eventName: string): Promise<SerializedEvent<Detail>>;
93
- /**
94
- * Waits until the element's style is `display !== 'none'`,
95
- * `visibility !== 'hidden'`, `opacity !== '0'` and the element
96
- * is connected to the document.
97
- */
98
- waitForVisible(): Promise<void>;
99
- /**
100
- * Waits until the element's style is `display === 'none'`, or
101
- * `visibility === 'hidden'`, or `opacity === '0'`, or the element
102
- * is no longer connected to the document.
103
- */
104
- waitForNotVisible(): Promise<void>;
105
- awaitVisibility(waitForVisible?: boolean): Promise<void>;
106
- /**
107
- * Resolves to true if the element is visible in the current viewport.
108
- */
109
- isIntersectingViewport(): Promise<boolean>;
110
- /**
111
- * Focuses the element, and then uses `keyboard.down` and `keyboard.up`.
112
- * If key is a single character and no modifier keys besides Shift are
113
- * being held down, a keypress/input event will also be generated. The
114
- * text option can be specified to force an input event to be generated.
115
- * Note: Modifier keys DO effect `elementHandle.press`. Holding down Shift
116
- * will type the text in upper case.
117
- * Key names: https://github.com/puppeteer/puppeteer/blob/main/src/common/USKeyboardLayout.ts
118
- */
119
- press(key: KeyInput, options?: {
120
- text?: string;
121
- delay?: number;
122
- }): Promise<void>;
123
- /**
124
- * This method scrolls the element it into view if needed,
125
- * and then uses `page.touchscreen` to tap in the center of the element.
126
- */
127
- tap(): Promise<void>;
128
- /**
129
- * Sends a keydown, keypress/input, and keyup event for each character in the text.
130
- * To press a special key, like Control or ArrowDown, use `keyboard.press`.
131
- */
132
- type(text: string, options?: {
133
- delay: number;
134
- }): Promise<void>;
135
- /**
136
- * Returns the value of a specified attribute on the element. If the
137
- * given attribute does not exist, the value returned will be null.
138
- */
139
- getProperty<T = any>(propertyName: string): Promise<T>;
140
- /**
141
- * Used to set a property set on a component. For example, if a
142
- * component has the property `elm.myProp`, then calling
143
- * `elm.setProperty('myProp', 88)` would set the value `88` to
144
- * the `myProp` property on the component.
145
- */
146
- setProperty(propertyName: string, value: unknown): void;
147
- /**
148
- * Returns the value of a specified attribute on the element. If the
149
- * given attribute does not exist, the value returned will be null.
150
- */
151
- getAttribute(name: string): string | null;
152
- /**
153
- * Removes the attribute on the specified element. Note that
154
- * `await page.waitForChanges()` must be called before reading
155
- * the value if content has changed.
156
- */
157
- setAttribute(name: string, value: string): void;
158
- /**
159
- * Removes the attribute on the specified element. Note that
160
- * `await page.waitForChanges()` must be called before reading
161
- * the value if content has changed.
162
- */
163
- removeAttribute(name: string): void;
164
- /**
165
- * Toggles a `boolean` attribute (removing it if it is present and adding
166
- * it if it is not present) on the given element. Note that
167
- * `await page.waitForChanges()` must be called before reading
168
- * the value if content has changed. The optional `force` argument is a
169
- * `boolean` value to determine whether the attribute should be added or
170
- * removed, no matter whether the attribute is present or not at the moment.
171
- */
172
- toggleAttribute(name: string, force?: boolean): boolean;
173
- /**
174
- * Gets and sets `innerHTML` property of the element.
175
- * Note that `await page.waitForChanges()` must be called before reading
176
- * the value if content has changed.
177
- */
178
- get innerHTML(): string;
179
- set innerHTML(value: string);
180
- /**
181
- * Gets and sets `innerText` property of the element.
182
- * Note that `await page.waitForChanges()` must be called before reading
183
- * the value if content has changed.
184
- */
185
- get innerText(): string;
186
- set innerText(value: string);
187
- get nodeValue(): string | null;
188
- set nodeValue(value: string | null);
189
- /**
190
- * Gets the element's `outerHTML. This is a read-only property and will
191
- * throw an error if set.
192
- */
193
- get outerHTML(): string;
194
- set outerHTML(_: never);
195
- /**
196
- * The `textContent` property represents the text content of a node
197
- * and its descendants. Note that `await page.waitForChanges()` must
198
- * be called before reading the value if content has changed.
199
- */
200
- get textContent(): string;
201
- set textContent(value: string);
202
- /**
203
- * Returns an object that reports the values of all CSS properties of this
204
- * element after applying active stylesheets and resolving any basic computation
205
- * those values may contain. Individual CSS property values are accessed by
206
- * simply indexing with CSS property names. The method is shortcut and an async
207
- * version of using `window.getComputedStyle(element)` directly.
208
- */
209
- getComputedStyle(pseudoElement?: string | null): Promise<CSSStyleDeclaration>;
210
- e2eRunActions(): Promise<unknown>;
211
- e2eSync(): Promise<void>;
212
- private _moveChildren;
213
- private _parseHtmlToFragment;
214
- private _validate;
215
- e2eDispose(): Promise<void>;
216
- cloneNode(deep?: boolean): Node;
9
+ export const Superclass: typeof HTMLElement;
10
+
11
+ export abstract class E2EElement extends Superclass {
12
+ /**
13
+ * The '2500' value that we default to is the value of `jasmine.DEFAULT_TIMEOUT_INTERVAL` (5000) divided by 2.
14
+ *
15
+ * @default 2_500
16
+ */
17
+ static defaultTimeout: number;
18
+ /**
19
+ * We can't directly call `new E22Element()` since it extends HTMLElement
20
+ * which is not directly constructable. Instead, we register it as a custom
21
+ * element.
22
+ *
23
+ * @param page
24
+ * @param handle
25
+ */
26
+ static create(page: E2EPage, handle: ElementHandle): E2EElement;
27
+ handle: ElementHandle;
28
+ /**
29
+ * Gets and sets `innerHTML` property of the element.
30
+ * Note that `await page.waitForChanges()` must be called before reading
31
+ * the value if content has changed.
32
+ */
33
+ accessor innerHTML: string;
34
+ /**
35
+ * Gets and sets `innerText` property of the element.
36
+ * Note that `await page.waitForChanges()` must be called before reading
37
+ * the value if content has changed.
38
+ */
39
+ accessor innerText: string;
40
+ accessor nodeValue: string | null;
41
+ /**
42
+ * Gets the element's `outerHTML. This is a read-only property and will
43
+ * throw an error if set.
44
+ */
45
+ get outerHTML(): string;
46
+ set outerHTML(value: never);
47
+ /**
48
+ * The `textContent` property represents the text content of a node
49
+ * and its descendants. Note that `await page.waitForChanges()` must
50
+ * be called before reading the value if content has changed.
51
+ */
52
+ accessor textContent: string;
53
+ /** @param waitForVisible */
54
+ awaitVisibility(waitForVisible?: boolean): Promise<void>;
55
+ /**
56
+ * Used to call a method on a component. For example, if a component
57
+ * has the method `cmp.myMethod(arg1, arg2)`, calling this method
58
+ * from a e2e test could be `cmp.callMethod('myMethod', arg1, arg2)`.
59
+ *
60
+ * @param methodName
61
+ * @param methodArgs
62
+ */
63
+ callMethod(methodName: string, ...methodArgs: unknown[]): Promise<unknown>;
64
+ /**
65
+ * Calling `click()` on an element scrolls it into view if needed, and
66
+ * then uses `page.mouse` to click in the center of the element.
67
+ * Please see the puppeteer docs for more information.
68
+ *
69
+ * @param options
70
+ */
71
+ click(options?: ClickOptions): Promise<void>;
72
+ e2eDispose(): Promise<void>;
73
+ e2eRunActions(): Promise<unknown>;
74
+ e2eSync(): Promise<void>;
75
+ /**
76
+ * Find a child element that matches the selector, which is the same as
77
+ * `element.querySelector(selector)`. Use `>>>` within the
78
+ * selector to find an element within a host element's shadow root.
79
+ * For example, to select the first `div` inside of the component
80
+ * `my-cmp`, which is a child of this element, the call would be
81
+ * `element.find('my-cmp >>> div')`. Returns `null` if no
82
+ * elements were found.
83
+ *
84
+ * @param selector
85
+ */
86
+ find(selector: FindSelector): Promise<E2EElement>;
87
+ /**
88
+ * Find all child elements that match the selector, which is the same as
89
+ * `element.querySelectorAll(selector)`. Use `>>>` within the
90
+ * selector to find elements within a host element's shadow root.
91
+ * For example, to select all `li` elements inside of the component
92
+ * `my-cmp`, which is a child of this element, the call would be
93
+ * `element.findAll('my-cmp >>> li')`. Returns an empty array if
94
+ * no elements were found.
95
+ *
96
+ * @param selector
97
+ */
98
+ findAll(selector: FindSelector): Promise<E2EElement[]>;
99
+ /** Sets focus on the element. */
100
+ focus(): Promise<void>;
101
+ /**
102
+ * Returns the value of a specified attribute on the element. If the
103
+ * given attribute does not exist, the value returned will be null.
104
+ *
105
+ * @param name
106
+ */
107
+ getAttribute(name: string): string | null;
108
+ /**
109
+ * Returns an object that reports the values of all CSS properties of this
110
+ * element after applying active stylesheets and resolving any basic computation
111
+ * those values may contain. Individual CSS property values are accessed by
112
+ * simply indexing with CSS property names. The method is shortcut and an async
113
+ * version of using `window.getComputedStyle(element)` directly.
114
+ *
115
+ * @param pseudoElement
116
+ */
117
+ getComputedStyle(pseudoElement?: string | null): Promise<CSSStyleDeclaration>;
118
+ /**
119
+ * Returns the value of a specified attribute on the element. If the
120
+ * given attribute does not exist, the value returned will be null.
121
+ *
122
+ * @param propertyName
123
+ */
124
+ getProperty<T = any>(propertyName: string): Promise<T>;
125
+ /** Sets hover on the element. */
126
+ hover(): Promise<void>;
127
+ /** Resolves to true if the element is visible in the current viewport. */
128
+ isIntersectingViewport(): Promise<boolean>;
129
+ /**
130
+ * Resolves `true` when the element's style is `display !== 'none'`,
131
+ * `visibility !== 'hidden'` and `opacity !== '0'`.
132
+ */
133
+ isVisible(): Promise<boolean>;
134
+ /**
135
+ * Focuses the element, and then uses `keyboard.down` and `keyboard.up`.
136
+ * If key is a single character and no modifier keys besides Shift are
137
+ * being held down, a keypress/input event will also be generated. The
138
+ * text option can be specified to force an input event to be generated.
139
+ * Note: Modifier keys DO effect `elementHandle.press`. Holding down Shift
140
+ * will type the text in upper case.
141
+ * Key names: https://github.com/puppeteer/puppeteer/blob/main/src/common/USKeyboardLayout.ts
142
+ *
143
+ * @param key
144
+ * @param options
145
+ */
146
+ press(key: KeyInput, options?: {
147
+ text?: string;
148
+ delay?: number;
149
+ }): Promise<void>;
150
+ /**
151
+ * Removes the attribute on the specified element. Note that
152
+ * `await page.waitForChanges()` must be called before reading
153
+ * the value if content has changed.
154
+ *
155
+ * @param name
156
+ */
157
+ removeAttribute(name: string): void;
158
+ /**
159
+ * Removes the attribute on the specified element. Note that
160
+ * `await page.waitForChanges()` must be called before reading
161
+ * the value if content has changed.
162
+ *
163
+ * @param name
164
+ * @param value
165
+ */
166
+ setAttribute(name: string, value: string): void;
167
+ /**
168
+ * Used to set a property set on a component. For example, if a
169
+ * component has the property `elm.myProp`, then calling
170
+ * `elm.setProperty('myProp', 88)` would set the value `88` to
171
+ * the `myProp` property on the component.
172
+ *
173
+ * @param propertyName
174
+ * @param value
175
+ */
176
+ setProperty(propertyName: string, value: unknown): void;
177
+ /**
178
+ * Used to test if an event was, or was not dispatched. This method
179
+ * returns a promise, that resolves with an EventSpy. The EventSpy
180
+ * can be used along with `expect(spy).toHaveReceivedEvent()`,
181
+ * `expect(spy).toHaveReceivedEventTimes(x)` and
182
+ * `expect(spy).toHaveReceivedEventDetail({...})`.
183
+ *
184
+ * @param eventName
185
+ */
186
+ spyOnEvent<Detail = unknown>(eventName: string): Promise<EventSpy<Detail>>;
187
+ /**
188
+ * This method scrolls the element it into view if needed,
189
+ * and then uses `page.touchscreen` to tap in the center of the element.
190
+ */
191
+ tap(): Promise<void>;
192
+ /**
193
+ * Toggles a `boolean` attribute (removing it if it is present and adding
194
+ * it if it is not present) on the given element. Note that
195
+ * `await page.waitForChanges()` must be called before reading
196
+ * the value if content has changed. The optional `force` argument is a
197
+ * `boolean` value to determine whether the attribute should be added or
198
+ * removed, no matter whether the attribute is present or not at the moment.
199
+ *
200
+ * @param name
201
+ * @param force
202
+ */
203
+ toggleAttribute(name: string, force?: boolean): boolean;
204
+ /**
205
+ * This is a convenience method to easily create a `CustomEvent`,
206
+ * and dispatch it from the element, to include any custom event
207
+ * `detail` data as the second argument.
208
+ *
209
+ * @param eventName
210
+ * @param eventInitDict
211
+ */
212
+ triggerEvent(eventName: string, eventInitDict?: EventInit): void;
213
+ /**
214
+ * Sends a keydown, keypress/input, and keyup event for each character in the text.
215
+ * To press a special key, like Control or ArrowDown, use `keyboard.press`.
216
+ *
217
+ * @param text
218
+ * @param options
219
+ */
220
+ type(text: string, options?: { delay: number; }): Promise<void>;
221
+ /**
222
+ * Waits until the given event is listened in the element.
223
+ *
224
+ * @param eventName
225
+ */
226
+ waitForEvent<Detail = unknown>(eventName: string): Promise<SerializedEvent<Detail>>;
227
+ /**
228
+ * Waits until the element's style is `display === 'none'`, or
229
+ * `visibility === 'hidden'`, or `opacity === '0'`, or the element
230
+ * is no longer connected to the document.
231
+ */
232
+ waitForNotVisible(): Promise<void>;
233
+ /**
234
+ * Waits until the element's style is `display !== 'none'`,
235
+ * `visibility !== 'hidden'`, `opacity !== '0'` and the element
236
+ * is connected to the document.
237
+ */
238
+ waitForVisible(): Promise<void>;
217
239
  }
218
- export declare function find(page: E2EPage, rootHandle: ElementHandle, selector: FindSelector): Promise<E2EElement | null>;
219
- export declare function findAll(page: E2EPage, rootHandle: ElementHandle, selector: FindSelector): Promise<E2EElement[]>;
220
- export {};
240
+
241
+ /**
242
+ * @param page
243
+ * @param rootHandle
244
+ * @param selector
245
+ */
246
+ export function find(page: E2EPage, rootHandle: ElementHandle, selector: FindSelector): Promise<E2EElement | null>;
247
+
248
+ /**
249
+ * @param page
250
+ * @param rootHandle
251
+ * @param selector
252
+ */
253
+ export function findAll(page: E2EPage, rootHandle: ElementHandle, selector: FindSelector): Promise<E2EElement[]>;
@@ -1,21 +1,15 @@
1
- import { ElementHandle, JSHandle } from 'puppeteer';
2
- import { E2EPage, SerializedEvent } from './types.ts';
3
- export declare function initPageEvents(page: E2EPage): Promise<void>;
4
- export declare function pageSpyOnEvent(page: E2EPage, eventName: string, selector?: "document" | "window"): Promise<EventSpy>;
5
- export declare function waitForEvent<Detail = unknown>(page: E2EPage, eventName: string, elementHandle: ElementHandle): Promise<SerializedEvent<Detail>>;
6
- export declare class EventSpy<Detail = unknown> {
7
- events: SerializedEvent<Detail>[];
8
- private _cursor;
9
- private _queuedHandler;
10
- eventName: string;
11
- constructor(eventName: string);
12
- get length(): number;
13
- get firstEvent(): SerializedEvent<Detail> | undefined;
14
- get lastEvent(): SerializedEvent<Detail> | undefined;
15
- next(): Promise<{
16
- done: boolean;
17
- value: SerializedEvent<Detail> | undefined;
18
- }>;
19
- push(event: SerializedEvent<Detail>): void;
20
- }
21
- export declare function addE2EListener(page: E2EPage, elementHandle: JSHandle, eventName: string, callback: (event: SerializedEvent) => void): Promise<void>;
1
+ import type { SerializedEvent } from "./types.js";
2
+
3
+ export abstract class EventSpy<Detail = unknown> {
4
+ eventName: string;
5
+ events: SerializedEvent<Detail>[];
6
+ get firstEvent(): SerializedEvent<Detail> | undefined;
7
+ get lastEvent(): SerializedEvent<Detail> | undefined;
8
+ get length(): number;
9
+ next(): Promise<{
10
+ done: boolean;
11
+ value: SerializedEvent<Detail> | undefined;
12
+ }>;
13
+ /** @param event */
14
+ push(event: SerializedEvent<Detail>): void;
15
+ }
@@ -1,5 +1,8 @@
1
- import { E2EPage } from './types.ts';
2
- export type NewE2EPageOptions = {
3
- html?: string;
4
- };
5
- export declare function newE2EPage(options?: NewE2EPageOptions): Promise<E2EPage>;
1
+ import type { E2EPage } from "./types.js";
2
+
3
+ export interface NewE2EPageOptions {
4
+ html?: string;
5
+ }
6
+
7
+ /** @param options */
8
+ export function newE2EPage(options?: NewE2EPageOptions): Promise<E2EPage>;