@gtkx/testing 1.0.0-rc.3 → 1.0.0
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.
- package/README.md +8 -9
- package/dist/accessible-native.d.ts +16 -0
- package/dist/accessible-native.d.ts.map +1 -0
- package/dist/accessible-native.js +206 -0
- package/dist/accessible-native.js.map +1 -0
- package/dist/act.d.ts +2 -0
- package/dist/act.d.ts.map +1 -1
- package/dist/act.js.map +1 -1
- package/dist/build-queries.d.ts +27 -10
- package/dist/build-queries.d.ts.map +1 -1
- package/dist/build-queries.js +39 -30
- package/dist/build-queries.js.map +1 -1
- package/dist/cleanup-registry.d.ts +1 -1
- package/dist/cleanup-registry.d.ts.map +1 -1
- package/dist/cleanup-registry.js.map +1 -1
- package/dist/config.d.ts +1 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +3 -3
- package/dist/config.js.map +1 -1
- package/dist/errors.d.ts +10 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +12 -3
- package/dist/errors.js.map +1 -1
- package/dist/fire-event.d.ts +35 -6
- package/dist/fire-event.d.ts.map +1 -1
- package/dist/fire-event.js +23 -7
- package/dist/fire-event.js.map +1 -1
- package/dist/frame-sync.d.ts +2 -1
- package/dist/frame-sync.d.ts.map +1 -1
- package/dist/frame-sync.js +15 -5
- package/dist/frame-sync.js.map +1 -1
- package/dist/harness-window.d.ts +4 -0
- package/dist/harness-window.d.ts.map +1 -0
- package/dist/harness-window.js +6 -0
- package/dist/harness-window.js.map +1 -0
- package/dist/index.d.ts +14 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -5
- package/dist/index.js.map +1 -1
- package/dist/internal.d.ts +4 -0
- package/dist/internal.d.ts.map +1 -0
- package/dist/internal.js +4 -0
- package/dist/internal.js.map +1 -0
- package/dist/matchers.d.ts +125 -39
- package/dist/matchers.d.ts.map +1 -1
- package/dist/matchers.js +156 -18
- package/dist/matchers.js.map +1 -1
- package/dist/pretty-format.d.ts +2 -0
- package/dist/pretty-format.d.ts.map +1 -0
- package/dist/pretty-format.js +2 -0
- package/dist/pretty-format.js.map +1 -0
- package/dist/pretty-widget.d.ts +7 -3
- package/dist/pretty-widget.d.ts.map +1 -1
- package/dist/pretty-widget.js +74 -57
- package/dist/pretty-widget.js.map +1 -1
- package/dist/production.d.ts +8 -0
- package/dist/production.d.ts.map +1 -0
- package/dist/production.js +34 -0
- package/dist/production.js.map +1 -0
- package/dist/queries.d.ts +99 -56
- package/dist/queries.d.ts.map +1 -1
- package/dist/queries.js +123 -83
- package/dist/queries.js.map +1 -1
- package/dist/query-helpers.d.ts +44 -0
- package/dist/query-helpers.d.ts.map +1 -0
- package/dist/query-helpers.js +57 -0
- package/dist/query-helpers.js.map +1 -0
- package/dist/render-children.d.ts +9 -0
- package/dist/render-children.d.ts.map +1 -0
- package/dist/render-children.js +11 -0
- package/dist/render-children.js.map +1 -0
- package/dist/render.d.ts.map +1 -1
- package/dist/render.js +13 -11
- package/dist/render.js.map +1 -1
- package/dist/role-helpers.d.ts +12 -3
- package/dist/role-helpers.d.ts.map +1 -1
- package/dist/role-helpers.js +13 -4
- package/dist/role-helpers.js.map +1 -1
- package/dist/role-naming.d.ts +5 -0
- package/dist/role-naming.d.ts.map +1 -0
- package/dist/role-naming.js +96 -0
- package/dist/role-naming.js.map +1 -0
- package/dist/screenshot.d.ts +12 -20
- package/dist/screenshot.d.ts.map +1 -1
- package/dist/screenshot.js +183 -91
- package/dist/screenshot.js.map +1 -1
- package/dist/suggestions.d.ts +3 -0
- package/dist/suggestions.d.ts.map +1 -1
- package/dist/suggestions.js.map +1 -1
- package/dist/traversal.d.ts +9 -1
- package/dist/traversal.d.ts.map +1 -1
- package/dist/traversal.js +26 -6
- package/dist/traversal.js.map +1 -1
- package/dist/types.d.ts +67 -17
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/user-event/adjustment.d.ts +16 -0
- package/dist/user-event/adjustment.d.ts.map +1 -1
- package/dist/user-event/adjustment.js +34 -2
- package/dist/user-event/adjustment.js.map +1 -1
- package/dist/user-event/click.d.ts +45 -3
- package/dist/user-event/click.d.ts.map +1 -1
- package/dist/user-event/click.js +177 -39
- package/dist/user-event/click.js.map +1 -1
- package/dist/user-event/column-header-click.d.ts +4 -0
- package/dist/user-event/column-header-click.d.ts.map +1 -0
- package/dist/user-event/column-header-click.js +65 -0
- package/dist/user-event/column-header-click.js.map +1 -0
- package/dist/user-event/controller.d.ts +29 -0
- package/dist/user-event/controller.d.ts.map +1 -1
- package/dist/user-event/controller.js +28 -0
- package/dist/user-event/controller.js.map +1 -1
- package/dist/user-event/event-wrapper.d.ts.map +1 -1
- package/dist/user-event/event-wrapper.js +2 -1
- package/dist/user-event/event-wrapper.js.map +1 -1
- package/dist/user-event/gesture.d.ts +51 -0
- package/dist/user-event/gesture.d.ts.map +1 -1
- package/dist/user-event/gesture.js +47 -4
- package/dist/user-event/gesture.js.map +1 -1
- package/dist/user-event/index.d.ts +70 -2
- package/dist/user-event/index.d.ts.map +1 -1
- package/dist/user-event/index.js +43 -26
- package/dist/user-event/index.js.map +1 -1
- package/dist/user-event/indexed-children.d.ts +10 -0
- package/dist/user-event/indexed-children.d.ts.map +1 -0
- package/dist/user-event/indexed-children.js +50 -0
- package/dist/user-event/indexed-children.js.map +1 -0
- package/dist/user-event/keyboard.d.ts +4 -2
- package/dist/user-event/keyboard.d.ts.map +1 -1
- package/dist/user-event/keyboard.js +46 -16
- package/dist/user-event/keyboard.js.map +1 -1
- package/dist/user-event/list-row-click.d.ts +4 -0
- package/dist/user-event/list-row-click.d.ts.map +1 -0
- package/dist/user-event/list-row-click.js +39 -0
- package/dist/user-event/list-row-click.js.map +1 -0
- package/dist/user-event/native-click.d.ts +6 -0
- package/dist/user-event/native-click.d.ts.map +1 -0
- package/dist/user-event/native-click.js +32 -0
- package/dist/user-event/native-click.js.map +1 -0
- package/dist/user-event/pointer.d.ts +1 -1
- package/dist/user-event/pointer.d.ts.map +1 -1
- package/dist/user-event/pointer.js +37 -13
- package/dist/user-event/pointer.js.map +1 -1
- package/dist/user-event/selection.d.ts +18 -0
- package/dist/user-event/selection.d.ts.map +1 -1
- package/dist/user-event/selection.js +56 -30
- package/dist/user-event/selection.js.map +1 -1
- package/dist/user-event/state.d.ts +1 -1
- package/dist/user-event/state.d.ts.map +1 -1
- package/dist/user-event/state.js +1 -1
- package/dist/user-event/state.js.map +1 -1
- package/dist/user-event/text.d.ts +34 -3
- package/dist/user-event/text.d.ts.map +1 -1
- package/dist/user-event/text.js +94 -17
- package/dist/user-event/text.js.map +1 -1
- package/dist/wait-for.d.ts +2 -0
- package/dist/wait-for.d.ts.map +1 -1
- package/dist/wait-for.js.map +1 -1
- package/dist/widget-accessible-properties.d.ts +14 -10
- package/dist/widget-accessible-properties.d.ts.map +1 -1
- package/dist/widget-accessible-properties.js +135 -173
- package/dist/widget-accessible-properties.js.map +1 -1
- package/dist/widget-getters.d.ts +8 -0
- package/dist/widget-getters.d.ts.map +1 -0
- package/dist/widget-getters.js +19 -0
- package/dist/widget-getters.js.map +1 -0
- package/dist/within.d.ts +3 -2
- package/dist/within.d.ts.map +1 -1
- package/dist/within.js +3 -2
- package/dist/within.js.map +1 -1
- package/package.json +13 -8
- package/src/accessible-native.ts +333 -0
- package/src/act.ts +2 -0
- package/src/build-queries.ts +66 -48
- package/src/cleanup-registry.ts +1 -1
- package/src/config.ts +4 -3
- package/src/errors.ts +14 -3
- package/src/fire-event.ts +61 -8
- package/src/frame-sync.ts +21 -5
- package/src/harness-window.ts +9 -0
- package/src/index.ts +18 -11
- package/src/internal.ts +11 -0
- package/src/matchers.ts +466 -64
- package/src/pretty-format.ts +1 -0
- package/src/pretty-widget.ts +100 -72
- package/src/production.ts +52 -0
- package/src/queries.ts +128 -89
- package/src/query-helpers.ts +97 -0
- package/src/render-children.ts +25 -0
- package/src/render.tsx +18 -13
- package/src/role-helpers.ts +14 -4
- package/src/role-naming.ts +99 -0
- package/src/screenshot.ts +272 -103
- package/src/suggestions.ts +3 -0
- package/src/traversal.ts +49 -6
- package/src/types.ts +69 -19
- package/src/user-event/adjustment.ts +42 -2
- package/src/user-event/click.ts +248 -46
- package/src/user-event/column-header-click.ts +90 -0
- package/src/user-event/controller.ts +29 -0
- package/src/user-event/event-wrapper.ts +3 -1
- package/src/user-event/gesture.ts +57 -6
- package/src/user-event/index.ts +119 -29
- package/src/user-event/indexed-children.ts +75 -0
- package/src/user-event/keyboard.ts +70 -20
- package/src/user-event/list-row-click.ts +57 -0
- package/src/user-event/native-click.ts +46 -0
- package/src/user-event/pointer.ts +52 -13
- package/src/user-event/selection.ts +74 -33
- package/src/user-event/state.ts +2 -2
- package/src/user-event/text.ts +121 -23
- package/src/wait-for.ts +2 -0
- package/src/widget-accessible-properties.ts +183 -214
- package/src/widget-getters.ts +32 -0
- package/src/within.ts +3 -2
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { createRoot } from "@gtkx/react";
|
|
2
|
+
import { createHarnessWindow } from "./harness-window.js";
|
|
3
|
+
const SETTLE_TURNS = 3;
|
|
4
|
+
const activeRenders = new Set();
|
|
5
|
+
const turn = () => new Promise((resolve) => setTimeout(resolve, 0));
|
|
6
|
+
const settle = async () => {
|
|
7
|
+
for (let index = 0; index < SETTLE_TURNS; index++) {
|
|
8
|
+
await turn();
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
const render = async (element) => {
|
|
12
|
+
const window = createHarnessWindow();
|
|
13
|
+
const root = createRoot(window);
|
|
14
|
+
activeRenders.add({ root, window });
|
|
15
|
+
root.render(element);
|
|
16
|
+
window.present();
|
|
17
|
+
await settle();
|
|
18
|
+
return {
|
|
19
|
+
rerender: async (next) => {
|
|
20
|
+
root.render(next);
|
|
21
|
+
await settle();
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
const cleanup = async () => {
|
|
26
|
+
for (const active of activeRenders) {
|
|
27
|
+
active.root.unmount();
|
|
28
|
+
active.window.destroy();
|
|
29
|
+
}
|
|
30
|
+
activeRenders.clear();
|
|
31
|
+
await settle();
|
|
32
|
+
};
|
|
33
|
+
export { cleanup, render };
|
|
34
|
+
//# sourceMappingURL=production.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"production.js","sourceRoot":"","sources":["../src/production.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAa,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAW1D,MAAM,YAAY,GAAG,CAAC,CAAC;AACvB,MAAM,aAAa,GAAsB,IAAI,GAAG,EAAE,CAAC;AAEnD,MAAM,IAAI,GAAG,GAAkB,EAAE,CAAC,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;AAEnF,MAAM,MAAM,GAAG,KAAK,IAAmB,EAAE;IACrC,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,YAAY,EAAE,KAAK,EAAE,EAAE,CAAC;QAChD,MAAM,IAAI,EAAE,CAAC;IACjB,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,KAAK,EAAE,OAAkB,EAAmC,EAAE;IACzE,MAAM,MAAM,GAAG,mBAAmB,EAAE,CAAC;IACrC,MAAM,IAAI,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;IAChC,aAAa,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IACpC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACrB,MAAM,CAAC,OAAO,EAAE,CAAC;IACjB,MAAM,MAAM,EAAE,CAAC;IAEf,OAAO;QACH,QAAQ,EAAE,KAAK,EAAE,IAAe,EAAiB,EAAE;YAC/C,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YAClB,MAAM,MAAM,EAAE,CAAC;QACnB,CAAC;KACJ,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,OAAO,GAAG,KAAK,IAAmB,EAAE;IACtC,KAAK,MAAM,MAAM,IAAI,aAAa,EAAE,CAAC;QACjC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;QACtB,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;IAC5B,CAAC;IAED,aAAa,CAAC,KAAK,EAAE,CAAC;IACtB,MAAM,MAAM,EAAE,CAAC;AACnB,CAAC,CAAC;AAEF,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC","sourcesContent":["import type * as Gtk from \"@gtkx/gi/gtk\";\nimport type { ReactNode } from \"react\";\nimport { createRoot, type Root } from \"@gtkx/react\";\nimport { createHarnessWindow } from \"./harness-window.js\";\n\ntype ProductionRenderResult = {\n rerender: (element: ReactNode) => Promise<void>;\n};\n\ntype ActiveRender = {\n root: Root;\n window: Gtk.Window;\n};\n\nconst SETTLE_TURNS = 3;\nconst activeRenders: Set<ActiveRender> = new Set();\n\nconst turn = (): Promise<void> => new Promise((resolve) => setTimeout(resolve, 0));\n\nconst settle = async (): Promise<void> => {\n for (let index = 0; index < SETTLE_TURNS; index++) {\n await turn();\n }\n};\n\nconst render = async (element: ReactNode): Promise<ProductionRenderResult> => {\n const window = createHarnessWindow();\n const root = createRoot(window);\n activeRenders.add({ root, window });\n root.render(element);\n window.present();\n await settle();\n\n return {\n rerender: async (next: ReactNode): Promise<void> => {\n root.render(next);\n await settle();\n },\n };\n};\n\nconst cleanup = async (): Promise<void> => {\n for (const active of activeRenders) {\n active.root.unmount();\n active.window.destroy();\n }\n\n activeRenders.clear();\n await settle();\n};\n\nexport { cleanup, render };\n"]}
|
package/dist/queries.d.ts
CHANGED
|
@@ -1,128 +1,171 @@
|
|
|
1
1
|
import * as Gtk from "@gtkx/gi/gtk";
|
|
2
2
|
import type { ByRoleOptions, Matcher, MatcherOptions, QueryFamilies } from "./types.js";
|
|
3
3
|
import { type Container } from "./traversal.js";
|
|
4
|
+
/** The built-in queries in their unbound form, each taking the container to search as its first argument. */
|
|
4
5
|
type BuiltinQueries = QueryFamilies<[container: Container]>;
|
|
5
6
|
declare const builtinQueries: BuiltinQueries;
|
|
6
7
|
/**
|
|
7
|
-
* Returns the single widget with a matching accessible role and options, or null when none
|
|
8
|
-
* Throws when more than one matches.
|
|
8
|
+
* Returns the single mapped widget with a matching accessible role and options, or null when none
|
|
9
|
+
* match. Widgets that are not mapped are never matched. Throws when more than one matches.
|
|
9
10
|
*/
|
|
10
11
|
declare const queryByRole: BuiltinQueries["queryByRole"];
|
|
11
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* Returns every mapped widget with a matching accessible role and options. Widgets that are not
|
|
14
|
+
* mapped are never matched. Throws when none match.
|
|
15
|
+
*/
|
|
12
16
|
declare const getAllByRole: BuiltinQueries["getAllByRole"];
|
|
13
17
|
/**
|
|
14
|
-
* Returns the single widget with a matching accessible role and options.
|
|
15
|
-
* Throws when none or more than one matches.
|
|
18
|
+
* Returns the single mapped widget with a matching accessible role and options. Widgets that are not
|
|
19
|
+
* mapped are never matched. Throws when none or more than one matches.
|
|
16
20
|
*/
|
|
17
21
|
declare const getByRole: BuiltinQueries["getByRole"];
|
|
18
22
|
/**
|
|
19
|
-
* Waits for and returns every widget with a matching accessible role and options, retrying
|
|
20
|
-
* least one appears or the timeout elapses.
|
|
23
|
+
* Waits for and returns every mapped widget with a matching accessible role and options, retrying
|
|
24
|
+
* until at least one appears or the timeout elapses. Widgets that are not mapped are never matched.
|
|
21
25
|
*/
|
|
22
26
|
declare const findAllByRole: BuiltinQueries["findAllByRole"];
|
|
23
27
|
/**
|
|
24
|
-
* Waits for and returns the single widget with a matching accessible role and options,
|
|
25
|
-
* until it appears or the timeout elapses.
|
|
28
|
+
* Waits for and returns the single mapped widget with a matching accessible role and options,
|
|
29
|
+
* retrying until it appears or the timeout elapses. Widgets that are not mapped are never matched.
|
|
30
|
+
* Rejects when none or more than one matches.
|
|
26
31
|
*/
|
|
27
32
|
declare const findByRole: BuiltinQueries["findByRole"];
|
|
28
33
|
/**
|
|
29
|
-
* Returns the single widget with matching associated label text, or null when none match.
|
|
30
|
-
* Throws when more than one matches.
|
|
34
|
+
* Returns the single mapped widget with matching associated label text, or null when none match.
|
|
35
|
+
* Widgets that are not mapped are never matched. Throws when more than one matches.
|
|
31
36
|
*/
|
|
32
37
|
declare const queryByLabelText: BuiltinQueries["queryByLabelText"];
|
|
33
|
-
/**
|
|
38
|
+
/**
|
|
39
|
+
* Returns every mapped widget with matching associated label text. Widgets that are not mapped are
|
|
40
|
+
* never matched. Throws when none match.
|
|
41
|
+
*/
|
|
34
42
|
declare const getAllByLabelText: BuiltinQueries["getAllByLabelText"];
|
|
35
|
-
/**
|
|
43
|
+
/**
|
|
44
|
+
* Returns the single mapped widget with matching associated label text. Widgets that are not mapped
|
|
45
|
+
* are never matched. Throws when none or more than one matches.
|
|
46
|
+
*/
|
|
36
47
|
declare const getByLabelText: BuiltinQueries["getByLabelText"];
|
|
37
48
|
/**
|
|
38
|
-
* Waits for and returns every widget with matching associated label text, retrying until at
|
|
39
|
-
* one appears or the timeout elapses.
|
|
49
|
+
* Waits for and returns every mapped widget with matching associated label text, retrying until at
|
|
50
|
+
* least one appears or the timeout elapses. Widgets that are not mapped are never matched.
|
|
40
51
|
*/
|
|
41
52
|
declare const findAllByLabelText: BuiltinQueries["findAllByLabelText"];
|
|
42
53
|
/**
|
|
43
|
-
* Waits for and returns the single widget with matching associated label text, retrying until
|
|
44
|
-
* appears or the timeout elapses.
|
|
54
|
+
* Waits for and returns the single mapped widget with matching associated label text, retrying until
|
|
55
|
+
* it appears or the timeout elapses. Widgets that are not mapped are never matched. Rejects when
|
|
56
|
+
* none or more than one matches.
|
|
45
57
|
*/
|
|
46
58
|
declare const findByLabelText: BuiltinQueries["findByLabelText"];
|
|
47
59
|
/**
|
|
48
|
-
* Returns the single widget with matching rendered text content, or null when none match.
|
|
49
|
-
* Throws when more than one matches.
|
|
60
|
+
* Returns the single mapped widget with matching rendered text content, or null when none match.
|
|
61
|
+
* Widgets that are not mapped are never matched. Throws when more than one matches.
|
|
50
62
|
*/
|
|
51
63
|
declare const queryByText: BuiltinQueries["queryByText"];
|
|
52
|
-
/**
|
|
64
|
+
/**
|
|
65
|
+
* Returns every mapped widget with matching rendered text content. Widgets that are not mapped are
|
|
66
|
+
* never matched. Throws when none match.
|
|
67
|
+
*/
|
|
53
68
|
declare const getAllByText: BuiltinQueries["getAllByText"];
|
|
54
|
-
/**
|
|
69
|
+
/**
|
|
70
|
+
* Returns the single mapped widget with matching rendered text content. Widgets that are not mapped
|
|
71
|
+
* are never matched. Throws when none or more than one matches.
|
|
72
|
+
*/
|
|
55
73
|
declare const getByText: BuiltinQueries["getByText"];
|
|
56
74
|
/**
|
|
57
|
-
* Waits for and returns every widget with matching rendered text content, retrying until at
|
|
58
|
-
* one appears or the timeout elapses.
|
|
75
|
+
* Waits for and returns every mapped widget with matching rendered text content, retrying until at
|
|
76
|
+
* least one appears or the timeout elapses. Widgets that are not mapped are never matched.
|
|
59
77
|
*/
|
|
60
78
|
declare const findAllByText: BuiltinQueries["findAllByText"];
|
|
61
79
|
/**
|
|
62
|
-
* Waits for and returns the single widget with matching rendered text content, retrying until
|
|
63
|
-
* appears or the timeout elapses.
|
|
80
|
+
* Waits for and returns the single mapped widget with matching rendered text content, retrying until
|
|
81
|
+
* it appears or the timeout elapses. Widgets that are not mapped are never matched. Rejects when
|
|
82
|
+
* none or more than one matches.
|
|
64
83
|
*/
|
|
65
84
|
declare const findByText: BuiltinQueries["findByText"];
|
|
66
85
|
/**
|
|
67
|
-
* Returns the single widget with a matching widget name, or null when none match.
|
|
68
|
-
* Throws when more than one matches.
|
|
86
|
+
* Returns the single mapped widget with a matching widget name, or null when none match. Widgets
|
|
87
|
+
* that are not mapped are never matched. Throws when more than one matches.
|
|
69
88
|
*/
|
|
70
89
|
declare const queryByName: BuiltinQueries["queryByName"];
|
|
71
|
-
/**
|
|
90
|
+
/**
|
|
91
|
+
* Returns every mapped widget with a matching widget name. Widgets that are not mapped are never
|
|
92
|
+
* matched. Throws when none match.
|
|
93
|
+
*/
|
|
72
94
|
declare const getAllByName: BuiltinQueries["getAllByName"];
|
|
73
|
-
/**
|
|
95
|
+
/**
|
|
96
|
+
* Returns the single mapped widget with a matching widget name. Widgets that are not mapped are
|
|
97
|
+
* never matched. Throws when none or more than one matches.
|
|
98
|
+
*/
|
|
74
99
|
declare const getByName: BuiltinQueries["getByName"];
|
|
75
100
|
/**
|
|
76
|
-
* Waits for and returns every widget with a matching widget name, retrying until at least one
|
|
77
|
-
* appears or the timeout elapses.
|
|
101
|
+
* Waits for and returns every mapped widget with a matching widget name, retrying until at least one
|
|
102
|
+
* appears or the timeout elapses. Widgets that are not mapped are never matched.
|
|
78
103
|
*/
|
|
79
104
|
declare const findAllByName: BuiltinQueries["findAllByName"];
|
|
80
105
|
/**
|
|
81
|
-
* Waits for and returns the single widget with a matching widget name, retrying until it
|
|
82
|
-
* the timeout elapses.
|
|
106
|
+
* Waits for and returns the single mapped widget with a matching widget name, retrying until it
|
|
107
|
+
* appears or the timeout elapses. Widgets that are not mapped are never matched. Rejects when none
|
|
108
|
+
* or more than one matches.
|
|
83
109
|
*/
|
|
84
110
|
declare const findByName: BuiltinQueries["findByName"];
|
|
85
111
|
/**
|
|
86
|
-
* Returns the single widget with matching placeholder text, or null when none match.
|
|
87
|
-
* Throws when more than one matches.
|
|
112
|
+
* Returns the single mapped widget with matching placeholder text, or null when none match. Widgets
|
|
113
|
+
* that are not mapped are never matched. Throws when more than one matches.
|
|
88
114
|
*/
|
|
89
115
|
declare const queryByPlaceholderText: BuiltinQueries["queryByPlaceholderText"];
|
|
90
|
-
/**
|
|
116
|
+
/**
|
|
117
|
+
* Returns every mapped widget with matching placeholder text. Widgets that are not mapped are never
|
|
118
|
+
* matched. Throws when none match.
|
|
119
|
+
*/
|
|
91
120
|
declare const getAllByPlaceholderText: BuiltinQueries["getAllByPlaceholderText"];
|
|
92
|
-
/**
|
|
121
|
+
/**
|
|
122
|
+
* Returns the single mapped widget with matching placeholder text. Widgets that are not mapped are
|
|
123
|
+
* never matched. Throws when none or more than one matches.
|
|
124
|
+
*/
|
|
93
125
|
declare const getByPlaceholderText: BuiltinQueries["getByPlaceholderText"];
|
|
94
126
|
/**
|
|
95
|
-
* Waits for and returns every widget with matching placeholder text, retrying until at least
|
|
96
|
-
* appears or the timeout elapses.
|
|
127
|
+
* Waits for and returns every mapped widget with matching placeholder text, retrying until at least
|
|
128
|
+
* one appears or the timeout elapses. Widgets that are not mapped are never matched.
|
|
97
129
|
*/
|
|
98
130
|
declare const findAllByPlaceholderText: BuiltinQueries["findAllByPlaceholderText"];
|
|
99
131
|
/**
|
|
100
|
-
* Waits for and returns the single widget with matching placeholder text, retrying until it
|
|
101
|
-
* or the timeout elapses.
|
|
132
|
+
* Waits for and returns the single mapped widget with matching placeholder text, retrying until it
|
|
133
|
+
* appears or the timeout elapses. Widgets that are not mapped are never matched. Rejects when none
|
|
134
|
+
* or more than one matches.
|
|
102
135
|
*/
|
|
103
136
|
declare const findByPlaceholderText: BuiltinQueries["findByPlaceholderText"];
|
|
104
137
|
/**
|
|
105
|
-
* Returns the single widget with a matching display value, or null when none match.
|
|
106
|
-
* Throws when more than one matches.
|
|
138
|
+
* Returns the single mapped widget with a matching display value, or null when none match. Widgets
|
|
139
|
+
* that are not mapped are never matched. Throws when more than one matches.
|
|
107
140
|
*/
|
|
108
141
|
declare const queryByDisplayValue: BuiltinQueries["queryByDisplayValue"];
|
|
109
|
-
/**
|
|
142
|
+
/**
|
|
143
|
+
* Returns every mapped widget with a matching display value. Widgets that are not mapped are never
|
|
144
|
+
* matched. Throws when none match.
|
|
145
|
+
*/
|
|
110
146
|
declare const getAllByDisplayValue: BuiltinQueries["getAllByDisplayValue"];
|
|
111
|
-
/**
|
|
147
|
+
/**
|
|
148
|
+
* Returns the single mapped widget with a matching display value. Widgets that are not mapped are
|
|
149
|
+
* never matched. Throws when none or more than one matches.
|
|
150
|
+
*/
|
|
112
151
|
declare const getByDisplayValue: BuiltinQueries["getByDisplayValue"];
|
|
113
152
|
/**
|
|
114
|
-
* Waits for and returns every widget with a matching display value, retrying until at least
|
|
115
|
-
* appears or the timeout elapses.
|
|
153
|
+
* Waits for and returns every mapped widget with a matching display value, retrying until at least
|
|
154
|
+
* one appears or the timeout elapses. Widgets that are not mapped are never matched.
|
|
116
155
|
*/
|
|
117
156
|
declare const findAllByDisplayValue: BuiltinQueries["findAllByDisplayValue"];
|
|
118
157
|
/**
|
|
119
|
-
* Waits for and returns the single widget with a matching display value, retrying until it
|
|
120
|
-
* or the timeout elapses.
|
|
158
|
+
* Waits for and returns the single mapped widget with a matching display value, retrying until it
|
|
159
|
+
* appears or the timeout elapses. Widgets that are not mapped are never matched. Rejects when none
|
|
160
|
+
* or more than one matches.
|
|
121
161
|
*/
|
|
122
162
|
declare const findByDisplayValue: BuiltinQueries["findByDisplayValue"];
|
|
163
|
+
declare const isTextMatch: (actual: string | null, expected: Matcher, widget: Gtk.Widget, options?: MatcherOptions) => boolean;
|
|
164
|
+
declare const isMatchingWidgetType: (widget: Gtk.Widget, options?: MatcherOptions) => boolean;
|
|
123
165
|
/**
|
|
124
166
|
* Finds every widget under the container whose accessible role matches `role` and that satisfies the given options.
|
|
125
|
-
* Widgets excluded from the accessibility tree are
|
|
167
|
+
* Widgets that are not mapped are never matched, and widgets excluded from the accessibility tree are
|
|
168
|
+
* skipped unless `options.hidden` is set.
|
|
126
169
|
* @param container Widget subtree to search.
|
|
127
170
|
* @param role Accessible role to match.
|
|
128
171
|
* @param options Additional accessible name, state, and value constraints.
|
|
@@ -131,7 +174,7 @@ declare const findByDisplayValue: BuiltinQueries["findByDisplayValue"];
|
|
|
131
174
|
declare function queryAllByRole(container: Container, role: Gtk.AccessibleRole, options?: ByRoleOptions): Gtk.Widget[];
|
|
132
175
|
/**
|
|
133
176
|
* Finds every widget associated with a label whose text matches: a Gtk.Label mnemonic target, the
|
|
134
|
-
* widget's own accessible label, or its labelled-by relation.
|
|
177
|
+
* widget's own accessible label, or its labelled-by relation. Widgets that are not mapped are never matched.
|
|
135
178
|
* @param container Widget subtree to search.
|
|
136
179
|
* @param text Matcher for the label text.
|
|
137
180
|
* @param options Text matching options.
|
|
@@ -139,7 +182,7 @@ declare function queryAllByRole(container: Container, role: Gtk.AccessibleRole,
|
|
|
139
182
|
*/
|
|
140
183
|
declare function queryAllByLabelText(container: Container, text: Matcher, options?: MatcherOptions): Gtk.Widget[];
|
|
141
184
|
/**
|
|
142
|
-
* Finds every widget whose rendered text content matches.
|
|
185
|
+
* Finds every widget whose rendered text content matches. Widgets that are not mapped are never matched.
|
|
143
186
|
* @param container Widget subtree to search.
|
|
144
187
|
* @param text Matcher for the widget text.
|
|
145
188
|
* @param options Text matching options.
|
|
@@ -147,7 +190,7 @@ declare function queryAllByLabelText(container: Container, text: Matcher, option
|
|
|
147
190
|
*/
|
|
148
191
|
declare function queryAllByText(container: Container, text: Matcher, options?: MatcherOptions): Gtk.Widget[];
|
|
149
192
|
/**
|
|
150
|
-
* Finds every widget whose widget name matches.
|
|
193
|
+
* Finds every widget whose widget name matches. Widgets that are not mapped are never matched.
|
|
151
194
|
* @param container Widget subtree to search.
|
|
152
195
|
* @param name Matcher for the widget name.
|
|
153
196
|
* @param options Text matching options.
|
|
@@ -155,7 +198,7 @@ declare function queryAllByText(container: Container, text: Matcher, options?: M
|
|
|
155
198
|
*/
|
|
156
199
|
declare function queryAllByName(container: Container, name: Matcher, options?: MatcherOptions): Gtk.Widget[];
|
|
157
200
|
/**
|
|
158
|
-
* Finds every widget whose placeholder text matches.
|
|
201
|
+
* Finds every widget whose placeholder text matches. Widgets that are not mapped are never matched.
|
|
159
202
|
* @param container Widget subtree to search.
|
|
160
203
|
* @param text Matcher for the placeholder text.
|
|
161
204
|
* @param options Text matching options.
|
|
@@ -163,12 +206,12 @@ declare function queryAllByName(container: Container, name: Matcher, options?: M
|
|
|
163
206
|
*/
|
|
164
207
|
declare function queryAllByPlaceholderText(container: Container, text: Matcher, options?: MatcherOptions): Gtk.Widget[];
|
|
165
208
|
/**
|
|
166
|
-
* Finds every widget whose current display value matches.
|
|
209
|
+
* Finds every widget whose current display value matches. Widgets that are not mapped are never matched.
|
|
167
210
|
* @param container Widget subtree to search.
|
|
168
211
|
* @param value Matcher for the display value.
|
|
169
212
|
* @param options Text matching options.
|
|
170
213
|
* @returns Every matching widget, or an empty array when none match.
|
|
171
214
|
*/
|
|
172
215
|
declare function queryAllByDisplayValue(container: Container, value: Matcher, options?: MatcherOptions): Gtk.Widget[];
|
|
173
|
-
export { builtinQueries, queryByRole, getAllByRole, getByRole, findAllByRole, findByRole, queryByLabelText, getAllByLabelText, getByLabelText, findAllByLabelText, findByLabelText, queryByText, getAllByText, getByText, findAllByText, findByText, queryByName, getAllByName, getByName, findAllByName, findByName, queryByPlaceholderText, getAllByPlaceholderText, getByPlaceholderText, findAllByPlaceholderText, findByPlaceholderText, queryByDisplayValue, getAllByDisplayValue, getByDisplayValue, findAllByDisplayValue, findByDisplayValue, queryAllByRole, queryAllByLabelText, queryAllByText, queryAllByName, queryAllByPlaceholderText, queryAllByDisplayValue,
|
|
216
|
+
export { builtinQueries, isMatchingWidgetType, isTextMatch, queryByRole, getAllByRole, getByRole, findAllByRole, findByRole, queryByLabelText, getAllByLabelText, getByLabelText, findAllByLabelText, findByLabelText, queryByText, getAllByText, getByText, findAllByText, findByText, queryByName, getAllByName, getByName, findAllByName, findByName, queryByPlaceholderText, getAllByPlaceholderText, getByPlaceholderText, findAllByPlaceholderText, findByPlaceholderText, queryByDisplayValue, getAllByDisplayValue, getByDisplayValue, findAllByDisplayValue, findByDisplayValue, queryAllByRole, queryAllByLabelText, queryAllByText, queryAllByName, queryAllByPlaceholderText, queryAllByDisplayValue, };
|
|
174
217
|
//# sourceMappingURL=queries.d.ts.map
|
package/dist/queries.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../src/queries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AACpC,OAAO,KAAK,EACR,aAAa,EAEb,OAAO,EACP,cAAc,EAEd,aAAa,EAChB,MAAM,YAAY,CAAC;AAIpB,OAAO,EAAE,KAAK,SAAS,EAAqB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../src/queries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AACpC,OAAO,KAAK,EACR,aAAa,EAEb,OAAO,EACP,cAAc,EAEd,aAAa,EAChB,MAAM,YAAY,CAAC;AAIpB,OAAO,EAAE,KAAK,SAAS,EAAqB,MAAM,gBAAgB,CAAC;AAuBnE,6GAA6G;AAC7G,KAAK,cAAc,GAAG,aAAa,CAAC,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC;AA+D5D,QAAA,MAAM,cAAc,EAOf,cAAc,CAAC;AAEpB;;;GAGG;AACH,QAAA,MAAM,WAAW,EAAE,cAAc,CAAC,aAAa,CAA8B,CAAC;AAC9E;;;GAGG;AACH,QAAA,MAAM,YAAY,EAAE,cAAc,CAAC,cAAc,CAA+B,CAAC;AACjF;;;GAGG;AACH,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,WAAW,CAA4B,CAAC;AACxE;;;GAGG;AACH,QAAA,MAAM,aAAa,EAAE,cAAc,CAAC,eAAe,CAAgC,CAAC;AACpF;;;;GAIG;AACH,QAAA,MAAM,UAAU,EAAE,cAAc,CAAC,YAAY,CAA6B,CAAC;AAC3E;;;GAGG;AACH,QAAA,MAAM,gBAAgB,EAAE,cAAc,CAAC,kBAAkB,CAAmC,CAAC;AAC7F;;;GAGG;AACH,QAAA,MAAM,iBAAiB,EAAE,cAAc,CAAC,mBAAmB,CAAoC,CAAC;AAChG;;;GAGG;AACH,QAAA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