appium-desktop-driver 1.2.0 → 1.4.1

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.
@@ -4,253 +4,253 @@ exports.FoundAutomationElement = exports.AutomationElementGroup = exports.Automa
4
4
  const core_1 = require("./core");
5
5
  const common_1 = require("./common");
6
6
  // TODO: Move the methods to a separate file, some of them are too complicated and are not easy to maintain
7
- const FIND_ALL_ANCESTOR = (0, core_1.pwsh$ /* ps1 */) `
8
- $treeWalker = [TreeWalker]::new($cacheRequest.TreeFilter)
9
- $els = New-Object System.Collections.Generic.List[AutomationElement]
10
-
11
- ${0} | ForEach-Object {
12
- $el = $_
13
- while ($null -ne ($parent = $treeWalker.GetParent($el))) {
14
- $el = $parent
15
- $validEl = $el.FindFirst([TreeScope]::Element, ${1})
16
-
17
- if ($null -ne $validEl) {
18
- $els.Add($validEl)
19
- }
20
- }
21
- }
22
-
23
- Write-Output $els
7
+ const FIND_ALL_ANCESTOR = (0, core_1.pwsh$ /* ps1 */) `
8
+ $treeWalker = [TreeWalker]::new($cacheRequest.TreeFilter)
9
+ $els = New-Object System.Collections.Generic.List[AutomationElement]
10
+
11
+ ${0} | ForEach-Object {
12
+ $el = $_
13
+ while ($null -ne ($parent = $treeWalker.GetParent($el))) {
14
+ $el = $parent
15
+ $validEl = $el.FindFirst([TreeScope]::Element, ${1})
16
+
17
+ if ($null -ne $validEl) {
18
+ $els.Add($validEl)
19
+ }
20
+ }
21
+ }
22
+
23
+ Write-Output $els
24
24
  `;
25
- const FIND_FIRST_ANCESTOR = (0, core_1.pwsh$ /* ps1 */) `
26
- $treeWalker = [TreeWalker]::new($cacheRequest.TreeFilter)
27
-
28
- ${0} | ForEach-Object {
29
- $el = $_
30
- while ($null -ne ($parent = $treeWalker.GetParent($el))) {
31
- $el = $parent
32
- $validEl = $el.FindFirst([TreeScope]::Element, ${1})
33
-
34
- if ($null -ne $validEl) {
35
- Write-Output $el
36
- break
37
- }
38
- }
39
- }
25
+ const FIND_FIRST_ANCESTOR = (0, core_1.pwsh$ /* ps1 */) `
26
+ $treeWalker = [TreeWalker]::new($cacheRequest.TreeFilter)
27
+
28
+ ${0} | ForEach-Object {
29
+ $el = $_
30
+ while ($null -ne ($parent = $treeWalker.GetParent($el))) {
31
+ $el = $parent
32
+ $validEl = $el.FindFirst([TreeScope]::Element, ${1})
33
+
34
+ if ($null -ne $validEl) {
35
+ Write-Output $el
36
+ break
37
+ }
38
+ }
39
+ }
40
40
  `;
