@vicinae/api 0.13.4 → 0.14.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.
package/dist/api/bus.d.ts CHANGED
@@ -65,6 +65,8 @@ type EndpointMapping = {
65
65
  "oauth.authorize": "oauth.authorize";
66
66
  "clipboard.copy": "clipboard.copy";
67
67
  "clipboard.paste": "clipboard.paste";
68
+ "clipboard.readContent": "clipboard.readContent";
69
+ "clipboard.clear": "clipboard.clear";
68
70
  };
69
71
  type RequestEndpoint = keyof EndpointMapping;
70
72
  type ResponseEndpoint = EndpointMapping[RequestEndpoint];
@@ -10,21 +10,51 @@ export declare namespace Clipboard {
10
10
  };
11
11
  type ReadContent = {
12
12
  text: string;
13
- } | {
14
13
  file?: string;
15
- } | {
16
14
  html?: string;
17
15
  };
18
16
  type CopyOptions = {
19
17
  concealed?: boolean;
20
18
  };
19
+ /**
20
+ * Copy the provided content in the clipboard.
21
+ * The `concealed` option can be passed so that the created clipboard selection
22
+ * does not get indexed by the Vicinae clipboard manager.
23
+ */
21
24
  function copy(text: string | number | Clipboard.Content, options?: Clipboard.CopyOptions): Promise<void>;
25
+ /**
26
+ * Paste the provided clipboard content to the active window.
27
+ * If the environment does not support either getting the active window
28
+ * or pasting content to it directly, this will fallback to a regular
29
+ * clipboard copy.
30
+ */
22
31
  function paste(text: string | Clipboard.Content): Promise<void>;
32
+ /**
33
+ * Read the current content of the clipboard, which can contain text, html and a file path.
34
+ * Note: the offset option is not yet implemented
35
+ *
36
+ * ```ts
37
+ * const { text, html, file } = await Clipboard.read();
38
+ * ```
39
+ */
23
40
  function read(options?: {
24
41
  offset?: number;
25
42
  }): Promise<Clipboard.ReadContent>;
43
+ /**
44
+ * Read the text representation of the current clipboard data. If the data is not text at all, this
45
+ * returns an empty string.
46
+ * If you want to read optional html or file path, consider @see {Clipboard.read}
47
+ * Note: the offset option is not yet implemented.
48
+ *
49
+ * ```ts
50
+ * const text = await Clipboard.readText();
51
+ * ```
52
+ */
26
53
  function readText(options?: {
27
54
  offset?: number;
28
- }): Promise<string | undefined>;
29
- function clear(text: string): Promise<void>;
55
+ }): Promise<string>;
56
+ /**
57
+ * Clear the current clipboard content.
58
+ */
59
+ function clear(): Promise<void>;
30
60
  }
@@ -23,6 +23,11 @@ var Clipboard;
23
23
  }
24
24
  return ct;
25
25
  }
26
+ /**
27
+ * Copy the provided content in the clipboard.
28
+ * The `concealed` option can be passed so that the created clipboard selection
29
+ * does not get indexed by the Vicinae clipboard manager.
30
+ */
26
31
  async function copy(text, options = {}) {
27
32
  await bus_1.bus.turboRequest("clipboard.copy", {
28
33
  content: mapContent(text),
@@ -30,22 +35,51 @@ var Clipboard;
30
35
  });
31
36
  }
32
37
  Clipboard.copy = copy;
38
+ /**
39
+ * Paste the provided clipboard content to the active window.
40
+ * If the environment does not support either getting the active window
41
+ * or pasting content to it directly, this will fallback to a regular
42
+ * clipboard copy.
43
+ */
33
44
  async function paste(text) {
34
45
  await bus_1.bus.turboRequest("clipboard.paste", {
35
46
  content: mapContent(text),
36
47
  });
37
48
  }
38
49
  Clipboard.paste = paste;
50
+ /**
51
+ * Read the current content of the clipboard, which can contain text, html and a file path.
52
+ * Note: the offset option is not yet implemented
53
+ *
54
+ * ```ts
55
+ * const { text, html, file } = await Clipboard.read();
56
+ * ```
57
+ */
39
58
  async function read(options) {
40
- throw new Error('Clipboard.read not implemented');
59
+ const res = await bus_1.bus.turboRequest('clipboard.readContent', {});
60
+ return res.unwrap().content;
41
61
  }
42
62
  Clipboard.read = read;
63
+ /**
64
+ * Read the text representation of the current clipboard data. If the data is not text at all, this
65
+ * returns an empty string.
66
+ * If you want to read optional html or file path, consider @see {Clipboard.read}
67
+ * Note: the offset option is not yet implemented.
68
+ *
69
+ * ```ts
70
+ * const text = await Clipboard.readText();
71
+ * ```
72
+ */
43
73
  async function readText(options) {
44
- throw new Error('Clipboard.readText not implemented');
74
+ const { text } = await read(options);
75
+ return text;
45
76
  }
46
77
  Clipboard.readText = readText;
47
- async function clear(text) {
48
- throw new Error('Clibpoard.clear not implemented');
78
+ /**
79
+ * Clear the current clipboard content.
80
+ */
81
+ async function clear() {
82
+ await bus_1.bus.turboRequest('clipboard.clear', {});
49
83
  }
50
84
  Clipboard.clear = clear;
51
85
  })(Clipboard || (exports.Clipboard = Clipboard = {}));
@@ -21,10 +21,12 @@ const TextField = ({ ref, ...props }) => {
21
21
  (0, use_imperative_form_handle_1.useImperativeFormHandle)(ref);
22
22
  return ((0, jsx_runtime_1.jsx)("text-field", { ...wrapFormItemProps(props) }));
23
23
  };
