@keyhive/keyhive 0.0.0-alpha.9 → 0.1.0-alpha.3
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/package.json +6 -5
- package/pkg/keyhive_wasm.d.ts +464 -352
- package/pkg/keyhive_wasm.js +5 -1
- package/pkg/keyhive_wasm_bg.js +1805 -1814
- package/pkg/keyhive_wasm_bg.wasm +0 -0
- package/pkg/keyhive_wasm_bg.wasm.d.ts +214 -173
- package/pkg/package.json +3 -3
- package/pkg-node/keyhive_wasm.d.ts +464 -352
- package/pkg-node/keyhive_wasm.js +2056 -2117
- package/pkg-node/keyhive_wasm_bg.wasm +0 -0
- package/pkg-node/keyhive_wasm_bg.wasm.d.ts +214 -173
- package/pkg-node/package.json +3 -3
- package/pkg-slim/keyhive_wasm.d.ts +706 -552
- package/pkg-slim/keyhive_wasm.js +2079 -2013
- package/pkg-slim/keyhive_wasm_bg.wasm +0 -0
- package/pkg-slim/keyhive_wasm_bg.wasm.base64.js +1 -1
- package/pkg-slim/keyhive_wasm_bg.wasm.d.ts +214 -173
- package/pkg-slim/package.json +3 -3
|
@@ -1,640 +1,794 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
+
|
|
4
|
+
export class Access {
|
|
5
|
+
private constructor();
|
|
6
|
+
free(): void;
|
|
7
|
+
[Symbol.dispose](): void;
|
|
8
|
+
toString(): string;
|
|
9
|
+
static tryFromString(s: string): Access | undefined;
|
|
10
|
+
}
|
|
11
|
+
|
|
3
12
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* This function needs to be called at least once during initialisation.
|
|
7
|
-
* https://rustwasm.github.io/docs/wasm-pack/tutorials/npm-browser-packages/template-deep-dive/src-utils-rs.html#2-what-is-console_error_panic_hook
|
|
13
|
+
* The result of adding a member: the membership delegation, plus any new leaf
|
|
14
|
+
* secrets produced by auto-rekeying a non-forward-secret document on add.
|
|
8
15
|
*/
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
export class AddMemberUpdate {
|
|
17
|
+
private constructor();
|
|
18
|
+
free(): void;
|
|
19
|
+
[Symbol.dispose](): void;
|
|
20
|
+
readonly delegation: SignedDelegation;
|
|
21
|
+
/**
|
|
22
|
+
* New leaf secret keypairs from auto-rekeying a non-forward-secret document
|
|
23
|
+
* when this reader was added, serialized as a
|
|
24
|
+
* `BTreeMap<ShareKey, ShareSecretKey>` (the format `importPrekeySecrets`
|
|
25
|
+
* accepts). A sibling instance of this identity (e.g. a tab and its
|
|
26
|
+
* SharedWorker) installs them to derive the rotated key. `undefined` when
|
|
27
|
+
* no rotation occurred (a forward-secret document).
|
|
28
|
+
*/
|
|
29
|
+
readonly leafSecrets: Uint8Array | undefined;
|
|
22
30
|
}
|
|
31
|
+
|
|
23
32
|
export class Agent {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
33
|
+
private constructor();
|
|
34
|
+
free(): void;
|
|
35
|
+
[Symbol.dispose](): void;
|
|
36
|
+
isDocument(): boolean;
|
|
37
|
+
isGroup(): boolean;
|
|
38
|
+
isIndividual(): boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Returns prekey operation hashes for this [`Agent`] as an array of hash bytes.
|
|
41
|
+
*/
|
|
42
|
+
keyOpHashes(): Promise<Uint8Array[]>;
|
|
43
|
+
/**
|
|
44
|
+
* Returns prekey operations for this agent as a Map of hash -> serialized bytes for [`StaticEvent`]
|
|
45
|
+
*/
|
|
46
|
+
keyOps(): Promise<Map<any, any>>;
|
|
47
|
+
toString(): string;
|
|
48
|
+
readonly id: Identifier;
|
|
32
49
|
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Result of [`JsKeyhive::all_agent_events`], containing all events for all agents
|
|
53
|
+
* with deduplicated storage and two-tier indirection for membership, prekey, and CGKA ops.
|
|
54
|
+
*
|
|
55
|
+
* The consumer follows: agent -> source IDs -> hashes -> event bytes.
|
|
56
|
+
*/
|
|
57
|
+
export class AllAgentEvents {
|
|
58
|
+
private constructor();
|
|
59
|
+
free(): void;
|
|
60
|
+
[Symbol.dispose](): void;
|
|
61
|
+
readonly agentCgkaSources: Map<any, any>;
|
|
62
|
+
readonly agentMembershipSources: Map<any, any>;
|
|
63
|
+
readonly agentPrekeySources: Map<any, any>;
|
|
64
|
+
readonly cgkaSources: Map<any, any>;
|
|
65
|
+
readonly events: Map<any, any>;
|
|
66
|
+
readonly membershipSources: Map<any, any>;
|
|
67
|
+
readonly prekeySources: Map<any, any>;
|
|
68
|
+
}
|
|
69
|
+
|
|
33
70
|
export class Archive {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
71
|
+
free(): void;
|
|
72
|
+
[Symbol.dispose](): void;
|
|
73
|
+
toBytes(): Uint8Array;
|
|
74
|
+
tryToKeyhive(ciphertext_store: CiphertextStore, signer: Signer, event_handler: Function): Promise<Keyhive>;
|
|
75
|
+
constructor(bytes: Uint8Array);
|
|
39
76
|
}
|
|
77
|
+
|
|
40
78
|
export class CannotParseEd25519SigningKey {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
79
|
+
private constructor();
|
|
80
|
+
free(): void;
|
|
81
|
+
[Symbol.dispose](): void;
|
|
44
82
|
}
|
|
83
|
+
|
|
45
84
|
export class CannotParseIdentifier {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
85
|
+
private constructor();
|
|
86
|
+
free(): void;
|
|
87
|
+
[Symbol.dispose](): void;
|
|
49
88
|
}
|
|
89
|
+
|
|
50
90
|
export class Capability {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
91
|
+
private constructor();
|
|
92
|
+
free(): void;
|
|
93
|
+
[Symbol.dispose](): void;
|
|
94
|
+
readonly can: Access;
|
|
95
|
+
readonly proof: SignedDelegation;
|
|
96
|
+
readonly who: Agent;
|
|
57
97
|
}
|
|
98
|
+
|
|
58
99
|
export class CgkaOperation {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
100
|
+
private constructor();
|
|
101
|
+
free(): void;
|
|
102
|
+
[Symbol.dispose](): void;
|
|
103
|
+
readonly variant: string;
|
|
63
104
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
105
|
+
|
|
106
|
+
export class ChangeId {
|
|
107
|
+
free(): void;
|
|
108
|
+
[Symbol.dispose](): void;
|
|
109
|
+
/**
|
|
110
|
+
* Upcasts; to the JS-import type for [`JsChangeId`].
|
|
111
|
+
*/
|
|
112
|
+
__wasm_refgen_toJsChangeId(): ChangeId;
|
|
113
|
+
constructor(bytes: Uint8Array);
|
|
114
|
+
readonly bytes: Uint8Array;
|
|
69
115
|
}
|
|
116
|
+
|
|
70
117
|
export class CiphertextStore {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
118
|
+
private constructor();
|
|
119
|
+
free(): void;
|
|
120
|
+
[Symbol.dispose](): void;
|
|
121
|
+
static newFromWebStorage(storage: Storage): CiphertextStore;
|
|
122
|
+
static newInMemory(): CiphertextStore;
|
|
76
123
|
}
|
|
124
|
+
|
|
77
125
|
export class ContactCard {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
126
|
+
private constructor();
|
|
127
|
+
free(): void;
|
|
128
|
+
[Symbol.dispose](): void;
|
|
129
|
+
static fromJson(json: string): ContactCard;
|
|
130
|
+
signature(): Uint8Array;
|
|
131
|
+
toJson(): string;
|
|
132
|
+
readonly id: Identifier;
|
|
133
|
+
readonly individualId: IndividualId;
|
|
134
|
+
readonly op: Event;
|
|
135
|
+
readonly shareKey: ShareKey;
|
|
86
136
|
}
|
|
137
|
+
|
|
87
138
|
export class Delegation {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}
|
|
96
|
-
export class DelegationError {
|
|
97
|
-
private constructor();
|
|
98
|
-
free(): void;
|
|
99
|
-
[Symbol.dispose](): void;
|
|
139
|
+
private constructor();
|
|
140
|
+
free(): void;
|
|
141
|
+
[Symbol.dispose](): void;
|
|
142
|
+
readonly after: History;
|
|
143
|
+
readonly can: Access;
|
|
144
|
+
readonly delegate: Agent;
|
|
145
|
+
readonly proof: SignedDelegation | undefined;
|
|
100
146
|
}
|
|
147
|
+
|
|
101
148
|
export class DocContentRefs {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
149
|
+
free(): void;
|
|
150
|
+
[Symbol.dispose](): void;
|
|
151
|
+
addChangeId(hash: ChangeId): Promise<void>;
|
|
152
|
+
constructor(doc_id: DocumentId, change_hashes: ChangeId[]);
|
|
153
|
+
readonly change_hashes: Promise<ChangeId[]>;
|
|
154
|
+
readonly docId: DocumentId;
|
|
108
155
|
}
|
|
156
|
+
|
|
109
157
|
export class Document {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
158
|
+
private constructor();
|
|
159
|
+
free(): void;
|
|
160
|
+
[Symbol.dispose](): void;
|
|
161
|
+
/**
|
|
162
|
+
* Upcasts; to the JS-import type for [`JsDocument`].
|
|
163
|
+
*/
|
|
164
|
+
__wasm_refgen_toJsDocument(): Document;
|
|
165
|
+
members(): Promise<Capability[]>;
|
|
166
|
+
toAgent(): Agent;
|
|
167
|
+
toMembered(): Membered;
|
|
168
|
+
toPeer(): Peer;
|
|
169
|
+
readonly doc_id: DocumentId;
|
|
170
|
+
readonly id: Identifier;
|
|
118
171
|
}
|
|
172
|
+
|
|
119
173
|
export class DocumentId {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
174
|
+
free(): void;
|
|
175
|
+
[Symbol.dispose](): void;
|
|
176
|
+
constructor(bytes: Uint8Array);
|
|
177
|
+
toBytes(): Uint8Array;
|
|
178
|
+
toJsValue(): any;
|
|
179
|
+
toString(): string;
|
|
126
180
|
}
|
|
181
|
+
|
|
127
182
|
export class Encrypted {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
183
|
+
private constructor();
|
|
184
|
+
free(): void;
|
|
185
|
+
[Symbol.dispose](): void;
|
|
186
|
+
static fromBytes(bytes: Uint8Array): Encrypted;
|
|
187
|
+
serialize(): Uint8Array;
|
|
188
|
+
toBytes(): Uint8Array;
|
|
189
|
+
readonly ciphertext: Uint8Array;
|
|
190
|
+
readonly content_ref: Uint8Array;
|
|
191
|
+
readonly nonce: Uint8Array;
|
|
192
|
+
readonly pcs_key_hash: Uint8Array;
|
|
193
|
+
readonly pred_refs: Uint8Array;
|
|
137
194
|
}
|
|
195
|
+
|
|
138
196
|
export class EncryptedContentWithUpdate {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
197
|
+
private constructor();
|
|
198
|
+
free(): void;
|
|
199
|
+
[Symbol.dispose](): void;
|
|
200
|
+
encrypted_content(): Encrypted;
|
|
201
|
+
update_op(): SignedCgkaOperation | undefined;
|
|
144
202
|
}
|
|
203
|
+
|
|
145
204
|
export class Event {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
message(): string;
|
|
205
|
+
private constructor();
|
|
206
|
+
free(): void;
|
|
207
|
+
[Symbol.dispose](): void;
|
|
208
|
+
/**
|
|
209
|
+
* Converts the underlying [`Event`] to a [`StaticEvent`] and then
|
|
210
|
+
* serializes it.
|
|
211
|
+
*/
|
|
212
|
+
toBytes(): Uint8Array;
|
|
213
|
+
tryIntoSignedDelegation(): SignedDelegation | undefined;
|
|
214
|
+
tryIntoSignedRevocation(): SignedRevocation | undefined;
|
|
215
|
+
readonly isDelegated: boolean;
|
|
216
|
+
readonly isRevoked: boolean;
|
|
217
|
+
readonly variant: string;
|
|
160
218
|
}
|
|
219
|
+
|
|
161
220
|
export class GenerateWebCryptoError {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
}
|
|
167
|
-
export class GetCiphertextError {
|
|
168
|
-
private constructor();
|
|
169
|
-
free(): void;
|
|
170
|
-
[Symbol.dispose](): void;
|
|
171
|
-
readonly message: string;
|
|
221
|
+
private constructor();
|
|
222
|
+
free(): void;
|
|
223
|
+
[Symbol.dispose](): void;
|
|
224
|
+
message(): string;
|
|
172
225
|
}
|
|
226
|
+
|
|
173
227
|
export class Group {
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
228
|
+
private constructor();
|
|
229
|
+
free(): void;
|
|
230
|
+
[Symbol.dispose](): void;
|
|
231
|
+
/**
|
|
232
|
+
* Upcasts; to the JS-import type for [`JsGroup`].
|
|
233
|
+
*/
|
|
234
|
+
__wasm_refgen_toJsGroup(): Group;
|
|
235
|
+
members(): Promise<Capability[]>;
|
|
236
|
+
toAgent(): Agent;
|
|
237
|
+
toMembered(): Membered;
|
|
238
|
+
toPeer(): Peer;
|
|
239
|
+
readonly groupId: GroupId;
|
|
240
|
+
readonly id: Identifier;
|
|
183
241
|
}
|
|
242
|
+
|
|
184
243
|
export class GroupId {
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
244
|
+
private constructor();
|
|
245
|
+
free(): void;
|
|
246
|
+
[Symbol.dispose](): void;
|
|
247
|
+
toString(): string;
|
|
189
248
|
}
|
|
249
|
+
|
|
190
250
|
export class History {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
251
|
+
private constructor();
|
|
252
|
+
free(): void;
|
|
253
|
+
[Symbol.dispose](): void;
|
|
254
|
+
contentRefs(): DocContentRefs[];
|
|
255
|
+
delegations(): SignedDelegation[];
|
|
256
|
+
revocations(): SignedRevocation[];
|
|
197
257
|
}
|
|
258
|
+
|
|
198
259
|
export class Identifier {
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
260
|
+
free(): void;
|
|
261
|
+
[Symbol.dispose](): void;
|
|
262
|
+
constructor(bytes: Uint8Array);
|
|
263
|
+
static publicId(): Identifier;
|
|
264
|
+
toBytes(): Uint8Array;
|
|
203
265
|
}
|
|
266
|
+
|
|
204
267
|
export class Individual {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
268
|
+
private constructor();
|
|
269
|
+
free(): void;
|
|
270
|
+
[Symbol.dispose](): void;
|
|
271
|
+
pickPrekey(doc_id: DocumentId): Promise<ShareKey>;
|
|
272
|
+
toAgent(): Agent;
|
|
273
|
+
toPeer(): Peer;
|
|
274
|
+
readonly id: Identifier;
|
|
275
|
+
readonly individualId: IndividualId;
|
|
213
276
|
}
|
|
277
|
+
|
|
214
278
|
export class IndividualId {
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
279
|
+
private constructor();
|
|
280
|
+
free(): void;
|
|
281
|
+
[Symbol.dispose](): void;
|
|
282
|
+
readonly bytes: Uint8Array;
|
|
219
283
|
}
|
|
284
|
+
|
|
220
285
|
export class Invocation {
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
}
|
|
225
|
-
export class JsDecryptError {
|
|
226
|
-
private constructor();
|
|
227
|
-
free(): void;
|
|
228
|
-
[Symbol.dispose](): void;
|
|
229
|
-
}
|
|
230
|
-
export class JsEncryptError {
|
|
231
|
-
private constructor();
|
|
232
|
-
free(): void;
|
|
233
|
-
[Symbol.dispose](): void;
|
|
234
|
-
}
|
|
235
|
-
export class JsReceivePreKeyOpError {
|
|
236
|
-
private constructor();
|
|
237
|
-
free(): void;
|
|
238
|
-
[Symbol.dispose](): void;
|
|
239
|
-
}
|
|
240
|
-
export class JsReceiveStaticEventError {
|
|
241
|
-
private constructor();
|
|
242
|
-
free(): void;
|
|
243
|
-
[Symbol.dispose](): void;
|
|
286
|
+
private constructor();
|
|
287
|
+
free(): void;
|
|
288
|
+
[Symbol.dispose](): void;
|
|
244
289
|
}
|
|
290
|
+
|
|
245
291
|
export class Keyhive {
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
292
|
+
private constructor();
|
|
293
|
+
free(): void;
|
|
294
|
+
[Symbol.dispose](): void;
|
|
295
|
+
accessForDoc(id: Identifier, doc_id: DocumentId): Promise<Access | undefined>;
|
|
296
|
+
addMember(to_add: Agent, membered: Membered, access: Access, other_relevant_docs: Document[]): Promise<AddMemberUpdate>;
|
|
297
|
+
/**
|
|
298
|
+
* Returns all agent events with deduplicated storage and two-tier indirection
|
|
299
|
+
* for membership, prekey, and CGKA ops.
|
|
300
|
+
*/
|
|
301
|
+
allAgentEvents(): Promise<AllAgentEvents>;
|
|
302
|
+
contactCard(): Promise<ContactCard>;
|
|
303
|
+
docMemberCapabilities(doc_id: DocumentId): Promise<Membership[]>;
|
|
304
|
+
/**
|
|
305
|
+
* Returns event hashes for provided [`JsAgent`] as an array of hash bytes.
|
|
306
|
+
*/
|
|
307
|
+
eventHashesForAgent(agent: Agent): Promise<Array<any>>;
|
|
308
|
+
/**
|
|
309
|
+
* Returns events for provided [`Agent`] as a map from hash to serialized [`StaticEvent`] bytes.
|
|
310
|
+
*/
|
|
311
|
+
eventsForAgent(agent: Agent): Promise<Map<any, any>>;
|
|
312
|
+
expandPrekeys(): Promise<ShareKey>;
|
|
313
|
+
exportPrekeySecrets(): Promise<Uint8Array>;
|
|
314
|
+
/**
|
|
315
|
+
* Force a PCS key rotation and return the new leaf secret, serialized as a
|
|
316
|
+
* one-entry `BTreeMap<ShareKey, ShareSecretKey>` (the exact format
|
|
317
|
+
* `importPrekeySecrets` accepts). A sibling instance of this identity can
|
|
318
|
+
* install it to derive the rotated key without re-importing the whole bundle.
|
|
319
|
+
*/
|
|
320
|
+
forcePcsUpdate(doc: Document): Promise<Uint8Array>;
|
|
321
|
+
/**
|
|
322
|
+
* Generate a document. Whether it provides forward secrecy is determined by
|
|
323
|
+
* this peer's forward-secrecy policy (chosen at `Keyhive.init`).
|
|
324
|
+
*/
|
|
325
|
+
generateDocument(coparents: Peer[], initial_content_ref_head: ChangeId, more_initial_content_refs: ChangeId[]): Promise<Document>;
|
|
326
|
+
generateGroup(js_coparents: Peer[]): Promise<Group>;
|
|
327
|
+
getAgent(id: Identifier): Promise<Agent | undefined>;
|
|
328
|
+
getDocument(doc_id: DocumentId): Promise<Document | undefined>;
|
|
329
|
+
getExistingContactCard(): Promise<ContactCard>;
|
|
330
|
+
getGroup(group_id: GroupId): Promise<Group | undefined>;
|
|
331
|
+
getIndividual(id: IndividualId): Promise<Individual | undefined>;
|
|
332
|
+
importPrekeySecrets(bytes: Uint8Array): Promise<void>;
|
|
333
|
+
ingestArchive(archive: Archive): Promise<void>;
|
|
334
|
+
ingestEventsBytes(events_bytes_array: Array<any>): Promise<Array<any>>;
|
|
335
|
+
/**
|
|
336
|
+
* Initialize a peer.
|
|
337
|
+
*
|
|
338
|
+
* `forward_secrecy` is this peer's policy for all documents it creates or
|
|
339
|
+
* receives. When `false`, documents carry the CGKA predecessor key chain
|
|
340
|
+
* (a member added later reads the whole prior history) and adding a reader
|
|
341
|
+
* auto-rekeys (see `addMember`'s `leafSecrets`). When `true`, a member
|
|
342
|
+
* added later cannot read content from before they joined.
|
|
343
|
+
*/
|
|
344
|
+
static init(signer: Signer, ciphertext_store: CiphertextStore, event_handler: Function, forward_secrecy: boolean): Promise<Keyhive>;
|
|
345
|
+
intoArchive(): Promise<Archive>;
|
|
346
|
+
membershipOpsForAgent(agent: Agent): Promise<Map<any, any>>;
|
|
347
|
+
pendingEventHashes(): Promise<Set<any>>;
|
|
348
|
+
reachableDocs(): Promise<Summary[]>;
|
|
349
|
+
receiveContactCard(contact_card: ContactCard): Promise<Individual>;
|
|
350
|
+
revokeMember(to_revoke: Agent, retain_all_other_members: boolean, membered: Membered): Promise<SignedRevocation[]>;
|
|
351
|
+
revokedMembersForDoc(doc_id: DocumentId): Promise<Membership[]>;
|
|
352
|
+
rotatePrekey(prekey: ShareKey): Promise<ShareKey>;
|
|
353
|
+
stats(): Promise<Stats>;
|
|
354
|
+
toArchive(): Promise<Archive>;
|
|
355
|
+
tryDecrypt(doc: Document, encrypted: Encrypted): Promise<Uint8Array>;
|
|
356
|
+
tryEncrypt(doc: Document, content_ref: ChangeId, js_pred_refs: ChangeId[], content: Uint8Array): Promise<EncryptedContentWithUpdate>;
|
|
357
|
+
tryEncryptArchive(doc: Document, content_ref: ChangeId, pred_refs: ChangeId[], content: Uint8Array): Promise<EncryptedContentWithUpdate>;
|
|
358
|
+
tryPcsKeyHash(doc: Document): Promise<Uint8Array | undefined>;
|
|
359
|
+
trySign(data: Uint8Array): Promise<Signed>;
|
|
360
|
+
readonly id: IndividualId;
|
|
361
|
+
readonly idString: string;
|
|
362
|
+
readonly individual: Promise<Individual>;
|
|
363
|
+
readonly whoami: IndividualId;
|
|
276
364
|
}
|
|
365
|
+
|
|
277
366
|
export class Membered {
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
367
|
+
private constructor();
|
|
368
|
+
free(): void;
|
|
369
|
+
[Symbol.dispose](): void;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
export class Membership {
|
|
373
|
+
private constructor();
|
|
374
|
+
free(): void;
|
|
375
|
+
[Symbol.dispose](): void;
|
|
376
|
+
readonly can: Access;
|
|
377
|
+
readonly who: Agent;
|
|
281
378
|
}
|
|
379
|
+
|
|
282
380
|
export class Peer {
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
381
|
+
private constructor();
|
|
382
|
+
free(): void;
|
|
383
|
+
[Symbol.dispose](): void;
|
|
384
|
+
/**
|
|
385
|
+
* Upcasts; to the JS-import type for [`JsPeer`].
|
|
386
|
+
*/
|
|
387
|
+
__wasm_refgen_toJsPeer(): Peer;
|
|
388
|
+
isDocument(): boolean;
|
|
389
|
+
isGroup(): boolean;
|
|
390
|
+
isIndividual(): boolean;
|
|
391
|
+
toString(): string;
|
|
392
|
+
readonly id: Identifier;
|
|
295
393
|
}
|
|
394
|
+
|
|
296
395
|
export class Revocation {
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
}
|
|
305
|
-
export class RevokeMemberError {
|
|
306
|
-
private constructor();
|
|
307
|
-
free(): void;
|
|
308
|
-
[Symbol.dispose](): void;
|
|
309
|
-
readonly message: string;
|
|
310
|
-
}
|
|
311
|
-
export class SerializationError {
|
|
312
|
-
private constructor();
|
|
313
|
-
free(): void;
|
|
314
|
-
[Symbol.dispose](): void;
|
|
315
|
-
toError(): any;
|
|
396
|
+
private constructor();
|
|
397
|
+
free(): void;
|
|
398
|
+
[Symbol.dispose](): void;
|
|
399
|
+
readonly after: History;
|
|
400
|
+
readonly proof: SignedDelegation | undefined;
|
|
401
|
+
readonly revoked: SignedDelegation;
|
|
402
|
+
readonly subject_id: Identifier;
|
|
316
403
|
}
|
|
404
|
+
|
|
317
405
|
export class ShareKey {
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
406
|
+
private constructor();
|
|
407
|
+
free(): void;
|
|
408
|
+
[Symbol.dispose](): void;
|
|
321
409
|
}
|
|
410
|
+
|
|
322
411
|
export class Signed {
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
412
|
+
private constructor();
|
|
413
|
+
free(): void;
|
|
414
|
+
[Symbol.dispose](): void;
|
|
415
|
+
static fromBytes(bytes: Uint8Array): Signed;
|
|
416
|
+
toBytes(): Uint8Array;
|
|
417
|
+
verify(): boolean;
|
|
418
|
+
readonly payload: Uint8Array;
|
|
419
|
+
readonly signature: Uint8Array;
|
|
420
|
+
readonly verifyingKey: Uint8Array;
|
|
332
421
|
}
|
|
422
|
+
|
|
333
423
|
export class SignedCgkaOperation {
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
424
|
+
private constructor();
|
|
425
|
+
free(): void;
|
|
426
|
+
[Symbol.dispose](): void;
|
|
427
|
+
verify(): boolean;
|
|
428
|
+
readonly delegation: CgkaOperation;
|
|
429
|
+
readonly signature: Uint8Array;
|
|
430
|
+
readonly verifyingKey: Uint8Array;
|
|
341
431
|
}
|
|
432
|
+
|
|
342
433
|
export class SignedDelegation {
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
434
|
+
private constructor();
|
|
435
|
+
free(): void;
|
|
436
|
+
[Symbol.dispose](): void;
|
|
437
|
+
verify(): boolean;
|
|
438
|
+
readonly delegation: Delegation;
|
|
439
|
+
readonly signature: Uint8Array;
|
|
440
|
+
readonly subjectId: Identifier;
|
|
441
|
+
readonly verifyingKey: Uint8Array;
|
|
350
442
|
}
|
|
443
|
+
|
|
351
444
|
export class SignedInvocation {
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
445
|
+
private constructor();
|
|
446
|
+
free(): void;
|
|
447
|
+
[Symbol.dispose](): void;
|
|
355
448
|
}
|
|
449
|
+
|
|
356
450
|
export class SignedRevocation {
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
451
|
+
private constructor();
|
|
452
|
+
free(): void;
|
|
453
|
+
[Symbol.dispose](): void;
|
|
454
|
+
verify(): boolean;
|
|
455
|
+
readonly delegation: Revocation;
|
|
456
|
+
readonly signature: Uint8Array;
|
|
457
|
+
readonly verifyingKey: Uint8Array;
|
|
364
458
|
}
|
|
459
|
+
|
|
365
460
|
export class Signer {
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
}
|
|
379
|
-
export class SigningError {
|
|
380
|
-
private constructor();
|
|
381
|
-
free(): void;
|
|
382
|
-
[Symbol.dispose](): void;
|
|
383
|
-
message(): string;
|
|
384
|
-
}
|
|
385
|
-
export class SimpleCapability {
|
|
386
|
-
private constructor();
|
|
387
|
-
free(): void;
|
|
388
|
-
[Symbol.dispose](): void;
|
|
389
|
-
readonly who: Agent;
|
|
390
|
-
readonly can: Access;
|
|
461
|
+
private constructor();
|
|
462
|
+
free(): void;
|
|
463
|
+
[Symbol.dispose](): void;
|
|
464
|
+
clone(): Signer;
|
|
465
|
+
static generate(): Promise<Signer>;
|
|
466
|
+
static generateMemory(): Signer;
|
|
467
|
+
static generateWebCrypto(): Promise<Signer>;
|
|
468
|
+
static memorySignerFromBytes(bytes: Uint8Array): Signer;
|
|
469
|
+
trySign(bytes: Uint8Array): Promise<Signed>;
|
|
470
|
+
static webCryptoSigner(keypair: any): Promise<Signer>;
|
|
471
|
+
readonly variant: string;
|
|
472
|
+
readonly verifyingKey: Uint8Array;
|
|
391
473
|
}
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
474
|
+
|
|
475
|
+
export class Stats {
|
|
476
|
+
private constructor();
|
|
477
|
+
free(): void;
|
|
478
|
+
[Symbol.dispose](): void;
|
|
479
|
+
readonly activePrekeyCount: bigint;
|
|
480
|
+
readonly cgkaOperations: bigint;
|
|
481
|
+
readonly delegations: bigint;
|
|
482
|
+
readonly docs: bigint;
|
|
483
|
+
readonly groups: bigint;
|
|
484
|
+
readonly individuals: bigint;
|
|
485
|
+
readonly pendingCgkaOperation: bigint;
|
|
486
|
+
readonly pendingCgkaOperationByActive: bigint;
|
|
487
|
+
readonly pendingDelegated: bigint;
|
|
488
|
+
readonly pendingDelegatedByActive: bigint;
|
|
489
|
+
readonly pendingPrekeyRotated: bigint;
|
|
490
|
+
readonly pendingPrekeyRotatedByActive: bigint;
|
|
491
|
+
readonly pendingPrekeysExpanded: bigint;
|
|
492
|
+
readonly pendingPrekeysExpandedByActive: bigint;
|
|
493
|
+
readonly pendingRevoked: bigint;
|
|
494
|
+
readonly pendingRevokedByActive: bigint;
|
|
495
|
+
readonly prekeyRotations: bigint;
|
|
496
|
+
readonly prekeysExpanded: bigint;
|
|
497
|
+
readonly revocations: bigint;
|
|
498
|
+
readonly totalOps: bigint;
|
|
499
|
+
readonly totalPendingOps: bigint;
|
|
398
500
|
}
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
501
|
+
|
|
502
|
+
export class Summary {
|
|
503
|
+
private constructor();
|
|
504
|
+
free(): void;
|
|
505
|
+
[Symbol.dispose](): void;
|
|
506
|
+
readonly access: Access;
|
|
507
|
+
readonly doc: Document;
|
|
404
508
|
}
|
|
405
509
|
|
|
510
|
+
/**
|
|
511
|
+
* Panic hook lets us get better error messages if our Rust code ever panics.
|
|
512
|
+
*
|
|
513
|
+
* This function needs to be called at least once during initialisation.
|
|
514
|
+
* https://rustwasm.github.io/docs/wasm-pack/tutorials/npm-browser-packages/template-deep-dive/src-utils-rs.html#2-what-is-console_error_panic_hook
|
|
515
|
+
*/
|
|
516
|
+
export function setPanicHook(): void;
|
|
517
|
+
|
|
406
518
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
407
519
|
|
|
408
520
|
export interface InitOutput {
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
521
|
+
readonly memory: WebAssembly.Memory;
|
|
522
|
+
readonly __wbg_allagentevents_free: (a: number, b: number) => void;
|
|
523
|
+
readonly __wbg_ciphertextstore_free: (a: number, b: number) => void;
|
|
524
|
+
readonly __wbg_invocation_free: (a: number, b: number) => void;
|
|
525
|
+
readonly __wbg_signedinvocation_free: (a: number, b: number) => void;
|
|
526
|
+
readonly allagentevents_agentCgkaSources: (a: number) => any;
|
|
527
|
+
readonly allagentevents_agentMembershipSources: (a: number) => any;
|
|
528
|
+
readonly allagentevents_agentPrekeySources: (a: number) => any;
|
|
529
|
+
readonly allagentevents_cgkaSources: (a: number) => any;
|
|
530
|
+
readonly allagentevents_events: (a: number) => any;
|
|
531
|
+
readonly allagentevents_membershipSources: (a: number) => any;
|
|
532
|
+
readonly allagentevents_prekeySources: (a: number) => any;
|
|
533
|
+
readonly ciphertextstore_newFromWebStorage: (a: any) => number;
|
|
534
|
+
readonly ciphertextstore_newInMemory: () => number;
|
|
535
|
+
readonly __wbg_archive_free: (a: number, b: number) => void;
|
|
536
|
+
readonly __wbg_signed_free: (a: number, b: number) => void;
|
|
537
|
+
readonly __wbg_stats_free: (a: number, b: number) => void;
|
|
538
|
+
readonly archive_toBytes: (a: number) => [number, number, number, number];
|
|
539
|
+
readonly archive_tryToKeyhive: (a: number, b: number, c: number, d: any) => any;
|
|
540
|
+
readonly archive_try_from_bytes: (a: number, b: number) => [number, number, number];
|
|
541
|
+
readonly signed_fromBytes: (a: number, b: number) => [number, number, number];
|
|
542
|
+
readonly signed_payload: (a: number) => [number, number];
|
|
543
|
+
readonly signed_signature: (a: number) => [number, number];
|
|
544
|
+
readonly signed_toBytes: (a: number) => [number, number, number, number];
|
|
545
|
+
readonly signed_verify: (a: number) => number;
|
|
546
|
+
readonly signed_verifyingKey: (a: number) => [number, number];
|
|
547
|
+
readonly stats_activePrekeyCount: (a: number) => bigint;
|
|
548
|
+
readonly stats_cgkaOperations: (a: number) => bigint;
|
|
549
|
+
readonly stats_delegations: (a: number) => bigint;
|
|
550
|
+
readonly stats_docs: (a: number) => bigint;
|
|
551
|
+
readonly stats_groups: (a: number) => bigint;
|
|
552
|
+
readonly stats_individuals: (a: number) => bigint;
|
|
553
|
+
readonly stats_pendingCgkaOperation: (a: number) => bigint;
|
|
554
|
+
readonly stats_pendingCgkaOperationByActive: (a: number) => bigint;
|
|
555
|
+
readonly stats_pendingDelegated: (a: number) => bigint;
|
|
556
|
+
readonly stats_pendingDelegatedByActive: (a: number) => bigint;
|
|
557
|
+
readonly stats_pendingPrekeyRotated: (a: number) => bigint;
|
|
558
|
+
readonly stats_pendingPrekeyRotatedByActive: (a: number) => bigint;
|
|
559
|
+
readonly stats_pendingPrekeysExpanded: (a: number) => bigint;
|
|
560
|
+
readonly stats_pendingPrekeysExpandedByActive: (a: number) => bigint;
|
|
561
|
+
readonly stats_pendingRevoked: (a: number) => bigint;
|
|
562
|
+
readonly stats_pendingRevokedByActive: (a: number) => bigint;
|
|
563
|
+
readonly stats_prekeyRotations: (a: number) => bigint;
|
|
564
|
+
readonly stats_prekeysExpanded: (a: number) => bigint;
|
|
565
|
+
readonly stats_revocations: (a: number) => bigint;
|
|
566
|
+
readonly stats_totalOps: (a: number) => bigint;
|
|
567
|
+
readonly stats_totalPendingOps: (a: number) => bigint;
|
|
568
|
+
readonly __wbg_agent_free: (a: number, b: number) => void;
|
|
569
|
+
readonly __wbg_document_free: (a: number, b: number) => void;
|
|
570
|
+
readonly __wbg_encryptedcontentwithupdate_free: (a: number, b: number) => void;
|
|
571
|
+
readonly __wbg_group_free: (a: number, b: number) => void;
|
|
572
|
+
readonly __wbg_individual_free: (a: number, b: number) => void;
|
|
573
|
+
readonly __wbg_keyhive_free: (a: number, b: number) => void;
|
|
574
|
+
readonly __wbg_peer_free: (a: number, b: number) => void;
|
|
575
|
+
readonly agent_id: (a: number) => number;
|
|
576
|
+
readonly agent_isDocument: (a: number) => number;
|
|
577
|
+
readonly agent_isGroup: (a: number) => number;
|
|
578
|
+
readonly agent_isIndividual: (a: number) => number;
|
|
579
|
+
readonly agent_keyOpHashes: (a: number) => any;
|
|
580
|
+
readonly agent_keyOps: (a: number) => any;
|
|
581
|
+
readonly agent_toString: (a: number) => [number, number];
|
|
582
|
+
readonly document___wasm_refgen_toJsDocument: (a: number) => number;
|
|
583
|
+
readonly document_doc_id: (a: number) => number;
|
|
584
|
+
readonly document_id: (a: number) => number;
|
|
585
|
+
readonly document_members: (a: number) => any;
|
|
586
|
+
readonly document_toAgent: (a: number) => number;
|
|
587
|
+
readonly document_toMembered: (a: number) => number;
|
|
588
|
+
readonly document_toPeer: (a: number) => number;
|
|
589
|
+
readonly encryptedcontentwithupdate_encrypted_content: (a: number) => number;
|
|
590
|
+
readonly encryptedcontentwithupdate_update_op: (a: number) => number;
|
|
591
|
+
readonly group___wasm_refgen_toJsGroup: (a: number) => number;
|
|
592
|
+
readonly group_members: (a: number) => any;
|
|
593
|
+
readonly group_toAgent: (a: number) => number;
|
|
594
|
+
readonly group_toMembered: (a: number) => number;
|
|
595
|
+
readonly group_toPeer: (a: number) => number;
|
|
596
|
+
readonly individual_individualId: (a: number) => number;
|
|
597
|
+
readonly individual_pickPrekey: (a: number, b: number) => any;
|
|
598
|
+
readonly individual_toAgent: (a: number) => number;
|
|
599
|
+
readonly individual_toPeer: (a: number) => number;
|
|
600
|
+
readonly keyhive_accessForDoc: (a: number, b: number, c: number) => any;
|
|
601
|
+
readonly keyhive_addMember: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
|
|
602
|
+
readonly keyhive_allAgentEvents: (a: number) => any;
|
|
603
|
+
readonly keyhive_contactCard: (a: number) => any;
|
|
604
|
+
readonly keyhive_docMemberCapabilities: (a: number, b: number) => any;
|
|
605
|
+
readonly keyhive_eventHashesForAgent: (a: number, b: number) => any;
|
|
606
|
+
readonly keyhive_eventsForAgent: (a: number, b: number) => any;
|
|
607
|
+
readonly keyhive_expandPrekeys: (a: number) => any;
|
|
608
|
+
readonly keyhive_exportPrekeySecrets: (a: number) => any;
|
|
609
|
+
readonly keyhive_forcePcsUpdate: (a: number, b: number) => any;
|
|
610
|
+
readonly keyhive_generateDocument: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
|
|
611
|
+
readonly keyhive_generateGroup: (a: number, b: number, c: number) => any;
|
|
612
|
+
readonly keyhive_getAgent: (a: number, b: number) => any;
|
|
613
|
+
readonly keyhive_getDocument: (a: number, b: number) => any;
|
|
614
|
+
readonly keyhive_getExistingContactCard: (a: number) => any;
|
|
615
|
+
readonly keyhive_getGroup: (a: number, b: number) => any;
|
|
616
|
+
readonly keyhive_getIndividual: (a: number, b: number) => any;
|
|
617
|
+
readonly keyhive_id: (a: number) => number;
|
|
618
|
+
readonly keyhive_idString: (a: number) => [number, number];
|
|
619
|
+
readonly keyhive_importPrekeySecrets: (a: number, b: number, c: number) => any;
|
|
620
|
+
readonly keyhive_individual: (a: number) => any;
|
|
621
|
+
readonly keyhive_ingestArchive: (a: number, b: number) => any;
|
|
622
|
+
readonly keyhive_ingestEventsBytes: (a: number, b: any) => any;
|
|
623
|
+
readonly keyhive_init: (a: number, b: number, c: any, d: number) => any;
|
|
624
|
+
readonly keyhive_intoArchive: (a: number) => any;
|
|
625
|
+
readonly keyhive_membershipOpsForAgent: (a: number, b: number) => any;
|
|
626
|
+
readonly keyhive_pendingEventHashes: (a: number) => any;
|
|
627
|
+
readonly keyhive_reachableDocs: (a: number) => any;
|
|
628
|
+
readonly keyhive_receiveContactCard: (a: number, b: number) => any;
|
|
629
|
+
readonly keyhive_revokeMember: (a: number, b: number, c: number, d: number) => any;
|
|
630
|
+
readonly keyhive_revokedMembersForDoc: (a: number, b: number) => any;
|
|
631
|
+
readonly keyhive_rotatePrekey: (a: number, b: number) => any;
|
|
632
|
+
readonly keyhive_stats: (a: number) => any;
|
|
633
|
+
readonly keyhive_toArchive: (a: number) => any;
|
|
634
|
+
readonly keyhive_tryDecrypt: (a: number, b: number, c: number) => any;
|
|
635
|
+
readonly keyhive_tryEncrypt: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => any;
|
|
636
|
+
readonly keyhive_tryEncryptArchive: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => any;
|
|
637
|
+
readonly keyhive_tryPcsKeyHash: (a: number, b: number) => any;
|
|
638
|
+
readonly keyhive_trySign: (a: number, b: number, c: number) => any;
|
|
639
|
+
readonly keyhive_whoami: (a: number) => number;
|
|
640
|
+
readonly peer___wasm_refgen_toJsPeer: (a: number) => number;
|
|
641
|
+
readonly peer_isDocument: (a: number) => number;
|
|
642
|
+
readonly peer_isGroup: (a: number) => number;
|
|
643
|
+
readonly peer_isIndividual: (a: number) => number;
|
|
644
|
+
readonly peer_toString: (a: number) => [number, number];
|
|
645
|
+
readonly setPanicHook: () => void;
|
|
646
|
+
readonly group_groupId: (a: number) => number;
|
|
647
|
+
readonly group_id: (a: number) => number;
|
|
648
|
+
readonly individual_id: (a: number) => number;
|
|
649
|
+
readonly peer_id: (a: number) => number;
|
|
650
|
+
readonly __wbg_signedcgkaoperation_free: (a: number, b: number) => void;
|
|
651
|
+
readonly signedcgkaoperation_delegation: (a: number) => number;
|
|
652
|
+
readonly signedcgkaoperation_signature: (a: number) => [number, number];
|
|
653
|
+
readonly signedcgkaoperation_verify: (a: number) => number;
|
|
654
|
+
readonly signedcgkaoperation_verifyingKey: (a: number) => [number, number];
|
|
655
|
+
readonly __wbg_cannotparseidentifier_free: (a: number, b: number) => void;
|
|
656
|
+
readonly __wbg_changeid_free: (a: number, b: number) => void;
|
|
657
|
+
readonly __wbg_doccontentrefs_free: (a: number, b: number) => void;
|
|
658
|
+
readonly __wbg_identifier_free: (a: number, b: number) => void;
|
|
659
|
+
readonly __wbg_revocation_free: (a: number, b: number) => void;
|
|
660
|
+
readonly __wbg_sharekey_free: (a: number, b: number) => void;
|
|
661
|
+
readonly __wbg_signedrevocation_free: (a: number, b: number) => void;
|
|
662
|
+
readonly changeid___wasm_refgen_toJsChangeId: (a: number) => number;
|
|
663
|
+
readonly changeid_bytes: (a: number) => [number, number];
|
|
664
|
+
readonly changeid_new: (a: number, b: number) => number;
|
|
665
|
+
readonly doccontentrefs_addChangeId: (a: number, b: number) => any;
|
|
666
|
+
readonly doccontentrefs_change_hashes: (a: number) => any;
|
|
667
|
+
readonly doccontentrefs_docId: (a: number) => number;
|
|
668
|
+
readonly doccontentrefs_new: (a: number, b: number, c: number) => [number, number, number];
|
|
669
|
+
readonly identifier_new: (a: number, b: number) => [number, number, number];
|
|
670
|
+
readonly identifier_publicId: () => number;
|
|
671
|
+
readonly identifier_toBytes: (a: number) => [number, number];
|
|
672
|
+
readonly revocation_after: (a: number) => number;
|
|
673
|
+
readonly revocation_proof: (a: number) => number;
|
|
674
|
+
readonly revocation_revoked: (a: number) => number;
|
|
675
|
+
readonly revocation_subject_id: (a: number) => number;
|
|
676
|
+
readonly signedrevocation_delegation: (a: number) => number;
|
|
677
|
+
readonly signedrevocation_signature: (a: number) => [number, number];
|
|
678
|
+
readonly signedrevocation_verify: (a: number) => number;
|
|
679
|
+
readonly signedrevocation_verifyingKey: (a: number) => [number, number];
|
|
680
|
+
readonly __wbg_access_free: (a: number, b: number) => void;
|
|
681
|
+
readonly __wbg_cannotparseed25519signingkey_free: (a: number, b: number) => void;
|
|
682
|
+
readonly __wbg_cgkaoperation_free: (a: number, b: number) => void;
|
|
683
|
+
readonly __wbg_contactcard_free: (a: number, b: number) => void;
|
|
684
|
+
readonly __wbg_documentid_free: (a: number, b: number) => void;
|
|
685
|
+
readonly __wbg_encrypted_free: (a: number, b: number) => void;
|
|
686
|
+
readonly __wbg_event_free: (a: number, b: number) => void;
|
|
687
|
+
readonly __wbg_generatewebcryptoerror_free: (a: number, b: number) => void;
|
|
688
|
+
readonly __wbg_groupid_free: (a: number, b: number) => void;
|
|
689
|
+
readonly __wbg_signer_free: (a: number, b: number) => void;
|
|
690
|
+
readonly access_toString: (a: number) => [number, number];
|
|
691
|
+
readonly access_tryFromString: (a: number, b: number) => number;
|
|
692
|
+
readonly cgkaoperation_variant: (a: number) => [number, number];
|
|
693
|
+
readonly contactcard_fromJson: (a: number, b: number) => [number, number, number];
|
|
694
|
+
readonly contactcard_id: (a: number) => number;
|
|
695
|
+
readonly contactcard_individualId: (a: number) => number;
|
|
696
|
+
readonly contactcard_op: (a: number) => number;
|
|
697
|
+
readonly contactcard_shareKey: (a: number) => number;
|
|
698
|
+
readonly contactcard_signature: (a: number) => [number, number];
|
|
699
|
+
readonly contactcard_toJson: (a: number) => [number, number, number, number];
|
|
700
|
+
readonly documentid_new: (a: number, b: number) => [number, number, number];
|
|
701
|
+
readonly documentid_toBytes: (a: number) => [number, number];
|
|
702
|
+
readonly documentid_toJsValue: (a: number) => any;
|
|
703
|
+
readonly documentid_toString: (a: number) => [number, number];
|
|
704
|
+
readonly encrypted_ciphertext: (a: number) => [number, number];
|
|
705
|
+
readonly encrypted_content_ref: (a: number) => [number, number];
|
|
706
|
+
readonly encrypted_fromBytes: (a: number, b: number) => [number, number, number];
|
|
707
|
+
readonly encrypted_nonce: (a: number) => [number, number];
|
|
708
|
+
readonly encrypted_pcs_key_hash: (a: number) => [number, number];
|
|
709
|
+
readonly encrypted_pred_refs: (a: number) => [number, number];
|
|
710
|
+
readonly encrypted_serialize: (a: number) => [number, number, number, number];
|
|
711
|
+
readonly event_isDelegated: (a: number) => number;
|
|
712
|
+
readonly event_isRevoked: (a: number) => number;
|
|
713
|
+
readonly event_toBytes: (a: number) => [number, number, number, number];
|
|
714
|
+
readonly event_tryIntoSignedDelegation: (a: number) => number;
|
|
715
|
+
readonly event_tryIntoSignedRevocation: (a: number) => number;
|
|
716
|
+
readonly event_variant: (a: number) => [number, number];
|
|
717
|
+
readonly generatewebcryptoerror_message: (a: number) => [number, number];
|
|
718
|
+
readonly groupid_toString: (a: number) => [number, number];
|
|
719
|
+
readonly signer_clone: (a: number) => number;
|
|
720
|
+
readonly signer_generate: () => any;
|
|
721
|
+
readonly signer_generateMemory: () => number;
|
|
722
|
+
readonly signer_generateWebCrypto: () => any;
|
|
723
|
+
readonly signer_memorySignerFromBytes: (a: number, b: number) => [number, number, number];
|
|
724
|
+
readonly signer_trySign: (a: number, b: number, c: number) => any;
|
|
725
|
+
readonly signer_variant: (a: number) => [number, number];
|
|
726
|
+
readonly signer_verifyingKey: (a: number) => [number, number];
|
|
727
|
+
readonly signer_webCryptoSigner: (a: any) => any;
|
|
728
|
+
readonly encrypted_toBytes: (a: number) => [number, number];
|
|
729
|
+
readonly __wbg_addmemberupdate_free: (a: number, b: number) => void;
|
|
730
|
+
readonly __wbg_capability_free: (a: number, b: number) => void;
|
|
731
|
+
readonly __wbg_delegation_free: (a: number, b: number) => void;
|
|
732
|
+
readonly __wbg_history_free: (a: number, b: number) => void;
|
|
733
|
+
readonly __wbg_individualid_free: (a: number, b: number) => void;
|
|
734
|
+
readonly __wbg_membered_free: (a: number, b: number) => void;
|
|
735
|
+
readonly __wbg_membership_free: (a: number, b: number) => void;
|
|
736
|
+
readonly __wbg_signeddelegation_free: (a: number, b: number) => void;
|
|
737
|
+
readonly __wbg_summary_free: (a: number, b: number) => void;
|
|
738
|
+
readonly addmemberupdate_delegation: (a: number) => number;
|
|
739
|
+
readonly addmemberupdate_leafSecrets: (a: number) => [number, number];
|
|
740
|
+
readonly capability_can: (a: number) => number;
|
|
741
|
+
readonly capability_proof: (a: number) => number;
|
|
742
|
+
readonly capability_who: (a: number) => number;
|
|
743
|
+
readonly delegation_after: (a: number) => number;
|
|
744
|
+
readonly delegation_can: (a: number) => number;
|
|
745
|
+
readonly delegation_delegate: (a: number) => number;
|
|
746
|
+
readonly delegation_proof: (a: number) => number;
|
|
747
|
+
readonly history_contentRefs: (a: number) => [number, number];
|
|
748
|
+
readonly history_delegations: (a: number) => [number, number];
|
|
749
|
+
readonly history_revocations: (a: number) => [number, number];
|
|
750
|
+
readonly individualid_bytes: (a: number) => [number, number];
|
|
751
|
+
readonly membership_can: (a: number) => number;
|
|
752
|
+
readonly membership_who: (a: number) => number;
|
|
753
|
+
readonly signeddelegation_delegation: (a: number) => number;
|
|
754
|
+
readonly signeddelegation_signature: (a: number) => [number, number];
|
|
755
|
+
readonly signeddelegation_subjectId: (a: number) => number;
|
|
756
|
+
readonly signeddelegation_verify: (a: number) => number;
|
|
757
|
+
readonly signeddelegation_verifyingKey: (a: number) => [number, number];
|
|
758
|
+
readonly summary_access: (a: number) => number;
|
|
759
|
+
readonly summary_doc: (a: number) => number;
|
|
760
|
+
readonly wasm_bindgen__convert__closures_____invoke__hd575a1431d676418: (a: number, b: number, c: any) => [number, number];
|
|
761
|
+
readonly wasm_bindgen__convert__closures_____invoke__h1ce7fe53f08aa9a8: (a: number, b: number, c: any, d: any) => void;
|
|
762
|
+
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
763
|
+
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
764
|
+
readonly __wbindgen_exn_store: (a: number) => void;
|
|
765
|
+
readonly __externref_table_alloc: () => number;
|
|
766
|
+
readonly __wbindgen_externrefs: WebAssembly.Table;
|
|
767
|
+
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
768
|
+
readonly __wbindgen_destroy_closure: (a: number, b: number) => void;
|
|
769
|
+
readonly __externref_drop_slice: (a: number, b: number) => void;
|
|
770
|
+
readonly __externref_table_dealloc: (a: number) => void;
|
|
771
|
+
readonly __wbindgen_start: () => void;
|
|
619
772
|
}
|
|
620
773
|
|
|
621
774
|
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
775
|
+
|
|
622
776
|
/**
|
|
623
|
-
* Instantiates the given `module`, which can either be bytes or
|
|
624
|
-
* a precompiled `WebAssembly.Module`.
|
|
625
|
-
*
|
|
626
|
-
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
627
|
-
*
|
|
628
|
-
* @returns {InitOutput}
|
|
629
|
-
*/
|
|
777
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
778
|
+
* a precompiled `WebAssembly.Module`.
|
|
779
|
+
*
|
|
780
|
+
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
781
|
+
*
|
|
782
|
+
* @returns {InitOutput}
|
|
783
|
+
*/
|
|
630
784
|
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
631
785
|
|
|
632
786
|
/**
|
|
633
|
-
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
634
|
-
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
635
|
-
*
|
|
636
|
-
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
637
|
-
*
|
|
638
|
-
* @returns {Promise<InitOutput>}
|
|
639
|
-
*/
|
|
787
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
788
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
789
|
+
*
|
|
790
|
+
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
791
|
+
*
|
|
792
|
+
* @returns {Promise<InitOutput>}
|
|
793
|
+
*/
|
|
640
794
|
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|