41
- const FIND_ALL_ANCESTOR_OR_SELF = (0, core_1.pwsh$ /* ps1 */) `
42
- $treeWalker = [TreeWalker]::new($cacheRequest.TreeFilter)
43
- $els = New-Object System.Collections.Generic.List[AutomationElement]
44
-
45
- ${0} | ForEach-Object {
46
- $el = $_
47
- while ($null -ne $el) {
48
- $validEl = $el.FindFirst([TreeScope]::Element, ${1})
49
-
50
- if ($null -ne $validEl) {
51
- $els.Add($validEl)
52
- }
53
-
54
- $el = $treeWalker.GetParent($el)
55
- }
56
- }
57
-
58
- Write-Output $els
41
+ const FIND_ALL_ANCESTOR_OR_SELF = (0, core_1.pwsh$ /* ps1 */) `
42
+ $treeWalker = [TreeWalker]::new($cacheRequest.TreeFilter)
43
+ $els = New-Object System.Collections.Generic.List[AutomationElement]
44
+
45
+ ${0} | ForEach-Object {
46
+ $el = $_
47
+ while ($null -ne $el) {
48
+ $validEl = $el.FindFirst([TreeScope]::Element, ${1})
49
+
50
+ if ($null -ne $validEl) {
51
+ $els.Add($validEl)
52
+ }
53
+
54
+ $el = $treeWalker.GetParent($el)
55
+ }
56
+ }
57
+
58
+ Write-Output $els
59
59
  `;
60
- const FIND_FIRST_ANCESTOR_OR_SELF = (0, core_1.pwsh$ /* ps1 */) `
61
- $treeWalker = [TreeWalker]::new($cacheRequest.TreeFilter)
62
-
63
- ${0} | ForEach-Object {
64
- $el = $_
65
- while ($null -ne $el) {
66
- $validEl = $el.FindFirst([TreeScope]::Element, ${1})
67
-
68
- if ($null -ne $validEl) {
69
- Write-Output $el
70
- break
71
- }
72
-
73
- $el = $treeWalker.GetParent($el)
74
- }
75
- }
60
+ const FIND_FIRST_ANCESTOR_OR_SELF = (0, core_1.pwsh$ /* ps1 */) `
61
+ $treeWalker = [TreeWalker]::new($cacheRequest.TreeFilter)
62
+
63
+ ${0} | ForEach-Object {
64
+ $el = $_
65
+ while ($null -ne $el) {
66
+ $validEl = $el.FindFirst([TreeScope]::Element, ${1})
67
+
68
+ if ($null -ne $validEl) {
69
+ Write-Output $el
70
+ break
71
+ }
72
+
73
+ $el = $treeWalker.GetParent($el)
74
+ }
75
+ }
76
76
  `;
77
- const FIND_PARENT = (0, core_1.pwsh$ /* ps1 */) `
78
- $treeWalker = [TreeWalker]::new($cacheRequest.TreeFilter)
79
-
80
- ${0} | ForEach-Object {
81
- $el = $_
82
- $el = $treeWalker.GetParent($el).FindFirst([TreeScope]::Element, ${1})
83
- Write-Output $el
84
- }
77
+ const FIND_PARENT = (0, core_1.pwsh$ /* ps1 */) `
78
+ $treeWalker = [TreeWalker]::new($cacheRequest.TreeFilter)
79
+
80
+ ${0} | ForEach-Object {
81
+ $el = $_
82
+ $el = $treeWalker.GetParent($el).FindFirst([TreeScope]::Element, ${1})
83
+ Write-Output $el
84
+ }
85
85
  `;
86
- const FIND_FOLLOWING = (0, core_1.pwsh$ /* ps1 */) `
87
- $treeWalker = [TreeWalker]::new([AndCondition]::new($cacheRequest.TreeFilter, ${1}))
88
- $els = New-Object System.Collections.Generic.List[AutomationElement]
89
-
90
- ${0} | ForEach-Object {
91
- $el = $_
92
- while ($null -ne $el) {
93
- if ($null -ne ($nextSibling = $treeWalker.GetNextSibling($el))) {
94
- $el = $nextSibling
95
-
96
- Write-Output $el
97
- break
98
- }
99
-
100
- $el = $treeWalker.GetParent($el)
101
- }
102
- }
86
+ const FIND_FOLLOWING = (0, core_1.pwsh$ /* ps1 */) `
87
+ $treeWalker = [TreeWalker]::new([AndCondition]::new($cacheRequest.TreeFilter, ${1}))
88
+ $els = New-Object System.Collections.Generic.List[AutomationElement]
89
+
90
+ ${0} | ForEach-Object {
91
+ $el = $_
92
+ while ($null -ne $el) {
93
+ if ($null -ne ($nextSibling = $treeWalker.GetNextSibling($el))) {
94
+ $el = $nextSibling
95
+
96
+ Write-Output $el
97
+ break
98
+ }
99
+
100
+ $el = $treeWalker.GetParent($el)
101
+ }
102
+ }
103
103
  `;