24
- const PasswordField = ({ ...props }) => {
24
+ const PasswordField = ({ ref, ...props }) => {
25
+ (0, use_imperative_form_handle_1.useImperativeFormHandle)(ref);
25
26
  return (0, jsx_runtime_1.jsx)("password-field", { ...props });
26
27
  };
27
- const DatePicker = ({ ...props }) => {
28
+ const DatePicker = ({ ref, ...props }) => {
29
+ (0, use_imperative_form_handle_1.useImperativeFormHandle)(ref);
28
30
  return (0, jsx_runtime_1.jsx)("date-picker-field", { ...props });
29
31
  };
30
32
  const Checkbox = ({ ref, ...props }) => {
@@ -33,8 +35,9 @@ const Checkbox = ({ ref, ...props }) => {
33
35
  };
34
36
  //FIXME: we probably need to reuse the existing dropdown in
35
37
  // a smarter way.
36
- const DropdownRoot = ({ children, ...props }) => {
38
+ const DropdownRoot = ({ ref, children, ...props }) => {
37
39
  // FIXME: testing stuff, we need to generalize this to all form items
40
+ (0, use_imperative_form_handle_1.useImperativeFormHandle)(ref);
38
41
  return ((0, jsx_runtime_1.jsx)("dropdown-field", { ...wrapFormItemProps(props), children: children }));
39
42
  };
40
43
  const Dropdown = Object.assign(DropdownRoot, {
@@ -50,10 +53,12 @@ const TagPickerItem = ({ icon, ...props }) => {
50
53
  const TagPicker = Object.assign(TagPickerRoot, {
51
54
  Item: TagPickerItem
52
55
  });
53
- const TextArea = (props) => {
56
+ const TextArea = ({ ref, ...props }) => {
57
+ (0, use_imperative_form_handle_1.useImperativeFormHandle)(ref);
54
58
  return ((0, jsx_runtime_1.jsx)("text-area-field", { ...wrapFormItemProps(props) }));
55
59
  };
56
- const FilePicker = (props) => {
60
+ const FilePicker = ({ ref, ...props }) => {
61
+ (0, use_imperative_form_handle_1.useImperativeFormHandle)(ref);
57
62
  return ((0, jsx_runtime_1.jsx)("file-picker-field", { ...wrapFormItemProps(props) }));
58
63
  };
59
64
  const Description = (props) => {
@@ -10,6 +10,15 @@ export interface ClipboardPathContent {
10
10
  export interface ClipboardOptions {
11
11
  concealed: boolean;
12
12
  }
13
+ export interface ClearRequest {
14
+ }
15
+ export interface ClearResponse {
16
+ }
17
+ export interface ReadContentRequest {
18
+ }
19
+ export interface ReadContentResponse {
20
+ content: ClipboardReadContent | undefined;
21
+ }
13
22
  export interface CopyToClipboardRequest {
14
23
  content: ClipboardContent | undefined;
15
24
  options: ClipboardOptions | undefined;
@@ -22,6 +31,11 @@ export interface ClipboardContent {
22
31
  html?: ClipboardHtmlContent | undefined;
23
32
  path?: ClipboardPathContent | undefined;
24
33
  }
34
+ export interface ClipboardReadContent {
35
+ text: string;
36
+ file?: string | undefined;
37
+ html?: string | undefined;
38
+ }
25
39
  export interface CopyToClipboardResponse {
26
40
  }
27
41
  export interface PasteToClipboardResponse {
@@ -29,17 +43,26 @@ export interface PasteToClipboardResponse {
29
43
  export interface Request {
30
44
  copy?: CopyToClipboardRequest | undefined;
31
45
  paste?: PasteToClipboardRequest | undefined;
46
+ readContent?: ReadContentRequest | undefined;
47
+ clear?: ClearRequest | undefined;
32
48
  }
33
49
  export interface Response {
34
50
  copy?: CopyToClipboardResponse | undefined;
35
51
  paste?: PasteToClipboardResponse | undefined;
52
+ readContent?: ReadContentResponse | undefined;
53
+ clear?: ClearResponse | undefined;
36
54
  }
37
55
  export declare const ClipboardHtmlContent: MessageFns<ClipboardHtmlContent>;
38
56
  export declare const ClipboardPathContent: MessageFns<ClipboardPathContent>;
39
57
  export declare const ClipboardOptions: MessageFns<ClipboardOptions>;
58
+ export declare const ClearRequest: MessageFns<ClearRequest>;
59
+ export declare const ClearResponse: MessageFns<ClearResponse>;
60
+ export declare const ReadContentRequest: MessageFns<ReadContentRequest>;
61
+ export declare const ReadContentResponse: MessageFns<ReadContentResponse>;
40
62
  export declare const CopyToClipboardRequest: MessageFns<CopyToClipboardRequest>;
41
63
  export declare const PasteToClipboardRequest: MessageFns<PasteToClipboardRequest>;
42
64
  export declare const ClipboardContent: MessageFns<ClipboardContent>;
65
+ export declare const ClipboardReadContent: MessageFns<ClipboardReadContent>;
43
66
  export declare const CopyToClipboardResponse: MessageFns<CopyToClipboardResponse>;
44
67
  export declare const PasteToClipboardResponse: MessageFns<PasteToClipboardResponse>;
45
68
  export declare const Request: MessageFns<Request>;
@@ -5,7 +5,7 @@
5
5
  // protoc v6.32.0
6
6
  // source: clipboard.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.Response = exports.Request = exports.PasteToClipboardResponse = exports.CopyToClipboardResponse = exports.ClipboardContent = exports.PasteToClipboardRequest = exports.CopyToClipboardRequest = exports.ClipboardOptions = exports.ClipboardPathContent = exports.ClipboardHtmlContent = exports.protobufPackage = void 0;
8
+ exports.Response = exports.Request = exports.PasteToClipboardResponse = exports.CopyToClipboardResponse = exports.ClipboardReadContent = exports.ClipboardContent = exports.PasteToClipboardRequest = exports.CopyToClipboardRequest = exports.ReadContentResponse = exports.ReadContentRequest = exports.ClearResponse = exports.ClearRequest = exports.ClipboardOptions = exports.ClipboardPathContent = exports.ClipboardHtmlContent = exports.protobufPackage = void 0;
9
9
  /* eslint-disable */
10
10
  const wire_1 = require("@bufbuild/protobuf/wire");
11
11
  exports.protobufPackage = "proto.ext.clipboard";
@@ -179,6 +179,170 @@ exports.ClipboardOptions = {
179
179
  return message;
180
180
  },
181
181
  };
182
+ function createBaseClearRequest() {
183
+ return {};
184
+ }
185
+ exports.ClearRequest = {
186
+ encode(_, writer = new wire_1.BinaryWriter()) {
187
+ return writer;
188
+ },
189
+ decode(input, length) {
190
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
191
+ const end = length === undefined ? reader.len : reader.pos + length;
192
+ const message = createBaseClearRequest();
193
+ while (reader.pos < end) {
194
+ const tag = reader.uint32();
195
+ switch (tag >>> 3) {
196
+ }
197
+ if ((tag & 7) === 4 || tag === 0) {
198
+ break;
199
+ }
200
+ reader.skip(tag & 7);
201
+ }
202
+ return message;
203
+ },
204
+ fromJSON(_) {
205
+ return {};
206
+ },
207
+ toJSON(_) {
208
+ const obj = {};
209
+ return obj;
210
+ },
211
+ create(base) {
212
+ return exports.ClearRequest.fromPartial(base ?? {});
213
+ },
214
+ fromPartial(_) {
215
+ const message = createBaseClearRequest();
216
+ return message;
217
+ },
218
+ };
219
+ function createBaseClearResponse() {
220
+ return {};
221
+ }
222
+ exports.ClearResponse = {
223
+ encode(_, writer = new wire_1.BinaryWriter()) {
224
+ return writer;
225
+ },
226
+ decode(input, length) {
227
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
228
+ const end = length === undefined ? reader.len : reader.pos + length;
229
+ const message = createBaseClearResponse();
230
+ while (reader.pos < end) {
231
+ const tag = reader.uint32();
232
+ switch (tag >>> 3) {
233
+ }
234
+ if ((tag & 7) === 4 || tag === 0) {
235
+ break;
236
+ }
237
+ reader.skip(tag & 7);
238
+ }
239
+ return message;
240
+ },
241
+ fromJSON(_) {
242
+ return {};
243
+ },
244
+ toJSON(_) {
245
+ const obj = {};
246
+ return obj;
247
+ },
248
+ create(base) {
249
+ return exports.ClearResponse.fromPartial(base ?? {});
250
+ },
251
+ fromPartial(_) {
252
+ const message = createBaseClearResponse();
253
+ return message;
254
+ },
255
+ };
256
+ function createBaseReadContentRequest() {
257
+ return {};
258
+ }
259
+ exports.ReadContentRequest = {
260
+ encode(_, writer = new wire_1.BinaryWriter()) {
261
+ return writer;
262
+ },
263
+ decode(input, length) {
264
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
265
+ const end = length === undefined ? reader.len : reader.pos + length;
266
+ const message = createBaseReadContentRequest();
267
+ while (reader.pos < end) {
268
+ const tag = reader.uint32();
269
+ switch (tag >>> 3) {
270
+ }
271
+ if ((tag & 7) === 4 || tag === 0) {
272
+ break;
273
+ }
274
+ reader.skip(tag & 7);
275
+ }
276
+ return message;
277
+ },
278
+ fromJSON(_) {
279
+ return {};
280
+ },
281
+ toJSON(_) {
282
+ const obj = {};
283
+ return obj;
284
+ },
285
+ create(base) {
286
+ return exports.ReadContentRequest.fromPartial(base ?? {});
287
+ },
288
+ fromPartial(_) {
289
+ const message = createBaseReadContentRequest();
290
+ return message;
291
+ },
292
+ };
293
+ function createBaseReadContentResponse() {
294
+ return { content: undefined };
295
+ }
296
+ exports.ReadContentResponse = {
297
+ encode(message, writer = new wire_1.BinaryWriter()) {
298
+ if (message.content !== undefined) {
299
+ exports.ClipboardReadContent.encode(message.content, writer.uint32(10).fork()).join();
300
+ }
301
+ return writer;
302
+ },
303
+ decode(input, length) {
304
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
305
+ const end = length === undefined ? reader.len : reader.pos + length;
306
+ const message = createBaseReadContentResponse();
307
+ while (reader.pos < end) {
308
+ const tag = reader.uint32();
309
+ switch (tag >>> 3) {
310
+ case 1: {
311
+ if (tag !== 10) {
312
+ break;
313
+ }
314
+ message.content = exports.ClipboardReadContent.decode(reader, reader.uint32());
315
+ continue;
316
+ }
317
+ }
318
+ if ((tag & 7) === 4 || tag === 0) {
319
+ break;
320
+ }
321
+ reader.skip(tag & 7);
322
+ }
323
+ return message;
324
+ },
325
+ fromJSON(object) {
326
+ return { content: isSet(object.content) ? exports.ClipboardReadContent.fromJSON(object.content) : undefined };
327
+ },
328
+ toJSON(message) {
329
+ const obj = {};
330
+ if (message.content !== undefined) {
331
+ obj.content = exports.ClipboardReadContent.toJSON(message.content);
332
+ }
333
+ return obj;
334
+ },
335
+ create(base) {
336
+ return exports.ReadContentResponse.fromPartial(base ?? {});
337
+ },
338
+ fromPartial(object) {
339
+ const message = createBaseReadContentResponse();
340
+ message.content = (object.content !== undefined && object.content !== null)
341
+ ? exports.ClipboardReadContent.fromPartial(object.content)
342
+ : undefined;
343
+ return message;
344
+ },
345
+ };
182
346
  function createBaseCopyToClipboardRequest() {
183
347
  return { content: undefined, options: undefined };
184
348
  }
@@ -391,6 +555,89 @@ exports.ClipboardContent = {
391
555
  return message;
392
556
  },
393
557
  };
558
+ function createBaseClipboardReadContent() {
559
+ return { text: "", file: undefined, html: undefined };
560
+ }
561
+ exports.ClipboardReadContent = {
562
+ encode(message, writer = new wire_1.BinaryWriter()) {
563
+ if (message.text !== "") {
564
+ writer.uint32(10).string(message.text);
565
+ }
566
+ if (message.file !== undefined) {
567
+ writer.uint32(18).string(message.file);
568
+ }
569
+ if (message.html !== undefined) {
570
+ writer.uint32(26).string(message.html);
571
+ }
572
+ return writer;
573
+ },
574
+ decode(input, length) {
575
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
576
+ const end = length === undefined ? reader.len : reader.pos + length;
577
+ const message = createBaseClipboardReadContent();
578
+ while (reader.pos < end) {
579
+ const tag = reader.uint32();
580
+ switch (tag >>> 3) {
581
+ case 1: {
582
+ if (tag !== 10) {
583
+ break;
584
+ }
585
+ message.text = reader.string();
586
+ continue;
587
+ }
588
+ case 2: {
589
+ if (tag !== 18) {
590
+ break;
591
+ }
592
+ message.file = reader.string();
593
+ continue;
594
+ }
595
+ case 3: {
596
+ if (tag !== 26) {
597
+ break;
598
+ }
599
+ message.html = reader.string();
600
+ continue;
601
+ }
602
+ }
603
+ if ((tag & 7) === 4 || tag === 0) {
604
+ break;
605
+ }
606
+ reader.skip(tag & 7);
607
+ }
608
+ return message;
609
+ },
610
+ fromJSON(object) {
611
+ return {
612
+ text: isSet(object.text) ? globalThis.String(object.text) : "",
613
+ file: isSet(object.file) ? globalThis.String(object.file) : undefined,
614
+ html: isSet(object.html) ? globalThis.String(object.html) : undefined,
615
+ };
616
+ },
617
+ toJSON(message) {
618
+ const obj = {};
619
+ if (message.text !== "") {
620
+ obj.text = message.text;
621
+ }
622
+ if (message.file !== undefined) {
623
+ obj.file = message.file;
624
+ }
625
+ if (message.html !== undefined) {
626
+ obj.html = message.html;
627
+ }
628
+ return obj;
629
+ },
630
+ create(base) {
631
+ return exports.ClipboardReadContent.fromPartial(base ?? {});
632
+ },
633
+ fromPartial(object) {
634
+ const message = createBaseClipboardReadContent();
635
+ message.text = object.text ?? "";
636
+ message.file = object.file ?? undefined;
637
+ message.html = object.html ?? undefined;
638
+ return message;
639
+ },
640
+ };
394
641
  function createBaseCopyToClipboardResponse() {
395
642
  return {};
396
643
  }
@@ -466,7 +713,7 @@ exports.PasteToClipboardResponse = {
466
713
  },
467
714
  };
468
715
  function createBaseRequest() {
469
- return { copy: undefined, paste: undefined };
716
+ return { copy: undefined, paste: undefined, readContent: undefined, clear: undefined };
470
717
  }
471
718
  exports.Request = {
472
719
  encode(message, writer = new wire_1.BinaryWriter()) {
@@ -476,6 +723,12 @@ exports.Request = {
476
723
  if (message.paste !== undefined) {
477
724
  exports.PasteToClipboardRequest.encode(message.paste, writer.uint32(18).fork()).join();
478
725
  }
726
+ if (message.readContent !== undefined) {
727
+ exports.ReadContentRequest.encode(message.readContent, writer.uint32(26).fork()).join();
728
+ }
729
+ if (message.clear !== undefined) {
730
+ exports.ClearRequest.encode(message.clear, writer.uint32(34).fork()).join();
731
+ }
479
732
  return writer;
480
733
  },
481
734
  decode(input, length) {
@@ -499,6 +752,20 @@ exports.Request = {
499
752
  message.paste = exports.PasteToClipboardRequest.decode(reader, reader.uint32());
500
753
  continue;
501
754
  }
755
+ case 3: {
756
+ if (tag !== 26) {
757
+ break;
758
+ }
759
+ message.readContent = exports.ReadContentRequest.decode(reader, reader.uint32());
760
+ continue;
761
+ }
762
+ case 4: {
763
+ if (tag !== 34) {
764
+ break;
765
+ }
766
+ message.clear = exports.ClearRequest.decode(reader, reader.uint32());
767
+ continue;
768
+ }
502
769
  }
503
770
  if ((tag & 7) === 4 || tag === 0) {
504
771
  break;
@@ -511,6 +778,8 @@ exports.Request = {
511
778
  return {
512
779
  copy: isSet(object.copy) ? exports.CopyToClipboardRequest.fromJSON(object.copy) : undefined,
513
780
  paste: isSet(object.paste) ? exports.PasteToClipboardRequest.fromJSON(object.paste) : undefined,
781
+ readContent: isSet(object.readContent) ? exports.ReadContentRequest.fromJSON(object.readContent) : undefined,
782
+ clear: isSet(object.clear) ? exports.ClearRequest.fromJSON(object.clear) : undefined,
514
783
  };
515
784
  },
516
785
  toJSON(message) {
@@ -521,6 +790,12 @@ exports.Request = {
521
790
  if (message.paste !== undefined) {
522
791
  obj.paste = exports.PasteToClipboardRequest.toJSON(message.paste);
523
792
  }
793
+ if (message.readContent !== undefined) {
794
+ obj.readContent = exports.ReadContentRequest.toJSON(message.readContent);
795
+ }
796
+ if (message.clear !== undefined) {
797
+ obj.clear = exports.ClearRequest.toJSON(message.clear);
798
+ }
524
799
  return obj;
525
800
  },
526
801
  create(base) {
@@ -534,11 +809,17 @@ exports.Request = {
534
809
  message.paste = (object.paste !== undefined && object.paste !== null)
535
810
  ? exports.PasteToClipboardRequest.fromPartial(object.paste)
536
811
  : undefined;
812
+ message.readContent = (object.readContent !== undefined && object.readContent !== null)
813
+ ? exports.ReadContentRequest.fromPartial(object.readContent)
814
+ : undefined;
815
+ message.clear = (object.clear !== undefined && object.clear !== null)
816
+ ? exports.ClearRequest.fromPartial(object.clear)
817
+ : undefined;
537
818
  return message;
538
819
  },
539
820
  };
540
821
  function createBaseResponse() {
541
- return { copy: undefined, paste: undefined };
822
+ return { copy: undefined, paste: undefined, readContent: undefined, clear: undefined };
542
823
  }
543
824
  exports.Response = {
544
825
  encode(message, writer = new wire_1.BinaryWriter()) {
@@ -548,6 +829,12 @@ exports.Response = {
548
829
  if (message.paste !== undefined) {
549
830
  exports.PasteToClipboardResponse.encode(message.paste, writer.uint32(18).fork()).join();
550
831
  }
832
+ if (message.readContent !== undefined) {
833
+ exports.ReadContentResponse.encode(message.readContent, writer.uint32(26).fork()).join();
834
+ }
835
+ if (message.clear !== undefined) {
836
+ exports.ClearResponse.encode(message.clear, writer.uint32(34).fork()).join();
837
+ }
551
838
  return writer;
552
839
  },
553
840
  decode(input, length) {
@@ -571,6 +858,20 @@ exports.Response = {
571
858
  message.paste = exports.PasteToClipboardResponse.decode(reader, reader.uint32());
572
859
  continue;
573
860
  }
861
+ case 3: {
862
+ if (tag !== 26) {
863
+ break;
864
+ }
865
+ message.readContent = exports.ReadContentResponse.decode(reader, reader.uint32());
866
+ continue;
867
+ }
868
+ case 4: {
869
+ if (tag !== 34) {
870
+ break;
871
+ }
872
+ message.clear = exports.ClearResponse.decode(reader, reader.uint32());
873
+ continue;
874
+ }
574
875
  }
575
876
  if ((tag & 7) === 4 || tag === 0) {
576
877
  break;
@@ -583,6 +884,8 @@ exports.Response = {
583
884
  return {
584
885
  copy: isSet(object.copy) ? exports.CopyToClipboardResponse.fromJSON(object.copy) : undefined,
585
886
  paste: isSet(object.paste) ? exports.PasteToClipboardResponse.fromJSON(object.paste) : undefined,
887
+ readContent: isSet(object.readContent) ? exports.ReadContentResponse.fromJSON(object.readContent) : undefined,
888
+ clear: isSet(object.clear) ? exports.ClearResponse.fromJSON(object.clear) : undefined,
586
889
  };
587
890
  },
588
891
  toJSON(message) {
@@ -593,6 +896,12 @@ exports.Response = {
593
896
  if (message.paste !== undefined) {
594
897
  obj.paste = exports.PasteToClipboardResponse.toJSON(message.paste);
595
898
  }
899
+ if (message.readContent !== undefined) {
900
+ obj.readContent = exports.ReadContentResponse.toJSON(message.readContent);
901
+ }
902
+ if (message.clear !== undefined) {
903
+ obj.clear = exports.ClearResponse.toJSON(message.clear);
904
+ }
596
905
  return obj;
597
906
  },
598
907
  create(base) {
@@ -606,6 +915,12 @@ exports.Response = {
606
915
  message.paste = (object.paste !== undefined && object.paste !== null)
607
916
  ? exports.PasteToClipboardResponse.fromPartial(object.paste)
608
917
  : undefined;
918
+ message.readContent = (object.readContent !== undefined && object.readContent !== null)
919
+ ? exports.ReadContentResponse.fromPartial(object.readContent)
920
+ : undefined;
921
+ message.clear = (object.clear !== undefined && object.clear !== null)
922
+ ? exports.ClearResponse.fromPartial(object.clear)
923
+ : undefined;
609
924
  return message;
610
925
  },
611
926
  };
@@ -5,14 +5,37 @@ export interface UrlResponse {
5
5
  export interface UrlRequest {
6
6
  url: string;
7
7
  }
8
+ export interface PingRequest {
9
+ }
10
+ export interface PingResponse {
11
+ }
12
+ export interface DmenuRequest {
13
+ rawContent: string;
14
+ navigationTitle: string;
15
+ placeholder: string;
16
+ noIcon: boolean;
17
+ sectionTitle: string;
18
+ noSection: boolean;
19
+ }
20
+ export interface DmenuResponse {
21
+ output: string;
22
+ }
8
23
  export interface Request {
24
+ ping?: PingRequest | undefined;
9
25
  url?: UrlRequest | undefined;
26
+ dmenu?: DmenuRequest | undefined;
10
27
  }
11
28
  export interface Response {
29
+ ping?: PingResponse | undefined;
12
30
  url?: UrlResponse | undefined;
31
+ dmenu?: DmenuResponse | undefined;
13
32
  }
14
33
  export declare const UrlResponse: MessageFns<UrlResponse>;
15
34
  export declare const UrlRequest: MessageFns<UrlRequest>;
35
+ export declare const PingRequest: MessageFns<PingRequest>;
36
+ export declare const PingResponse: MessageFns<PingResponse>;
37
+ export declare const DmenuRequest: MessageFns<DmenuRequest>;
38
+ export declare const DmenuResponse: MessageFns<DmenuResponse>;
16
39
  export declare const Request: MessageFns<Request>;
17
40
  export declare const Response: MessageFns<Response>;
18
41
  type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
@@ -5,7 +5,7 @@
5
5
  // protoc v6.32.0
6
6
  // source: daemon.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.Response = exports.Request = exports.UrlRequest = exports.UrlResponse = exports.protobufPackage = void 0;
8
+ exports.Response = exports.Request = exports.DmenuResponse = exports.DmenuRequest = exports.PingResponse = exports.PingRequest = exports.UrlRequest = exports.UrlResponse = exports.protobufPackage = void 0;
9
9
  /* eslint-disable */
10
10
  const wire_1 = require("@bufbuild/protobuf/wire");
11
11
  exports.protobufPackage = "proto.ext.daemon";
@@ -97,13 +97,272 @@ exports.UrlRequest = {
97
97
  return message;
98
98
  },
99
99
  };
100
+ function createBasePingRequest() {
101
+ return {};
102
+ }
103
+ exports.PingRequest = {
104
+ encode(_, writer = new wire_1.BinaryWriter()) {
105
+ return writer;
106
+ },
107
+ decode(input, length) {
108
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
109
+ const end = length === undefined ? reader.len : reader.pos + length;
110
+ const message = createBasePingRequest();
111
+ while (reader.pos < end) {
112
+ const tag = reader.uint32();
113
+ switch (tag >>> 3) {
114
+ }
115
+ if ((tag & 7) === 4 || tag === 0) {
116
+ break;
117
+ }
118
+ reader.skip(tag & 7);
119
+ }
120
+ return message;
121
+ },
122
+ fromJSON(_) {
123
+ return {};
124
+ },
125
+ toJSON(_) {
126
+ const obj = {};
127
+ return obj;
128
+ },
129
+ create(base) {
130
+ return exports.PingRequest.fromPartial(base ?? {});
131
+ },
132
+ fromPartial(_) {
133
+ const message = createBasePingRequest();
134
+ return message;
135
+ },
136
+ };
137
+ function createBasePingResponse() {
138
+ return {};
139
+ }
140
+ exports.PingResponse = {
141
+ encode(_, writer = new wire_1.BinaryWriter()) {
142
+ return writer;
143
+ },
144
+ decode(input, length) {
145
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
146
+ const end = length === undefined ? reader.len : reader.pos + length;
147
+ const message = createBasePingResponse();
148
+ while (reader.pos < end) {
149
+ const tag = reader.uint32();
150
+ switch (tag >>> 3) {
151
+ }
152
+ if ((tag & 7) === 4 || tag === 0) {
153
+ break;
154
+ }
155
+ reader.skip(tag & 7);
156
+ }
157
+ return message;
158
+ },
159
+ fromJSON(_) {
160
+ return {};
161
+ },
162
+ toJSON(_) {
163
+ const obj = {};
164
+ return obj;
165
+ },
166
+ create(base) {
167
+ return exports.PingResponse.fromPartial(base ?? {});
168
+ },
169
+ fromPartial(_) {
170
+ const message = createBasePingResponse();
171
+ return message;
172
+ },
173
+ };
174
+ function createBaseDmenuRequest() {
175
+ return { rawContent: "", navigationTitle: "", placeholder: "", noIcon: false, sectionTitle: "", noSection: false };
176
+ }
177
+ exports.DmenuRequest = {
178
+ encode(message, writer = new wire_1.BinaryWriter()) {
179
+ if (message.rawContent !== "") {
180
+ writer.uint32(10).string(message.rawContent);
181
+ }
182
+ if (message.navigationTitle !== "") {
183
+ writer.uint32(18).string(message.navigationTitle);
184
+ }
185
+ if (message.placeholder !== "") {
186
+ writer.uint32(26).string(message.placeholder);
187
+ }
188
+ if (message.noIcon !== false) {
189
+ writer.uint32(32).bool(message.noIcon);
190
+ }
191
+ if (message.sectionTitle !== "") {
192
+ writer.uint32(42).string(message.sectionTitle);
193
+ }
194
+ if (message.noSection !== false) {
195
+ writer.uint32(48).bool(message.noSection);
196
+ }
197
+ return writer;
198
+ },
199
+ decode(input, length) {
200
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
201
+ const end = length === undefined ? reader.len : reader.pos + length;
202
+ const message = createBaseDmenuRequest();
203
+ while (reader.pos < end) {
204
+ const tag = reader.uint32();
205
+ switch (tag >>> 3) {
206
+ case 1: {
207
+ if (tag !== 10) {
208
+ break;
209
+ }
210
+ message.rawContent = reader.string();
211
+ continue;
212
+ }
213
+ case 2: {
214
+ if (tag !== 18) {
215
+ break;
216
+ }
217
+ message.navigationTitle = reader.string();
218
+ continue;
219
+ }
220
+ case 3: {
221
+ if (tag !== 26) {
222
+ break;
223
+ }
224
+ message.placeholder = reader.string();
225
+ continue;
226
+ }
227
+ case 4: {
228
+ if (tag !== 32) {
229
+ break;
230
+ }
231
+ message.noIcon = reader.bool();
232
+ continue;
233
+ }
234
+ case 5: {
235
+ if (tag !== 42) {
236
+ break;
237
+ }
238
+ message.sectionTitle = reader.string();
239
+ continue;
240
+ }
241
+ case 6: {
242
+ if (tag !== 48) {
243
+ break;
244
+ }
245
+ message.noSection = reader.bool();
246
+ continue;
247
+ }
248
+ }
249
+ if ((tag & 7) === 4 || tag === 0) {
250
+ break;
251
+ }
252
+ reader.skip(tag & 7);
253
+ }
254
+ return message;
255
+ },
256
+ fromJSON(object) {
257
+ return {
258
+ rawContent: isSet(object.rawContent) ? globalThis.String(object.rawContent) : "",
259
+ navigationTitle: isSet(object.navigationTitle) ? globalThis.String(object.navigationTitle) : "",
260
+ placeholder: isSet(object.placeholder) ? globalThis.String(object.placeholder) : "",
261
+ noIcon: isSet(object.noIcon) ? globalThis.Boolean(object.noIcon) : false,
262
+ sectionTitle: isSet(object.sectionTitle) ? globalThis.String(object.sectionTitle) : "",
263
+ noSection: isSet(object.noSection) ? globalThis.Boolean(object.noSection) : false,
264
+ };
265
+ },
266
+ toJSON(message) {
267
+ const obj = {};
268
+ if (message.rawContent !== "") {
269
+ obj.rawContent = message.rawContent;
270
+ }
271
+ if (message.navigationTitle !== "") {
272
+ obj.navigationTitle = message.navigationTitle;
273
+ }
274
+ if (message.placeholder !== "") {
275
+ obj.placeholder = message.placeholder;
276
+ }
277
+ if (message.noIcon !== false) {
278
+ obj.noIcon = message.noIcon;
279
+ }
280
+ if (message.sectionTitle !== "") {
281
+ obj.sectionTitle = message.sectionTitle;
282
+ }
283
+ if (message.noSection !== false) {
284
+ obj.noSection = message.noSection;
285
+ }
286
+ return obj;
287
+ },
288
+ create(base) {
289
+ return exports.DmenuRequest.fromPartial(base ?? {});
290
+ },
291
+ fromPartial(object) {
292
+ const message = createBaseDmenuRequest();
293
+ message.rawContent = object.rawContent ?? "";
294
+ message.navigationTitle = object.navigationTitle ?? "";
295
+ message.placeholder = object.placeholder ?? "";
296
+ message.noIcon = object.noIcon ?? false;
297
+ message.sectionTitle = object.sectionTitle ?? "";
298
+ message.noSection = object.noSection ?? false;
299
+ return message;
300
+ },
301
+ };
302
+ function createBaseDmenuResponse() {
303
+ return { output: "" };
304
+ }
305
+ exports.DmenuResponse = {
306
+ encode(message, writer = new wire_1.BinaryWriter()) {
307
+ if (message.output !== "") {
308
+ writer.uint32(10).string(message.output);
309
+ }
310
+ return writer;
311
+ },
312
+ decode(input, length) {
313
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
314
+ const end = length === undefined ? reader.len : reader.pos + length;
315
+ const message = createBaseDmenuResponse();
316
+ while (reader.pos < end) {
317
+ const tag = reader.uint32();
318
+ switch (tag >>> 3) {
319
+ case 1: {
320
+ if (tag !== 10) {
321
+ break;
322
+ }
323
+ message.output = reader.string();
324
+ continue;
325
+ }
326
+ }
327
+ if ((tag & 7) === 4 || tag === 0) {
328
+ break;
329
+ }
330
+ reader.skip(tag & 7);
331
+ }
332
+ return message;
333
+ },
334
+ fromJSON(object) {
335
+ return { output: isSet(object.output) ? globalThis.String(object.output) : "" };
336
+ },
337
+ toJSON(message) {
338
+ const obj = {};
339
+ if (message.output !== "") {
340
+ obj.output = message.output;
341
+ }
342
+ return obj;
343
+ },
344
+ create(base) {
345
+ return exports.DmenuResponse.fromPartial(base ?? {});
346
+ },
347
+ fromPartial(object) {
348
+ const message = createBaseDmenuResponse();
349
+ message.output = object.output ?? "";
350
+ return message;
351
+ },
352
+ };
100
353
  function createBaseRequest() {
101
- return { url: undefined };
354
+ return { ping: undefined, url: undefined, dmenu: undefined };
102
355
  }
103
356
  exports.Request = {
104
357
  encode(message, writer = new wire_1.BinaryWriter()) {
358
+ if (message.ping !== undefined) {
359
+ exports.PingRequest.encode(message.ping, writer.uint32(10).fork()).join();
360
+ }
105
361
  if (message.url !== undefined) {
106
- exports.UrlRequest.encode(message.url, writer.uint32(10).fork()).join();
362
+ exports.UrlRequest.encode(message.url, writer.uint32(18).fork()).join();
363
+ }
364
+ if (message.dmenu !== undefined) {
365
+ exports.DmenuRequest.encode(message.dmenu, writer.uint32(26).fork()).join();
107
366
  }
108
367
  return writer;
109
368
  },
@@ -118,9 +377,23 @@ exports.Request = {
118
377
  if (tag !== 10) {
119
378
  break;
120
379
  }
380
+ message.ping = exports.PingRequest.decode(reader, reader.uint32());
381
+ continue;
382
+ }
383
+ case 2: {
384
+ if (tag !== 18) {
385
+ break;
386
+ }
121
387
  message.url = exports.UrlRequest.decode(reader, reader.uint32());
122
388
  continue;
123
389
  }
390
+ case 3: {
391
+ if (tag !== 26) {
392
+ break;
393
+ }
394
+ message.dmenu = exports.DmenuRequest.decode(reader, reader.uint32());
395
+ continue;
396
+ }
124
397
  }
125
398
  if ((tag & 7) === 4 || tag === 0) {
126
399
  break;
@@ -130,13 +403,23 @@ exports.Request = {
130
403
  return message;
131
404
  },
132
405
  fromJSON(object) {
133
- return { url: isSet(object.url) ? exports.UrlRequest.fromJSON(object.url) : undefined };
406
+ return {
407
+ ping: isSet(object.ping) ? exports.PingRequest.fromJSON(object.ping) : undefined,
408
+ url: isSet(object.url) ? exports.UrlRequest.fromJSON(object.url) : undefined,
409
+ dmenu: isSet(object.dmenu) ? exports.DmenuRequest.fromJSON(object.dmenu) : undefined,
410
+ };
134
411
  },
135
412
  toJSON(message) {
136
413
  const obj = {};
414
+ if (message.ping !== undefined) {
415
+ obj.ping = exports.PingRequest.toJSON(message.ping);
416
+ }
137
417
  if (message.url !== undefined) {
138
418
  obj.url = exports.UrlRequest.toJSON(message.url);
139
419
  }
420
+ if (message.dmenu !== undefined) {
421
+ obj.dmenu = exports.DmenuRequest.toJSON(message.dmenu);
422
+ }
140
423
  return obj;
141
424
  },
142
425
  create(base) {
@@ -144,17 +427,29 @@ exports.Request = {
144
427
  },
145
428
  fromPartial(object) {
146
429
  const message = createBaseRequest();
430
+ message.ping = (object.ping !== undefined && object.ping !== null)
431
+ ? exports.PingRequest.fromPartial(object.ping)
432
+ : undefined;
147
433
  message.url = (object.url !== undefined && object.url !== null) ? exports.UrlRequest.fromPartial(object.url) : undefined;
434
+ message.dmenu = (object.dmenu !== undefined && object.dmenu !== null)
435
+ ? exports.DmenuRequest.fromPartial(object.dmenu)
436
+ : undefined;
148
437
  return message;
149
438
  },
150
439
  };
151
440
  function createBaseResponse() {
152
- return { url: undefined };
441
+ return { ping: undefined, url: undefined, dmenu: undefined };
153
442
  }
154
443
  exports.Response = {
155
444
  encode(message, writer = new wire_1.BinaryWriter()) {
445
+ if (message.ping !== undefined) {
446
+ exports.PingResponse.encode(message.ping, writer.uint32(10).fork()).join();
447
+ }
156
448
  if (message.url !== undefined) {
157
- exports.UrlResponse.encode(message.url, writer.uint32(10).fork()).join();
449
+ exports.UrlResponse.encode(message.url, writer.uint32(18).fork()).join();
450
+ }
451
+ if (message.dmenu !== undefined) {
452
+ exports.DmenuResponse.encode(message.dmenu, writer.uint32(26).fork()).join();
158
453
  }
159
454
  return writer;
160
455
  },
@@ -169,9 +464,23 @@ exports.Response = {
169
464
  if (tag !== 10) {
170
465
  break;
171
466
  }
467
+ message.ping = exports.PingResponse.decode(reader, reader.uint32());
468
+ continue;
469
+ }
470
+ case 2: {
471
+ if (tag !== 18) {
472
+ break;
473
+ }
172
474
  message.url = exports.UrlResponse.decode(reader, reader.uint32());
173
475
  continue;
174
476
  }
477
+ case 3: {
478
+ if (tag !== 26) {
479
+ break;
480
+ }
481
+ message.dmenu = exports.DmenuResponse.decode(reader, reader.uint32());
482
+ continue;
483
+ }
175
484
  }
176
485
  if ((tag & 7) === 4 || tag === 0) {
177
486
  break;
@@ -181,13 +490,23 @@ exports.Response = {
181
490
  return message;
182
491
  },
183
492
  fromJSON(object) {
184
- return { url: isSet(object.url) ? exports.UrlResponse.fromJSON(object.url) : undefined };
493
+ return {
494
+ ping: isSet(object.ping) ? exports.PingResponse.fromJSON(object.ping) : undefined,
495
+ url: isSet(object.url) ? exports.UrlResponse.fromJSON(object.url) : undefined,
496
+ dmenu: isSet(object.dmenu) ? exports.DmenuResponse.fromJSON(object.dmenu) : undefined,
497
+ };
185
498
  },
186
499
  toJSON(message) {
187
500
  const obj = {};
501
+ if (message.ping !== undefined) {
502
+ obj.ping = exports.PingResponse.toJSON(message.ping);
503
+ }
188
504
  if (message.url !== undefined) {
189
505
  obj.url = exports.UrlResponse.toJSON(message.url);
190
506
  }
507
+ if (message.dmenu !== undefined) {
508
+ obj.dmenu = exports.DmenuResponse.toJSON(message.dmenu);
509
+ }
191
510
  return obj;
192
511
  },
193
512
  create(base) {
@@ -195,7 +514,13 @@ exports.Response = {
195
514
  },
196
515
  fromPartial(object) {
197
516
  const message = createBaseResponse();
517
+ message.ping = (object.ping !== undefined && object.ping !== null)
518
+ ? exports.PingResponse.fromPartial(object.ping)
519
+ : undefined;
198
520
  message.url = (object.url !== undefined && object.url !== null) ? exports.UrlResponse.fromPartial(object.url) : undefined;
521
+ message.dmenu = (object.dmenu !== undefined && object.dmenu !== null)
522
+ ? exports.DmenuResponse.fromPartial(object.dmenu)
523
+ : undefined;
199
524
  return message;
200
525
  },
201
526
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vicinae/api",
3
- "version": "0.13.4",
3
+ "version": "0.14.1",
4
4
  "description": "TypeScript SDK to build Vicinae extensions",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",