@vicinae/api 0.16.5 → 0.16.7
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 +1 -1
- package/dist/api/ai.d.ts +4 -1
- package/dist/api/ai.js +3 -0
- package/dist/api/alert.d.ts +6 -0
- package/dist/api/alert.js +18 -11
- package/dist/api/bus.d.ts +6 -0
- package/dist/api/bus.js +2 -0
- package/dist/api/cache.d.ts +5 -0
- package/dist/api/cache.js +2 -0
- package/dist/api/clipboard.d.ts +6 -1
- package/dist/api/clipboard.js +6 -1
- package/dist/api/color.d.ts +9 -0
- package/dist/api/color.js +3 -0
- package/dist/api/components/action-pannel.d.ts +32 -20
- package/dist/api/components/action-pannel.js +3 -0
- package/dist/api/components/actions.d.ts +76 -47
- package/dist/api/components/actions.js +3 -0
- package/dist/api/components/detail.d.ts +33 -8
- package/dist/api/components/detail.js +3 -0
- package/dist/api/components/form.d.ts +33 -28
- package/dist/api/components/form.js +3 -0
- package/dist/api/components/grid.d.ts +55 -0
- package/dist/api/components/grid.js +12 -0
- package/dist/api/components/index.d.ts +1 -1
- package/dist/api/components/index.js +3 -1
- package/dist/api/components/list.d.ts +159 -16
- package/dist/api/components/list.js +5 -2
- package/dist/api/components/menu-bar.d.ts +3 -0
- package/dist/api/components/menu-bar.js +3 -0
- package/dist/api/components/metadata.d.ts +5 -1
- package/dist/api/components/metadata.js +13 -1
- package/dist/api/context/navigation-provider.d.ts +3 -0
- package/dist/api/context/navigation-provider.js +3 -0
- package/dist/api/controls.d.ts +14 -0
- package/dist/api/controls.js +14 -1
- package/dist/api/environment.d.ts +11 -0
- package/dist/api/environment.js +11 -0
- package/dist/api/file-search.d.ts +1 -0
- package/dist/api/file-search.js +1 -0
- package/dist/api/hooks/index.d.ts +0 -1
- package/dist/api/hooks/index.js +0 -1
- package/dist/api/hooks/use-imperative-form-handle.d.ts +3 -3
- package/dist/api/hooks/use-imperative-form-handle.js +2 -2
- package/dist/api/hooks/use-navigation.d.ts +6 -0
- package/dist/api/hooks/use-navigation.js +6 -0
- package/dist/api/icon.d.ts +3 -0
- package/dist/api/icon.js +3 -0
- package/dist/api/image.d.ts +11 -1
- package/dist/api/image.js +3 -0
- package/dist/api/index.d.ts +2 -2
- package/dist/api/index.js +5 -2
- package/dist/api/keyboard.d.ts +9 -0
- package/dist/api/keyboard.js +3 -0
- package/dist/api/local-storage.d.ts +8 -7
- package/dist/api/local-storage.js +17 -8
- package/dist/api/oauth.d.ts +11 -9
- package/dist/api/oauth.js +19 -0
- package/dist/api/preference.d.ts +8 -0
- package/dist/api/preference.js +8 -0
- package/dist/api/proto/wm.d.ts +11 -0
- package/dist/api/proto/wm.js +183 -19
- package/dist/api/toast.d.ts +8 -0
- package/dist/api/toast.js +8 -0
- package/dist/api/utils.d.ts +24 -2
- package/dist/api/utils.js +21 -2
- package/dist/api/window-management.d.ts +52 -4
- package/dist/api/window-management.js +34 -8
- package/package.json +3 -3
- package/types/jsx.d.ts +1 -1
- package/dist/api/hooks/use-applications.d.ts +0 -2
- package/dist/api/hooks/use-applications.js +0 -19
package/dist/api/proto/wm.js
CHANGED
|
@@ -5,42 +5,56 @@
|
|
|
5
5
|
// protoc v6.32.1
|
|
6
6
|
// source: wm.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.Response = exports.Request = exports.SetWindowBoundsResponse = exports.SetWindowBoundsRequest = exports.GetWindowsResponse = exports.GetWindowsRequest = exports.GetScreensResponse = exports.GetScreensRequest = exports.GetActiveWorkspaceWindowsResponse = exports.GetActiveWorkspaceWindowsRequest = exports.GetActiveWorkspaceResponse = exports.GetActiveWorkspaceRequest = exports.GetWorkspacesResponse = exports.GetWorkspacesRequest = exports.GetActiveWindowResponse = exports.GetActiveWindowRequest = exports.PingResponse = exports.PingRequest = exports.Workspace = exports.Screen = exports.Window = exports.protobufPackage = void 0;
|
|
8
|
+
exports.Response = exports.Request = exports.SetWindowBoundsResponse = exports.SetWindowBoundsRequest = exports.GetWindowsResponse = exports.GetWindowsRequest = exports.GetScreensResponse = exports.GetScreensRequest = exports.GetActiveWorkspaceWindowsResponse = exports.GetActiveWorkspaceWindowsRequest = exports.GetActiveWorkspaceResponse = exports.GetActiveWorkspaceRequest = exports.GetWorkspacesResponse = exports.GetWorkspacesRequest = exports.GetActiveWindowResponse = exports.GetActiveWindowRequest = exports.FocusWindowResponse = exports.FocusWindowRequest = exports.PingResponse = exports.PingRequest = exports.Workspace = exports.Screen = exports.Window = exports.protobufPackage = void 0;
|
|
9
9
|
/* eslint-disable */
|
|
10
10
|
const wire_1 = require("@bufbuild/protobuf/wire");
|
|
11
11
|
const application_1 = require("./application");
|
|
12
12
|
exports.protobufPackage = "proto.ext.wm";
|
|
13
13
|
function createBaseWindow() {
|
|
14
|
-
return {
|
|
14
|
+
return {
|
|
15
|
+
id: "",
|
|
16
|
+
title: "",
|
|
17
|
+
workspaceId: "",
|
|
18
|
+
active: false,
|
|
19
|
+
fullscreen: false,
|
|
20
|
+
x: 0,
|
|
21
|
+
y: 0,
|
|
22
|
+
width: 0,
|
|
23
|
+
height: 0,
|
|
24
|
+
app: undefined,
|
|
25
|
+
};
|
|
15
26
|
}
|
|
16
27
|
exports.Window = {
|
|
17
28
|
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
18
29
|
if (message.id !== "") {
|
|
19
30
|
writer.uint32(10).string(message.id);
|
|
20
31
|
}
|
|
32
|
+
if (message.title !== "") {
|
|
33
|
+
writer.uint32(18).string(message.title);
|
|
34
|
+
}
|
|
21
35
|
if (message.workspaceId !== "") {
|
|
22
|
-
writer.uint32(
|
|
36
|
+
writer.uint32(26).string(message.workspaceId);
|
|
23
37
|
}
|
|
24
38
|
if (message.active !== false) {
|
|
25
|
-
writer.uint32(
|
|
39
|
+
writer.uint32(32).bool(message.active);
|
|
26
40
|
}
|
|
27
41
|
if (message.fullscreen !== false) {
|
|
28
|
-
writer.uint32(
|
|
42
|
+
writer.uint32(40).bool(message.fullscreen);
|
|
29
43
|
}
|
|
30
44
|
if (message.x !== 0) {
|
|
31
|
-
writer.uint32(
|
|
45
|
+
writer.uint32(48).int32(message.x);
|
|
32
46
|
}
|
|
33
47
|
if (message.y !== 0) {
|
|
34
|
-
writer.uint32(
|
|
48
|
+
writer.uint32(56).int32(message.y);
|
|
35
49
|
}
|
|
36
50
|
if (message.width !== 0) {
|
|
37
|
-
writer.uint32(
|
|
51
|
+
writer.uint32(64).int32(message.width);
|
|
38
52
|
}
|
|
39
53
|
if (message.height !== 0) {
|
|
40
|
-
writer.uint32(
|
|
54
|
+
writer.uint32(72).int32(message.height);
|
|
41
55
|
}
|
|
42
56
|
if (message.app !== undefined) {
|
|
43
|
-
application_1.Application.encode(message.app, writer.uint32(
|
|
57
|
+
application_1.Application.encode(message.app, writer.uint32(82).fork()).join();
|
|
44
58
|
}
|
|
45
59
|
return writer;
|
|
46
60
|
},
|
|
@@ -62,53 +76,60 @@ exports.Window = {
|
|
|
62
76
|
if (tag !== 18) {
|
|
63
77
|
break;
|
|
64
78
|
}
|
|
65
|
-
message.
|
|
79
|
+
message.title = reader.string();
|
|
66
80
|
continue;
|
|
67
81
|
}
|
|
68
82
|
case 3: {
|
|
69
|
-
if (tag !==
|
|
83
|
+
if (tag !== 26) {
|
|
70
84
|
break;
|
|
71
85
|
}
|
|
72
|
-
message.
|
|
86
|
+
message.workspaceId = reader.string();
|
|
73
87
|
continue;
|
|
74
88
|
}
|
|
75
89
|
case 4: {
|
|
76
90
|
if (tag !== 32) {
|
|
77
91
|
break;
|
|
78
92
|
}
|
|
79
|
-
message.
|
|
93
|
+
message.active = reader.bool();
|
|
80
94
|
continue;
|
|
81
95
|
}
|
|
82
96
|
case 5: {
|
|
83
97
|
if (tag !== 40) {
|
|
84
98
|
break;
|
|
85
99
|
}
|
|
86
|
-
message.
|
|
100
|
+
message.fullscreen = reader.bool();
|
|
87
101
|
continue;
|
|
88
102
|
}
|
|
89
103
|
case 6: {
|
|
90
104
|
if (tag !== 48) {
|
|
91
105
|
break;
|
|
92
106
|
}
|
|
93
|
-
message.
|
|
107
|
+
message.x = reader.int32();
|
|
94
108
|
continue;
|
|
95
109
|
}
|
|
96
110
|
case 7: {
|
|
97
111
|
if (tag !== 56) {
|
|
98
112
|
break;
|
|
99
113
|
}
|
|
100
|
-
message.
|
|
114
|
+
message.y = reader.int32();
|
|
101
115
|
continue;
|
|
102
116
|
}
|
|
103
117
|
case 8: {
|
|
104
118
|
if (tag !== 64) {
|
|
105
119
|
break;
|
|
106
120
|
}
|
|
107
|
-
message.
|
|
121
|
+
message.width = reader.int32();
|
|
108
122
|
continue;
|
|
109
123
|
}
|
|
110
124
|
case 9: {
|
|
111
|
-
if (tag !==
|
|
125
|
+
if (tag !== 72) {
|
|
126
|
+
break;
|
|
127
|
+
}
|
|
128
|
+
message.height = reader.int32();
|
|
129
|
+
continue;
|
|
130
|
+
}
|
|
131
|
+
case 10: {
|
|
132
|
+
if (tag !== 82) {
|
|
112
133
|
break;
|
|
113
134
|
}
|
|
114
135
|
message.app = application_1.Application.decode(reader, reader.uint32());
|
|
@@ -125,6 +146,7 @@ exports.Window = {
|
|
|
125
146
|
fromJSON(object) {
|
|
126
147
|
return {
|
|
127
148
|
id: isSet(object.id) ? globalThis.String(object.id) : "",
|
|
149
|
+
title: isSet(object.title) ? globalThis.String(object.title) : "",
|
|
128
150
|
workspaceId: isSet(object.workspaceId) ? globalThis.String(object.workspaceId) : "",
|
|
129
151
|
active: isSet(object.active) ? globalThis.Boolean(object.active) : false,
|
|
130
152
|
fullscreen: isSet(object.fullscreen) ? globalThis.Boolean(object.fullscreen) : false,
|
|
@@ -140,6 +162,9 @@ exports.Window = {
|
|
|
140
162
|
if (message.id !== "") {
|
|
141
163
|
obj.id = message.id;
|
|
142
164
|
}
|
|
165
|
+
if (message.title !== "") {
|
|
166
|
+
obj.title = message.title;
|
|
167
|
+
}
|
|
143
168
|
if (message.workspaceId !== "") {
|
|
144
169
|
obj.workspaceId = message.workspaceId;
|
|
145
170
|
}
|
|
@@ -172,6 +197,7 @@ exports.Window = {
|
|
|
172
197
|
fromPartial(object) {
|
|
173
198
|
const message = createBaseWindow();
|
|
174
199
|
message.id = object.id ?? "";
|
|
200
|
+
message.title = object.title ?? "";
|
|
175
201
|
message.workspaceId = object.workspaceId ?? "";
|
|
176
202
|
message.active = object.active ?? false;
|
|
177
203
|
message.fullscreen = object.fullscreen ?? false;
|
|
@@ -542,6 +568,108 @@ exports.PingResponse = {
|
|
|
542
568
|
return message;
|
|
543
569
|
},
|
|
544
570
|
};
|
|
571
|
+
function createBaseFocusWindowRequest() {
|
|
572
|
+
return { id: "" };
|
|
573
|
+
}
|
|
574
|
+
exports.FocusWindowRequest = {
|
|
575
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
576
|
+
if (message.id !== "") {
|
|
577
|
+
writer.uint32(10).string(message.id);
|
|
578
|
+
}
|
|
579
|
+
return writer;
|
|
580
|
+
},
|
|
581
|
+
decode(input, length) {
|
|
582
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
583
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
584
|
+
const message = createBaseFocusWindowRequest();
|
|
585
|
+
while (reader.pos < end) {
|
|
586
|
+
const tag = reader.uint32();
|
|
587
|
+
switch (tag >>> 3) {
|
|
588
|
+
case 1: {
|
|
589
|
+
if (tag !== 10) {
|
|
590
|
+
break;
|
|
591
|
+
}
|
|
592
|
+
message.id = reader.string();
|
|
593
|
+
continue;
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
597
|
+
break;
|
|
598
|
+
}
|
|
599
|
+
reader.skip(tag & 7);
|
|
600
|
+
}
|
|
601
|
+
return message;
|
|
602
|
+
},
|
|
603
|
+
fromJSON(object) {
|
|
604
|
+
return { id: isSet(object.id) ? globalThis.String(object.id) : "" };
|
|
605
|
+
},
|
|
606
|
+
toJSON(message) {
|
|
607
|
+
const obj = {};
|
|
608
|
+
if (message.id !== "") {
|
|
609
|
+
obj.id = message.id;
|
|
610
|
+
}
|
|
611
|
+
return obj;
|
|
612
|
+
},
|
|
613
|
+
create(base) {
|
|
614
|
+
return exports.FocusWindowRequest.fromPartial(base ?? {});
|
|
615
|
+
},
|
|
616
|
+
fromPartial(object) {
|
|
617
|
+
const message = createBaseFocusWindowRequest();
|
|
618
|
+
message.id = object.id ?? "";
|
|
619
|
+
return message;
|
|
620
|
+
},
|
|
621
|
+
};
|
|
622
|
+
function createBaseFocusWindowResponse() {
|
|
623
|
+
return { ok: false };
|
|
624
|
+
}
|
|
625
|
+
exports.FocusWindowResponse = {
|
|
626
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
627
|
+
if (message.ok !== false) {
|
|
628
|
+
writer.uint32(8).bool(message.ok);
|
|
629
|
+
}
|
|
630
|
+
return writer;
|
|
631
|
+
},
|
|
632
|
+
decode(input, length) {
|
|
633
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
634
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
635
|
+
const message = createBaseFocusWindowResponse();
|
|
636
|
+
while (reader.pos < end) {
|
|
637
|
+
const tag = reader.uint32();
|
|
638
|
+
switch (tag >>> 3) {
|
|
639
|
+
case 1: {
|
|
640
|
+
if (tag !== 8) {
|
|
641
|
+
break;
|
|
642
|
+
}
|
|
643
|
+
message.ok = reader.bool();
|
|
644
|
+
continue;
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
648
|
+
break;
|
|
649
|
+
}
|
|
650
|
+
reader.skip(tag & 7);
|
|
651
|
+
}
|
|
652
|
+
return message;
|
|
653
|
+
},
|
|
654
|
+
fromJSON(object) {
|
|
655
|
+
return { ok: isSet(object.ok) ? globalThis.Boolean(object.ok) : false };
|
|
656
|
+
},
|
|
657
|
+
toJSON(message) {
|
|
658
|
+
const obj = {};
|
|
659
|
+
if (message.ok !== false) {
|
|
660
|
+
obj.ok = message.ok;
|
|
661
|
+
}
|
|
662
|
+
return obj;
|
|
663
|
+
},
|
|
664
|
+
create(base) {
|
|
665
|
+
return exports.FocusWindowResponse.fromPartial(base ?? {});
|
|
666
|
+
},
|
|
667
|
+
fromPartial(object) {
|
|
668
|
+
const message = createBaseFocusWindowResponse();
|
|
669
|
+
message.ok = object.ok ?? false;
|
|
670
|
+
return message;
|
|
671
|
+
},
|
|
672
|
+
};
|
|
545
673
|
function createBaseGetActiveWindowRequest() {
|
|
546
674
|
return {};
|
|
547
675
|
}
|
|
@@ -1212,6 +1340,7 @@ function createBaseRequest() {
|
|
|
1212
1340
|
getScreens: undefined,
|
|
1213
1341
|
getWorkspaces: undefined,
|
|
1214
1342
|
setWindowBounds: undefined,
|
|
1343
|
+
focusWindow: undefined,
|
|
1215
1344
|
};
|
|
1216
1345
|
}
|
|
1217
1346
|
exports.Request = {
|
|
@@ -1237,6 +1366,9 @@ exports.Request = {
|
|
|
1237
1366
|
if (message.setWindowBounds !== undefined) {
|
|
1238
1367
|
exports.SetWindowBoundsRequest.encode(message.setWindowBounds, writer.uint32(58).fork()).join();
|
|
1239
1368
|
}
|
|
1369
|
+
if (message.focusWindow !== undefined) {
|
|
1370
|
+
exports.FocusWindowRequest.encode(message.focusWindow, writer.uint32(66).fork()).join();
|
|
1371
|
+
}
|
|
1240
1372
|
return writer;
|
|
1241
1373
|
},
|
|
1242
1374
|
decode(input, length) {
|
|
@@ -1295,6 +1427,13 @@ exports.Request = {
|
|
|
1295
1427
|
message.setWindowBounds = exports.SetWindowBoundsRequest.decode(reader, reader.uint32());
|
|
1296
1428
|
continue;
|
|
1297
1429
|
}
|
|
1430
|
+
case 8: {
|
|
1431
|
+
if (tag !== 66) {
|
|
1432
|
+
break;
|
|
1433
|
+
}
|
|
1434
|
+
message.focusWindow = exports.FocusWindowRequest.decode(reader, reader.uint32());
|
|
1435
|
+
continue;
|
|
1436
|
+
}
|
|
1298
1437
|
}
|
|
1299
1438
|
if ((tag & 7) === 4 || tag === 0) {
|
|
1300
1439
|
break;
|
|
@@ -1318,6 +1457,7 @@ exports.Request = {
|
|
|
1318
1457
|
setWindowBounds: isSet(object.setWindowBounds)
|
|
1319
1458
|
? exports.SetWindowBoundsRequest.fromJSON(object.setWindowBounds)
|
|
1320
1459
|
: undefined,
|
|
1460
|
+
focusWindow: isSet(object.focusWindow) ? exports.FocusWindowRequest.fromJSON(object.focusWindow) : undefined,
|
|
1321
1461
|
};
|
|
1322
1462
|
},
|
|
1323
1463
|
toJSON(message) {
|
|
@@ -1343,6 +1483,9 @@ exports.Request = {
|
|
|
1343
1483
|
if (message.setWindowBounds !== undefined) {
|
|
1344
1484
|
obj.setWindowBounds = exports.SetWindowBoundsRequest.toJSON(message.setWindowBounds);
|
|
1345
1485
|
}
|
|
1486
|
+
if (message.focusWindow !== undefined) {
|
|
1487
|
+
obj.focusWindow = exports.FocusWindowRequest.toJSON(message.focusWindow);
|
|
1488
|
+
}
|
|
1346
1489
|
return obj;
|
|
1347
1490
|
},
|
|
1348
1491
|
create(base) {
|
|
@@ -1371,6 +1514,9 @@ exports.Request = {
|
|
|
1371
1514
|
message.setWindowBounds = (object.setWindowBounds !== undefined && object.setWindowBounds !== null)
|
|
1372
1515
|
? exports.SetWindowBoundsRequest.fromPartial(object.setWindowBounds)
|
|
1373
1516
|
: undefined;
|
|
1517
|
+
message.focusWindow = (object.focusWindow !== undefined && object.focusWindow !== null)
|
|
1518
|
+
? exports.FocusWindowRequest.fromPartial(object.focusWindow)
|
|
1519
|
+
: undefined;
|
|
1374
1520
|
return message;
|
|
1375
1521
|
},
|
|
1376
1522
|
};
|
|
@@ -1383,6 +1529,7 @@ function createBaseResponse() {
|
|
|
1383
1529
|
getScreens: undefined,
|
|
1384
1530
|
getWorkspaces: undefined,
|
|
1385
1531
|
setWindowBounds: undefined,
|
|
1532
|
+
focusWindow: undefined,
|
|
1386
1533
|
};
|
|
1387
1534
|
}
|
|
1388
1535
|
exports.Response = {
|
|
@@ -1408,6 +1555,9 @@ exports.Response = {
|
|
|
1408
1555
|
if (message.setWindowBounds !== undefined) {
|
|
1409
1556
|
exports.SetWindowBoundsResponse.encode(message.setWindowBounds, writer.uint32(58).fork()).join();
|
|
1410
1557
|
}
|
|
1558
|
+
if (message.focusWindow !== undefined) {
|
|
1559
|
+
exports.FocusWindowResponse.encode(message.focusWindow, writer.uint32(66).fork()).join();
|
|
1560
|
+
}
|
|
1411
1561
|
return writer;
|
|
1412
1562
|
},
|
|
1413
1563
|
decode(input, length) {
|
|
@@ -1466,6 +1616,13 @@ exports.Response = {
|
|
|
1466
1616
|
message.setWindowBounds = exports.SetWindowBoundsResponse.decode(reader, reader.uint32());
|
|
1467
1617
|
continue;
|
|
1468
1618
|
}
|
|
1619
|
+
case 8: {
|
|
1620
|
+
if (tag !== 66) {
|
|
1621
|
+
break;
|
|
1622
|
+
}
|
|
1623
|
+
message.focusWindow = exports.FocusWindowResponse.decode(reader, reader.uint32());
|
|
1624
|
+
continue;
|
|
1625
|
+
}
|
|
1469
1626
|
}
|
|
1470
1627
|
if ((tag & 7) === 4 || tag === 0) {
|
|
1471
1628
|
break;
|
|
@@ -1489,6 +1646,7 @@ exports.Response = {
|
|
|
1489
1646
|
setWindowBounds: isSet(object.setWindowBounds)
|
|
1490
1647
|
? exports.SetWindowBoundsResponse.fromJSON(object.setWindowBounds)
|
|
1491
1648
|
: undefined,
|
|
1649
|
+
focusWindow: isSet(object.focusWindow) ? exports.FocusWindowResponse.fromJSON(object.focusWindow) : undefined,
|
|
1492
1650
|
};
|
|
1493
1651
|
},
|
|
1494
1652
|
toJSON(message) {
|
|
@@ -1514,6 +1672,9 @@ exports.Response = {
|
|
|
1514
1672
|
if (message.setWindowBounds !== undefined) {
|
|
1515
1673
|
obj.setWindowBounds = exports.SetWindowBoundsResponse.toJSON(message.setWindowBounds);
|
|
1516
1674
|
}
|
|
1675
|
+
if (message.focusWindow !== undefined) {
|
|
1676
|
+
obj.focusWindow = exports.FocusWindowResponse.toJSON(message.focusWindow);
|
|
1677
|
+
}
|
|
1517
1678
|
return obj;
|
|
1518
1679
|
},
|
|
1519
1680
|
create(base) {
|
|
@@ -1542,6 +1703,9 @@ exports.Response = {
|
|
|
1542
1703
|
message.setWindowBounds = (object.setWindowBounds !== undefined && object.setWindowBounds !== null)
|
|
1543
1704
|
? exports.SetWindowBoundsResponse.fromPartial(object.setWindowBounds)
|
|
1544
1705
|
: undefined;
|
|
1706
|
+
message.focusWindow = (object.focusWindow !== undefined && object.focusWindow !== null)
|
|
1707
|
+
? exports.FocusWindowResponse.fromPartial(object.focusWindow)
|
|
1708
|
+
: undefined;
|
|
1545
1709
|
return message;
|
|
1546
1710
|
},
|
|
1547
1711
|
};
|
package/dist/api/toast.d.ts
CHANGED
|
@@ -16,6 +16,8 @@ import { Keyboard } from "./keyboard";
|
|
|
16
16
|
* toast.title = "Uploaded image";
|
|
17
17
|
* };
|
|
18
18
|
* ```
|
|
19
|
+
*
|
|
20
|
+
* @category Toast
|
|
19
21
|
*/
|
|
20
22
|
export declare class Toast {
|
|
21
23
|
private options;
|
|
@@ -65,6 +67,9 @@ export declare class Toast {
|
|
|
65
67
|
*/
|
|
66
68
|
hide(): Promise<void>;
|
|
67
69
|
}
|
|
70
|
+
/**
|
|
71
|
+
* @category Toast
|
|
72
|
+
*/
|
|
68
73
|
export declare namespace Toast {
|
|
69
74
|
/**
|
|
70
75
|
* The options to create a {@link Toast}.
|
|
@@ -156,4 +161,7 @@ export declare interface ToastOptions extends Toast.Options {
|
|
|
156
161
|
* @deprecated Use {@link Toast.Style} instead
|
|
157
162
|
*/
|
|
158
163
|
export declare const ToastStyle: typeof Toast.Style;
|
|
164
|
+
/**
|
|
165
|
+
* @category Toast
|
|
166
|
+
*/
|
|
159
167
|
export declare const showToast: (init: Toast.Style | Toast.Options, title?: string, message?: string) => Promise<Toast>;
|
package/dist/api/toast.js
CHANGED
|
@@ -54,6 +54,8 @@ const ui = __importStar(require("./proto/ui"));
|
|
|
54
54
|
* toast.title = "Uploaded image";
|
|
55
55
|
* };
|
|
56
56
|
* ```
|
|
57
|
+
*
|
|
58
|
+
* @category Toast
|
|
57
59
|
*/
|
|
58
60
|
class Toast {
|
|
59
61
|
options;
|
|
@@ -184,6 +186,9 @@ class Toast {
|
|
|
184
186
|
}
|
|
185
187
|
}
|
|
186
188
|
exports.Toast = Toast;
|
|
189
|
+
/**
|
|
190
|
+
* @category Toast
|
|
191
|
+
*/
|
|
187
192
|
(function (Toast) {
|
|
188
193
|
/**
|
|
189
194
|
* Defines the visual style of the Toast.
|
|
@@ -200,6 +205,9 @@ exports.Toast = Toast;
|
|
|
200
205
|
Style["Animated"] = "animated";
|
|
201
206
|
})(Style = Toast.Style || (Toast.Style = {}));
|
|
202
207
|
})(Toast || (exports.Toast = Toast = {}));
|
|
208
|
+
/**
|
|
209
|
+
* @category Toast
|
|
210
|
+
*/
|
|
203
211
|
const showToast = async (init, title = "", message) => {
|
|
204
212
|
const toast = typeof init === "string"
|
|
205
213
|
? new Toast({ style: init, message, title })
|
package/dist/api/utils.d.ts
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
import { PathLike } from "fs";
|
|
2
|
-
import { Application } from "./proto/application";
|
|
1
|
+
import type { PathLike } from "node:fs";
|
|
2
|
+
import type { Application } from "./proto/application";
|
|
3
|
+
/**
|
|
4
|
+
@ignore - we should probably move this to raycast compat, I don't think we want that.
|
|
5
|
+
*/
|
|
3
6
|
export declare const trash: (path: PathLike | PathLike[]) => Promise<void>;
|
|
4
7
|
/**
|
|
5
8
|
* Additional options that can be passed in order to tweak the behavior of the terminal window.
|
|
6
9
|
* Note that most options are best-effort, which means that they may or may not work depending on
|
|
7
10
|
* the default terminal emulator that is available.
|
|
8
11
|
* On Linux, Vicinae honors the xdg-terminal-exec specification: https://gitlab.freedesktop.org/terminal-wg/specifications/-/merge_requests/3/diffs
|
|
12
|
+
*
|
|
13
|
+
* @category System
|
|
9
14
|
*/
|
|
10
15
|
export type RunInTerminalOptions = {
|
|
11
16
|
/**
|
|
@@ -42,11 +47,28 @@ export type RunInTerminalOptions = {
|
|
|
42
47
|
* // or, inside a shell:
|
|
43
48
|
* await runInTerminal(['/bin/bash', 'echo "dis is my home: $HOME"'], { hold: true });
|
|
44
49
|
* ```
|
|
50
|
+
*
|
|
51
|
+
* @category System
|
|
45
52
|
*/
|
|
46
53
|
export declare const runInTerminal: (args: string[], options?: RunInTerminalOptions) => Promise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* @category System
|
|
56
|
+
*/
|
|
47
57
|
export declare const open: (target: string, app?: Application | string) => Promise<void>;
|
|
58
|
+
/**
|
|
59
|
+
* @category System
|
|
60
|
+
*/
|
|
48
61
|
export declare const getFrontmostApplication: () => Promise<Application>;
|
|
62
|
+
/**
|
|
63
|
+
* @category System
|
|
64
|
+
*/
|
|
49
65
|
export declare const getApplications: (target?: string) => Promise<Application[]>;
|
|
66
|
+
/**
|
|
67
|
+
* @category System
|
|
68
|
+
*/
|
|
50
69
|
export declare const getDefaultApplication: (path: string) => Promise<Application>;
|
|
70
|
+
/**
|
|
71
|
+
* @category System
|
|
72
|
+
*/
|
|
51
73
|
export declare const showInFileBrowser: (path: PathLike) => Promise<void>;
|
|
52
74
|
export { Application } from "./proto/application";
|
package/dist/api/utils.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Application = exports.showInFileBrowser = exports.getDefaultApplication = exports.getApplications = exports.getFrontmostApplication = exports.open = exports.runInTerminal = exports.trash = void 0;
|
|
4
|
-
const promises_1 = require("fs/promises");
|
|
4
|
+
const promises_1 = require("node:fs/promises");
|
|
5
5
|
const bus_1 = require("./bus");
|
|
6
6
|
const window_management_1 = require("./window-management");
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
@ignore - we should probably move this to raycast compat, I don't think we want that.
|
|
9
|
+
*/
|
|
8
10
|
const trash = async (path) => {
|
|
9
11
|
const targets = Array.isArray(path) ? path : [path];
|
|
10
12
|
const promises = targets.map((p) => (0, promises_1.rm)(p, { recursive: true }));
|
|
@@ -23,6 +25,8 @@ exports.trash = trash;
|
|
|
23
25
|
* // or, inside a shell:
|
|
24
26
|
* await runInTerminal(['/bin/bash', 'echo "dis is my home: $HOME"'], { hold: true });
|
|
25
27
|
* ```
|
|
28
|
+
*
|
|
29
|
+
* @category System
|
|
26
30
|
*/
|
|
27
31
|
const runInTerminal = async (args, options = {}) => {
|
|
28
32
|
const { hold = false, appId, title } = options;
|
|
@@ -34,6 +38,9 @@ const runInTerminal = async (args, options = {}) => {
|
|
|
34
38
|
});
|
|
35
39
|
};
|
|
36
40
|
exports.runInTerminal = runInTerminal;
|
|
41
|
+
/**
|
|
42
|
+
* @category System
|
|
43
|
+
*/
|
|
37
44
|
const open = async (target, app) => {
|
|
38
45
|
let appId;
|
|
39
46
|
if (app) {
|
|
@@ -50,6 +57,9 @@ const open = async (target, app) => {
|
|
|
50
57
|
});
|
|
51
58
|
};
|
|
52
59
|
exports.open = open;
|
|
60
|
+
/**
|
|
61
|
+
* @category System
|
|
62
|
+
*/
|
|
53
63
|
const getFrontmostApplication = async () => {
|
|
54
64
|
const { application } = await window_management_1.WindowManagement.getActiveWindow();
|
|
55
65
|
if (!application) {
|
|
@@ -58,11 +68,17 @@ const getFrontmostApplication = async () => {
|
|
|
58
68
|
return application;
|
|
59
69
|
};
|
|
60
70
|
exports.getFrontmostApplication = getFrontmostApplication;
|
|
71
|
+
/**
|
|
72
|
+
* @category System
|
|
73
|
+
*/
|
|
61
74
|
const getApplications = async (target) => {
|
|
62
75
|
const res = await bus_1.bus.turboRequest("app.list", { target });
|
|
63
76
|
return res.unwrap().apps;
|
|
64
77
|
};
|
|
65
78
|
exports.getApplications = getApplications;
|
|
79
|
+
/**
|
|
80
|
+
* @category System
|
|
81
|
+
*/
|
|
66
82
|
const getDefaultApplication = async (path) => {
|
|
67
83
|
const res = await bus_1.bus.turboRequest("app.getDefault", { target: path });
|
|
68
84
|
const app = res.unwrap().app;
|
|
@@ -71,6 +87,9 @@ const getDefaultApplication = async (path) => {
|
|
|
71
87
|
return app;
|
|
72
88
|
};
|
|
73
89
|
exports.getDefaultApplication = getDefaultApplication;
|
|
90
|
+
/**
|
|
91
|
+
* @category System
|
|
92
|
+
*/
|
|
74
93
|
const showInFileBrowser = async (path) => {
|
|
75
94
|
const fileBrowser = await (0, exports.getDefaultApplication)("inode/directory"); // FIXME: we may want something more robust
|
|
76
95
|
await (0, exports.open)(path.toString(), fileBrowser);
|
|
@@ -4,21 +4,36 @@ import * as wm from "./proto/wm";
|
|
|
4
4
|
* Access Vicinae's window management features.
|
|
5
5
|
*
|
|
6
6
|
* @remarks
|
|
7
|
-
* Window management
|
|
8
|
-
*
|
|
7
|
+
* Window management support varies a lot depending on the environment.
|
|
8
|
+
* Right now it is pretty well supported on almost all linux desktop environments except KDE.
|
|
9
9
|
*
|
|
10
10
|
* @example
|
|
11
11
|
* ```typescript
|
|
12
12
|
* import { WindowManagement } from '@vicinae/api';
|
|
13
13
|
*
|
|
14
|
-
* const
|
|
14
|
+
* const wins = await WindowManagement.getWindows();
|
|
15
|
+
* const browserWindow = wins.find(w => w.application?.name?.includes('firefox'));
|
|
16
|
+
*
|
|
17
|
+
* if (browserWindow) {
|
|
18
|
+
* await browserWindow.focus();
|
|
19
|
+
* }
|
|
15
20
|
* ```
|
|
16
21
|
*
|
|
22
|
+
* @category Window Management
|
|
17
23
|
* @public
|
|
18
24
|
*/
|
|
19
25
|
export declare namespace WindowManagement {
|
|
26
|
+
/**
|
|
27
|
+
* A window as defined by the windowing system in use.
|
|
28
|
+
* A window can be optionally tied to an application or a workspace.
|
|
29
|
+
*/
|
|
20
30
|
type Window = {
|
|
21
31
|
id: string;
|
|
32
|
+
title: string;
|
|
33
|
+
/**
|
|
34
|
+
* Whether this window is currently active.
|
|
35
|
+
* This is usually the window that currently owns focus.
|
|
36
|
+
*/
|
|
22
37
|
active: boolean;
|
|
23
38
|
bounds: {
|
|
24
39
|
position: {
|
|
@@ -30,8 +45,20 @@ export declare namespace WindowManagement {
|
|
|
30
45
|
width: number;
|
|
31
46
|
};
|
|
32
47
|
};
|
|
48
|
+
/**
|
|
49
|
+
* The ID of the workspace this window belongs to, if applicable in the context
|
|
50
|
+
* of the current window manager.
|
|
51
|
+
*/
|
|
33
52
|
workspaceId?: string;
|
|
53
|
+
/**
|
|
54
|
+
* The application this window belongs to, if any.
|
|
55
|
+
*/
|
|
34
56
|
application?: Application;
|
|
57
|
+
/**
|
|
58
|
+
* Request that the window manager focuses this window.
|
|
59
|
+
* @see {@link focusWindow}
|
|
60
|
+
*/
|
|
61
|
+
focus: () => Promise<boolean>;
|
|
35
62
|
};
|
|
36
63
|
type Workspace = {
|
|
37
64
|
id: string;
|
|
@@ -43,6 +70,13 @@ export declare namespace WindowManagement {
|
|
|
43
70
|
* A screen, physical or virtual, attached to this computer.
|
|
44
71
|
*/
|
|
45
72
|
type Screen = {
|
|
73
|
+
/**
|
|
74
|
+
* Name assigned by the windowing system to that screen.
|
|
75
|
+
*
|
|
76
|
+
* In Wayland environments for instance, the name is set to something like `DP-1`, `DP-2`, `e-DP1`...
|
|
77
|
+
*
|
|
78
|
+
* @remarks The name is not guaranteed to remain stable but is usually stable enough to uniquely identify a screen.
|
|
79
|
+
*/
|
|
46
80
|
name: string;
|
|
47
81
|
/**
|
|
48
82
|
* Name of the screen's manufacturer.
|
|
@@ -64,8 +98,22 @@ export declare namespace WindowManagement {
|
|
|
64
98
|
};
|
|
65
99
|
};
|
|
66
100
|
};
|
|
67
|
-
function ping(): Promise<boolean>;
|
|
68
101
|
function getWindows(options?: wm.GetWindowsRequest): Promise<WindowManagement.Window[]>;
|
|
102
|
+
/**
|
|
103
|
+
* Focus `window`.
|
|
104
|
+
*
|
|
105
|
+
* @remarks
|
|
106
|
+
* Window objects have a {@link Window.focus} method that can be used to achieve the same thing on a specific window directly.
|
|
107
|
+
*
|
|
108
|
+
* @param window - the window to focus. You may want to make sure this window still exists when you request focus.
|
|
109
|
+
*
|
|
110
|
+
* @return `true` if the window was focused, `false` otherwise.
|
|
111
|
+
* A window may not have been focused because it doesn't accept focus (e.g some layer shell surfaces)
|
|
112
|
+
* or simply because it doesn't exist anymore.
|
|
113
|
+
*
|
|
114
|
+
* @see {@link Window.focus}
|
|
115
|
+
*/
|
|
116
|
+
function focusWindow(window: Window): Promise<boolean>;
|
|
69
117
|
/**
|
|
70
118
|
* Return the list of screens (physical and virtual) currently attached to the computer.
|
|
71
119
|
*/
|