104
- const FIND_ALL_FOLLOWING = (0, core_1.pwsh$ /* ps1 */) `
105
- $treeWalker = [TreeWalker]::new($cacheRequest.TreeFilter)
106
- $els = New-Object System.Collections.Generic.List[AutomationElement]
107
-
108
- ${0} | ForEach-Object {
109
- $el = $_
110
- while ($null -ne $el) {
111
- if ($null -ne ($nextSibling = $treeWalker.GetNextSibling($el))) {
112
- $el = $nextSibling
113
- $els.Add($el)
114
- $els.AddRange($el.FindAll([TreeScope]::Children, ${1}))
115
- }
116
-
117
- $el = $treeWalker.GetParent($el)
118
- }
119
- }
120
-
121
- Write-Output $els
104
+ const FIND_ALL_FOLLOWING = (0, core_1.pwsh$ /* ps1 */) `
105
+ $treeWalker = [TreeWalker]::new($cacheRequest.TreeFilter)
106
+ $els = New-Object System.Collections.Generic.List[AutomationElement]
107
+
108
+ ${0} | ForEach-Object {
109
+ $el = $_
110
+ while ($null -ne $el) {
111
+ if ($null -ne ($nextSibling = $treeWalker.GetNextSibling($el))) {
112
+ $el = $nextSibling
113
+ $els.Add($el)
114
+ $els.AddRange($el.FindAll([TreeScope]::Children, ${1}))
115
+ }
116
+
117
+ $el = $treeWalker.GetParent($el)
118
+ }
119
+ }
120
+
121
+ Write-Output $els
122
122
  `;
123
- const FIND_FOLLOWING_SIBLING = (0, core_1.pwsh$ /* ps1 */) `
124
- $treeWalker = [TreeWalker]::new($cacheRequest.TreeFilter)
125
-
126
- ${0} | ForEach-Object {
127
- $el = $_
128
- while ($null -ne ($nextSibling = $treeWalker.GetNextSibling($el))) {
129
- $el = $nextSibling
130
- $validEl = $el.FindFirst([TreeScope]::Element, ${1})
131
-
132
- if ($null -ne $validEl) {
133
- Write-Output $el
134
- break
135
- }
136
- }
137
- }
123
+ const FIND_FOLLOWING_SIBLING = (0, core_1.pwsh$ /* ps1 */) `
124
+ $treeWalker = [TreeWalker]::new($cacheRequest.TreeFilter)
125
+
126
+ ${0} | ForEach-Object {
127
+ $el = $_
128
+ while ($null -ne ($nextSibling = $treeWalker.GetNextSibling($el))) {
129
+ $el = $nextSibling
130
+ $validEl = $el.FindFirst([TreeScope]::Element, ${1})
131
+
132
+ if ($null -ne $validEl) {
133
+ Write-Output $el
134
+ break
135
+ }
136
+ }
137
+ }
138
138
  `;
