@vicinae/api 0.18.3 → 0.19.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.
@@ -80,6 +80,12 @@ export declare namespace Action {
80
80
  quicklink: Quicklink;
81
81
  };
82
82
  }
83
+ /**
84
+ * @ignore - not implemented
85
+ */
86
+ namespace PickDate {
87
+ type Props = BaseActionProps & {};
88
+ }
83
89
  }
84
90
  export type Quicklink = {
85
91
  name?: string;
@@ -99,6 +105,9 @@ export declare const Action: React.FC<ActionProps> & {
99
105
  OpenInBrowser: React.FC<Action.OpenInBrowser.Props>;
100
106
  ShowInFinder: React.FC<Action.ShowInFinderProps.Props>;
101
107
  CreateQuicklink: React.FC<Action.CreateQuicklink.Props>;
108
+ PickDate: React.FC<BaseActionProps> & {
109
+ isFullDay: () => false;
110
+ };
102
111
  Style: {
103
112
  Regular: "regular";
104
113
  Destructive: "destructive";
@@ -68,6 +68,10 @@ const SubmitForm = ({ title = "Submit", ...props }) => {
68
68
  };
69
69
  return (0, jsx_runtime_1.jsx)("action", { ...nativeProps });
70
70
  };
71
+ // TODO: implement date picker action. This probably requires a full rework of the action panel.
72
+ const PickDate = () => {
73
+ return null;
74
+ };
71
75
  const CreateQuicklink = ({ title = "Create Quicklink", quicklink, ...props }) => {
72
76
  const stableIdRef = (0, react_1.useRef)(undefined);
73
77
  if (!stableIdRef.current) {
@@ -103,6 +107,10 @@ exports.Action = Object.assign(ActionRoot, {
103
107
  OpenInBrowser,
104
108
  ShowInFinder,
105
109
  CreateQuicklink,
110
+ PickDate: Object.assign(PickDate, {
111
+ // TODO: to implement too
112
+ isFullDay: () => false
113
+ }),
106
114
  Style: {
107
115
  Regular: "regular",
108
116
  Destructive: "destructive",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vicinae/api",
3
- "version": "0.18.3",
3
+ "version": "0.19.0",
4
4
  "description": "TypeScript SDK to build Vicinae extensions",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",
@@ -1,103 +0,0 @@
1
- import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
- export declare const protobufPackage = "proto.ext.daemon";
3
- export interface UrlResponse {
4
- /** empty string if no error */
5
- error: string;
6
- }
7
- export interface UrlRequest {
8
- url: string;
9
- }
10
- export interface PingRequest {
11
- }
12
- export interface PingResponse {
13
- }
14
- export interface DmenuRequest {
15
- rawContent: string;
16
- navigationTitle: string;
17
- placeholder: string;
18
- sectionTitle: string;
19
- noSection: boolean;
20
- noQuickLook: boolean;
21
- noIcon: boolean;
22
- noMetadata: boolean;
23
- query: string;
24
- width?: number | undefined;
25
- height?: number | undefined;
26
- noFooter: boolean;
27
- }
28
- export interface LaunchAppRequest {
29
- appId: string;
30
- args: string[];
31
- newInstance: boolean;
32
- }
33
- export interface LaunchAppResponse {
34
- error: string;
35
- focusedWindowTitle: string;
36
- }
37
- export interface ListAppsRequest {
38
- withActions: boolean;
39
- }
40
- export interface AppInfo {
41
- id: string;
42
- name: string;
43
- hidden: boolean;
44
- path: string;
45
- description: string;
46
- program: string;
47
- isTerminalApp: boolean;
48
- keywords: string[];
49
- iconUrl: string;
50
- isAction: boolean;
51
- }
52
- export interface ListAppsResponse {
53
- apps: AppInfo[];
54
- }
55
- export interface DmenuResponse {
56
- output: string;
57
- }
58
- export interface Request {
59
- ping?: PingRequest | undefined;
60
- url?: UrlRequest | undefined;
61
- dmenu?: DmenuRequest | undefined;
62
- launchApp?: LaunchAppRequest | undefined;
63
- listApps?: ListAppsRequest | undefined;
64
- }
65
- export interface Response {
66
- ping?: PingResponse | undefined;
67
- url?: UrlResponse | undefined;
68
- dmenu?: DmenuResponse | undefined;
69
- launchApp?: LaunchAppResponse | undefined;
70
- listApps?: ListAppsResponse | undefined;
71
- }
72
- export declare const UrlResponse: MessageFns<UrlResponse>;
73
- export declare const UrlRequest: MessageFns<UrlRequest>;
74
- export declare const PingRequest: MessageFns<PingRequest>;
75
- export declare const PingResponse: MessageFns<PingResponse>;
76
- export declare const DmenuRequest: MessageFns<DmenuRequest>;
77
- export declare const LaunchAppRequest: MessageFns<LaunchAppRequest>;
78
- export declare const LaunchAppResponse: MessageFns<LaunchAppResponse>;
79
- export declare const ListAppsRequest: MessageFns<ListAppsRequest>;
80
- export declare const AppInfo: MessageFns<AppInfo>;
81
- export declare const ListAppsResponse: MessageFns<ListAppsResponse>;
82
- export declare const DmenuResponse: MessageFns<DmenuResponse>;
83
- export declare const Request: MessageFns<Request>;
84
- export declare const Response: MessageFns<Response>;
85
- type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
86
- export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
87
- [K in keyof T]?: DeepPartial<T[K]>;
88
- } : Partial<T>;
89
- type KeysOfUnion<T> = T extends T ? keyof T : never;
90
- export type Exact<P, I extends P> = P extends Builtin ? P : P & {
91
- [K in keyof P]: Exact<P[K], I[K]>;
92
- } & {
93
- [K in Exclude<keyof I, KeysOfUnion<P>>]: never;
94
- };
95
- export interface MessageFns<T> {
96
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
97
- decode(input: BinaryReader | Uint8Array, length?: number): T;
98
- fromJSON(object: any): T;
99
- toJSON(message: T): unknown;
100
- create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
101
- fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
102
- }
103
- export {};
@@ -1,1166 +0,0 @@
1
- "use strict";
2
- // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
- // versions:
4
- // protoc-gen-ts_proto v2.7.7
5
- // protoc v6.33.1
6
- // source: daemon.proto
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.Response = exports.Request = exports.DmenuResponse = exports.ListAppsResponse = exports.AppInfo = exports.ListAppsRequest = exports.LaunchAppResponse = exports.LaunchAppRequest = exports.DmenuRequest = exports.PingResponse = exports.PingRequest = exports.UrlRequest = exports.UrlResponse = exports.protobufPackage = void 0;
9
- /* eslint-disable */
10
- const wire_1 = require("@bufbuild/protobuf/wire");
11
- exports.protobufPackage = "proto.ext.daemon";
12
- function createBaseUrlResponse() {
13
- return { error: "" };
14
- }
15
- exports.UrlResponse = {
16
- encode(message, writer = new wire_1.BinaryWriter()) {
17
- if (message.error !== "") {
18
- writer.uint32(10).string(message.error);
19
- }
20
- return writer;
21
- },
22
- decode(input, length) {
23
- const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
24
- const end = length === undefined ? reader.len : reader.pos + length;
25
- const message = createBaseUrlResponse();
26
- while (reader.pos < end) {
27
- const tag = reader.uint32();
28
- switch (tag >>> 3) {
29
- case 1: {
30
- if (tag !== 10) {
31
- break;
32
- }
33
- message.error = reader.string();
34
- continue;
35
- }
36
- }
37
- if ((tag & 7) === 4 || tag === 0) {
38
- break;
39
- }
40
- reader.skip(tag & 7);
41
- }
42
- return message;
43
- },
44
- fromJSON(object) {
45
- return { error: isSet(object.error) ? globalThis.String(object.error) : "" };
46
- },
47
- toJSON(message) {
48
- const obj = {};
49
- if (message.error !== "") {
50
- obj.error = message.error;
51
- }
52
- return obj;
53
- },
54
- create(base) {
55
- return exports.UrlResponse.fromPartial(base ?? {});
56
- },
57
- fromPartial(object) {
58
- const message = createBaseUrlResponse();
59
- message.error = object.error ?? "";
60
- return message;
61
- },
62
- };
63
- function createBaseUrlRequest() {
64
- return { url: "" };
65
- }
66
- exports.UrlRequest = {
67
- encode(message, writer = new wire_1.BinaryWriter()) {
68
- if (message.url !== "") {
69
- writer.uint32(10).string(message.url);
70
- }
71
- return writer;
72
- },
73
- decode(input, length) {
74
- const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
75
- const end = length === undefined ? reader.len : reader.pos + length;
76
- const message = createBaseUrlRequest();
77
- while (reader.pos < end) {
78
- const tag = reader.uint32();
79
- switch (tag >>> 3) {
80
- case 1: {
81
- if (tag !== 10) {
82
- break;
83
- }
84
- message.url = reader.string();
85
- continue;
86
- }
87
- }
88
- if ((tag & 7) === 4 || tag === 0) {
89
- break;
90
- }
91
- reader.skip(tag & 7);
92
- }
93
- return message;
94
- },
95
- fromJSON(object) {
96
- return { url: isSet(object.url) ? globalThis.String(object.url) : "" };
97
- },
98
- toJSON(message) {
99
- const obj = {};
100
- if (message.url !== "") {
101
- obj.url = message.url;
102
- }
103
- return obj;
104
- },
105
- create(base) {
106
- return exports.UrlRequest.fromPartial(base ?? {});
107
- },
108
- fromPartial(object) {
109
- const message = createBaseUrlRequest();
110
- message.url = object.url ?? "";
111
- return message;
112
- },
113
- };
114
- function createBasePingRequest() {
115
- return {};
116
- }
117
- exports.PingRequest = {
118
- encode(_, writer = new wire_1.BinaryWriter()) {
119
- return writer;
120
- },
121
- decode(input, length) {
122
- const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
123
- const end = length === undefined ? reader.len : reader.pos + length;
124
- const message = createBasePingRequest();
125
- while (reader.pos < end) {
126
- const tag = reader.uint32();
127
- switch (tag >>> 3) {
128
- }
129
- if ((tag & 7) === 4 || tag === 0) {
130
- break;
131
- }
132
- reader.skip(tag & 7);
133
- }
134
- return message;
135
- },
136
- fromJSON(_) {
137
- return {};
138
- },
139
- toJSON(_) {
140
- const obj = {};
141
- return obj;
142
- },
143
- create(base) {
144
- return exports.PingRequest.fromPartial(base ?? {});
145
- },
146
- fromPartial(_) {
147
- const message = createBasePingRequest();
148
- return message;
149
- },
150
- };
151
- function createBasePingResponse() {
152
- return {};
153
- }
154
- exports.PingResponse = {
155
- encode(_, writer = new wire_1.BinaryWriter()) {
156
- return writer;
157
- },
158
- decode(input, length) {
159
- const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
160
- const end = length === undefined ? reader.len : reader.pos + length;
161
- const message = createBasePingResponse();
162
- while (reader.pos < end) {
163
- const tag = reader.uint32();
164
- switch (tag >>> 3) {
165
- }
166
- if ((tag & 7) === 4 || tag === 0) {
167
- break;
168
- }
169
- reader.skip(tag & 7);
170
- }
171
- return message;
172
- },
173
- fromJSON(_) {
174
- return {};
175
- },
176
- toJSON(_) {
177
- const obj = {};
178
- return obj;
179
- },
180
- create(base) {
181
- return exports.PingResponse.fromPartial(base ?? {});
182
- },
183
- fromPartial(_) {
184
- const message = createBasePingResponse();
185
- return message;
186
- },
187
- };
188
- function createBaseDmenuRequest() {
189
- return {
190
- rawContent: "",
191
- navigationTitle: "",
192
- placeholder: "",
193
- sectionTitle: "",
194
- noSection: false,
195
- noQuickLook: false,
196
- noIcon: false,
197
- noMetadata: false,
198
- query: "",
199
- width: undefined,
200
- height: undefined,
201
- noFooter: false,
202
- };
203
- }
204
- exports.DmenuRequest = {
205
- encode(message, writer = new wire_1.BinaryWriter()) {
206
- if (message.rawContent !== "") {
207
- writer.uint32(10).string(message.rawContent);
208
- }
209
- if (message.navigationTitle !== "") {
210
- writer.uint32(18).string(message.navigationTitle);
211
- }
212
- if (message.placeholder !== "") {
213
- writer.uint32(26).string(message.placeholder);
214
- }
215
- if (message.sectionTitle !== "") {
216
- writer.uint32(34).string(message.sectionTitle);
217
- }
218
- if (message.noSection !== false) {
219
- writer.uint32(40).bool(message.noSection);
220
- }
221
- if (message.noQuickLook !== false) {
222
- writer.uint32(48).bool(message.noQuickLook);
223
- }
224
- if (message.noIcon !== false) {
225
- writer.uint32(56).bool(message.noIcon);
226
- }
227
- if (message.noMetadata !== false) {
228
- writer.uint32(64).bool(message.noMetadata);
229
- }
230
- if (message.query !== "") {
231
- writer.uint32(74).string(message.query);
232
- }
233
- if (message.width !== undefined) {
234
- writer.uint32(80).int32(message.width);
235
- }
236
- if (message.height !== undefined) {
237
- writer.uint32(88).int32(message.height);
238
- }
239
- if (message.noFooter !== false) {
240
- writer.uint32(96).bool(message.noFooter);
241
- }
242
- return writer;
243
- },
244
- decode(input, length) {
245
- const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
246
- const end = length === undefined ? reader.len : reader.pos + length;
247
- const message = createBaseDmenuRequest();
248
- while (reader.pos < end) {
249
- const tag = reader.uint32();
250
- switch (tag >>> 3) {
251
- case 1: {
252
- if (tag !== 10) {
253
- break;
254
- }
255
- message.rawContent = reader.string();
256
- continue;
257
- }
258
- case 2: {
259
- if (tag !== 18) {
260
- break;
261
- }
262
- message.navigationTitle = reader.string();
263
- continue;
264
- }
265
- case 3: {
266
- if (tag !== 26) {
267
- break;
268
- }
269
- message.placeholder = reader.string();
270
- continue;
271
- }
272
- case 4: {
273
- if (tag !== 34) {
274
- break;
275
- }
276
- message.sectionTitle = reader.string();
277
- continue;
278
- }
279
- case 5: {
280
- if (tag !== 40) {
281
- break;
282
- }
283
- message.noSection = reader.bool();
284
- continue;
285
- }
286
- case 6: {
287
- if (tag !== 48) {
288
- break;
289
- }
290
- message.noQuickLook = reader.bool();
291
- continue;
292
- }
293
- case 7: {
294
- if (tag !== 56) {
295
- break;
296
- }
297
- message.noIcon = reader.bool();
298
- continue;
299
- }
300
- case 8: {
301
- if (tag !== 64) {
302
- break;
303
- }
304
- message.noMetadata = reader.bool();
305
- continue;
306
- }
307
- case 9: {
308
- if (tag !== 74) {
309
- break;
310
- }
311
- message.query = reader.string();
312
- continue;
313
- }
314
- case 10: {
315
- if (tag !== 80) {
316
- break;
317
- }
318
- message.width = reader.int32();
319
- continue;
320
- }
321
- case 11: {
322
- if (tag !== 88) {
323
- break;
324
- }
325
- message.height = reader.int32();
326
- continue;
327
- }
328
- case 12: {
329
- if (tag !== 96) {
330
- break;
331
- }
332
- message.noFooter = reader.bool();
333
- continue;
334
- }
335
- }
336
- if ((tag & 7) === 4 || tag === 0) {
337
- break;
338
- }
339
- reader.skip(tag & 7);
340
- }
341
- return message;
342
- },
343
- fromJSON(object) {
344
- return {
345
- rawContent: isSet(object.rawContent) ? globalThis.String(object.rawContent) : "",
346
- navigationTitle: isSet(object.navigationTitle) ? globalThis.String(object.navigationTitle) : "",
347
- placeholder: isSet(object.placeholder) ? globalThis.String(object.placeholder) : "",
348
- sectionTitle: isSet(object.sectionTitle) ? globalThis.String(object.sectionTitle) : "",
349
- noSection: isSet(object.noSection) ? globalThis.Boolean(object.noSection) : false,
350
- noQuickLook: isSet(object.noQuickLook) ? globalThis.Boolean(object.noQuickLook) : false,
351
- noIcon: isSet(object.noIcon) ? globalThis.Boolean(object.noIcon) : false,
352
- noMetadata: isSet(object.noMetadata) ? globalThis.Boolean(object.noMetadata) : false,
353
- query: isSet(object.query) ? globalThis.String(object.query) : "",
354
- width: isSet(object.width) ? globalThis.Number(object.width) : undefined,
355
- height: isSet(object.height) ? globalThis.Number(object.height) : undefined,
356
- noFooter: isSet(object.noFooter) ? globalThis.Boolean(object.noFooter) : false,
357
- };
358
- },
359
- toJSON(message) {
360
- const obj = {};
361
- if (message.rawContent !== "") {
362
- obj.rawContent = message.rawContent;
363
- }
364
- if (message.navigationTitle !== "") {
365
- obj.navigationTitle = message.navigationTitle;
366
- }
367
- if (message.placeholder !== "") {
368
- obj.placeholder = message.placeholder;
369
- }
370
- if (message.sectionTitle !== "") {
371
- obj.sectionTitle = message.sectionTitle;
372
- }
373
- if (message.noSection !== false) {
374
- obj.noSection = message.noSection;
375
- }
376
- if (message.noQuickLook !== false) {
377
- obj.noQuickLook = message.noQuickLook;
378
- }
379
- if (message.noIcon !== false) {
380
- obj.noIcon = message.noIcon;
381
- }
382
- if (message.noMetadata !== false) {
383
- obj.noMetadata = message.noMetadata;
384
- }
385
- if (message.query !== "") {
386
- obj.query = message.query;
387
- }
388
- if (message.width !== undefined) {
389
- obj.width = Math.round(message.width);
390
- }
391
- if (message.height !== undefined) {
392
- obj.height = Math.round(message.height);
393
- }
394
- if (message.noFooter !== false) {
395
- obj.noFooter = message.noFooter;
396
- }
397
- return obj;
398
- },
399
- create(base) {
400
- return exports.DmenuRequest.fromPartial(base ?? {});
401
- },
402
- fromPartial(object) {
403
- const message = createBaseDmenuRequest();
404
- message.rawContent = object.rawContent ?? "";
405
- message.navigationTitle = object.navigationTitle ?? "";
406
- message.placeholder = object.placeholder ?? "";
407
- message.sectionTitle = object.sectionTitle ?? "";
408
- message.noSection = object.noSection ?? false;
409
- message.noQuickLook = object.noQuickLook ?? false;
410
- message.noIcon = object.noIcon ?? false;
411
- message.noMetadata = object.noMetadata ?? false;
412
- message.query = object.query ?? "";
413
- message.width = object.width ?? undefined;
414
- message.height = object.height ?? undefined;
415
- message.noFooter = object.noFooter ?? false;
416
- return message;
417
- },
418
- };
419
- function createBaseLaunchAppRequest() {
420
- return { appId: "", args: [], newInstance: false };
421
- }
422
- exports.LaunchAppRequest = {
423
- encode(message, writer = new wire_1.BinaryWriter()) {
424
- if (message.appId !== "") {
425
- writer.uint32(10).string(message.appId);
426
- }
427
- for (const v of message.args) {
428
- writer.uint32(18).string(v);
429
- }
430
- if (message.newInstance !== false) {
431
- writer.uint32(24).bool(message.newInstance);
432
- }
433
- return writer;
434
- },
435
- decode(input, length) {
436
- const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
437
- const end = length === undefined ? reader.len : reader.pos + length;
438
- const message = createBaseLaunchAppRequest();
439
- while (reader.pos < end) {
440
- const tag = reader.uint32();
441
- switch (tag >>> 3) {
442
- case 1: {
443
- if (tag !== 10) {
444
- break;
445
- }
446
- message.appId = reader.string();
447
- continue;
448
- }
449
- case 2: {
450
- if (tag !== 18) {
451
- break;
452
- }
453
- message.args.push(reader.string());
454
- continue;
455
- }
456
- case 3: {
457
- if (tag !== 24) {
458
- break;
459
- }
460
- message.newInstance = reader.bool();
461
- continue;
462
- }
463
- }
464
- if ((tag & 7) === 4 || tag === 0) {
465
- break;
466
- }
467
- reader.skip(tag & 7);
468
- }
469
- return message;
470
- },
471
- fromJSON(object) {
472
- return {
473
- appId: isSet(object.appId) ? globalThis.String(object.appId) : "",
474
- args: globalThis.Array.isArray(object?.args) ? object.args.map((e) => globalThis.String(e)) : [],
475
- newInstance: isSet(object.newInstance) ? globalThis.Boolean(object.newInstance) : false,
476
- };
477
- },
478
- toJSON(message) {
479
- const obj = {};
480
- if (message.appId !== "") {
481
- obj.appId = message.appId;
482
- }
483
- if (message.args?.length) {
484
- obj.args = message.args;
485
- }
486
- if (message.newInstance !== false) {
487
- obj.newInstance = message.newInstance;
488
- }
489
- return obj;
490
- },
491
- create(base) {
492
- return exports.LaunchAppRequest.fromPartial(base ?? {});
493
- },
494
- fromPartial(object) {
495
- const message = createBaseLaunchAppRequest();
496
- message.appId = object.appId ?? "";
497
- message.args = object.args?.map((e) => e) || [];
498
- message.newInstance = object.newInstance ?? false;
499
- return message;
500
- },
501
- };
502
- function createBaseLaunchAppResponse() {
503
- return { error: "", focusedWindowTitle: "" };
504
- }
505
- exports.LaunchAppResponse = {
506
- encode(message, writer = new wire_1.BinaryWriter()) {
507
- if (message.error !== "") {
508
- writer.uint32(10).string(message.error);
509
- }
510
- if (message.focusedWindowTitle !== "") {
511
- writer.uint32(18).string(message.focusedWindowTitle);
512
- }
513
- return writer;
514
- },
515
- decode(input, length) {
516
- const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
517
- const end = length === undefined ? reader.len : reader.pos + length;
518
- const message = createBaseLaunchAppResponse();
519
- while (reader.pos < end) {
520
- const tag = reader.uint32();
521
- switch (tag >>> 3) {
522
- case 1: {
523
- if (tag !== 10) {
524
- break;
525
- }
526
- message.error = reader.string();
527
- continue;
528
- }
529
- case 2: {
530
- if (tag !== 18) {
531
- break;
532
- }
533
- message.focusedWindowTitle = reader.string();
534
- continue;
535
- }
536
- }
537
- if ((tag & 7) === 4 || tag === 0) {
538
- break;
539
- }
540
- reader.skip(tag & 7);
541
- }
542
- return message;
543
- },
544
- fromJSON(object) {
545
- return {
546
- error: isSet(object.error) ? globalThis.String(object.error) : "",
547
- focusedWindowTitle: isSet(object.focusedWindowTitle) ? globalThis.String(object.focusedWindowTitle) : "",
548
- };
549
- },
550
- toJSON(message) {
551
- const obj = {};
552
- if (message.error !== "") {
553
- obj.error = message.error;
554
- }
555
- if (message.focusedWindowTitle !== "") {
556
- obj.focusedWindowTitle = message.focusedWindowTitle;
557
- }
558
- return obj;
559
- },
560
- create(base) {
561
- return exports.LaunchAppResponse.fromPartial(base ?? {});
562
- },
563
- fromPartial(object) {
564
- const message = createBaseLaunchAppResponse();
565
- message.error = object.error ?? "";
566
- message.focusedWindowTitle = object.focusedWindowTitle ?? "";
567
- return message;
568
- },
569
- };
570
- function createBaseListAppsRequest() {
571
- return { withActions: false };
572
- }
573
- exports.ListAppsRequest = {
574
- encode(message, writer = new wire_1.BinaryWriter()) {
575
- if (message.withActions !== false) {
576
- writer.uint32(8).bool(message.withActions);
577
- }
578
- return writer;
579
- },
580
- decode(input, length) {
581
- const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
582
- const end = length === undefined ? reader.len : reader.pos + length;
583
- const message = createBaseListAppsRequest();
584
- while (reader.pos < end) {
585
- const tag = reader.uint32();
586
- switch (tag >>> 3) {
587
- case 1: {
588
- if (tag !== 8) {
589
- break;
590
- }
591
- message.withActions = reader.bool();
592
- continue;
593
- }
594
- }
595
- if ((tag & 7) === 4 || tag === 0) {
596
- break;
597
- }
598
- reader.skip(tag & 7);
599
- }
600
- return message;
601
- },
602
- fromJSON(object) {
603
- return { withActions: isSet(object.withActions) ? globalThis.Boolean(object.withActions) : false };
604
- },
605
- toJSON(message) {
606
- const obj = {};
607
- if (message.withActions !== false) {
608
- obj.withActions = message.withActions;
609
- }
610
- return obj;
611
- },
612
- create(base) {
613
- return exports.ListAppsRequest.fromPartial(base ?? {});
614
- },
615
- fromPartial(object) {
616
- const message = createBaseListAppsRequest();
617
- message.withActions = object.withActions ?? false;
618
- return message;
619
- },
620
- };
621
- function createBaseAppInfo() {
622
- return {
623
- id: "",
624
- name: "",
625
- hidden: false,
626
- path: "",
627
- description: "",
628
- program: "",
629
- isTerminalApp: false,
630
- keywords: [],
631
- iconUrl: "",
632
- isAction: false,
633
- };
634
- }
635
- exports.AppInfo = {
636
- encode(message, writer = new wire_1.BinaryWriter()) {
637
- if (message.id !== "") {
638
- writer.uint32(10).string(message.id);
639
- }
640
- if (message.name !== "") {
641
- writer.uint32(18).string(message.name);
642
- }
643
- if (message.hidden !== false) {
644
- writer.uint32(24).bool(message.hidden);
645
- }
646
- if (message.path !== "") {
647
- writer.uint32(34).string(message.path);
648
- }
649
- if (message.description !== "") {
650
- writer.uint32(42).string(message.description);
651
- }
652
- if (message.program !== "") {
653
- writer.uint32(50).string(message.program);
654
- }
655
- if (message.isTerminalApp !== false) {
656
- writer.uint32(56).bool(message.isTerminalApp);
657
- }
658
- for (const v of message.keywords) {
659
- writer.uint32(66).string(v);
660
- }
661
- if (message.iconUrl !== "") {
662
- writer.uint32(74).string(message.iconUrl);
663
- }
664
- if (message.isAction !== false) {
665
- writer.uint32(80).bool(message.isAction);
666
- }
667
- return writer;
668
- },
669
- decode(input, length) {
670
- const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
671
- const end = length === undefined ? reader.len : reader.pos + length;
672
- const message = createBaseAppInfo();
673
- while (reader.pos < end) {
674
- const tag = reader.uint32();
675
- switch (tag >>> 3) {
676
- case 1: {
677
- if (tag !== 10) {
678
- break;
679
- }
680
- message.id = reader.string();
681
- continue;
682
- }
683
- case 2: {
684
- if (tag !== 18) {
685
- break;
686
- }
687
- message.name = reader.string();
688
- continue;
689
- }
690
- case 3: {
691
- if (tag !== 24) {
692
- break;
693
- }
694
- message.hidden = reader.bool();
695
- continue;
696
- }
697
- case 4: {
698
- if (tag !== 34) {
699
- break;
700
- }
701
- message.path = reader.string();
702
- continue;
703
- }
704
- case 5: {
705
- if (tag !== 42) {
706
- break;
707
- }
708
- message.description = reader.string();
709
- continue;
710
- }
711
- case 6: {
712
- if (tag !== 50) {
713
- break;
714
- }
715
- message.program = reader.string();
716
- continue;
717
- }
718
- case 7: {
719
- if (tag !== 56) {
720
- break;
721
- }
722
- message.isTerminalApp = reader.bool();
723
- continue;
724
- }
725
- case 8: {
726
- if (tag !== 66) {
727
- break;
728
- }
729
- message.keywords.push(reader.string());
730
- continue;
731
- }
732
- case 9: {
733
- if (tag !== 74) {
734
- break;
735
- }
736
- message.iconUrl = reader.string();
737
- continue;
738
- }
739
- case 10: {
740
- if (tag !== 80) {
741
- break;
742
- }
743
- message.isAction = reader.bool();
744
- continue;
745
- }
746
- }
747
- if ((tag & 7) === 4 || tag === 0) {
748
- break;
749
- }
750
- reader.skip(tag & 7);
751
- }
752
- return message;
753
- },
754
- fromJSON(object) {
755
- return {
756
- id: isSet(object.id) ? globalThis.String(object.id) : "",
757
- name: isSet(object.name) ? globalThis.String(object.name) : "",
758
- hidden: isSet(object.hidden) ? globalThis.Boolean(object.hidden) : false,
759
- path: isSet(object.path) ? globalThis.String(object.path) : "",
760
- description: isSet(object.description) ? globalThis.String(object.description) : "",
761
- program: isSet(object.program) ? globalThis.String(object.program) : "",
762
- isTerminalApp: isSet(object.isTerminalApp) ? globalThis.Boolean(object.isTerminalApp) : false,
763
- keywords: globalThis.Array.isArray(object?.keywords) ? object.keywords.map((e) => globalThis.String(e)) : [],
764
- iconUrl: isSet(object.iconUrl) ? globalThis.String(object.iconUrl) : "",
765
- isAction: isSet(object.isAction) ? globalThis.Boolean(object.isAction) : false,
766
- };
767
- },
768
- toJSON(message) {
769
- const obj = {};
770
- if (message.id !== "") {
771
- obj.id = message.id;
772
- }
773
- if (message.name !== "") {
774
- obj.name = message.name;
775
- }
776
- if (message.hidden !== false) {
777
- obj.hidden = message.hidden;
778
- }
779
- if (message.path !== "") {
780
- obj.path = message.path;
781
- }
782
- if (message.description !== "") {
783
- obj.description = message.description;
784
- }
785
- if (message.program !== "") {
786
- obj.program = message.program;
787
- }
788
- if (message.isTerminalApp !== false) {
789
- obj.isTerminalApp = message.isTerminalApp;
790
- }
791
- if (message.keywords?.length) {
792
- obj.keywords = message.keywords;
793
- }
794
- if (message.iconUrl !== "") {
795
- obj.iconUrl = message.iconUrl;
796
- }
797
- if (message.isAction !== false) {
798
- obj.isAction = message.isAction;
799
- }
800
- return obj;
801
- },
802
- create(base) {
803
- return exports.AppInfo.fromPartial(base ?? {});
804
- },
805
- fromPartial(object) {
806
- const message = createBaseAppInfo();
807
- message.id = object.id ?? "";
808
- message.name = object.name ?? "";
809
- message.hidden = object.hidden ?? false;
810
- message.path = object.path ?? "";
811
- message.description = object.description ?? "";
812
- message.program = object.program ?? "";
813
- message.isTerminalApp = object.isTerminalApp ?? false;
814
- message.keywords = object.keywords?.map((e) => e) || [];
815
- message.iconUrl = object.iconUrl ?? "";
816
- message.isAction = object.isAction ?? false;
817
- return message;
818
- },
819
- };
820
- function createBaseListAppsResponse() {
821
- return { apps: [] };
822
- }
823
- exports.ListAppsResponse = {
824
- encode(message, writer = new wire_1.BinaryWriter()) {
825
- for (const v of message.apps) {
826
- exports.AppInfo.encode(v, writer.uint32(10).fork()).join();
827
- }
828
- return writer;
829
- },
830
- decode(input, length) {
831
- const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
832
- const end = length === undefined ? reader.len : reader.pos + length;
833
- const message = createBaseListAppsResponse();
834
- while (reader.pos < end) {
835
- const tag = reader.uint32();
836
- switch (tag >>> 3) {
837
- case 1: {
838
- if (tag !== 10) {
839
- break;
840
- }
841
- message.apps.push(exports.AppInfo.decode(reader, reader.uint32()));
842
- continue;
843
- }
844
- }
845
- if ((tag & 7) === 4 || tag === 0) {
846
- break;
847
- }
848
- reader.skip(tag & 7);
849
- }
850
- return message;
851
- },
852
- fromJSON(object) {
853
- return { apps: globalThis.Array.isArray(object?.apps) ? object.apps.map((e) => exports.AppInfo.fromJSON(e)) : [] };
854
- },
855
- toJSON(message) {
856
- const obj = {};
857
- if (message.apps?.length) {
858
- obj.apps = message.apps.map((e) => exports.AppInfo.toJSON(e));
859
- }
860
- return obj;
861
- },
862
- create(base) {
863
- return exports.ListAppsResponse.fromPartial(base ?? {});
864
- },
865
- fromPartial(object) {
866
- const message = createBaseListAppsResponse();
867
- message.apps = object.apps?.map((e) => exports.AppInfo.fromPartial(e)) || [];
868
- return message;
869
- },
870
- };
871
- function createBaseDmenuResponse() {
872
- return { output: "" };
873
- }
874
- exports.DmenuResponse = {
875
- encode(message, writer = new wire_1.BinaryWriter()) {
876
- if (message.output !== "") {
877
- writer.uint32(10).string(message.output);
878
- }
879
- return writer;
880
- },
881
- decode(input, length) {
882
- const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
883
- const end = length === undefined ? reader.len : reader.pos + length;
884
- const message = createBaseDmenuResponse();
885
- while (reader.pos < end) {
886
- const tag = reader.uint32();
887
- switch (tag >>> 3) {
888
- case 1: {
889
- if (tag !== 10) {
890
- break;
891
- }
892
- message.output = reader.string();
893
- continue;
894
- }
895
- }
896
- if ((tag & 7) === 4 || tag === 0) {
897
- break;
898
- }
899
- reader.skip(tag & 7);
900
- }
901
- return message;
902
- },
903
- fromJSON(object) {
904
- return { output: isSet(object.output) ? globalThis.String(object.output) : "" };
905
- },
906
- toJSON(message) {
907
- const obj = {};
908
- if (message.output !== "") {
909
- obj.output = message.output;
910
- }
911
- return obj;
912
- },
913
- create(base) {
914
- return exports.DmenuResponse.fromPartial(base ?? {});
915
- },
916
- fromPartial(object) {
917
- const message = createBaseDmenuResponse();
918
- message.output = object.output ?? "";
919
- return message;
920
- },
921
- };
922
- function createBaseRequest() {
923
- return { ping: undefined, url: undefined, dmenu: undefined, launchApp: undefined, listApps: undefined };
924
- }
925
- exports.Request = {
926
- encode(message, writer = new wire_1.BinaryWriter()) {
927
- if (message.ping !== undefined) {
928
- exports.PingRequest.encode(message.ping, writer.uint32(10).fork()).join();
929
- }
930
- if (message.url !== undefined) {
931
- exports.UrlRequest.encode(message.url, writer.uint32(18).fork()).join();
932
- }
933
- if (message.dmenu !== undefined) {
934
- exports.DmenuRequest.encode(message.dmenu, writer.uint32(26).fork()).join();
935
- }
936
- if (message.launchApp !== undefined) {
937
- exports.LaunchAppRequest.encode(message.launchApp, writer.uint32(34).fork()).join();
938
- }
939
- if (message.listApps !== undefined) {
940
- exports.ListAppsRequest.encode(message.listApps, writer.uint32(42).fork()).join();
941
- }
942
- return writer;
943
- },
944
- decode(input, length) {
945
- const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
946
- const end = length === undefined ? reader.len : reader.pos + length;
947
- const message = createBaseRequest();
948
- while (reader.pos < end) {
949
- const tag = reader.uint32();
950
- switch (tag >>> 3) {
951
- case 1: {
952
- if (tag !== 10) {
953
- break;
954
- }
955
- message.ping = exports.PingRequest.decode(reader, reader.uint32());
956
- continue;
957
- }
958
- case 2: {
959
- if (tag !== 18) {
960
- break;
961
- }
962
- message.url = exports.UrlRequest.decode(reader, reader.uint32());
963
- continue;
964
- }
965
- case 3: {
966
- if (tag !== 26) {
967
- break;
968
- }
969
- message.dmenu = exports.DmenuRequest.decode(reader, reader.uint32());
970
- continue;
971
- }
972
- case 4: {
973
- if (tag !== 34) {
974
- break;
975
- }
976
- message.launchApp = exports.LaunchAppRequest.decode(reader, reader.uint32());
977
- continue;
978
- }
979
- case 5: {
980
- if (tag !== 42) {
981
- break;
982
- }
983
- message.listApps = exports.ListAppsRequest.decode(reader, reader.uint32());
984
- continue;
985
- }
986
- }
987
- if ((tag & 7) === 4 || tag === 0) {
988
- break;
989
- }
990
- reader.skip(tag & 7);
991
- }
992
- return message;
993
- },
994
- fromJSON(object) {
995
- return {
996
- ping: isSet(object.ping) ? exports.PingRequest.fromJSON(object.ping) : undefined,
997
- url: isSet(object.url) ? exports.UrlRequest.fromJSON(object.url) : undefined,
998
- dmenu: isSet(object.dmenu) ? exports.DmenuRequest.fromJSON(object.dmenu) : undefined,
999
- launchApp: isSet(object.launchApp) ? exports.LaunchAppRequest.fromJSON(object.launchApp) : undefined,
1000
- listApps: isSet(object.listApps) ? exports.ListAppsRequest.fromJSON(object.listApps) : undefined,
1001
- };
1002
- },
1003
- toJSON(message) {
1004
- const obj = {};
1005
- if (message.ping !== undefined) {
1006
- obj.ping = exports.PingRequest.toJSON(message.ping);
1007
- }
1008
- if (message.url !== undefined) {
1009
- obj.url = exports.UrlRequest.toJSON(message.url);
1010
- }
1011
- if (message.dmenu !== undefined) {
1012
- obj.dmenu = exports.DmenuRequest.toJSON(message.dmenu);
1013
- }
1014
- if (message.launchApp !== undefined) {
1015
- obj.launchApp = exports.LaunchAppRequest.toJSON(message.launchApp);
1016
- }
1017
- if (message.listApps !== undefined) {
1018
- obj.listApps = exports.ListAppsRequest.toJSON(message.listApps);
1019
- }
1020
- return obj;
1021
- },
1022
- create(base) {
1023
- return exports.Request.fromPartial(base ?? {});
1024
- },
1025
- fromPartial(object) {
1026
- const message = createBaseRequest();
1027
- message.ping = (object.ping !== undefined && object.ping !== null)
1028
- ? exports.PingRequest.fromPartial(object.ping)
1029
- : undefined;
1030
- message.url = (object.url !== undefined && object.url !== null) ? exports.UrlRequest.fromPartial(object.url) : undefined;
1031
- message.dmenu = (object.dmenu !== undefined && object.dmenu !== null)
1032
- ? exports.DmenuRequest.fromPartial(object.dmenu)
1033
- : undefined;
1034
- message.launchApp = (object.launchApp !== undefined && object.launchApp !== null)
1035
- ? exports.LaunchAppRequest.fromPartial(object.launchApp)
1036
- : undefined;
1037
- message.listApps = (object.listApps !== undefined && object.listApps !== null)
1038
- ? exports.ListAppsRequest.fromPartial(object.listApps)
1039
- : undefined;
1040
- return message;
1041
- },
1042
- };
1043
- function createBaseResponse() {
1044
- return { ping: undefined, url: undefined, dmenu: undefined, launchApp: undefined, listApps: undefined };
1045
- }
1046
- exports.Response = {
1047
- encode(message, writer = new wire_1.BinaryWriter()) {
1048
- if (message.ping !== undefined) {
1049
- exports.PingResponse.encode(message.ping, writer.uint32(10).fork()).join();
1050
- }
1051
- if (message.url !== undefined) {
1052
- exports.UrlResponse.encode(message.url, writer.uint32(18).fork()).join();
1053
- }
1054
- if (message.dmenu !== undefined) {
1055
- exports.DmenuResponse.encode(message.dmenu, writer.uint32(26).fork()).join();
1056
- }
1057
- if (message.launchApp !== undefined) {
1058
- exports.LaunchAppResponse.encode(message.launchApp, writer.uint32(34).fork()).join();
1059
- }
1060
- if (message.listApps !== undefined) {
1061
- exports.ListAppsResponse.encode(message.listApps, writer.uint32(42).fork()).join();
1062
- }
1063
- return writer;
1064
- },
1065
- decode(input, length) {
1066
- const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1067
- const end = length === undefined ? reader.len : reader.pos + length;
1068
- const message = createBaseResponse();
1069
- while (reader.pos < end) {
1070
- const tag = reader.uint32();
1071
- switch (tag >>> 3) {
1072
- case 1: {
1073
- if (tag !== 10) {
1074
- break;
1075
- }
1076
- message.ping = exports.PingResponse.decode(reader, reader.uint32());
1077
- continue;
1078
- }
1079
- case 2: {
1080
- if (tag !== 18) {
1081
- break;
1082
- }
1083
- message.url = exports.UrlResponse.decode(reader, reader.uint32());
1084
- continue;
1085
- }
1086
- case 3: {
1087
- if (tag !== 26) {
1088
- break;
1089
- }
1090
- message.dmenu = exports.DmenuResponse.decode(reader, reader.uint32());
1091
- continue;
1092
- }
1093
- case 4: {
1094
- if (tag !== 34) {
1095
- break;
1096
- }
1097
- message.launchApp = exports.LaunchAppResponse.decode(reader, reader.uint32());
1098
- continue;
1099
- }
1100
- case 5: {
1101
- if (tag !== 42) {
1102
- break;
1103
- }
1104
- message.listApps = exports.ListAppsResponse.decode(reader, reader.uint32());
1105
- continue;
1106
- }
1107
- }
1108
- if ((tag & 7) === 4 || tag === 0) {
1109
- break;
1110
- }
1111
- reader.skip(tag & 7);
1112
- }
1113
- return message;
1114
- },
1115
- fromJSON(object) {
1116
- return {
1117
- ping: isSet(object.ping) ? exports.PingResponse.fromJSON(object.ping) : undefined,
1118
- url: isSet(object.url) ? exports.UrlResponse.fromJSON(object.url) : undefined,
1119
- dmenu: isSet(object.dmenu) ? exports.DmenuResponse.fromJSON(object.dmenu) : undefined,
1120
- launchApp: isSet(object.launchApp) ? exports.LaunchAppResponse.fromJSON(object.launchApp) : undefined,
1121
- listApps: isSet(object.listApps) ? exports.ListAppsResponse.fromJSON(object.listApps) : undefined,
1122
- };
1123
- },
1124
- toJSON(message) {
1125
- const obj = {};
1126
- if (message.ping !== undefined) {
1127
- obj.ping = exports.PingResponse.toJSON(message.ping);
1128
- }
1129
- if (message.url !== undefined) {
1130
- obj.url = exports.UrlResponse.toJSON(message.url);
1131
- }
1132
- if (message.dmenu !== undefined) {
1133
- obj.dmenu = exports.DmenuResponse.toJSON(message.dmenu);
1134
- }
1135
- if (message.launchApp !== undefined) {
1136
- obj.launchApp = exports.LaunchAppResponse.toJSON(message.launchApp);
1137
- }
1138
- if (message.listApps !== undefined) {
1139
- obj.listApps = exports.ListAppsResponse.toJSON(message.listApps);
1140
- }
1141
- return obj;
1142
- },
1143
- create(base) {
1144
- return exports.Response.fromPartial(base ?? {});
1145
- },
1146
- fromPartial(object) {
1147
- const message = createBaseResponse();
1148
- message.ping = (object.ping !== undefined && object.ping !== null)
1149
- ? exports.PingResponse.fromPartial(object.ping)
1150
- : undefined;
1151
- message.url = (object.url !== undefined && object.url !== null) ? exports.UrlResponse.fromPartial(object.url) : undefined;
1152
- message.dmenu = (object.dmenu !== undefined && object.dmenu !== null)
1153
- ? exports.DmenuResponse.fromPartial(object.dmenu)
1154
- : undefined;
1155
- message.launchApp = (object.launchApp !== undefined && object.launchApp !== null)
1156
- ? exports.LaunchAppResponse.fromPartial(object.launchApp)
1157
- : undefined;
1158
- message.listApps = (object.listApps !== undefined && object.listApps !== null)
1159
- ? exports.ListAppsResponse.fromPartial(object.listApps)
1160
- : undefined;
1161
- return message;
1162
- },
1163
- };
1164
- function isSet(value) {
1165
- return value !== null && value !== undefined;
1166
- }