@vicinae/api 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -0
- package/bin/run.js +9 -0
- package/dist/api/ai.d.ts +110 -0
- package/dist/api/ai.js +120 -0
- package/dist/api/alert.d.ts +22 -0
- package/dist/api/alert.js +61 -0
- package/dist/api/bus.d.ts +95 -0
- package/dist/api/bus.js +211 -0
- package/dist/api/cache.d.ts +117 -0
- package/dist/api/cache.js +52 -0
- package/dist/api/clipboard.d.ts +34 -0
- package/dist/api/clipboard.js +52 -0
- package/dist/api/color.d.ts +24 -0
- package/dist/api/color.js +24 -0
- package/dist/api/components/action-pannel.d.ts +23 -0
- package/dist/api/components/action-pannel.js +30 -0
- package/dist/api/components/actions.d.ts +52 -0
- package/dist/api/components/actions.js +81 -0
- package/dist/api/components/detail.d.ts +21 -0
- package/dist/api/components/detail.js +12 -0
- package/dist/api/components/dropdown.d.ts +36 -0
- package/dist/api/components/dropdown.js +21 -0
- package/dist/api/components/empty-view.d.ts +9 -0
- package/dist/api/components/empty-view.js +12 -0
- package/dist/api/components/form.d.ts +81 -0
- package/dist/api/components/form.js +53 -0
- package/dist/api/components/grid.d.ts +117 -0
- package/dist/api/components/grid.js +80 -0
- package/dist/api/components/index.d.ts +7 -0
- package/dist/api/components/index.js +23 -0
- package/dist/api/components/list.d.ts +109 -0
- package/dist/api/components/list.js +53 -0
- package/dist/api/components/menu-bar.d.ts +26 -0
- package/dist/api/components/menu-bar.js +25 -0
- package/dist/api/components/metadata.d.ts +23 -0
- package/dist/api/components/metadata.js +27 -0
- package/dist/api/components/tag.d.ts +16 -0
- package/dist/api/components/tag.js +28 -0
- package/dist/api/context/index.d.ts +1 -0
- package/dist/api/context/index.js +17 -0
- package/dist/api/context/navigation-context.d.ts +7 -0
- package/dist/api/context/navigation-context.js +8 -0
- package/dist/api/context/navigation-provider.d.ts +4 -0
- package/dist/api/context/navigation-provider.js +40 -0
- package/dist/api/controls.d.ts +3 -0
- package/dist/api/controls.js +20 -0
- package/dist/api/environment.d.ts +118 -0
- package/dist/api/environment.js +17 -0
- package/dist/api/hooks/index.d.ts +2 -0
- package/dist/api/hooks/index.js +18 -0
- package/dist/api/hooks/use-applications.d.ts +2 -0
- package/dist/api/hooks/use-applications.js +19 -0
- package/dist/api/hooks/use-imperative-form-handle.d.ts +3 -0
- package/dist/api/hooks/use-imperative-form-handle.js +25 -0
- package/dist/api/hooks/use-navigation.d.ts +4 -0
- package/dist/api/hooks/use-navigation.js +13 -0
- package/dist/api/hooks.d.ts +1 -0
- package/dist/api/hooks.js +24 -0
- package/dist/api/icon.d.ts +444 -0
- package/dist/api/icon.js +448 -0
- package/dist/api/image.d.ts +35 -0
- package/dist/api/image.js +84 -0
- package/dist/api/index.d.ts +19 -0
- package/dist/api/index.js +35 -0
- package/dist/api/keyboard.d.ts +16 -0
- package/dist/api/keyboard.js +12 -0
- package/dist/api/lib/result.d.ts +9 -0
- package/dist/api/lib/result.js +11 -0
- package/dist/api/local-storage.d.ts +13 -0
- package/dist/api/local-storage.js +31 -0
- package/dist/api/oauth.d.ts +319 -0
- package/dist/api/oauth.js +166 -0
- package/dist/api/preference.d.ts +5 -0
- package/dist/api/preference.js +18 -0
- package/dist/api/proto/application.d.ts +48 -0
- package/dist/api/proto/application.js +378 -0
- package/dist/api/proto/clipboard.d.ts +65 -0
- package/dist/api/proto/clipboard.js +614 -0
- package/dist/api/proto/common.d.ts +28 -0
- package/dist/api/proto/common.js +102 -0
- package/dist/api/proto/extension.d.ts +68 -0
- package/dist/api/proto/extension.js +604 -0
- package/dist/api/proto/google/protobuf/struct.d.ts +107 -0
- package/dist/api/proto/google/protobuf/struct.js +456 -0
- package/dist/api/proto/ipc.d.ts +64 -0
- package/dist/api/proto/ipc.js +604 -0
- package/dist/api/proto/manager.d.ts +82 -0
- package/dist/api/proto/manager.js +689 -0
- package/dist/api/proto/oauth.d.ts +55 -0
- package/dist/api/proto/oauth.js +379 -0
- package/dist/api/proto/storage.d.ts +80 -0
- package/dist/api/proto/storage.js +804 -0
- package/dist/api/proto/ui.d.ts +186 -0
- package/dist/api/proto/ui.js +1993 -0
- package/dist/api/toast.d.ts +168 -0
- package/dist/api/toast.js +152 -0
- package/dist/api/utils.d.ts +15 -0
- package/dist/api/utils.js +64 -0
- package/dist/commands/build/index.d.ts +11 -0
- package/dist/commands/build/index.js +123 -0
- package/dist/commands/develop/index.d.ts +10 -0
- package/dist/commands/develop/index.js +193 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +17 -0
- package/dist/schemas/manifest.d.ts +75 -0
- package/dist/schemas/manifest.js +4 -0
- package/dist/utils/logger.d.ts +13 -0
- package/dist/utils/logger.js +38 -0
- package/dist/utils/utils.d.ts +2 -0
- package/dist/utils/utils.js +19 -0
- package/dist/utils/vicinae.d.ts +12 -0
- package/dist/utils/vicinae.js +33 -0
- package/package.json +73 -0
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
+
export declare const protobufPackage = "google.protobuf";
|
|
3
|
+
/**
|
|
4
|
+
* `NullValue` is a singleton enumeration to represent the null value for the
|
|
5
|
+
* `Value` type union.
|
|
6
|
+
*
|
|
7
|
+
* The JSON representation for `NullValue` is JSON `null`.
|
|
8
|
+
*/
|
|
9
|
+
export declare enum NullValue {
|
|
10
|
+
/** NULL_VALUE - Null value. */
|
|
11
|
+
NULL_VALUE = 0,
|
|
12
|
+
UNRECOGNIZED = -1
|
|
13
|
+
}
|
|
14
|
+
export declare function nullValueFromJSON(object: any): NullValue;
|
|
15
|
+
export declare function nullValueToJSON(object: NullValue): string;
|
|
16
|
+
/**
|
|
17
|
+
* `Struct` represents a structured data value, consisting of fields
|
|
18
|
+
* which map to dynamically typed values. In some languages, `Struct`
|
|
19
|
+
* might be supported by a native representation. For example, in
|
|
20
|
+
* scripting languages like JS a struct is represented as an
|
|
21
|
+
* object. The details of that representation are described together
|
|
22
|
+
* with the proto support for the language.
|
|
23
|
+
*
|
|
24
|
+
* The JSON representation for `Struct` is JSON object.
|
|
25
|
+
*/
|
|
26
|
+
export interface Struct {
|
|
27
|
+
/** Unordered map of dynamically typed values. */
|
|
28
|
+
fields: {
|
|
29
|
+
[key: string]: any | undefined;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export interface Struct_FieldsEntry {
|
|
33
|
+
key: string;
|
|
34
|
+
value: any | undefined;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* `Value` represents a dynamically typed value which can be either
|
|
38
|
+
* null, a number, a string, a boolean, a recursive struct value, or a
|
|
39
|
+
* list of values. A producer of value is expected to set one of these
|
|
40
|
+
* variants. Absence of any variant indicates an error.
|
|
41
|
+
*
|
|
42
|
+
* The JSON representation for `Value` is JSON value.
|
|
43
|
+
*/
|
|
44
|
+
export interface Value {
|
|
45
|
+
/** Represents a null value. */
|
|
46
|
+
nullValue?: NullValue | undefined;
|
|
47
|
+
/** Represents a double value. */
|
|
48
|
+
numberValue?: number | undefined;
|
|
49
|
+
/** Represents a string value. */
|
|
50
|
+
stringValue?: string | undefined;
|
|
51
|
+
/** Represents a boolean value. */
|
|
52
|
+
boolValue?: boolean | undefined;
|
|
53
|
+
/** Represents a structured value. */
|
|
54
|
+
structValue?: {
|
|
55
|
+
[key: string]: any;
|
|
56
|
+
} | undefined;
|
|
57
|
+
/** Represents a repeated `Value`. */
|
|
58
|
+
listValue?: Array<any> | undefined;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* `ListValue` is a wrapper around a repeated field of values.
|
|
62
|
+
*
|
|
63
|
+
* The JSON representation for `ListValue` is JSON array.
|
|
64
|
+
*/
|
|
65
|
+
export interface ListValue {
|
|
66
|
+
/** Repeated field of dynamically typed values. */
|
|
67
|
+
values: any[];
|
|
68
|
+
}
|
|
69
|
+
export declare const Struct: MessageFns<Struct> & StructWrapperFns;
|
|
70
|
+
export declare const Struct_FieldsEntry: MessageFns<Struct_FieldsEntry>;
|
|
71
|
+
export declare const Value: MessageFns<Value> & AnyValueWrapperFns;
|
|
72
|
+
export declare const ListValue: MessageFns<ListValue> & ListValueWrapperFns;
|
|
73
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
74
|
+
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 {} ? {
|
|
75
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
76
|
+
} : Partial<T>;
|
|
77
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
78
|
+
export type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
79
|
+
[K in keyof P]: Exact<P[K], I[K]>;
|
|
80
|
+
} & {
|
|
81
|
+
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
|
82
|
+
};
|
|
83
|
+
export interface MessageFns<T> {
|
|
84
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
85
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
86
|
+
fromJSON(object: any): T;
|
|
87
|
+
toJSON(message: T): unknown;
|
|
88
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
89
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
90
|
+
}
|
|
91
|
+
export interface StructWrapperFns {
|
|
92
|
+
wrap(object: {
|
|
93
|
+
[key: string]: any;
|
|
94
|
+
} | undefined): Struct;
|
|
95
|
+
unwrap(message: Struct): {
|
|
96
|
+
[key: string]: any;
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
export interface AnyValueWrapperFns {
|
|
100
|
+
wrap(value: any): Value;
|
|
101
|
+
unwrap(message: any): string | number | boolean | Object | null | Array<any> | undefined;
|
|
102
|
+
}
|
|
103
|
+
export interface ListValueWrapperFns {
|
|
104
|
+
wrap(array: Array<any> | undefined): ListValue;
|
|
105
|
+
unwrap(message: ListValue): Array<any>;
|
|
106
|
+
}
|
|
107
|
+
export {};
|
|
@@ -0,0 +1,456 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v2.7.5
|
|
5
|
+
// protoc v6.31.1
|
|
6
|
+
// source: google/protobuf/struct.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.ListValue = exports.Value = exports.Struct_FieldsEntry = exports.Struct = exports.NullValue = exports.protobufPackage = void 0;
|
|
9
|
+
exports.nullValueFromJSON = nullValueFromJSON;
|
|
10
|
+
exports.nullValueToJSON = nullValueToJSON;
|
|
11
|
+
/* eslint-disable */
|
|
12
|
+
const wire_1 = require("@bufbuild/protobuf/wire");
|
|
13
|
+
exports.protobufPackage = "google.protobuf";
|
|
14
|
+
/**
|
|
15
|
+
* `NullValue` is a singleton enumeration to represent the null value for the
|
|
16
|
+
* `Value` type union.
|
|
17
|
+
*
|
|
18
|
+
* The JSON representation for `NullValue` is JSON `null`.
|
|
19
|
+
*/
|
|
20
|
+
var NullValue;
|
|
21
|
+
(function (NullValue) {
|
|
22
|
+
/** NULL_VALUE - Null value. */
|
|
23
|
+
NullValue[NullValue["NULL_VALUE"] = 0] = "NULL_VALUE";
|
|
24
|
+
NullValue[NullValue["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
25
|
+
})(NullValue || (exports.NullValue = NullValue = {}));
|
|
26
|
+
function nullValueFromJSON(object) {
|
|
27
|
+
switch (object) {
|
|
28
|
+
case 0:
|
|
29
|
+
case "NULL_VALUE":
|
|
30
|
+
return NullValue.NULL_VALUE;
|
|
31
|
+
case -1:
|
|
32
|
+
case "UNRECOGNIZED":
|
|
33
|
+
default:
|
|
34
|
+
return NullValue.UNRECOGNIZED;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
function nullValueToJSON(object) {
|
|
38
|
+
switch (object) {
|
|
39
|
+
case NullValue.NULL_VALUE:
|
|
40
|
+
return "NULL_VALUE";
|
|
41
|
+
case NullValue.UNRECOGNIZED:
|
|
42
|
+
default:
|
|
43
|
+
return "UNRECOGNIZED";
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function createBaseStruct() {
|
|
47
|
+
return { fields: {} };
|
|
48
|
+
}
|
|
49
|
+
exports.Struct = {
|
|
50
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
51
|
+
Object.entries(message.fields).forEach(([key, value]) => {
|
|
52
|
+
if (value !== undefined) {
|
|
53
|
+
exports.Struct_FieldsEntry.encode({ key: key, value }, writer.uint32(10).fork()).join();
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
return writer;
|
|
57
|
+
},
|
|
58
|
+
decode(input, length) {
|
|
59
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
60
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
61
|
+
const message = createBaseStruct();
|
|
62
|
+
while (reader.pos < end) {
|
|
63
|
+
const tag = reader.uint32();
|
|
64
|
+
switch (tag >>> 3) {
|
|
65
|
+
case 1: {
|
|
66
|
+
if (tag !== 10) {
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
69
|
+
const entry1 = exports.Struct_FieldsEntry.decode(reader, reader.uint32());
|
|
70
|
+
if (entry1.value !== undefined) {
|
|
71
|
+
message.fields[entry1.key] = entry1.value;
|
|
72
|
+
}
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
reader.skip(tag & 7);
|
|
80
|
+
}
|
|
81
|
+
return message;
|
|
82
|
+
},
|
|
83
|
+
fromJSON(object) {
|
|
84
|
+
return {
|
|
85
|
+
fields: isObject(object.fields)
|
|
86
|
+
? Object.entries(object.fields).reduce((acc, [key, value]) => {
|
|
87
|
+
acc[key] = value;
|
|
88
|
+
return acc;
|
|
89
|
+
}, {})
|
|
90
|
+
: {},
|
|
91
|
+
};
|
|
92
|
+
},
|
|
93
|
+
toJSON(message) {
|
|
94
|
+
const obj = {};
|
|
95
|
+
if (message.fields) {
|
|
96
|
+
const entries = Object.entries(message.fields);
|
|
97
|
+
if (entries.length > 0) {
|
|
98
|
+
obj.fields = {};
|
|
99
|
+
entries.forEach(([k, v]) => {
|
|
100
|
+
obj.fields[k] = v;
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return obj;
|
|
105
|
+
},
|
|
106
|
+
create(base) {
|
|
107
|
+
return exports.Struct.fromPartial(base ?? {});
|
|
108
|
+
},
|
|
109
|
+
fromPartial(object) {
|
|
110
|
+
const message = createBaseStruct();
|
|
111
|
+
message.fields = Object.entries(object.fields ?? {}).reduce((acc, [key, value]) => {
|
|
112
|
+
if (value !== undefined) {
|
|
113
|
+
acc[key] = value;
|
|
114
|
+
}
|
|
115
|
+
return acc;
|
|
116
|
+
}, {});
|
|
117
|
+
return message;
|
|
118
|
+
},
|
|
119
|
+
wrap(object) {
|
|
120
|
+
const struct = createBaseStruct();
|
|
121
|
+
if (object !== undefined) {
|
|
122
|
+
for (const key of Object.keys(object)) {
|
|
123
|
+
struct.fields[key] = object[key];
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return struct;
|
|
127
|
+
},
|
|
128
|
+
unwrap(message) {
|
|
129
|
+
const object = {};
|
|
130
|
+
if (message.fields) {
|
|
131
|
+
for (const key of Object.keys(message.fields)) {
|
|
132
|
+
object[key] = message.fields[key];
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
return object;
|
|
136
|
+
},
|
|
137
|
+
};
|
|
138
|
+
function createBaseStruct_FieldsEntry() {
|
|
139
|
+
return { key: "", value: undefined };
|
|
140
|
+
}
|
|
141
|
+
exports.Struct_FieldsEntry = {
|
|
142
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
143
|
+
if (message.key !== "") {
|
|
144
|
+
writer.uint32(10).string(message.key);
|
|
145
|
+
}
|
|
146
|
+
if (message.value !== undefined) {
|
|
147
|
+
exports.Value.encode(exports.Value.wrap(message.value), writer.uint32(18).fork()).join();
|
|
148
|
+
}
|
|
149
|
+
return writer;
|
|
150
|
+
},
|
|
151
|
+
decode(input, length) {
|
|
152
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
153
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
154
|
+
const message = createBaseStruct_FieldsEntry();
|
|
155
|
+
while (reader.pos < end) {
|
|
156
|
+
const tag = reader.uint32();
|
|
157
|
+
switch (tag >>> 3) {
|
|
158
|
+
case 1: {
|
|
159
|
+
if (tag !== 10) {
|
|
160
|
+
break;
|
|
161
|
+
}
|
|
162
|
+
message.key = reader.string();
|
|
163
|
+
continue;
|
|
164
|
+
}
|
|
165
|
+
case 2: {
|
|
166
|
+
if (tag !== 18) {
|
|
167
|
+
break;
|
|
168
|
+
}
|
|
169
|
+
message.value = exports.Value.unwrap(exports.Value.decode(reader, reader.uint32()));
|
|
170
|
+
continue;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
174
|
+
break;
|
|
175
|
+
}
|
|
176
|
+
reader.skip(tag & 7);
|
|
177
|
+
}
|
|
178
|
+
return message;
|
|
179
|
+
},
|
|
180
|
+
fromJSON(object) {
|
|
181
|
+
return {
|
|
182
|
+
key: isSet(object.key) ? globalThis.String(object.key) : "",
|
|
183
|
+
value: isSet(object?.value) ? object.value : undefined,
|
|
184
|
+
};
|
|
185
|
+
},
|
|
186
|
+
toJSON(message) {
|
|
187
|
+
const obj = {};
|
|
188
|
+
if (message.key !== "") {
|
|
189
|
+
obj.key = message.key;
|
|
190
|
+
}
|
|
191
|
+
if (message.value !== undefined) {
|
|
192
|
+
obj.value = message.value;
|
|
193
|
+
}
|
|
194
|
+
return obj;
|
|
195
|
+
},
|
|
196
|
+
create(base) {
|
|
197
|
+
return exports.Struct_FieldsEntry.fromPartial(base ?? {});
|
|
198
|
+
},
|
|
199
|
+
fromPartial(object) {
|
|
200
|
+
const message = createBaseStruct_FieldsEntry();
|
|
201
|
+
message.key = object.key ?? "";
|
|
202
|
+
message.value = object.value ?? undefined;
|
|
203
|
+
return message;
|
|
204
|
+
},
|
|
205
|
+
};
|
|
206
|
+
function createBaseValue() {
|
|
207
|
+
return {
|
|
208
|
+
nullValue: undefined,
|
|
209
|
+
numberValue: undefined,
|
|
210
|
+
stringValue: undefined,
|
|
211
|
+
boolValue: undefined,
|
|
212
|
+
structValue: undefined,
|
|
213
|
+
listValue: undefined,
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
exports.Value = {
|
|
217
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
218
|
+
if (message.nullValue !== undefined) {
|
|
219
|
+
writer.uint32(8).int32(message.nullValue);
|
|
220
|
+
}
|
|
221
|
+
if (message.numberValue !== undefined) {
|
|
222
|
+
writer.uint32(17).double(message.numberValue);
|
|
223
|
+
}
|
|
224
|
+
if (message.stringValue !== undefined) {
|
|
225
|
+
writer.uint32(26).string(message.stringValue);
|
|
226
|
+
}
|
|
227
|
+
if (message.boolValue !== undefined) {
|
|
228
|
+
writer.uint32(32).bool(message.boolValue);
|
|
229
|
+
}
|
|
230
|
+
if (message.structValue !== undefined) {
|
|
231
|
+
exports.Struct.encode(exports.Struct.wrap(message.structValue), writer.uint32(42).fork()).join();
|
|
232
|
+
}
|
|
233
|
+
if (message.listValue !== undefined) {
|
|
234
|
+
exports.ListValue.encode(exports.ListValue.wrap(message.listValue), writer.uint32(50).fork()).join();
|
|
235
|
+
}
|
|
236
|
+
return writer;
|
|
237
|
+
},
|
|
238
|
+
decode(input, length) {
|
|
239
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
240
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
241
|
+
const message = createBaseValue();
|
|
242
|
+
while (reader.pos < end) {
|
|
243
|
+
const tag = reader.uint32();
|
|
244
|
+
switch (tag >>> 3) {
|
|
245
|
+
case 1: {
|
|
246
|
+
if (tag !== 8) {
|
|
247
|
+
break;
|
|
248
|
+
}
|
|
249
|
+
message.nullValue = reader.int32();
|
|
250
|
+
continue;
|
|
251
|
+
}
|
|
252
|
+
case 2: {
|
|
253
|
+
if (tag !== 17) {
|
|
254
|
+
break;
|
|
255
|
+
}
|
|
256
|
+
message.numberValue = reader.double();
|
|
257
|
+
continue;
|
|
258
|
+
}
|
|
259
|
+
case 3: {
|
|
260
|
+
if (tag !== 26) {
|
|
261
|
+
break;
|
|
262
|
+
}
|
|
263
|
+
message.stringValue = reader.string();
|
|
264
|
+
continue;
|
|
265
|
+
}
|
|
266
|
+
case 4: {
|
|
267
|
+
if (tag !== 32) {
|
|
268
|
+
break;
|
|
269
|
+
}
|
|
270
|
+
message.boolValue = reader.bool();
|
|
271
|
+
continue;
|
|
272
|
+
}
|
|
273
|
+
case 5: {
|
|
274
|
+
if (tag !== 42) {
|
|
275
|
+
break;
|
|
276
|
+
}
|
|
277
|
+
message.structValue = exports.Struct.unwrap(exports.Struct.decode(reader, reader.uint32()));
|
|
278
|
+
continue;
|
|
279
|
+
}
|
|
280
|
+
case 6: {
|
|
281
|
+
if (tag !== 50) {
|
|
282
|
+
break;
|
|
283
|
+
}
|
|
284
|
+
message.listValue = exports.ListValue.unwrap(exports.ListValue.decode(reader, reader.uint32()));
|
|
285
|
+
continue;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
289
|
+
break;
|
|
290
|
+
}
|
|
291
|
+
reader.skip(tag & 7);
|
|
292
|
+
}
|
|
293
|
+
return message;
|
|
294
|
+
},
|
|
295
|
+
fromJSON(object) {
|
|
296
|
+
return {
|
|
297
|
+
nullValue: isSet(object.nullValue) ? nullValueFromJSON(object.nullValue) : undefined,
|
|
298
|
+
numberValue: isSet(object.numberValue) ? globalThis.Number(object.numberValue) : undefined,
|
|
299
|
+
stringValue: isSet(object.stringValue) ? globalThis.String(object.stringValue) : undefined,
|
|
300
|
+
boolValue: isSet(object.boolValue) ? globalThis.Boolean(object.boolValue) : undefined,
|
|
301
|
+
structValue: isObject(object.structValue) ? object.structValue : undefined,
|
|
302
|
+
listValue: globalThis.Array.isArray(object.listValue) ? [...object.listValue] : undefined,
|
|
303
|
+
};
|
|
304
|
+
},
|
|
305
|
+
toJSON(message) {
|
|
306
|
+
const obj = {};
|
|
307
|
+
if (message.nullValue !== undefined) {
|
|
308
|
+
obj.nullValue = nullValueToJSON(message.nullValue);
|
|
309
|
+
}
|
|
310
|
+
if (message.numberValue !== undefined) {
|
|
311
|
+
obj.numberValue = message.numberValue;
|
|
312
|
+
}
|
|
313
|
+
if (message.stringValue !== undefined) {
|
|
314
|
+
obj.stringValue = message.stringValue;
|
|
315
|
+
}
|
|
316
|
+
if (message.boolValue !== undefined) {
|
|
317
|
+
obj.boolValue = message.boolValue;
|
|
318
|
+
}
|
|
319
|
+
if (message.structValue !== undefined) {
|
|
320
|
+
obj.structValue = message.structValue;
|
|
321
|
+
}
|
|
322
|
+
if (message.listValue !== undefined) {
|
|
323
|
+
obj.listValue = message.listValue;
|
|
324
|
+
}
|
|
325
|
+
return obj;
|
|
326
|
+
},
|
|
327
|
+
create(base) {
|
|
328
|
+
return exports.Value.fromPartial(base ?? {});
|
|
329
|
+
},
|
|
330
|
+
fromPartial(object) {
|
|
331
|
+
const message = createBaseValue();
|
|
332
|
+
message.nullValue = object.nullValue ?? undefined;
|
|
333
|
+
message.numberValue = object.numberValue ?? undefined;
|
|
334
|
+
message.stringValue = object.stringValue ?? undefined;
|
|
335
|
+
message.boolValue = object.boolValue ?? undefined;
|
|
336
|
+
message.structValue = object.structValue ?? undefined;
|
|
337
|
+
message.listValue = object.listValue ?? undefined;
|
|
338
|
+
return message;
|
|
339
|
+
},
|
|
340
|
+
wrap(value) {
|
|
341
|
+
const result = createBaseValue();
|
|
342
|
+
if (value === null) {
|
|
343
|
+
result.nullValue = NullValue.NULL_VALUE;
|
|
344
|
+
}
|
|
345
|
+
else if (typeof value === "boolean") {
|
|
346
|
+
result.boolValue = value;
|
|
347
|
+
}
|
|
348
|
+
else if (typeof value === "number") {
|
|
349
|
+
result.numberValue = value;
|
|
350
|
+
}
|
|
351
|
+
else if (typeof value === "string") {
|
|
352
|
+
result.stringValue = value;
|
|
353
|
+
}
|
|
354
|
+
else if (globalThis.Array.isArray(value)) {
|
|
355
|
+
result.listValue = value;
|
|
356
|
+
}
|
|
357
|
+
else if (typeof value === "object") {
|
|
358
|
+
result.structValue = value;
|
|
359
|
+
}
|
|
360
|
+
else if (typeof value !== "undefined") {
|
|
361
|
+
throw new globalThis.Error("Unsupported any value type: " + typeof value);
|
|
362
|
+
}
|
|
363
|
+
return result;
|
|
364
|
+
},
|
|
365
|
+
unwrap(message) {
|
|
366
|
+
if (message.stringValue !== undefined) {
|
|
367
|
+
return message.stringValue;
|
|
368
|
+
}
|
|
369
|
+
else if (message?.numberValue !== undefined) {
|
|
370
|
+
return message.numberValue;
|
|
371
|
+
}
|
|
372
|
+
else if (message?.boolValue !== undefined) {
|
|
373
|
+
return message.boolValue;
|
|
374
|
+
}
|
|
375
|
+
else if (message?.structValue !== undefined) {
|
|
376
|
+
return message.structValue;
|
|
377
|
+
}
|
|
378
|
+
else if (message?.listValue !== undefined) {
|
|
379
|
+
return message.listValue;
|
|
380
|
+
}
|
|
381
|
+
else if (message?.nullValue !== undefined) {
|
|
382
|
+
return null;
|
|
383
|
+
}
|
|
384
|
+
return undefined;
|
|
385
|
+
},
|
|
386
|
+
};
|
|
387
|
+
function createBaseListValue() {
|
|
388
|
+
return { values: [] };
|
|
389
|
+
}
|
|
390
|
+
exports.ListValue = {
|
|
391
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
392
|
+
for (const v of message.values) {
|
|
393
|
+
exports.Value.encode(exports.Value.wrap(v), writer.uint32(10).fork()).join();
|
|
394
|
+
}
|
|
395
|
+
return writer;
|
|
396
|
+
},
|
|
397
|
+
decode(input, length) {
|
|
398
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
399
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
400
|
+
const message = createBaseListValue();
|
|
401
|
+
while (reader.pos < end) {
|
|
402
|
+
const tag = reader.uint32();
|
|
403
|
+
switch (tag >>> 3) {
|
|
404
|
+
case 1: {
|
|
405
|
+
if (tag !== 10) {
|
|
406
|
+
break;
|
|
407
|
+
}
|
|
408
|
+
message.values.push(exports.Value.unwrap(exports.Value.decode(reader, reader.uint32())));
|
|
409
|
+
continue;
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
413
|
+
break;
|
|
414
|
+
}
|
|
415
|
+
reader.skip(tag & 7);
|
|
416
|
+
}
|
|
417
|
+
return message;
|
|
418
|
+
},
|
|
419
|
+
fromJSON(object) {
|
|
420
|
+
return { values: globalThis.Array.isArray(object?.values) ? [...object.values] : [] };
|
|
421
|
+
},
|
|
422
|
+
toJSON(message) {
|
|
423
|
+
const obj = {};
|
|
424
|
+
if (message.values?.length) {
|
|
425
|
+
obj.values = message.values;
|
|
426
|
+
}
|
|
427
|
+
return obj;
|
|
428
|
+
},
|
|
429
|
+
create(base) {
|
|
430
|
+
return exports.ListValue.fromPartial(base ?? {});
|
|
431
|
+
},
|
|
432
|
+
fromPartial(object) {
|
|
433
|
+
const message = createBaseListValue();
|
|
434
|
+
message.values = object.values?.map((e) => e) || [];
|
|
435
|
+
return message;
|
|
436
|
+
},
|
|
437
|
+
wrap(array) {
|
|
438
|
+
const result = createBaseListValue();
|
|
439
|
+
result.values = array ?? [];
|
|
440
|
+
return result;
|
|
441
|
+
},
|
|
442
|
+
unwrap(message) {
|
|
443
|
+
if (message?.hasOwnProperty("values") && globalThis.Array.isArray(message.values)) {
|
|
444
|
+
return message.values;
|
|
445
|
+
}
|
|
446
|
+
else {
|
|
447
|
+
return message;
|
|
448
|
+
}
|
|
449
|
+
},
|
|
450
|
+
};
|
|
451
|
+
function isObject(value) {
|
|
452
|
+
return typeof value === "object" && value !== null;
|
|
453
|
+
}
|
|
454
|
+
function isSet(value) {
|
|
455
|
+
return value !== null && value !== undefined;
|
|
456
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
+
import { ErrorResponse } from "./common";
|
|
3
|
+
import { Event, Request, Response } from "./extension";
|
|
4
|
+
import { RequestData, ResponseData } from "./manager";
|
|
5
|
+
export declare const protobufPackage = "proto.ext";
|
|
6
|
+
export interface IpcMessage {
|
|
7
|
+
extensionRequest?: QualifiedExtensionRequest | undefined;
|
|
8
|
+
extensionResponse?: QualifiedExtensionResponse | undefined;
|
|
9
|
+
extensionEvent?: QualifiedExtensionEvent | undefined;
|
|
10
|
+
managerRequest?: ManagerRequest | undefined;
|
|
11
|
+
managerResponse?: ManagerResponse | undefined;
|
|
12
|
+
}
|
|
13
|
+
export interface ManagerRequest {
|
|
14
|
+
requestId: string;
|
|
15
|
+
payload: RequestData | undefined;
|
|
16
|
+
}
|
|
17
|
+
export interface ManagerResponse {
|
|
18
|
+
requestId: string;
|
|
19
|
+
value?: ResponseData | undefined;
|
|
20
|
+
error?: ErrorResponse | undefined;
|
|
21
|
+
}
|
|
22
|
+
export interface QualifiedExtensionRequest {
|
|
23
|
+
sessionId: string;
|
|
24
|
+
request: Request | undefined;
|
|
25
|
+
}
|
|
26
|
+
export interface QualifiedExtensionResponse {
|
|
27
|
+
sessionId: string;
|
|
28
|
+
response: Response | undefined;
|
|
29
|
+
}
|
|
30
|
+
export interface QualifiedExtensionEvent {
|
|
31
|
+
sessionId: string;
|
|
32
|
+
event: Event | undefined;
|
|
33
|
+
}
|
|
34
|
+
export interface ExtensionMessage {
|
|
35
|
+
request?: Request | undefined;
|
|
36
|
+
response?: Response | undefined;
|
|
37
|
+
event?: Event | undefined;
|
|
38
|
+
}
|
|
39
|
+
export declare const IpcMessage: MessageFns<IpcMessage>;
|
|
40
|
+
export declare const ManagerRequest: MessageFns<ManagerRequest>;
|
|
41
|
+
export declare const ManagerResponse: MessageFns<ManagerResponse>;
|
|
42
|
+
export declare const QualifiedExtensionRequest: MessageFns<QualifiedExtensionRequest>;
|
|
43
|
+
export declare const QualifiedExtensionResponse: MessageFns<QualifiedExtensionResponse>;
|
|
44
|
+
export declare const QualifiedExtensionEvent: MessageFns<QualifiedExtensionEvent>;
|
|
45
|
+
export declare const ExtensionMessage: MessageFns<ExtensionMessage>;
|
|
46
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
47
|
+
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 {} ? {
|
|
48
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
49
|
+
} : Partial<T>;
|
|
50
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
51
|
+
export type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
52
|
+
[K in keyof P]: Exact<P[K], I[K]>;
|
|
53
|
+
} & {
|
|
54
|
+
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
|
55
|
+
};
|
|
56
|
+
export interface MessageFns<T> {
|
|
57
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
58
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
59
|
+
fromJSON(object: any): T;
|
|
60
|
+
toJSON(message: T): unknown;
|
|
61
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
62
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
63
|
+
}
|
|
64
|
+
export {};
|