139
- const FIND_ALL_FOLLOWING_SIBLING = (0, core_1.pwsh$ /* ps1 */) `
140
- $treeWalker = [TreeWalker]::new($cacheRequest.TreeFilter)
141
- $els = New-Object System.Collections.Generic.List[AutomationElement]
142
-
143
- ${0} | ForEach-Object {
144
- $el = $_
145
- while ($null -ne ($nextSibling = $treeWalker.GetNextSibling($el))) {
146
- $el = $nextSibling
147
- $validEl = $el.FindFirst([TreeScope]::Element, ${1})
148
-
149
- if ($null -ne $validEl) {
150
- $els.Add($validEl)
151
- }
152
- }
153
- }
154
-
155
- Write-Output $els
139
+ const FIND_ALL_FOLLOWING_SIBLING = (0, core_1.pwsh$ /* ps1 */) `
140
+ $treeWalker = [TreeWalker]::new($cacheRequest.TreeFilter)
141
+ $els = New-Object System.Collections.Generic.List[AutomationElement]
142
+
143
+ ${0} | ForEach-Object {
144
+ $el = $_
145
+ while ($null -ne ($nextSibling = $treeWalker.GetNextSibling($el))) {
146
+ $el = $nextSibling
147
+ $validEl = $el.FindFirst([TreeScope]::Element, ${1})
148
+
149
+ if ($null -ne $validEl) {
150
+ $els.Add($validEl)
151
+ }
152
+ }
153
+ }
154
+
155
+ Write-Output $els
156
156
  `;
157
- const FIND_PRECEDING = (0, core_1.pwsh$ /* ps1 */) `
158
- $treeWalker = [TreeWalker]::new([AndCondition]::new($cacheRequest.TreeFilter, ${1}))
159
-
160
- ${0} | ForEach-Object {
161
- $el = $_
162
- while ($null -ne $el) {
163
- if ($null -ne ($previousSibling = $treeWalker.GetPreviousSibling($el))) {
164
- $el = $previousSibling
165
-
166
- Write-Output $el
167
- break
168
- }
169
-
170
- $el = $treeWalker.GetParent($el)
171
- }
172
- }
157
+ const FIND_PRECEDING = (0, core_1.pwsh$ /* ps1 */) `
158
+ $treeWalker = [TreeWalker]::new([AndCondition]::new($cacheRequest.TreeFilter, ${1}))
159
+
160
+ ${0} | ForEach-Object {
161
+ $el = $_
162
+ while ($null -ne $el) {
163
+ if ($null -ne ($previousSibling = $treeWalker.GetPreviousSibling($el))) {
164
+ $el = $previousSibling
165
+
166
+ Write-Output $el
167
+ break
168
+ }
169
+
170
+ $el = $treeWalker.GetParent($el)
171
+ }
172
+ }
173
173
  `;
174
- const FIND_ALL_PRECEDING = (0, core_1.pwsh$ /* ps1 */) `
175
- $treeWalker = [TreeWalker]::new([AndCondition]::new($cacheRequest.TreeFilter, ${1}))
176
- $els = New-Object System.Collections.Generic.List[AutomationElement]
177
-
178
- ${0} | ForEach-Object {
179
- $el = $_
180
- while ($null -ne $el) {
181
- if ($null -ne ($previousSibling = $treeWalker.GetPreviousSibling($el))) {
182
- $el = $previousSibling
183
- $els.Add($el)
184
- $els.AddRange($el.FindAll([TreeScope]::Children, ${1}))
185
- }
186
-
187
- $el = $treeWalker.GetParent($el)
188
- }
189
- }
190
-
191
- Write-Output $els
174
+ const FIND_ALL_PRECEDING = (0, core_1.pwsh$ /* ps1 */) `
175
+ $treeWalker = [TreeWalker]::new([AndCondition]::new($cacheRequest.TreeFilter, ${1}))
176
+ $els = New-Object System.Collections.Generic.List[AutomationElement]
177
+
178
+ ${0} | ForEach-Object {
179
+ $el = $_
180
+ while ($null -ne $el) {
181
+ if ($null -ne ($previousSibling = $treeWalker.GetPreviousSibling($el))) {
182
+ $el = $previousSibling
183
+ $els.Add($el)
184
+ $els.AddRange($el.FindAll([TreeScope]::Children, ${1}))
185
+ }
186
+
187
+ $el = $treeWalker.GetParent($el)
188
+ }
189
+ }
190
+
191
+ Write-Output $els
192
192
  `;
193
- const FIND_PRECEDING_SIBLING = (0, core_1.pwsh$ /* ps1 */) `
194
- $treeWalker = [TreeWalker]::new($cacheRequest.TreeFilter)
195
-
196
- ${0} | ForEach-Object {
197
- $el = $_
198
- while ($null -ne ($previousSibling = $treeWalker.GetPreviousSibling($el))) {
199
- $el = $previousSibling
200
- $validEl = $el.FindFirst([TreeScope]::Element, ${1})
201
-
202
- if ($null -ne $validEl) {
203
- Write-Output $el
204
- break
205
- }
206
- }
207
- }
193
+ const FIND_PRECEDING_SIBLING = (0, core_1.pwsh$ /* ps1 */) `
194
+ $treeWalker = [TreeWalker]::new($cacheRequest.TreeFilter)
195
+
196
+ ${0} | ForEach-Object {
197
+ $el = $_
198
+ while ($null -ne ($previousSibling = $treeWalker.GetPreviousSibling($el))) {
199
+ $el = $previousSibling
200
+ $validEl = $el.FindFirst([TreeScope]::Element, ${1})
201
+
202
+ if ($null -ne $validEl) {
203
+ Write-Output $el
204
+ break
205
+ }
206
+ }
207
+ }
208
208
  `;
209
- const FIND_ALL_PRECEDING_SIBLING = (0, core_1.pwsh$ /* ps1 */) `
210
- $treeWalker = [TreeWalker]::new($cacheRequest.TreeFilter)
211
- $els = New-Object System.Collections.Generic.List[AutomationElement]
212
-
213
- ${0} | ForEach-Object {
214
- $el = $_
215
- while ($null -ne ($previousSibling = $treeWalker.GetPreviousSibling($el))) {
216
- $el = $previousSibling
217
- $validEl = $el.FindFirst([TreeScope]::Element, ${1})
218
-
219
- if ($null -ne $validEl) {
220
- $els.Add($validEl)
221
- }
222
- }
223
- }
224
-
225
- Write-Output $els
209
+ const FIND_ALL_PRECEDING_SIBLING = (0, core_1.pwsh$ /* ps1 */) `
210
+ $treeWalker = [TreeWalker]::new($cacheRequest.TreeFilter)
211
+ $els = New-Object System.Collections.Generic.List[AutomationElement]
212
+
213
+ ${0} | ForEach-Object {
214
+ $el = $_
215
+ while ($null -ne ($previousSibling = $treeWalker.GetPreviousSibling($el))) {
216
+ $el = $previousSibling
217
+ $validEl = $el.FindFirst([TreeScope]::Element, ${1})
218
+
219
+ if ($null -ne $validEl) {
220
+ $els.Add($validEl)
221
+ }
222
+ }
223
+ }
224
+
225
+ Write-Output $els
226
226
  `;
227
- const FIND_CHILDREN_OR_SELF = (0, core_1.pwsh$ /* ps1 */) `
228
- $els = New-Object System.Collections.Generic.List[AutomationElement]
229
-
230
- ${0} | ForEach-Object {
231
- $el = $_
232
- $validEl = $el.FindFirst([TreeScope]::Element -bor [TreeScope]::Children, ${1});
233
-
234
- if ($null -ne $validEl) {
235
- $els.Add($validEl)
236
- }
237
- }
238
-
239
- Write-Output $els
227
+ const FIND_CHILDREN_OR_SELF = (0, core_1.pwsh$ /* ps1 */) `
228
+ $els = New-Object System.Collections.Generic.List[AutomationElement]
229
+
230
+ ${0} | ForEach-Object {
231
+ $el = $_
232
+ $validEl = $el.FindFirst([TreeScope]::Element -bor [TreeScope]::Children, ${1});
233
+
234
+ if ($null -ne $validEl) {
235
+ $els.Add($validEl)
236
+ }
237
+ }
238
+
239
+ Write-Output $els
240
240
  `;
241
- const FIND_ALL_CHILDREN_OR_SELF = (0, core_1.pwsh$ /* ps1 */) `
242
- $els = New-Object System.Collections.Generic.List[AutomationElement]
243
-
244
- ${0} | ForEach-Object {
245
- $el = $_
246
- $validEl = $el.FindAll([TreeScope]::Element -bor [TreeScope]::Children, ${1});
247
-
248
- if ($null -ne $validEl) {
249
- $els.Add($validEl)
250
- }
251
- }
252
-
253
- Write-Output $els
241
+ const FIND_ALL_CHILDREN_OR_SELF = (0, core_1.pwsh$ /* ps1 */) `
242
+ $els = New-Object System.Collections.Generic.List[AutomationElement]
243
+
244
+ ${0} | ForEach-Object {
245
+ $el = $_
246
+ $validEl = $el.FindAll([TreeScope]::Element -bor [TreeScope]::Children, ${1});
247
+
248
+ if ($null -ne $validEl) {
249
+ $els.Add($validEl)
250
+ }
251
+ }
252
+
253
+ Write-Output $els
254
254
  `;
255
255
  const FIND_DESCENDANTS = (0, core_1.pwsh$ /* ps1 */) `Find-ChildrenRecursively -element (${0}) -condition (${1})`;
256
256
  const FIND_ALL_DESCENDANTS = (0, core_1.pwsh$ /* ps1 */) `Find-AllChildrenRecursively -element (${0}) -condition (${1})`;
@@ -261,46 +261,46 @@ const FIND_ALL = (0, core_1.pwsh$ /* ps1 */) `${0}.FindAll([TreeScope]::${1}, ${
261
261
  const AUTOMATION_ROOT = /* ps1 */ `$rootElement`;
262
262
  const FOCUSED_ELEMENT = /* ps1 */ `[AutomationElement]::FocusedElement`;
263
263
  const ROOT_ELEMENT = /* ps1 */ `[AutomationElement]::RootElement`;
264
- const SAVE_TO_ELEMENT_TABLE_AND_RETURN_ID = (0, core_1.pwsh$ /* ps1 */) `
265
- ${0} | Where-Object { $null -ne $_ } | ForEach-Object {
266
- $runtimeId = $_.GetCurrentPropertyValue([AutomationElement]::RuntimeIdProperty) -join '.';
267
-
268
- if (-not $elementTable.ContainsKey($runtimeId)) {
269
- $elementTable.Add($runtimeId, $_)
270
- };
271
-
272
- $runtimeId
273
- }
264
+ const SAVE_TO_ELEMENT_TABLE_AND_RETURN_ID = (0, core_1.pwsh$ /* ps1 */) `
265
+ ${0} | Where-Object { $null -ne $_ } | ForEach-Object {
266
+ $runtimeId = $_.GetCurrentPropertyValue([AutomationElement]::RuntimeIdProperty) -join '.';
267
+
268
+ if (-not $elementTable.ContainsKey($runtimeId)) {
269
+ $elementTable.Add($runtimeId, $_)
270
+ };
271
+
272
+ $runtimeId
273
+ }
274
274
  `;
275
275
  const ELEMENT_TABLE_GET = (0, core_1.pwsh$ /* ps1 */) `$elementTable['${0}']`;
276
276
  // TODO: maybe encode the result first? Some properties may be on multiple lines, it may cause a problem when returning multiple element results at once
277
277
  const GET_ELEMENT_PROPERTY = (0, core_1.pwsh$ /* ps1 */) `${0}.GetCurrentPropertyValue([AutomationElement]::${1}Property)`;
278
- const GET_ELEMENT_RUNTIME_ID = (0, core_1.pwsh$ /* ps1 */) `
279
- ${0} | ForEach-Object {
280
- $_.GetCurrentPropertyValue([AutomationElement]::RuntimeIdProperty) -join '.'
281
- }
278
+ const GET_ELEMENT_RUNTIME_ID = (0, core_1.pwsh$ /* ps1 */) `
279
+ ${0} | ForEach-Object {
280
+ $_.GetCurrentPropertyValue([AutomationElement]::RuntimeIdProperty) -join '.'
281
+ }
282
282
  `;
283
- const GET_ELEMENT_RECT = (0, core_1.pwsh$ /* ps1 */) `
284
- ${0}.Current.BoundingRectangle |
285
- Select-Object X, Y, Width, Height |
286
- ForEach-Object { $_ | ConvertTo-Json -Compress } |
287
- ForEach-Object { if ($null -ne $_) { $_.ToLower() } }
283
+ const GET_ELEMENT_RECT = (0, core_1.pwsh$ /* ps1 */) `
284
+ ${0}.Current.BoundingRectangle |
285
+ Select-Object X, Y, Width, Height |
286
+ ForEach-Object { $_ | ConvertTo-Json -Compress } |
287
+ ForEach-Object { if ($null -ne $_) { $_.ToLower() } }
288
288
  `;
289
- const GET_ELEMENT_TAG_NAME = (0, core_1.pwsh$ /* ps1 */) `
290
- ${0}.Current.ControlType.ProgrammaticName |
291
- ForEach-Object { $_.Split('.')[-1] }
289
+ const GET_ELEMENT_TAG_NAME = (0, core_1.pwsh$ /* ps1 */) `
290
+ ${0}.Current.ControlType.ProgrammaticName |
291
+ ForEach-Object { $_.Split('.')[-1] }
292
292
  `;
293
293
  const SET_FOCUS_TO_ELEMENT = (0, core_1.pwsh$ /* ps1 */) `${0}.SetFocus()`;
294
- const GET_ELEMENT_TEXT = (0, core_1.pwsh$ /* ps1 */) `
295
- try {
296
- ${0}.GetCurrentPattern([TextPattern]::Pattern).DocumentRange.GetText(-1)
297
- } catch {
298
- try {
299
- ${0}.GetCurrentPattern([SelectionPattern]::Pattern).Current.GetSelection().Current.Name
300
- } catch {
301
- ${0}.Current.Name
302
- }
303
- }
294
+ const GET_ELEMENT_TEXT = (0, core_1.pwsh$ /* ps1 */) `
295
+ try {
296
+ ${0}.GetCurrentPattern([TextPattern]::Pattern).DocumentRange.GetText(-1)
297
+ } catch {
298
+ try {
299
+ ${0}.GetCurrentPattern([SelectionPattern]::Pattern).Current.GetSelection().Current.Name
300
+ } catch {
301
+ ${0}.Current.Name
302
+ }
303
+ }
304
304
  `;
305
305
  const INVOKE_ELEMENT = (0, core_1.pwsh$ /* ps1 */) `${0}.GetCurrentPattern([InvokePattern]::Pattern).Invoke()`;
306
306
  const EXPAND_ELEMENT = (0, core_1.pwsh$ /* ps1 */) `${0}.GetCurrentPattern([ExpandCollapsePattern]::Pattern).Expand()`;
@@ -40,6 +40,12 @@ type HardwareInputStruct = {
40
40
  wParamL: unknown;
41
41
  wParamH: unknown;
42
42
  };
43
+ export declare function getVirtualScreenBounds(): {
44
+ left: number;
45
+ top: number;
46
+ width: number;
47
+ height: number;
48
+ };
43
49
  export declare function keyDown(char: string, forceUnicode?: boolean): void;
44
50
  export declare function keyUp(char: string, forceUnicode?: boolean): void;
45
51
  export declare function mouseMoveRelative(x: number, y: number, duration?: number, easingFunction?: string): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"user32.d.ts","sourceRoot":"","sources":["../../../lib/winapi/user32.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAc5C,OAAO,EACH,SAAS,EACT,aAAa,EAEb,QAAQ,EACR,UAAU,EAEb,MAAM,SAAS,CAAC;AAOjB,UAAU,KAAK;IACX,IAAI,EAAE,SAAS,CAAC;IAChB,CAAC,EAAE;QACC,EAAE,CAAC,EAAE,mBAAmB,CAAC;QACzB,EAAE,CAAC,EAAE,gBAAgB,CAAC;QACtB,EAAE,CAAC,EAAE,mBAAmB,CAAC;KAC5B,CAAA;CACJ;AAED,UAAU,aAAc,SAAQ,KAAK;IACjC,IAAI,EAAE,OAAO,SAAS,CAAC,cAAc,CAAC;IACtC,CAAC,EAAE;QACC,EAAE,EAAE;YACA,GAAG,EAAE,U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