@wireapp/core-crypto 9.3.3 → 10.0.0-pre.10
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/browser/autogenerated/wasm-bindgen/index_bg.wasm +0 -0
- package/dist/browser/autogenerated/wasm-bindgen/index_bg.wasm.d.ts +880 -0
- package/dist/browser/corecrypto.d.ts +3829 -0
- package/dist/browser/corecrypto.js +10198 -0
- package/dist/native/corecrypto.d.ts +3802 -0
- package/dist/native/corecrypto.js +8661 -0
- package/dist/native/libcore_crypto_ffi.so +0 -0
- package/package.json +44 -52
- package/README.md +0 -5
- package/src/autogenerated/core-crypto-ffi_bg.wasm +0 -0
- package/src/autogenerated/core-crypto-ffi_bg.wasm.d.ts +0 -278
- package/src/corecrypto.d.ts +0 -2567
- package/src/corecrypto.js +0 -4329
|
@@ -0,0 +1,3802 @@
|
|
|
1
|
+
// Generated by dts-bundle-generator v9.5.1
|
|
2
|
+
|
|
3
|
+
import { UniffiAbstractObject, UniffiGcObject, UniffiHandle, destructorGuardSymbol, pointerLiteralSymbol, uniffiTypeNameSymbol, variantOrdinalSymbol } from '@ubjs/core';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Returns build metadata for CoreCrypto.
|
|
7
|
+
*/
|
|
8
|
+
export declare function buildMetadata(): BuildMetadata;
|
|
9
|
+
/**
|
|
10
|
+
* Get an instance of the default cipher suite.
|
|
11
|
+
*/
|
|
12
|
+
export declare function cipherSuiteDefault(): CipherSuite;
|
|
13
|
+
/**
|
|
14
|
+
* Construct a cipher suite enum instance from its discriminant.
|
|
15
|
+
*/
|
|
16
|
+
export declare function cipherSuiteFromU16(discriminant: number): CipherSuite;
|
|
17
|
+
/**
|
|
18
|
+
* Updates the key of the CoreCrypto database.
|
|
19
|
+
*
|
|
20
|
+
* This function is intended to be called only once, when migrating from CoreCrypto 5.x to 6.x.
|
|
21
|
+
*/
|
|
22
|
+
export declare function migrateDatabaseKeyTypeToBytes(path: string, oldKey: string, newKey: DatabaseKeyLike, asyncOpts_?: {
|
|
23
|
+
signal: AbortSignal;
|
|
24
|
+
}): Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* Returns the Proteus last resort prekey ID.
|
|
27
|
+
*
|
|
28
|
+
* The last resort prekey is a special prekey retained after all other prekeys have been consumed,
|
|
29
|
+
* ensuring a session can always be established. Its ID is always `u16::MAX` (65535).
|
|
30
|
+
*/
|
|
31
|
+
declare function proteusLastResortPrekeyIdFfi(): number;
|
|
32
|
+
/**
|
|
33
|
+
* Initializes the logger.
|
|
34
|
+
*/
|
|
35
|
+
export declare function setLogger(logger: CoreCryptoLogger): void;
|
|
36
|
+
/**
|
|
37
|
+
* Sets the maximum log level forwarded to the logger.
|
|
38
|
+
*/
|
|
39
|
+
export declare function setMaxLogLevel(level: CoreCryptoLogLevel): void;
|
|
40
|
+
/**
|
|
41
|
+
* The version of `core-crypto`.
|
|
42
|
+
*/
|
|
43
|
+
export declare function version(): string;
|
|
44
|
+
/**
|
|
45
|
+
* This directly represents a `ClientId` of the `<userid>-<device-id>@<domain>` format.
|
|
46
|
+
* Instantiate via [ClientId::deserialize].
|
|
47
|
+
*/
|
|
48
|
+
export type DeserializedClientId = {
|
|
49
|
+
/**
|
|
50
|
+
* The client id this was deserialized from
|
|
51
|
+
*/
|
|
52
|
+
clientId: ClientIdLike;
|
|
53
|
+
/**
|
|
54
|
+
* The string representation of a UUID
|
|
55
|
+
*/
|
|
56
|
+
userId: string;
|
|
57
|
+
/**
|
|
58
|
+
* A hex-encoded unsigned 64-bit integer
|
|
59
|
+
*/
|
|
60
|
+
deviceId: string;
|
|
61
|
+
/**
|
|
62
|
+
* The domain
|
|
63
|
+
*/
|
|
64
|
+
domain: string;
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* Generated factory for {@link DeserializedClientId} record objects.
|
|
68
|
+
*/
|
|
69
|
+
export declare const DeserializedClientId: Readonly<{
|
|
70
|
+
create: (partial: Partial<DeserializedClientId> & Required<Omit<DeserializedClientId, never>>) => DeserializedClientId;
|
|
71
|
+
new: (partial: Partial<DeserializedClientId> & Required<Omit<DeserializedClientId, never>>) => DeserializedClientId;
|
|
72
|
+
defaults: () => Partial<DeserializedClientId>;
|
|
73
|
+
}>;
|
|
74
|
+
type ClientIdLike = ClientId;
|
|
75
|
+
/**
|
|
76
|
+
* A unique identifier for an MLS client.
|
|
77
|
+
*
|
|
78
|
+
* Each app instance a user is running, such as desktop or mobile, is a separate client
|
|
79
|
+
* with its own client id. A single user may therefore have multiple clients.
|
|
80
|
+
* More information: <https://messaginglayersecurity.rocks/mls-architecture/draft-ietf-mls-architecture.html#name-group-members-and-clients>
|
|
81
|
+
*/
|
|
82
|
+
export declare class ClientId extends UniffiAbstractObject {
|
|
83
|
+
readonly [uniffiTypeNameSymbol] = "ClientId";
|
|
84
|
+
readonly [destructorGuardSymbol]: UniffiGcObject;
|
|
85
|
+
readonly [pointerLiteralSymbol]: UniffiHandle;
|
|
86
|
+
/**
|
|
87
|
+
* Create a new client id.
|
|
88
|
+
*/
|
|
89
|
+
constructor(userId: string, deviceId: string, domain: string);
|
|
90
|
+
/**
|
|
91
|
+
* Copy the wrapped data into a new byte array.
|
|
92
|
+
*/
|
|
93
|
+
copyBytes(): Uint8Array;
|
|
94
|
+
/**
|
|
95
|
+
* Copy the wrapped data into a direct representation of the `<userid>-<device-id>@<domain>` format.
|
|
96
|
+
*/
|
|
97
|
+
deserialize(): DeserializedClientId;
|
|
98
|
+
equals(other: ClientId): boolean;
|
|
99
|
+
hashCode(): bigint;
|
|
100
|
+
uniffiDestroy(): void;
|
|
101
|
+
static instanceOf(obj_: any): obj_ is ClientId;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* The standalone status of a device credential in an MLS group at a given moment.
|
|
105
|
+
*
|
|
106
|
+
* This does not represent states where a device is not using MLS or end-to-end identity.
|
|
107
|
+
*/
|
|
108
|
+
export declare enum DeviceStatus {
|
|
109
|
+
/**
|
|
110
|
+
* The device credential is valid.
|
|
111
|
+
*/
|
|
112
|
+
Valid = 1,
|
|
113
|
+
/**
|
|
114
|
+
* The device credential's certificate has expired.
|
|
115
|
+
*/
|
|
116
|
+
Expired = 2,
|
|
117
|
+
/**
|
|
118
|
+
* The device credential's certificate has been revoked.
|
|
119
|
+
*
|
|
120
|
+
* Note: revocation is not yet implemented.
|
|
121
|
+
*/
|
|
122
|
+
Revoked = 3
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* The type of credential used to authenticate an MLS client's identity.
|
|
126
|
+
*/
|
|
127
|
+
export declare enum CredentialType {
|
|
128
|
+
/**
|
|
129
|
+
* A basic credential backed by a raw key pair, without any certificate infrastructure.
|
|
130
|
+
*/
|
|
131
|
+
Basic = 1,
|
|
132
|
+
/**
|
|
133
|
+
* An X509 certificate credential, typically obtained through the end-to-end identity enrollment process.
|
|
134
|
+
*/
|
|
135
|
+
X509 = 2
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Typealias from the type name used in the UDL file to the builtin type. This
|
|
139
|
+
* is needed because the UDL type name is used in function/method signatures.
|
|
140
|
+
*/
|
|
141
|
+
export type Timestamp = Date;
|
|
142
|
+
/**
|
|
143
|
+
* Fields from a `WireIdentity` that are specific to X509 credentials.
|
|
144
|
+
*/
|
|
145
|
+
export type X509Identity = {
|
|
146
|
+
/**
|
|
147
|
+
* User handle e.g. `john_wire`
|
|
148
|
+
*/
|
|
149
|
+
handle: string;
|
|
150
|
+
/**
|
|
151
|
+
* Name as displayed in the messaging application e.g. `John Fitzgerald Kennedy`
|
|
152
|
+
*/
|
|
153
|
+
displayName: string;
|
|
154
|
+
/**
|
|
155
|
+
* DNS domain for which this identity proof was generated e.g. `whitehouse.gov`
|
|
156
|
+
*/
|
|
157
|
+
domain: string;
|
|
158
|
+
/**
|
|
159
|
+
* PEM-encoded X509 certificate identifying this client in the MLS group.
|
|
160
|
+
*/
|
|
161
|
+
certificate: string;
|
|
162
|
+
/**
|
|
163
|
+
* X509 certificate serial number
|
|
164
|
+
*/
|
|
165
|
+
serialNumber: string;
|
|
166
|
+
/**
|
|
167
|
+
* Certificate validity start time (the X509 notBefore field).
|
|
168
|
+
*/
|
|
169
|
+
notBefore: Timestamp;
|
|
170
|
+
/**
|
|
171
|
+
* Certificate validity end time (the X509 notAfter field).
|
|
172
|
+
*/
|
|
173
|
+
notAfter: Timestamp;
|
|
174
|
+
};
|
|
175
|
+
/**
|
|
176
|
+
* Generated factory for {@link X509Identity} record objects.
|
|
177
|
+
*/
|
|
178
|
+
export declare const X509Identity: Readonly<{
|
|
179
|
+
create: (partial: Partial<X509Identity> & Required<Omit<X509Identity, never>>) => X509Identity;
|
|
180
|
+
new: (partial: Partial<X509Identity> & Required<Omit<X509Identity, never>>) => X509Identity;
|
|
181
|
+
defaults: () => Partial<X509Identity>;
|
|
182
|
+
}>;
|
|
183
|
+
/**
|
|
184
|
+
* The identity claims identifying a client.
|
|
185
|
+
*
|
|
186
|
+
* Those claims are verifiable by any member in the group.
|
|
187
|
+
*/
|
|
188
|
+
export type WireIdentity = {
|
|
189
|
+
/**
|
|
190
|
+
* Unique client identifier e.g. `T4Coy4vdRzianwfOgXpn6A:6add501bacd1d90e@whitehouse.gov`
|
|
191
|
+
*/
|
|
192
|
+
clientId?: ClientIdLike;
|
|
193
|
+
/**
|
|
194
|
+
* Status of the credential at the moment this object is created.
|
|
195
|
+
*/
|
|
196
|
+
status: DeviceStatus;
|
|
197
|
+
/**
|
|
198
|
+
* MLS thumbprint
|
|
199
|
+
*/
|
|
200
|
+
thumbprint: string;
|
|
201
|
+
/**
|
|
202
|
+
* Indicates whether the credential is Basic or X509.
|
|
203
|
+
*/
|
|
204
|
+
credentialType: CredentialType;
|
|
205
|
+
/**
|
|
206
|
+
* The X509 certificate details; populated only when `credential_type` is X509.
|
|
207
|
+
*/
|
|
208
|
+
x509Identity?: X509Identity;
|
|
209
|
+
};
|
|
210
|
+
/**
|
|
211
|
+
* Generated factory for {@link WireIdentity} record objects.
|
|
212
|
+
*/
|
|
213
|
+
export declare const WireIdentity: Readonly<{
|
|
214
|
+
create: (partial: Partial<WireIdentity> & Required<Omit<WireIdentity, "clientId" | "x509Identity">>) => WireIdentity;
|
|
215
|
+
new: (partial: Partial<WireIdentity> & Required<Omit<WireIdentity, "clientId" | "x509Identity">>) => WireIdentity;
|
|
216
|
+
defaults: () => Partial<WireIdentity>;
|
|
217
|
+
}>;
|
|
218
|
+
/**
|
|
219
|
+
* A decrypted message that was buffered due to out-of-order delivery by the distribution service.
|
|
220
|
+
*
|
|
221
|
+
* These are returned in the `buffered_messages` field of a `DecryptedMessage` when a commit is
|
|
222
|
+
* processed. They represent messages for the new epoch that arrived before the commit that created it.
|
|
223
|
+
*/
|
|
224
|
+
export type BufferedDecryptedMessage = {
|
|
225
|
+
/**
|
|
226
|
+
* Decrypted plaintext
|
|
227
|
+
*/
|
|
228
|
+
message?: Uint8Array;
|
|
229
|
+
/**
|
|
230
|
+
* False if processing this message caused the client to be removed from the group, i.e. due to a Remove commit.
|
|
231
|
+
*/
|
|
232
|
+
isActive: boolean;
|
|
233
|
+
/**
|
|
234
|
+
* Commit delay in seconds.
|
|
235
|
+
*
|
|
236
|
+
* When set, clients must delay this long before processing a commit.
|
|
237
|
+
* This reduces load on the backend, which otherwise would receive epoch change notifications from all clients
|
|
238
|
+
* simultaneously.
|
|
239
|
+
*/
|
|
240
|
+
commitDelay?: bigint;
|
|
241
|
+
/**
|
|
242
|
+
* `ClientId` of the sender of the message being decrypted. Only present for application messages.
|
|
243
|
+
*/
|
|
244
|
+
senderClientId?: ClientIdLike;
|
|
245
|
+
/**
|
|
246
|
+
* Identity claims present in the sender credential.
|
|
247
|
+
*/
|
|
248
|
+
identity: WireIdentity;
|
|
249
|
+
};
|
|
250
|
+
/**
|
|
251
|
+
* Generated factory for {@link BufferedDecryptedMessage} record objects.
|
|
252
|
+
*/
|
|
253
|
+
export declare const BufferedDecryptedMessage: Readonly<{
|
|
254
|
+
create: (partial: Partial<BufferedDecryptedMessage> & Required<Omit<BufferedDecryptedMessage, "message" | "commitDelay" | "senderClientId">>) => BufferedDecryptedMessage;
|
|
255
|
+
new: (partial: Partial<BufferedDecryptedMessage> & Required<Omit<BufferedDecryptedMessage, "message" | "commitDelay" | "senderClientId">>) => BufferedDecryptedMessage;
|
|
256
|
+
defaults: () => Partial<BufferedDecryptedMessage>;
|
|
257
|
+
}>;
|
|
258
|
+
/**
|
|
259
|
+
* Metadata describing the conditions of the build of this software.
|
|
260
|
+
*/
|
|
261
|
+
export type BuildMetadata = {
|
|
262
|
+
/**
|
|
263
|
+
* Build timestamp
|
|
264
|
+
*/
|
|
265
|
+
timestamp: string;
|
|
266
|
+
/**
|
|
267
|
+
* Whether this build was in Debug mode (true) or Release mode (false).
|
|
268
|
+
*/
|
|
269
|
+
cargoDebug: string;
|
|
270
|
+
/**
|
|
271
|
+
* Features enabled for this build.
|
|
272
|
+
*/
|
|
273
|
+
cargoFeatures: string;
|
|
274
|
+
/**
|
|
275
|
+
* Optimization level
|
|
276
|
+
*/
|
|
277
|
+
optLevel: string;
|
|
278
|
+
/**
|
|
279
|
+
* Build target triple
|
|
280
|
+
*/
|
|
281
|
+
targetTriple: string;
|
|
282
|
+
/**
|
|
283
|
+
* Git branch
|
|
284
|
+
*/
|
|
285
|
+
gitBranch: string;
|
|
286
|
+
/**
|
|
287
|
+
* Output of `git describe`
|
|
288
|
+
*/
|
|
289
|
+
gitDescribe: string;
|
|
290
|
+
/**
|
|
291
|
+
* Hash of current git commit
|
|
292
|
+
*/
|
|
293
|
+
gitSha: string;
|
|
294
|
+
/**
|
|
295
|
+
* `true` when the source code differed from the commit at the most recent git hash.
|
|
296
|
+
*/
|
|
297
|
+
gitDirty: string;
|
|
298
|
+
};
|
|
299
|
+
/**
|
|
300
|
+
* Generated factory for {@link BuildMetadata} record objects.
|
|
301
|
+
*/
|
|
302
|
+
export declare const BuildMetadata: Readonly<{
|
|
303
|
+
create: (partial: Partial<BuildMetadata> & Required<Omit<BuildMetadata, never>>) => BuildMetadata;
|
|
304
|
+
new: (partial: Partial<BuildMetadata> & Required<Omit<BuildMetadata, never>>) => BuildMetadata;
|
|
305
|
+
defaults: () => Partial<BuildMetadata>;
|
|
306
|
+
}>;
|
|
307
|
+
export declare enum MlsError_Tags {
|
|
308
|
+
ConversationAlreadyExists = "ConversationAlreadyExists",
|
|
309
|
+
DuplicateMessage = "DuplicateMessage",
|
|
310
|
+
BufferedFutureMessage = "BufferedFutureMessage",
|
|
311
|
+
WrongEpoch = "WrongEpoch",
|
|
312
|
+
BufferedCommit = "BufferedCommit",
|
|
313
|
+
MessageEpochTooOld = "MessageEpochTooOld",
|
|
314
|
+
SelfCommitIgnored = "SelfCommitIgnored",
|
|
315
|
+
UnmergedPendingGroup = "UnmergedPendingGroup",
|
|
316
|
+
StaleProposal = "StaleProposal",
|
|
317
|
+
StaleCommit = "StaleCommit",
|
|
318
|
+
OrphanWelcome = "OrphanWelcome",
|
|
319
|
+
MessageRejected = "MessageRejected",
|
|
320
|
+
Other = "Other"
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* Errors produced by the MLS layer.
|
|
324
|
+
*/
|
|
325
|
+
export declare const MlsError: Readonly<{
|
|
326
|
+
instanceOf: (obj: any) => obj is MlsError;
|
|
327
|
+
ConversationAlreadyExists: {
|
|
328
|
+
new (inner: {
|
|
329
|
+
conversationId: Uint8Array;
|
|
330
|
+
}): {
|
|
331
|
+
readonly tag: MlsError_Tags.ConversationAlreadyExists;
|
|
332
|
+
readonly inner: Readonly<{
|
|
333
|
+
conversationId: Uint8Array;
|
|
334
|
+
}>;
|
|
335
|
+
/**
|
|
336
|
+
* @private
|
|
337
|
+
* This field is private and should not be used, use `tag` instead.
|
|
338
|
+
*/
|
|
339
|
+
readonly [uniffiTypeNameSymbol]: "MlsError";
|
|
340
|
+
name: string;
|
|
341
|
+
message: string;
|
|
342
|
+
stack?: string;
|
|
343
|
+
cause?: unknown;
|
|
344
|
+
};
|
|
345
|
+
"new"(inner: {
|
|
346
|
+
conversationId: Uint8Array;
|
|
347
|
+
}): {
|
|
348
|
+
readonly tag: MlsError_Tags.ConversationAlreadyExists;
|
|
349
|
+
readonly inner: Readonly<{
|
|
350
|
+
conversationId: Uint8Array;
|
|
351
|
+
}>;
|
|
352
|
+
/**
|
|
353
|
+
* @private
|
|
354
|
+
* This field is private and should not be used, use `tag` instead.
|
|
355
|
+
*/
|
|
356
|
+
readonly [uniffiTypeNameSymbol]: "MlsError";
|
|
357
|
+
name: string;
|
|
358
|
+
message: string;
|
|
359
|
+
stack?: string;
|
|
360
|
+
cause?: unknown;
|
|
361
|
+
};
|
|
362
|
+
instanceOf(obj: any): obj is {
|
|
363
|
+
readonly tag: MlsError_Tags.ConversationAlreadyExists;
|
|
364
|
+
readonly inner: Readonly<{
|
|
365
|
+
conversationId: Uint8Array;
|
|
366
|
+
}>;
|
|
367
|
+
/**
|
|
368
|
+
* @private
|
|
369
|
+
* This field is private and should not be used, use `tag` instead.
|
|
370
|
+
*/
|
|
371
|
+
readonly [uniffiTypeNameSymbol]: "MlsError";
|
|
372
|
+
name: string;
|
|
373
|
+
message: string;
|
|
374
|
+
stack?: string;
|
|
375
|
+
cause?: unknown;
|
|
376
|
+
};
|
|
377
|
+
hasInner(obj: any): obj is {
|
|
378
|
+
readonly tag: MlsError_Tags.ConversationAlreadyExists;
|
|
379
|
+
readonly inner: Readonly<{
|
|
380
|
+
conversationId: Uint8Array;
|
|
381
|
+
}>;
|
|
382
|
+
/**
|
|
383
|
+
* @private
|
|
384
|
+
* This field is private and should not be used, use `tag` instead.
|
|
385
|
+
*/
|
|
386
|
+
readonly [uniffiTypeNameSymbol]: "MlsError";
|
|
387
|
+
name: string;
|
|
388
|
+
message: string;
|
|
389
|
+
stack?: string;
|
|
390
|
+
cause?: unknown;
|
|
391
|
+
};
|
|
392
|
+
getInner(obj: {
|
|
393
|
+
readonly tag: MlsError_Tags.ConversationAlreadyExists;
|
|
394
|
+
readonly inner: Readonly<{
|
|
395
|
+
conversationId: Uint8Array;
|
|
396
|
+
}>;
|
|
397
|
+
/**
|
|
398
|
+
* @private
|
|
399
|
+
* This field is private and should not be used, use `tag` instead.
|
|
400
|
+
*/
|
|
401
|
+
readonly [uniffiTypeNameSymbol]: "MlsError";
|
|
402
|
+
name: string;
|
|
403
|
+
message: string;
|
|
404
|
+
stack?: string;
|
|
405
|
+
cause?: unknown;
|
|
406
|
+
}): Readonly<{
|
|
407
|
+
conversationId: Uint8Array;
|
|
408
|
+
}>;
|
|
409
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
410
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
411
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
412
|
+
stackTraceLimit: number;
|
|
413
|
+
isError(value: unknown): value is Error;
|
|
414
|
+
};
|
|
415
|
+
DuplicateMessage: {
|
|
416
|
+
new (): {
|
|
417
|
+
readonly tag: MlsError_Tags.DuplicateMessage;
|
|
418
|
+
/**
|
|
419
|
+
* @private
|
|
420
|
+
* This field is private and should not be used, use `tag` instead.
|
|
421
|
+
*/
|
|
422
|
+
readonly [uniffiTypeNameSymbol]: "MlsError";
|
|
423
|
+
name: string;
|
|
424
|
+
message: string;
|
|
425
|
+
stack?: string;
|
|
426
|
+
cause?: unknown;
|
|
427
|
+
};
|
|
428
|
+
"new"(): {
|
|
429
|
+
readonly tag: MlsError_Tags.DuplicateMessage;
|
|
430
|
+
/**
|
|
431
|
+
* @private
|
|
432
|
+
* This field is private and should not be used, use `tag` instead.
|
|
433
|
+
*/
|
|
434
|
+
readonly [uniffiTypeNameSymbol]: "MlsError";
|
|
435
|
+
name: string;
|
|
436
|
+
message: string;
|
|
437
|
+
stack?: string;
|
|
438
|
+
cause?: unknown;
|
|
439
|
+
};
|
|
440
|
+
instanceOf(obj: any): obj is {
|
|
441
|
+
readonly tag: MlsError_Tags.DuplicateMessage;
|
|
442
|
+
/**
|
|
443
|
+
* @private
|
|
444
|
+
* This field is private and should not be used, use `tag` instead.
|
|
445
|
+
*/
|
|
446
|
+
readonly [uniffiTypeNameSymbol]: "MlsError";
|
|
447
|
+
name: string;
|
|
448
|
+
message: string;
|
|
449
|
+
stack?: string;
|
|
450
|
+
cause?: unknown;
|
|
451
|
+
};
|
|
452
|
+
hasInner(obj: any): obj is {
|
|
453
|
+
readonly tag: MlsError_Tags.DuplicateMessage;
|
|
454
|
+
/**
|
|
455
|
+
* @private
|
|
456
|
+
* This field is private and should not be used, use `tag` instead.
|
|
457
|
+
*/
|
|
458
|
+
readonly [uniffiTypeNameSymbol]: "MlsError";
|
|
459
|
+
name: string;
|
|
460
|
+
message: string;
|
|
461
|
+
stack?: string;
|
|
462
|
+
cause?: unknown;
|
|
463
|
+
};
|
|
464
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
465
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
466
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
467
|
+
stackTraceLimit: number;
|
|
468
|
+
isError(value: unknown): value is Error;
|
|
469
|
+
};
|
|
470
|
+
BufferedFutureMessage: {
|
|
471
|
+
new (): {
|
|
472
|
+
readonly tag: MlsError_Tags.BufferedFutureMessage;
|
|
473
|
+
/**
|
|
474
|
+
* @private
|
|
475
|
+
* This field is private and should not be used, use `tag` instead.
|
|
476
|
+
*/
|
|
477
|
+
readonly [uniffiTypeNameSymbol]: "MlsError";
|
|
478
|
+
name: string;
|
|
479
|
+
message: string;
|
|
480
|
+
stack?: string;
|
|
481
|
+
cause?: unknown;
|
|
482
|
+
};
|
|
483
|
+
"new"(): {
|
|
484
|
+
readonly tag: MlsError_Tags.BufferedFutureMessage;
|
|
485
|
+
/**
|
|
486
|
+
* @private
|
|
487
|
+
* This field is private and should not be used, use `tag` instead.
|
|
488
|
+
*/
|
|
489
|
+
readonly [uniffiTypeNameSymbol]: "MlsError";
|
|
490
|
+
name: string;
|
|
491
|
+
message: string;
|
|
492
|
+
stack?: string;
|
|
493
|
+
cause?: unknown;
|
|
494
|
+
};
|
|
495
|
+
instanceOf(obj: any): obj is {
|
|
496
|
+
readonly tag: MlsError_Tags.BufferedFutureMessage;
|
|
497
|
+
/**
|
|
498
|
+
* @private
|
|
499
|
+
* This field is private and should not be used, use `tag` instead.
|
|
500
|
+
*/
|
|
501
|
+
readonly [uniffiTypeNameSymbol]: "MlsError";
|
|
502
|
+
name: string;
|
|
503
|
+
message: string;
|
|
504
|
+
stack?: string;
|
|
505
|
+
cause?: unknown;
|
|
506
|
+
};
|
|
507
|
+
hasInner(obj: any): obj is {
|
|
508
|
+
readonly tag: MlsError_Tags.BufferedFutureMessage;
|
|
509
|
+
/**
|
|
510
|
+
* @private
|
|
511
|
+
* This field is private and should not be used, use `tag` instead.
|
|
512
|
+
*/
|
|
513
|
+
readonly [uniffiTypeNameSymbol]: "MlsError";
|
|
514
|
+
name: string;
|
|
515
|
+
message: string;
|
|
516
|
+
stack?: string;
|
|
517
|
+
cause?: unknown;
|
|
518
|
+
};
|
|
519
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
520
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
521
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
522
|
+
stackTraceLimit: number;
|
|
523
|
+
isError(value: unknown): value is Error;
|
|
524
|
+
};
|
|
525
|
+
WrongEpoch: {
|
|
526
|
+
new (): {
|
|
527
|
+
readonly tag: MlsError_Tags.WrongEpoch;
|
|
528
|
+
/**
|
|
529
|
+
* @private
|
|
530
|
+
* This field is private and should not be used, use `tag` instead.
|
|
531
|
+
*/
|
|
532
|
+
readonly [uniffiTypeNameSymbol]: "MlsError";
|
|
533
|
+
name: string;
|
|
534
|
+
message: string;
|
|
535
|
+
stack?: string;
|
|
536
|
+
cause?: unknown;
|
|
537
|
+
};
|
|
538
|
+
"new"(): {
|
|
539
|
+
readonly tag: MlsError_Tags.WrongEpoch;
|
|
540
|
+
/**
|
|
541
|
+
* @private
|
|
542
|
+
* This field is private and should not be used, use `tag` instead.
|
|
543
|
+
*/
|
|
544
|
+
readonly [uniffiTypeNameSymbol]: "MlsError";
|
|
545
|
+
name: string;
|
|
546
|
+
message: string;
|
|
547
|
+
stack?: string;
|
|
548
|
+
cause?: unknown;
|
|
549
|
+
};
|
|
550
|
+
instanceOf(obj: any): obj is {
|
|
551
|
+
readonly tag: MlsError_Tags.WrongEpoch;
|
|
552
|
+
/**
|
|
553
|
+
* @private
|
|
554
|
+
* This field is private and should not be used, use `tag` instead.
|
|
555
|
+
*/
|
|
556
|
+
readonly [uniffiTypeNameSymbol]: "MlsError";
|
|
557
|
+
name: string;
|
|
558
|
+
message: string;
|
|
559
|
+
stack?: string;
|
|
560
|
+
cause?: unknown;
|
|
561
|
+
};
|
|
562
|
+
hasInner(obj: any): obj is {
|
|
563
|
+
readonly tag: MlsError_Tags.WrongEpoch;
|
|
564
|
+
/**
|
|
565
|
+
* @private
|
|
566
|
+
* This field is private and should not be used, use `tag` instead.
|
|
567
|
+
*/
|
|
568
|
+
readonly [uniffiTypeNameSymbol]: "MlsError";
|
|
569
|
+
name: string;
|
|
570
|
+
message: string;
|
|
571
|
+
stack?: string;
|
|
572
|
+
cause?: unknown;
|
|
573
|
+
};
|
|
574
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
575
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
576
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
577
|
+
stackTraceLimit: number;
|
|
578
|
+
isError(value: unknown): value is Error;
|
|
579
|
+
};
|
|
580
|
+
BufferedCommit: {
|
|
581
|
+
new (): {
|
|
582
|
+
readonly tag: MlsError_Tags.BufferedCommit;
|
|
583
|
+
/**
|
|
584
|
+
* @private
|
|
585
|
+
* This field is private and should not be used, use `tag` instead.
|
|
586
|
+
*/
|
|
587
|
+
readonly [uniffiTypeNameSymbol]: "MlsError";
|
|
588
|
+
name: string;
|
|
589
|
+
message: string;
|
|
590
|
+
stack?: string;
|
|
591
|
+
cause?: unknown;
|
|
592
|
+
};
|
|
593
|
+
"new"(): {
|
|
594
|
+
readonly tag: MlsError_Tags.BufferedCommit;
|
|
595
|
+
/**
|
|
596
|
+
* @private
|
|
597
|
+
* This field is private and should not be used, use `tag` instead.
|
|
598
|
+
*/
|
|
599
|
+
readonly [uniffiTypeNameSymbol]: "MlsError";
|
|
600
|
+
name: string;
|
|
601
|
+
message: string;
|
|
602
|
+
stack?: string;
|
|
603
|
+
cause?: unknown;
|
|
604
|
+
};
|
|
605
|
+
instanceOf(obj: any): obj is {
|
|
606
|
+
readonly tag: MlsError_Tags.BufferedCommit;
|
|
607
|
+
/**
|
|
608
|
+
* @private
|
|
609
|
+
* This field is private and should not be used, use `tag` instead.
|
|
610
|
+
*/
|
|
611
|
+
readonly [uniffiTypeNameSymbol]: "MlsError";
|
|
612
|
+
name: string;
|
|
613
|
+
message: string;
|
|
614
|
+
stack?: string;
|
|
615
|
+
cause?: unknown;
|
|
616
|
+
};
|
|
617
|
+
hasInner(obj: any): obj is {
|
|
618
|
+
readonly tag: MlsError_Tags.BufferedCommit;
|
|
619
|
+
/**
|
|
620
|
+
* @private
|
|
621
|
+
* This field is private and should not be used, use `tag` instead.
|
|
622
|
+
*/
|
|
623
|
+
readonly [uniffiTypeNameSymbol]: "MlsError";
|
|
624
|
+
name: string;
|
|
625
|
+
message: string;
|
|
626
|
+
stack?: string;
|
|
627
|
+
cause?: unknown;
|
|
628
|
+
};
|
|
629
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
630
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
631
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
632
|
+
stackTraceLimit: number;
|
|
633
|
+
isError(value: unknown): value is Error;
|
|
634
|
+
};
|
|
635
|
+
MessageEpochTooOld: {
|
|
636
|
+
new (): {
|
|
637
|
+
readonly tag: MlsError_Tags.MessageEpochTooOld;
|
|
638
|
+
/**
|
|
639
|
+
* @private
|
|
640
|
+
* This field is private and should not be used, use `tag` instead.
|
|
641
|
+
*/
|
|
642
|
+
readonly [uniffiTypeNameSymbol]: "MlsError";
|
|
643
|
+
name: string;
|
|
644
|
+
message: string;
|
|
645
|
+
stack?: string;
|
|
646
|
+
cause?: unknown;
|
|
647
|
+
};
|
|
648
|
+
"new"(): {
|
|
649
|
+
readonly tag: MlsError_Tags.MessageEpochTooOld;
|
|
650
|
+
/**
|
|
651
|
+
* @private
|
|
652
|
+
* This field is private and should not be used, use `tag` instead.
|
|
653
|
+
*/
|
|
654
|
+
readonly [uniffiTypeNameSymbol]: "MlsError";
|
|
655
|
+
name: string;
|
|
656
|
+
message: string;
|
|
657
|
+
stack?: string;
|
|
658
|
+
cause?: unknown;
|
|
659
|
+
};
|
|
660
|
+
instanceOf(obj: any): obj is {
|
|
661
|
+
readonly tag: MlsError_Tags.MessageEpochTooOld;
|
|
662
|
+
/**
|
|
663
|
+
* @private
|
|
664
|
+
* This field is private and should not be used, use `tag` instead.
|
|
665
|
+
*/
|
|
666
|
+
readonly [uniffiTypeNameSymbol]: "MlsError";
|
|
667
|
+
name: string;
|
|
668
|
+
message: string;
|
|
669
|
+
stack?: string;
|
|
670
|
+
cause?: unknown;
|
|
671
|
+
};
|
|
672
|
+
hasInner(obj: any): obj is {
|
|
673
|
+
readonly tag: MlsError_Tags.MessageEpochTooOld;
|
|
674
|
+
/**
|
|
675
|
+
* @private
|
|
676
|
+
* This field is private and should not be used, use `tag` instead.
|
|
677
|
+
*/
|
|
678
|
+
readonly [uniffiTypeNameSymbol]: "MlsError";
|
|
679
|
+
name: string;
|
|
680
|
+
message: string;
|
|
681
|
+
stack?: string;
|
|
682
|
+
cause?: unknown;
|
|
683
|
+
};
|
|
684
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
685
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
686
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
687
|
+
stackTraceLimit: number;
|
|
688
|
+
isError(value: unknown): value is Error;
|
|
689
|
+
};
|
|
690
|
+
SelfCommitIgnored: {
|
|
691
|
+
new (): {
|
|
692
|
+
readonly tag: MlsError_Tags.SelfCommitIgnored;
|
|
693
|
+
/**
|
|
694
|
+
* @private
|
|
695
|
+
* This field is private and should not be used, use `tag` instead.
|
|
696
|
+
*/
|
|
697
|
+
readonly [uniffiTypeNameSymbol]: "MlsError";
|
|
698
|
+
name: string;
|
|
699
|
+
message: string;
|
|
700
|
+
stack?: string;
|
|
701
|
+
cause?: unknown;
|
|
702
|
+
};
|
|
703
|
+
"new"(): {
|
|
704
|
+
readonly tag: MlsError_Tags.SelfCommitIgnored;
|
|
705
|
+
/**
|
|
706
|
+
* @private
|
|
707
|
+
* This field is private and should not be used, use `tag` instead.
|
|
708
|
+
*/
|
|
709
|
+
readonly [uniffiTypeNameSymbol]: "MlsError";
|
|
710
|
+
name: string;
|
|
711
|
+
message: string;
|
|
712
|
+
stack?: string;
|
|
713
|
+
cause?: unknown;
|
|
714
|
+
};
|
|
715
|
+
instanceOf(obj: any): obj is {
|
|
716
|
+
readonly tag: MlsError_Tags.SelfCommitIgnored;
|
|
717
|
+
/**
|
|
718
|
+
* @private
|
|
719
|
+
* This field is private and should not be used, use `tag` instead.
|
|
720
|
+
*/
|
|
721
|
+
readonly [uniffiTypeNameSymbol]: "MlsError";
|
|
722
|
+
name: string;
|
|
723
|
+
message: string;
|
|
724
|
+
stack?: string;
|
|
725
|
+
cause?: unknown;
|
|
726
|
+
};
|
|
727
|
+
hasInner(obj: any): obj is {
|
|
728
|
+
readonly tag: MlsError_Tags.SelfCommitIgnored;
|
|
729
|
+
/**
|
|
730
|
+
* @private
|
|
731
|
+
* This field is private and should not be used, use `tag` instead.
|
|
732
|
+
*/
|
|
733
|
+
readonly [uniffiTypeNameSymbol]: "MlsError";
|
|
734
|
+
name: string;
|
|
735
|
+
message: string;
|
|
736
|
+
stack?: string;
|
|
737
|
+
cause?: unknown;
|
|
738
|
+
};
|
|
739
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
740
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
741
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
742
|
+
stackTraceLimit: number;
|
|
743
|
+
isError(value: unknown): value is Error;
|
|
744
|
+
};
|
|
745
|
+
UnmergedPendingGroup: {
|
|
746
|
+
new (): {
|
|
747
|
+
readonly tag: MlsError_Tags.UnmergedPendingGroup;
|
|
748
|
+
/**
|
|
749
|
+
* @private
|
|
750
|
+
* This field is private and should not be used, use `tag` instead.
|
|
751
|
+
*/
|
|
752
|
+
readonly [uniffiTypeNameSymbol]: "MlsError";
|
|
753
|
+
name: string;
|
|
754
|
+
message: string;
|
|
755
|
+
stack?: string;
|
|
756
|
+
cause?: unknown;
|
|
757
|
+
};
|
|
758
|
+
"new"(): {
|
|
759
|
+
readonly tag: MlsError_Tags.UnmergedPendingGroup;
|
|
760
|
+
/**
|
|
761
|
+
* @private
|
|
762
|
+
* This field is private and should not be used, use `tag` instead.
|
|
763
|
+
*/
|
|
764
|
+
readonly [uniffiTypeNameSymbol]: "MlsError";
|
|
765
|
+
name: string;
|
|
766
|
+
message: string;
|
|
767
|
+
stack?: string;
|
|
768
|
+
cause?: unknown;
|
|
769
|
+
};
|
|
770
|
+
instanceOf(obj: any): obj is {
|
|
771
|
+
readonly tag: MlsError_Tags.UnmergedPendingGroup;
|
|
772
|
+
/**
|
|
773
|
+
* @private
|
|
774
|
+
* This field is private and should not be used, use `tag` instead.
|
|
775
|
+
*/
|
|
776
|
+
readonly [uniffiTypeNameSymbol]: "MlsError";
|
|
777
|
+
name: string;
|
|
778
|
+
message: string;
|
|
779
|
+
stack?: string;
|
|
780
|
+
cause?: unknown;
|
|
781
|
+
};
|
|
782
|
+
hasInner(obj: any): obj is {
|
|
783
|
+
readonly tag: MlsError_Tags.UnmergedPendingGroup;
|
|
784
|
+
/**
|
|
785
|
+
* @private
|
|
786
|
+
* This field is private and should not be used, use `tag` instead.
|
|
787
|
+
*/
|
|
788
|
+
readonly [uniffiTypeNameSymbol]: "MlsError";
|
|
789
|
+
name: string;
|
|
790
|
+
message: string;
|
|
791
|
+
stack?: string;
|
|
792
|
+
cause?: unknown;
|
|
793
|
+
};
|
|
794
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
795
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
796
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
797
|
+
stackTraceLimit: number;
|
|
798
|
+
isError(value: unknown): value is Error;
|
|
799
|
+
};
|
|
800
|
+
StaleProposal: {
|
|
801
|
+
new (): {
|
|
802
|
+
readonly tag: MlsError_Tags.StaleProposal;
|
|
803
|
+
/**
|
|
804
|
+
* @private
|
|
805
|
+
* This field is private and should not be used, use `tag` instead.
|
|
806
|
+
*/
|
|
807
|
+
readonly [uniffiTypeNameSymbol]: "MlsError";
|
|
808
|
+
name: string;
|
|
809
|
+
message: string;
|
|
810
|
+
stack?: string;
|
|
811
|
+
cause?: unknown;
|
|
812
|
+
};
|
|
813
|
+
"new"(): {
|
|
814
|
+
readonly tag: MlsError_Tags.StaleProposal;
|
|
815
|
+
/**
|
|
816
|
+
* @private
|
|
817
|
+
* This field is private and should not be used, use `tag` instead.
|
|
818
|
+
*/
|
|
819
|
+
readonly [uniffiTypeNameSymbol]: "MlsError";
|
|
820
|
+
name: string;
|
|
821
|
+
message: string;
|
|
822
|
+
stack?: string;
|
|
823
|
+
cause?: unknown;
|
|
824
|
+
};
|
|
825
|
+
instanceOf(obj: any): obj is {
|
|
826
|
+
readonly tag: MlsError_Tags.StaleProposal;
|
|
827
|
+
/**
|
|
828
|
+
* @private
|
|
829
|
+
* This field is private and should not be used, use `tag` instead.
|
|
830
|
+
*/
|
|
831
|
+
readonly [uniffiTypeNameSymbol]: "MlsError";
|
|
832
|
+
name: string;
|
|
833
|
+
message: string;
|
|
834
|
+
stack?: string;
|
|
835
|
+
cause?: unknown;
|
|
836
|
+
};
|
|
837
|
+
hasInner(obj: any): obj is {
|
|
838
|
+
readonly tag: MlsError_Tags.StaleProposal;
|
|
839
|
+
/**
|
|
840
|
+
* @private
|
|
841
|
+
* This field is private and should not be used, use `tag` instead.
|
|
842
|
+
*/
|
|
843
|
+
readonly [uniffiTypeNameSymbol]: "MlsError";
|
|
844
|
+
name: string;
|
|
845
|
+
message: string;
|
|
846
|
+
stack?: string;
|
|
847
|
+
cause?: unknown;
|
|
848
|
+
};
|
|
849
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
850
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
851
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
852
|
+
stackTraceLimit: number;
|
|
853
|
+
isError(value: unknown): value is Error;
|
|
854
|
+
};
|
|
855
|
+
StaleCommit: {
|
|
856
|
+
new (): {
|
|
857
|
+
readonly tag: MlsError_Tags.StaleCommit;
|
|
858
|
+
/**
|
|
859
|
+
* @private
|
|
860
|
+
* This field is private and should not be used, use `tag` instead.
|
|
861
|
+
*/
|
|
862
|
+
readonly [uniffiTypeNameSymbol]: "MlsError";
|
|
863
|
+
name: string;
|
|
864
|
+
message: string;
|
|
865
|
+
stack?: string;
|
|
866
|
+
cause?: unknown;
|
|
867
|
+
};
|
|
868
|
+
"new"(): {
|
|
869
|
+
readonly tag: MlsError_Tags.StaleCommit;
|
|
870
|
+
/**
|
|
871
|
+
* @private
|
|
872
|
+
* This field is private and should not be used, use `tag` instead.
|
|
873
|
+
*/
|
|
874
|
+
readonly [uniffiTypeNameSymbol]: "MlsError";
|
|
875
|
+
name: string;
|
|
876
|
+
message: string;
|
|
877
|
+
stack?: string;
|
|
878
|
+
cause?: unknown;
|
|
879
|
+
};
|
|
880
|
+
instanceOf(obj: any): obj is {
|
|
881
|
+
readonly tag: MlsError_Tags.StaleCommit;
|
|
882
|
+
/**
|
|
883
|
+
* @private
|
|
884
|
+
* This field is private and should not be used, use `tag` instead.
|
|
885
|
+
*/
|
|
886
|
+
readonly [uniffiTypeNameSymbol]: "MlsError";
|
|
887
|
+
name: string;
|
|
888
|
+
message: string;
|
|
889
|
+
stack?: string;
|
|
890
|
+
cause?: unknown;
|
|
891
|
+
};
|
|
892
|
+
hasInner(obj: any): obj is {
|
|
893
|
+
readonly tag: MlsError_Tags.StaleCommit;
|
|
894
|
+
/**
|
|
895
|
+
* @private
|
|
896
|
+
* This field is private and should not be used, use `tag` instead.
|
|
897
|
+
*/
|
|
898
|
+
readonly [uniffiTypeNameSymbol]: "MlsError";
|
|
899
|
+
name: string;
|
|
900
|
+
message: string;
|
|
901
|
+
stack?: string;
|
|
902
|
+
cause?: unknown;
|
|
903
|
+
};
|
|
904
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
905
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
906
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
907
|
+
stackTraceLimit: number;
|
|
908
|
+
isError(value: unknown): value is Error;
|
|
909
|
+
};
|
|
910
|
+
OrphanWelcome: {
|
|
911
|
+
new (): {
|
|
912
|
+
readonly tag: MlsError_Tags.OrphanWelcome;
|
|
913
|
+
/**
|
|
914
|
+
* @private
|
|
915
|
+
* This field is private and should not be used, use `tag` instead.
|
|
916
|
+
*/
|
|
917
|
+
readonly [uniffiTypeNameSymbol]: "MlsError";
|
|
918
|
+
name: string;
|
|
919
|
+
message: string;
|
|
920
|
+
stack?: string;
|
|
921
|
+
cause?: unknown;
|
|
922
|
+
};
|
|
923
|
+
"new"(): {
|
|
924
|
+
readonly tag: MlsError_Tags.OrphanWelcome;
|
|
925
|
+
/**
|
|
926
|
+
* @private
|
|
927
|
+
* This field is private and should not be used, use `tag` instead.
|
|
928
|
+
*/
|
|
929
|
+
readonly [uniffiTypeNameSymbol]: "MlsError";
|
|
930
|
+
name: string;
|
|
931
|
+
message: string;
|
|
932
|
+
stack?: string;
|
|
933
|
+
cause?: unknown;
|
|
934
|
+
};
|
|
935
|
+
instanceOf(obj: any): obj is {
|
|
936
|
+
readonly tag: MlsError_Tags.OrphanWelcome;
|
|
937
|
+
/**
|
|
938
|
+
* @private
|
|
939
|
+
* This field is private and should not be used, use `tag` instead.
|
|
940
|
+
*/
|
|
941
|
+
readonly [uniffiTypeNameSymbol]: "MlsError";
|
|
942
|
+
name: string;
|
|
943
|
+
message: string;
|
|
944
|
+
stack?: string;
|
|
945
|
+
cause?: unknown;
|
|
946
|
+
};
|
|
947
|
+
hasInner(obj: any): obj is {
|
|
948
|
+
readonly tag: MlsError_Tags.OrphanWelcome;
|
|
949
|
+
/**
|
|
950
|
+
* @private
|
|
951
|
+
* This field is private and should not be used, use `tag` instead.
|
|
952
|
+
*/
|
|
953
|
+
readonly [uniffiTypeNameSymbol]: "MlsError";
|
|
954
|
+
name: string;
|
|
955
|
+
message: string;
|
|
956
|
+
stack?: string;
|
|
957
|
+
cause?: unknown;
|
|
958
|
+
};
|
|
959
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
960
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
961
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
962
|
+
stackTraceLimit: number;
|
|
963
|
+
isError(value: unknown): value is Error;
|
|
964
|
+
};
|
|
965
|
+
MessageRejected: {
|
|
966
|
+
new (inner: {
|
|
967
|
+
reason: string;
|
|
968
|
+
}): {
|
|
969
|
+
readonly tag: MlsError_Tags.MessageRejected;
|
|
970
|
+
readonly inner: Readonly<{
|
|
971
|
+
reason: string;
|
|
972
|
+
}>;
|
|
973
|
+
/**
|
|
974
|
+
* @private
|
|
975
|
+
* This field is private and should not be used, use `tag` instead.
|
|
976
|
+
*/
|
|
977
|
+
readonly [uniffiTypeNameSymbol]: "MlsError";
|
|
978
|
+
name: string;
|
|
979
|
+
message: string;
|
|
980
|
+
stack?: string;
|
|
981
|
+
cause?: unknown;
|
|
982
|
+
};
|
|
983
|
+
"new"(inner: {
|
|
984
|
+
reason: string;
|
|
985
|
+
}): {
|
|
986
|
+
readonly tag: MlsError_Tags.MessageRejected;
|
|
987
|
+
readonly inner: Readonly<{
|
|
988
|
+
reason: string;
|
|
989
|
+
}>;
|
|
990
|
+
/**
|
|
991
|
+
* @private
|
|
992
|
+
* This field is private and should not be used, use `tag` instead.
|
|
993
|
+
*/
|
|
994
|
+
readonly [uniffiTypeNameSymbol]: "MlsError";
|
|
995
|
+
name: string;
|
|
996
|
+
message: string;
|
|
997
|
+
stack?: string;
|
|
998
|
+
cause?: unknown;
|
|
999
|
+
};
|
|
1000
|
+
instanceOf(obj: any): obj is {
|
|
1001
|
+
readonly tag: MlsError_Tags.MessageRejected;
|
|
1002
|
+
readonly inner: Readonly<{
|
|
1003
|
+
reason: string;
|
|
1004
|
+
}>;
|
|
1005
|
+
/**
|
|
1006
|
+
* @private
|
|
1007
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1008
|
+
*/
|
|
1009
|
+
readonly [uniffiTypeNameSymbol]: "MlsError";
|
|
1010
|
+
name: string;
|
|
1011
|
+
message: string;
|
|
1012
|
+
stack?: string;
|
|
1013
|
+
cause?: unknown;
|
|
1014
|
+
};
|
|
1015
|
+
hasInner(obj: any): obj is {
|
|
1016
|
+
readonly tag: MlsError_Tags.MessageRejected;
|
|
1017
|
+
readonly inner: Readonly<{
|
|
1018
|
+
reason: string;
|
|
1019
|
+
}>;
|
|
1020
|
+
/**
|
|
1021
|
+
* @private
|
|
1022
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1023
|
+
*/
|
|
1024
|
+
readonly [uniffiTypeNameSymbol]: "MlsError";
|
|
1025
|
+
name: string;
|
|
1026
|
+
message: string;
|
|
1027
|
+
stack?: string;
|
|
1028
|
+
cause?: unknown;
|
|
1029
|
+
};
|
|
1030
|
+
getInner(obj: {
|
|
1031
|
+
readonly tag: MlsError_Tags.MessageRejected;
|
|
1032
|
+
readonly inner: Readonly<{
|
|
1033
|
+
reason: string;
|
|
1034
|
+
}>;
|
|
1035
|
+
/**
|
|
1036
|
+
* @private
|
|
1037
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1038
|
+
*/
|
|
1039
|
+
readonly [uniffiTypeNameSymbol]: "MlsError";
|
|
1040
|
+
name: string;
|
|
1041
|
+
message: string;
|
|
1042
|
+
stack?: string;
|
|
1043
|
+
cause?: unknown;
|
|
1044
|
+
}): Readonly<{
|
|
1045
|
+
reason: string;
|
|
1046
|
+
}>;
|
|
1047
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
1048
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
1049
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
1050
|
+
stackTraceLimit: number;
|
|
1051
|
+
isError(value: unknown): value is Error;
|
|
1052
|
+
};
|
|
1053
|
+
Other: {
|
|
1054
|
+
new (inner: {
|
|
1055
|
+
msg: string;
|
|
1056
|
+
}): {
|
|
1057
|
+
readonly tag: MlsError_Tags.Other;
|
|
1058
|
+
readonly inner: Readonly<{
|
|
1059
|
+
msg: string;
|
|
1060
|
+
}>;
|
|
1061
|
+
/**
|
|
1062
|
+
* @private
|
|
1063
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1064
|
+
*/
|
|
1065
|
+
readonly [uniffiTypeNameSymbol]: "MlsError";
|
|
1066
|
+
name: string;
|
|
1067
|
+
message: string;
|
|
1068
|
+
stack?: string;
|
|
1069
|
+
cause?: unknown;
|
|
1070
|
+
};
|
|
1071
|
+
"new"(inner: {
|
|
1072
|
+
msg: string;
|
|
1073
|
+
}): {
|
|
1074
|
+
readonly tag: MlsError_Tags.Other;
|
|
1075
|
+
readonly inner: Readonly<{
|
|
1076
|
+
msg: string;
|
|
1077
|
+
}>;
|
|
1078
|
+
/**
|
|
1079
|
+
* @private
|
|
1080
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1081
|
+
*/
|
|
1082
|
+
readonly [uniffiTypeNameSymbol]: "MlsError";
|
|
1083
|
+
name: string;
|
|
1084
|
+
message: string;
|
|
1085
|
+
stack?: string;
|
|
1086
|
+
cause?: unknown;
|
|
1087
|
+
};
|
|
1088
|
+
instanceOf(obj: any): obj is {
|
|
1089
|
+
readonly tag: MlsError_Tags.Other;
|
|
1090
|
+
readonly inner: Readonly<{
|
|
1091
|
+
msg: string;
|
|
1092
|
+
}>;
|
|
1093
|
+
/**
|
|
1094
|
+
* @private
|
|
1095
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1096
|
+
*/
|
|
1097
|
+
readonly [uniffiTypeNameSymbol]: "MlsError";
|
|
1098
|
+
name: string;
|
|
1099
|
+
message: string;
|
|
1100
|
+
stack?: string;
|
|
1101
|
+
cause?: unknown;
|
|
1102
|
+
};
|
|
1103
|
+
hasInner(obj: any): obj is {
|
|
1104
|
+
readonly tag: MlsError_Tags.Other;
|
|
1105
|
+
readonly inner: Readonly<{
|
|
1106
|
+
msg: string;
|
|
1107
|
+
}>;
|
|
1108
|
+
/**
|
|
1109
|
+
* @private
|
|
1110
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1111
|
+
*/
|
|
1112
|
+
readonly [uniffiTypeNameSymbol]: "MlsError";
|
|
1113
|
+
name: string;
|
|
1114
|
+
message: string;
|
|
1115
|
+
stack?: string;
|
|
1116
|
+
cause?: unknown;
|
|
1117
|
+
};
|
|
1118
|
+
getInner(obj: {
|
|
1119
|
+
readonly tag: MlsError_Tags.Other;
|
|
1120
|
+
readonly inner: Readonly<{
|
|
1121
|
+
msg: string;
|
|
1122
|
+
}>;
|
|
1123
|
+
/**
|
|
1124
|
+
* @private
|
|
1125
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1126
|
+
*/
|
|
1127
|
+
readonly [uniffiTypeNameSymbol]: "MlsError";
|
|
1128
|
+
name: string;
|
|
1129
|
+
message: string;
|
|
1130
|
+
stack?: string;
|
|
1131
|
+
cause?: unknown;
|
|
1132
|
+
}): Readonly<{
|
|
1133
|
+
msg: string;
|
|
1134
|
+
}>;
|
|
1135
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
1136
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
1137
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
1138
|
+
stackTraceLimit: number;
|
|
1139
|
+
isError(value: unknown): value is Error;
|
|
1140
|
+
};
|
|
1141
|
+
}>;
|
|
1142
|
+
/**
|
|
1143
|
+
* Errors produced by the MLS layer.
|
|
1144
|
+
*/
|
|
1145
|
+
export type MlsError = InstanceType<(typeof MlsError)["ConversationAlreadyExists" | "DuplicateMessage" | "BufferedFutureMessage" | "WrongEpoch" | "BufferedCommit" | "MessageEpochTooOld" | "SelfCommitIgnored" | "UnmergedPendingGroup" | "StaleProposal" | "StaleCommit" | "OrphanWelcome" | "MessageRejected" | "Other"]>;
|
|
1146
|
+
export declare enum ProteusError_Tags {
|
|
1147
|
+
SessionNotFound = "SessionNotFound",
|
|
1148
|
+
DuplicateMessage = "DuplicateMessage",
|
|
1149
|
+
RemoteIdentityChanged = "RemoteIdentityChanged",
|
|
1150
|
+
Other = "Other"
|
|
1151
|
+
}
|
|
1152
|
+
/**
|
|
1153
|
+
* Errors produced by the Proteus layer.
|
|
1154
|
+
*/
|
|
1155
|
+
export declare const ProteusError: Readonly<{
|
|
1156
|
+
instanceOf: (obj: any) => obj is ProteusError;
|
|
1157
|
+
SessionNotFound: {
|
|
1158
|
+
new (): {
|
|
1159
|
+
readonly tag: ProteusError_Tags.SessionNotFound;
|
|
1160
|
+
/**
|
|
1161
|
+
* @private
|
|
1162
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1163
|
+
*/
|
|
1164
|
+
readonly [uniffiTypeNameSymbol]: "ProteusError";
|
|
1165
|
+
name: string;
|
|
1166
|
+
message: string;
|
|
1167
|
+
stack?: string;
|
|
1168
|
+
cause?: unknown;
|
|
1169
|
+
};
|
|
1170
|
+
"new"(): {
|
|
1171
|
+
readonly tag: ProteusError_Tags.SessionNotFound;
|
|
1172
|
+
/**
|
|
1173
|
+
* @private
|
|
1174
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1175
|
+
*/
|
|
1176
|
+
readonly [uniffiTypeNameSymbol]: "ProteusError";
|
|
1177
|
+
name: string;
|
|
1178
|
+
message: string;
|
|
1179
|
+
stack?: string;
|
|
1180
|
+
cause?: unknown;
|
|
1181
|
+
};
|
|
1182
|
+
instanceOf(obj: any): obj is {
|
|
1183
|
+
readonly tag: ProteusError_Tags.SessionNotFound;
|
|
1184
|
+
/**
|
|
1185
|
+
* @private
|
|
1186
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1187
|
+
*/
|
|
1188
|
+
readonly [uniffiTypeNameSymbol]: "ProteusError";
|
|
1189
|
+
name: string;
|
|
1190
|
+
message: string;
|
|
1191
|
+
stack?: string;
|
|
1192
|
+
cause?: unknown;
|
|
1193
|
+
};
|
|
1194
|
+
hasInner(obj: any): obj is {
|
|
1195
|
+
readonly tag: ProteusError_Tags.SessionNotFound;
|
|
1196
|
+
/**
|
|
1197
|
+
* @private
|
|
1198
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1199
|
+
*/
|
|
1200
|
+
readonly [uniffiTypeNameSymbol]: "ProteusError";
|
|
1201
|
+
name: string;
|
|
1202
|
+
message: string;
|
|
1203
|
+
stack?: string;
|
|
1204
|
+
cause?: unknown;
|
|
1205
|
+
};
|
|
1206
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
1207
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
1208
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
1209
|
+
stackTraceLimit: number;
|
|
1210
|
+
isError(value: unknown): value is Error;
|
|
1211
|
+
};
|
|
1212
|
+
DuplicateMessage: {
|
|
1213
|
+
new (): {
|
|
1214
|
+
readonly tag: ProteusError_Tags.DuplicateMessage;
|
|
1215
|
+
/**
|
|
1216
|
+
* @private
|
|
1217
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1218
|
+
*/
|
|
1219
|
+
readonly [uniffiTypeNameSymbol]: "ProteusError";
|
|
1220
|
+
name: string;
|
|
1221
|
+
message: string;
|
|
1222
|
+
stack?: string;
|
|
1223
|
+
cause?: unknown;
|
|
1224
|
+
};
|
|
1225
|
+
"new"(): {
|
|
1226
|
+
readonly tag: ProteusError_Tags.DuplicateMessage;
|
|
1227
|
+
/**
|
|
1228
|
+
* @private
|
|
1229
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1230
|
+
*/
|
|
1231
|
+
readonly [uniffiTypeNameSymbol]: "ProteusError";
|
|
1232
|
+
name: string;
|
|
1233
|
+
message: string;
|
|
1234
|
+
stack?: string;
|
|
1235
|
+
cause?: unknown;
|
|
1236
|
+
};
|
|
1237
|
+
instanceOf(obj: any): obj is {
|
|
1238
|
+
readonly tag: ProteusError_Tags.DuplicateMessage;
|
|
1239
|
+
/**
|
|
1240
|
+
* @private
|
|
1241
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1242
|
+
*/
|
|
1243
|
+
readonly [uniffiTypeNameSymbol]: "ProteusError";
|
|
1244
|
+
name: string;
|
|
1245
|
+
message: string;
|
|
1246
|
+
stack?: string;
|
|
1247
|
+
cause?: unknown;
|
|
1248
|
+
};
|
|
1249
|
+
hasInner(obj: any): obj is {
|
|
1250
|
+
readonly tag: ProteusError_Tags.DuplicateMessage;
|
|
1251
|
+
/**
|
|
1252
|
+
* @private
|
|
1253
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1254
|
+
*/
|
|
1255
|
+
readonly [uniffiTypeNameSymbol]: "ProteusError";
|
|
1256
|
+
name: string;
|
|
1257
|
+
message: string;
|
|
1258
|
+
stack?: string;
|
|
1259
|
+
cause?: unknown;
|
|
1260
|
+
};
|
|
1261
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
1262
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
1263
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
1264
|
+
stackTraceLimit: number;
|
|
1265
|
+
isError(value: unknown): value is Error;
|
|
1266
|
+
};
|
|
1267
|
+
RemoteIdentityChanged: {
|
|
1268
|
+
new (): {
|
|
1269
|
+
readonly tag: ProteusError_Tags.RemoteIdentityChanged;
|
|
1270
|
+
/**
|
|
1271
|
+
* @private
|
|
1272
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1273
|
+
*/
|
|
1274
|
+
readonly [uniffiTypeNameSymbol]: "ProteusError";
|
|
1275
|
+
name: string;
|
|
1276
|
+
message: string;
|
|
1277
|
+
stack?: string;
|
|
1278
|
+
cause?: unknown;
|
|
1279
|
+
};
|
|
1280
|
+
"new"(): {
|
|
1281
|
+
readonly tag: ProteusError_Tags.RemoteIdentityChanged;
|
|
1282
|
+
/**
|
|
1283
|
+
* @private
|
|
1284
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1285
|
+
*/
|
|
1286
|
+
readonly [uniffiTypeNameSymbol]: "ProteusError";
|
|
1287
|
+
name: string;
|
|
1288
|
+
message: string;
|
|
1289
|
+
stack?: string;
|
|
1290
|
+
cause?: unknown;
|
|
1291
|
+
};
|
|
1292
|
+
instanceOf(obj: any): obj is {
|
|
1293
|
+
readonly tag: ProteusError_Tags.RemoteIdentityChanged;
|
|
1294
|
+
/**
|
|
1295
|
+
* @private
|
|
1296
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1297
|
+
*/
|
|
1298
|
+
readonly [uniffiTypeNameSymbol]: "ProteusError";
|
|
1299
|
+
name: string;
|
|
1300
|
+
message: string;
|
|
1301
|
+
stack?: string;
|
|
1302
|
+
cause?: unknown;
|
|
1303
|
+
};
|
|
1304
|
+
hasInner(obj: any): obj is {
|
|
1305
|
+
readonly tag: ProteusError_Tags.RemoteIdentityChanged;
|
|
1306
|
+
/**
|
|
1307
|
+
* @private
|
|
1308
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1309
|
+
*/
|
|
1310
|
+
readonly [uniffiTypeNameSymbol]: "ProteusError";
|
|
1311
|
+
name: string;
|
|
1312
|
+
message: string;
|
|
1313
|
+
stack?: string;
|
|
1314
|
+
cause?: unknown;
|
|
1315
|
+
};
|
|
1316
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
1317
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
1318
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
1319
|
+
stackTraceLimit: number;
|
|
1320
|
+
isError(value: unknown): value is Error;
|
|
1321
|
+
};
|
|
1322
|
+
Other: {
|
|
1323
|
+
new (inner: {
|
|
1324
|
+
errorCode: number;
|
|
1325
|
+
}): {
|
|
1326
|
+
readonly tag: ProteusError_Tags.Other;
|
|
1327
|
+
readonly inner: Readonly<{
|
|
1328
|
+
errorCode: number;
|
|
1329
|
+
}>;
|
|
1330
|
+
/**
|
|
1331
|
+
* @private
|
|
1332
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1333
|
+
*/
|
|
1334
|
+
readonly [uniffiTypeNameSymbol]: "ProteusError";
|
|
1335
|
+
name: string;
|
|
1336
|
+
message: string;
|
|
1337
|
+
stack?: string;
|
|
1338
|
+
cause?: unknown;
|
|
1339
|
+
};
|
|
1340
|
+
"new"(inner: {
|
|
1341
|
+
errorCode: number;
|
|
1342
|
+
}): {
|
|
1343
|
+
readonly tag: ProteusError_Tags.Other;
|
|
1344
|
+
readonly inner: Readonly<{
|
|
1345
|
+
errorCode: number;
|
|
1346
|
+
}>;
|
|
1347
|
+
/**
|
|
1348
|
+
* @private
|
|
1349
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1350
|
+
*/
|
|
1351
|
+
readonly [uniffiTypeNameSymbol]: "ProteusError";
|
|
1352
|
+
name: string;
|
|
1353
|
+
message: string;
|
|
1354
|
+
stack?: string;
|
|
1355
|
+
cause?: unknown;
|
|
1356
|
+
};
|
|
1357
|
+
instanceOf(obj: any): obj is {
|
|
1358
|
+
readonly tag: ProteusError_Tags.Other;
|
|
1359
|
+
readonly inner: Readonly<{
|
|
1360
|
+
errorCode: number;
|
|
1361
|
+
}>;
|
|
1362
|
+
/**
|
|
1363
|
+
* @private
|
|
1364
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1365
|
+
*/
|
|
1366
|
+
readonly [uniffiTypeNameSymbol]: "ProteusError";
|
|
1367
|
+
name: string;
|
|
1368
|
+
message: string;
|
|
1369
|
+
stack?: string;
|
|
1370
|
+
cause?: unknown;
|
|
1371
|
+
};
|
|
1372
|
+
hasInner(obj: any): obj is {
|
|
1373
|
+
readonly tag: ProteusError_Tags.Other;
|
|
1374
|
+
readonly inner: Readonly<{
|
|
1375
|
+
errorCode: number;
|
|
1376
|
+
}>;
|
|
1377
|
+
/**
|
|
1378
|
+
* @private
|
|
1379
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1380
|
+
*/
|
|
1381
|
+
readonly [uniffiTypeNameSymbol]: "ProteusError";
|
|
1382
|
+
name: string;
|
|
1383
|
+
message: string;
|
|
1384
|
+
stack?: string;
|
|
1385
|
+
cause?: unknown;
|
|
1386
|
+
};
|
|
1387
|
+
getInner(obj: {
|
|
1388
|
+
readonly tag: ProteusError_Tags.Other;
|
|
1389
|
+
readonly inner: Readonly<{
|
|
1390
|
+
errorCode: number;
|
|
1391
|
+
}>;
|
|
1392
|
+
/**
|
|
1393
|
+
* @private
|
|
1394
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1395
|
+
*/
|
|
1396
|
+
readonly [uniffiTypeNameSymbol]: "ProteusError";
|
|
1397
|
+
name: string;
|
|
1398
|
+
message: string;
|
|
1399
|
+
stack?: string;
|
|
1400
|
+
cause?: unknown;
|
|
1401
|
+
}): Readonly<{
|
|
1402
|
+
errorCode: number;
|
|
1403
|
+
}>;
|
|
1404
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
1405
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
1406
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
1407
|
+
stackTraceLimit: number;
|
|
1408
|
+
isError(value: unknown): value is Error;
|
|
1409
|
+
};
|
|
1410
|
+
}>;
|
|
1411
|
+
/**
|
|
1412
|
+
* Errors produced by the Proteus layer.
|
|
1413
|
+
*/
|
|
1414
|
+
export type ProteusError = InstanceType<(typeof ProteusError)["SessionNotFound" | "DuplicateMessage" | "RemoteIdentityChanged" | "Other"]>;
|
|
1415
|
+
export declare enum CoreCryptoError_Tags {
|
|
1416
|
+
Mls = "Mls",
|
|
1417
|
+
Proteus = "Proteus",
|
|
1418
|
+
E2ei = "E2ei",
|
|
1419
|
+
TransactionFailed = "TransactionFailed",
|
|
1420
|
+
Other = "Other"
|
|
1421
|
+
}
|
|
1422
|
+
/**
|
|
1423
|
+
* The primary error type returned across the CoreCrypto FFI boundary.
|
|
1424
|
+
*/
|
|
1425
|
+
export declare const CoreCryptoError: Readonly<{
|
|
1426
|
+
instanceOf: (obj: any) => obj is CoreCryptoError;
|
|
1427
|
+
Mls: {
|
|
1428
|
+
new (inner: {
|
|
1429
|
+
mlsError: MlsError;
|
|
1430
|
+
}): {
|
|
1431
|
+
readonly tag: CoreCryptoError_Tags.Mls;
|
|
1432
|
+
readonly inner: Readonly<{
|
|
1433
|
+
mlsError: MlsError;
|
|
1434
|
+
}>;
|
|
1435
|
+
/**
|
|
1436
|
+
* @private
|
|
1437
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1438
|
+
*/
|
|
1439
|
+
readonly [uniffiTypeNameSymbol]: "CoreCryptoError";
|
|
1440
|
+
name: string;
|
|
1441
|
+
message: string;
|
|
1442
|
+
stack?: string;
|
|
1443
|
+
cause?: unknown;
|
|
1444
|
+
};
|
|
1445
|
+
"new"(inner: {
|
|
1446
|
+
mlsError: MlsError;
|
|
1447
|
+
}): {
|
|
1448
|
+
readonly tag: CoreCryptoError_Tags.Mls;
|
|
1449
|
+
readonly inner: Readonly<{
|
|
1450
|
+
mlsError: MlsError;
|
|
1451
|
+
}>;
|
|
1452
|
+
/**
|
|
1453
|
+
* @private
|
|
1454
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1455
|
+
*/
|
|
1456
|
+
readonly [uniffiTypeNameSymbol]: "CoreCryptoError";
|
|
1457
|
+
name: string;
|
|
1458
|
+
message: string;
|
|
1459
|
+
stack?: string;
|
|
1460
|
+
cause?: unknown;
|
|
1461
|
+
};
|
|
1462
|
+
instanceOf(obj: any): obj is {
|
|
1463
|
+
readonly tag: CoreCryptoError_Tags.Mls;
|
|
1464
|
+
readonly inner: Readonly<{
|
|
1465
|
+
mlsError: MlsError;
|
|
1466
|
+
}>;
|
|
1467
|
+
/**
|
|
1468
|
+
* @private
|
|
1469
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1470
|
+
*/
|
|
1471
|
+
readonly [uniffiTypeNameSymbol]: "CoreCryptoError";
|
|
1472
|
+
name: string;
|
|
1473
|
+
message: string;
|
|
1474
|
+
stack?: string;
|
|
1475
|
+
cause?: unknown;
|
|
1476
|
+
};
|
|
1477
|
+
hasInner(obj: any): obj is {
|
|
1478
|
+
readonly tag: CoreCryptoError_Tags.Mls;
|
|
1479
|
+
readonly inner: Readonly<{
|
|
1480
|
+
mlsError: MlsError;
|
|
1481
|
+
}>;
|
|
1482
|
+
/**
|
|
1483
|
+
* @private
|
|
1484
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1485
|
+
*/
|
|
1486
|
+
readonly [uniffiTypeNameSymbol]: "CoreCryptoError";
|
|
1487
|
+
name: string;
|
|
1488
|
+
message: string;
|
|
1489
|
+
stack?: string;
|
|
1490
|
+
cause?: unknown;
|
|
1491
|
+
};
|
|
1492
|
+
getInner(obj: {
|
|
1493
|
+
readonly tag: CoreCryptoError_Tags.Mls;
|
|
1494
|
+
readonly inner: Readonly<{
|
|
1495
|
+
mlsError: MlsError;
|
|
1496
|
+
}>;
|
|
1497
|
+
/**
|
|
1498
|
+
* @private
|
|
1499
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1500
|
+
*/
|
|
1501
|
+
readonly [uniffiTypeNameSymbol]: "CoreCryptoError";
|
|
1502
|
+
name: string;
|
|
1503
|
+
message: string;
|
|
1504
|
+
stack?: string;
|
|
1505
|
+
cause?: unknown;
|
|
1506
|
+
}): Readonly<{
|
|
1507
|
+
mlsError: MlsError;
|
|
1508
|
+
}>;
|
|
1509
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
1510
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
1511
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
1512
|
+
stackTraceLimit: number;
|
|
1513
|
+
isError(value: unknown): value is Error;
|
|
1514
|
+
};
|
|
1515
|
+
Proteus: {
|
|
1516
|
+
new (inner: {
|
|
1517
|
+
exception: ProteusError;
|
|
1518
|
+
}): {
|
|
1519
|
+
readonly tag: CoreCryptoError_Tags.Proteus;
|
|
1520
|
+
readonly inner: Readonly<{
|
|
1521
|
+
exception: ProteusError;
|
|
1522
|
+
}>;
|
|
1523
|
+
/**
|
|
1524
|
+
* @private
|
|
1525
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1526
|
+
*/
|
|
1527
|
+
readonly [uniffiTypeNameSymbol]: "CoreCryptoError";
|
|
1528
|
+
name: string;
|
|
1529
|
+
message: string;
|
|
1530
|
+
stack?: string;
|
|
1531
|
+
cause?: unknown;
|
|
1532
|
+
};
|
|
1533
|
+
"new"(inner: {
|
|
1534
|
+
exception: ProteusError;
|
|
1535
|
+
}): {
|
|
1536
|
+
readonly tag: CoreCryptoError_Tags.Proteus;
|
|
1537
|
+
readonly inner: Readonly<{
|
|
1538
|
+
exception: ProteusError;
|
|
1539
|
+
}>;
|
|
1540
|
+
/**
|
|
1541
|
+
* @private
|
|
1542
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1543
|
+
*/
|
|
1544
|
+
readonly [uniffiTypeNameSymbol]: "CoreCryptoError";
|
|
1545
|
+
name: string;
|
|
1546
|
+
message: string;
|
|
1547
|
+
stack?: string;
|
|
1548
|
+
cause?: unknown;
|
|
1549
|
+
};
|
|
1550
|
+
instanceOf(obj: any): obj is {
|
|
1551
|
+
readonly tag: CoreCryptoError_Tags.Proteus;
|
|
1552
|
+
readonly inner: Readonly<{
|
|
1553
|
+
exception: ProteusError;
|
|
1554
|
+
}>;
|
|
1555
|
+
/**
|
|
1556
|
+
* @private
|
|
1557
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1558
|
+
*/
|
|
1559
|
+
readonly [uniffiTypeNameSymbol]: "CoreCryptoError";
|
|
1560
|
+
name: string;
|
|
1561
|
+
message: string;
|
|
1562
|
+
stack?: string;
|
|
1563
|
+
cause?: unknown;
|
|
1564
|
+
};
|
|
1565
|
+
hasInner(obj: any): obj is {
|
|
1566
|
+
readonly tag: CoreCryptoError_Tags.Proteus;
|
|
1567
|
+
readonly inner: Readonly<{
|
|
1568
|
+
exception: ProteusError;
|
|
1569
|
+
}>;
|
|
1570
|
+
/**
|
|
1571
|
+
* @private
|
|
1572
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1573
|
+
*/
|
|
1574
|
+
readonly [uniffiTypeNameSymbol]: "CoreCryptoError";
|
|
1575
|
+
name: string;
|
|
1576
|
+
message: string;
|
|
1577
|
+
stack?: string;
|
|
1578
|
+
cause?: unknown;
|
|
1579
|
+
};
|
|
1580
|
+
getInner(obj: {
|
|
1581
|
+
readonly tag: CoreCryptoError_Tags.Proteus;
|
|
1582
|
+
readonly inner: Readonly<{
|
|
1583
|
+
exception: ProteusError;
|
|
1584
|
+
}>;
|
|
1585
|
+
/**
|
|
1586
|
+
* @private
|
|
1587
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1588
|
+
*/
|
|
1589
|
+
readonly [uniffiTypeNameSymbol]: "CoreCryptoError";
|
|
1590
|
+
name: string;
|
|
1591
|
+
message: string;
|
|
1592
|
+
stack?: string;
|
|
1593
|
+
cause?: unknown;
|
|
1594
|
+
}): Readonly<{
|
|
1595
|
+
exception: ProteusError;
|
|
1596
|
+
}>;
|
|
1597
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
1598
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
1599
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
1600
|
+
stackTraceLimit: number;
|
|
1601
|
+
isError(value: unknown): value is Error;
|
|
1602
|
+
};
|
|
1603
|
+
E2ei: {
|
|
1604
|
+
new (inner: {
|
|
1605
|
+
e2eiError: string;
|
|
1606
|
+
}): {
|
|
1607
|
+
readonly tag: CoreCryptoError_Tags.E2ei;
|
|
1608
|
+
readonly inner: Readonly<{
|
|
1609
|
+
e2eiError: string;
|
|
1610
|
+
}>;
|
|
1611
|
+
/**
|
|
1612
|
+
* @private
|
|
1613
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1614
|
+
*/
|
|
1615
|
+
readonly [uniffiTypeNameSymbol]: "CoreCryptoError";
|
|
1616
|
+
name: string;
|
|
1617
|
+
message: string;
|
|
1618
|
+
stack?: string;
|
|
1619
|
+
cause?: unknown;
|
|
1620
|
+
};
|
|
1621
|
+
"new"(inner: {
|
|
1622
|
+
e2eiError: string;
|
|
1623
|
+
}): {
|
|
1624
|
+
readonly tag: CoreCryptoError_Tags.E2ei;
|
|
1625
|
+
readonly inner: Readonly<{
|
|
1626
|
+
e2eiError: string;
|
|
1627
|
+
}>;
|
|
1628
|
+
/**
|
|
1629
|
+
* @private
|
|
1630
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1631
|
+
*/
|
|
1632
|
+
readonly [uniffiTypeNameSymbol]: "CoreCryptoError";
|
|
1633
|
+
name: string;
|
|
1634
|
+
message: string;
|
|
1635
|
+
stack?: string;
|
|
1636
|
+
cause?: unknown;
|
|
1637
|
+
};
|
|
1638
|
+
instanceOf(obj: any): obj is {
|
|
1639
|
+
readonly tag: CoreCryptoError_Tags.E2ei;
|
|
1640
|
+
readonly inner: Readonly<{
|
|
1641
|
+
e2eiError: string;
|
|
1642
|
+
}>;
|
|
1643
|
+
/**
|
|
1644
|
+
* @private
|
|
1645
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1646
|
+
*/
|
|
1647
|
+
readonly [uniffiTypeNameSymbol]: "CoreCryptoError";
|
|
1648
|
+
name: string;
|
|
1649
|
+
message: string;
|
|
1650
|
+
stack?: string;
|
|
1651
|
+
cause?: unknown;
|
|
1652
|
+
};
|
|
1653
|
+
hasInner(obj: any): obj is {
|
|
1654
|
+
readonly tag: CoreCryptoError_Tags.E2ei;
|
|
1655
|
+
readonly inner: Readonly<{
|
|
1656
|
+
e2eiError: string;
|
|
1657
|
+
}>;
|
|
1658
|
+
/**
|
|
1659
|
+
* @private
|
|
1660
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1661
|
+
*/
|
|
1662
|
+
readonly [uniffiTypeNameSymbol]: "CoreCryptoError";
|
|
1663
|
+
name: string;
|
|
1664
|
+
message: string;
|
|
1665
|
+
stack?: string;
|
|
1666
|
+
cause?: unknown;
|
|
1667
|
+
};
|
|
1668
|
+
getInner(obj: {
|
|
1669
|
+
readonly tag: CoreCryptoError_Tags.E2ei;
|
|
1670
|
+
readonly inner: Readonly<{
|
|
1671
|
+
e2eiError: string;
|
|
1672
|
+
}>;
|
|
1673
|
+
/**
|
|
1674
|
+
* @private
|
|
1675
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1676
|
+
*/
|
|
1677
|
+
readonly [uniffiTypeNameSymbol]: "CoreCryptoError";
|
|
1678
|
+
name: string;
|
|
1679
|
+
message: string;
|
|
1680
|
+
stack?: string;
|
|
1681
|
+
cause?: unknown;
|
|
1682
|
+
}): Readonly<{
|
|
1683
|
+
e2eiError: string;
|
|
1684
|
+
}>;
|
|
1685
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
1686
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
1687
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
1688
|
+
stackTraceLimit: number;
|
|
1689
|
+
isError(value: unknown): value is Error;
|
|
1690
|
+
};
|
|
1691
|
+
TransactionFailed: {
|
|
1692
|
+
new (inner: {
|
|
1693
|
+
error: string;
|
|
1694
|
+
}): {
|
|
1695
|
+
readonly tag: CoreCryptoError_Tags.TransactionFailed;
|
|
1696
|
+
readonly inner: Readonly<{
|
|
1697
|
+
error: string;
|
|
1698
|
+
}>;
|
|
1699
|
+
/**
|
|
1700
|
+
* @private
|
|
1701
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1702
|
+
*/
|
|
1703
|
+
readonly [uniffiTypeNameSymbol]: "CoreCryptoError";
|
|
1704
|
+
name: string;
|
|
1705
|
+
message: string;
|
|
1706
|
+
stack?: string;
|
|
1707
|
+
cause?: unknown;
|
|
1708
|
+
};
|
|
1709
|
+
"new"(inner: {
|
|
1710
|
+
error: string;
|
|
1711
|
+
}): {
|
|
1712
|
+
readonly tag: CoreCryptoError_Tags.TransactionFailed;
|
|
1713
|
+
readonly inner: Readonly<{
|
|
1714
|
+
error: string;
|
|
1715
|
+
}>;
|
|
1716
|
+
/**
|
|
1717
|
+
* @private
|
|
1718
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1719
|
+
*/
|
|
1720
|
+
readonly [uniffiTypeNameSymbol]: "CoreCryptoError";
|
|
1721
|
+
name: string;
|
|
1722
|
+
message: string;
|
|
1723
|
+
stack?: string;
|
|
1724
|
+
cause?: unknown;
|
|
1725
|
+
};
|
|
1726
|
+
instanceOf(obj: any): obj is {
|
|
1727
|
+
readonly tag: CoreCryptoError_Tags.TransactionFailed;
|
|
1728
|
+
readonly inner: Readonly<{
|
|
1729
|
+
error: string;
|
|
1730
|
+
}>;
|
|
1731
|
+
/**
|
|
1732
|
+
* @private
|
|
1733
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1734
|
+
*/
|
|
1735
|
+
readonly [uniffiTypeNameSymbol]: "CoreCryptoError";
|
|
1736
|
+
name: string;
|
|
1737
|
+
message: string;
|
|
1738
|
+
stack?: string;
|
|
1739
|
+
cause?: unknown;
|
|
1740
|
+
};
|
|
1741
|
+
hasInner(obj: any): obj is {
|
|
1742
|
+
readonly tag: CoreCryptoError_Tags.TransactionFailed;
|
|
1743
|
+
readonly inner: Readonly<{
|
|
1744
|
+
error: string;
|
|
1745
|
+
}>;
|
|
1746
|
+
/**
|
|
1747
|
+
* @private
|
|
1748
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1749
|
+
*/
|
|
1750
|
+
readonly [uniffiTypeNameSymbol]: "CoreCryptoError";
|
|
1751
|
+
name: string;
|
|
1752
|
+
message: string;
|
|
1753
|
+
stack?: string;
|
|
1754
|
+
cause?: unknown;
|
|
1755
|
+
};
|
|
1756
|
+
getInner(obj: {
|
|
1757
|
+
readonly tag: CoreCryptoError_Tags.TransactionFailed;
|
|
1758
|
+
readonly inner: Readonly<{
|
|
1759
|
+
error: string;
|
|
1760
|
+
}>;
|
|
1761
|
+
/**
|
|
1762
|
+
* @private
|
|
1763
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1764
|
+
*/
|
|
1765
|
+
readonly [uniffiTypeNameSymbol]: "CoreCryptoError";
|
|
1766
|
+
name: string;
|
|
1767
|
+
message: string;
|
|
1768
|
+
stack?: string;
|
|
1769
|
+
cause?: unknown;
|
|
1770
|
+
}): Readonly<{
|
|
1771
|
+
error: string;
|
|
1772
|
+
}>;
|
|
1773
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
1774
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
1775
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
1776
|
+
stackTraceLimit: number;
|
|
1777
|
+
isError(value: unknown): value is Error;
|
|
1778
|
+
};
|
|
1779
|
+
Other: {
|
|
1780
|
+
new (inner: {
|
|
1781
|
+
msg: string;
|
|
1782
|
+
}): {
|
|
1783
|
+
readonly tag: CoreCryptoError_Tags.Other;
|
|
1784
|
+
readonly inner: Readonly<{
|
|
1785
|
+
msg: string;
|
|
1786
|
+
}>;
|
|
1787
|
+
/**
|
|
1788
|
+
* @private
|
|
1789
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1790
|
+
*/
|
|
1791
|
+
readonly [uniffiTypeNameSymbol]: "CoreCryptoError";
|
|
1792
|
+
name: string;
|
|
1793
|
+
message: string;
|
|
1794
|
+
stack?: string;
|
|
1795
|
+
cause?: unknown;
|
|
1796
|
+
};
|
|
1797
|
+
"new"(inner: {
|
|
1798
|
+
msg: string;
|
|
1799
|
+
}): {
|
|
1800
|
+
readonly tag: CoreCryptoError_Tags.Other;
|
|
1801
|
+
readonly inner: Readonly<{
|
|
1802
|
+
msg: string;
|
|
1803
|
+
}>;
|
|
1804
|
+
/**
|
|
1805
|
+
* @private
|
|
1806
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1807
|
+
*/
|
|
1808
|
+
readonly [uniffiTypeNameSymbol]: "CoreCryptoError";
|
|
1809
|
+
name: string;
|
|
1810
|
+
message: string;
|
|
1811
|
+
stack?: string;
|
|
1812
|
+
cause?: unknown;
|
|
1813
|
+
};
|
|
1814
|
+
instanceOf(obj: any): obj is {
|
|
1815
|
+
readonly tag: CoreCryptoError_Tags.Other;
|
|
1816
|
+
readonly inner: Readonly<{
|
|
1817
|
+
msg: string;
|
|
1818
|
+
}>;
|
|
1819
|
+
/**
|
|
1820
|
+
* @private
|
|
1821
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1822
|
+
*/
|
|
1823
|
+
readonly [uniffiTypeNameSymbol]: "CoreCryptoError";
|
|
1824
|
+
name: string;
|
|
1825
|
+
message: string;
|
|
1826
|
+
stack?: string;
|
|
1827
|
+
cause?: unknown;
|
|
1828
|
+
};
|
|
1829
|
+
hasInner(obj: any): obj is {
|
|
1830
|
+
readonly tag: CoreCryptoError_Tags.Other;
|
|
1831
|
+
readonly inner: Readonly<{
|
|
1832
|
+
msg: string;
|
|
1833
|
+
}>;
|
|
1834
|
+
/**
|
|
1835
|
+
* @private
|
|
1836
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1837
|
+
*/
|
|
1838
|
+
readonly [uniffiTypeNameSymbol]: "CoreCryptoError";
|
|
1839
|
+
name: string;
|
|
1840
|
+
message: string;
|
|
1841
|
+
stack?: string;
|
|
1842
|
+
cause?: unknown;
|
|
1843
|
+
};
|
|
1844
|
+
getInner(obj: {
|
|
1845
|
+
readonly tag: CoreCryptoError_Tags.Other;
|
|
1846
|
+
readonly inner: Readonly<{
|
|
1847
|
+
msg: string;
|
|
1848
|
+
}>;
|
|
1849
|
+
/**
|
|
1850
|
+
* @private
|
|
1851
|
+
* This field is private and should not be used, use `tag` instead.
|
|
1852
|
+
*/
|
|
1853
|
+
readonly [uniffiTypeNameSymbol]: "CoreCryptoError";
|
|
1854
|
+
name: string;
|
|
1855
|
+
message: string;
|
|
1856
|
+
stack?: string;
|
|
1857
|
+
cause?: unknown;
|
|
1858
|
+
}): Readonly<{
|
|
1859
|
+
msg: string;
|
|
1860
|
+
}>;
|
|
1861
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
1862
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
1863
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
1864
|
+
stackTraceLimit: number;
|
|
1865
|
+
isError(value: unknown): value is Error;
|
|
1866
|
+
};
|
|
1867
|
+
}>;
|
|
1868
|
+
/**
|
|
1869
|
+
* The primary error type returned across the CoreCrypto FFI boundary.
|
|
1870
|
+
*/
|
|
1871
|
+
export type CoreCryptoError = InstanceType<(typeof CoreCryptoError)["Mls" | "Proteus" | "E2ei" | "TransactionFailed" | "Other"]>;
|
|
1872
|
+
type WelcomeLike = Welcome;
|
|
1873
|
+
/**
|
|
1874
|
+
* A TLS-serialized Welcome message.
|
|
1875
|
+
*
|
|
1876
|
+
* This structure is defined in RFC 9420:
|
|
1877
|
+
* <https://www.rfc-editor.org/rfc/rfc9420.html#joining-via-welcome-message>.
|
|
1878
|
+
*/
|
|
1879
|
+
export declare class Welcome extends UniffiAbstractObject {
|
|
1880
|
+
readonly [uniffiTypeNameSymbol] = "Welcome";
|
|
1881
|
+
readonly [destructorGuardSymbol]: UniffiGcObject;
|
|
1882
|
+
readonly [pointerLiteralSymbol]: UniffiHandle;
|
|
1883
|
+
/**
|
|
1884
|
+
* Fallibly instantiate an instance from a byte array.
|
|
1885
|
+
*/
|
|
1886
|
+
constructor(bytes: Uint8Array);
|
|
1887
|
+
/**
|
|
1888
|
+
* TLS-serialize this message
|
|
1889
|
+
*/
|
|
1890
|
+
serialize(): Uint8Array;
|
|
1891
|
+
uniffiDestroy(): void;
|
|
1892
|
+
static instanceOf(obj_: any): obj_ is Welcome;
|
|
1893
|
+
}
|
|
1894
|
+
/**
|
|
1895
|
+
* How a `GroupInfo` is encrypted in a commit bundle.
|
|
1896
|
+
*/
|
|
1897
|
+
declare enum MlsGroupInfoEncryptionType {
|
|
1898
|
+
/**
|
|
1899
|
+
* Unencrypted `GroupInfo`
|
|
1900
|
+
*/
|
|
1901
|
+
Plaintext = 1,
|
|
1902
|
+
/**
|
|
1903
|
+
* `GroupInfo` encrypted in a JWE
|
|
1904
|
+
*/
|
|
1905
|
+
JweEncrypted = 2
|
|
1906
|
+
}
|
|
1907
|
+
/**
|
|
1908
|
+
* How the ratchet tree is represented in a `GroupInfo`.
|
|
1909
|
+
*/
|
|
1910
|
+
declare enum MlsRatchetTreeType {
|
|
1911
|
+
/**
|
|
1912
|
+
* The full ratchet tree is included.
|
|
1913
|
+
*/
|
|
1914
|
+
Full = 1,
|
|
1915
|
+
/**
|
|
1916
|
+
* Only changes since the previous epoch are included.
|
|
1917
|
+
*
|
|
1918
|
+
* Not yet implemented. See the draft proposal:
|
|
1919
|
+
* <https://github.com/rohan-wire/ietf-drafts/blob/main/mahy-mls-ratchet-tree-delta/draft-mahy-mls-ratchet-tree-delta.md>
|
|
1920
|
+
*/
|
|
1921
|
+
Delta = 2,
|
|
1922
|
+
/**
|
|
1923
|
+
* The ratchet tree is identified by an external reference rather than included inline.
|
|
1924
|
+
*/
|
|
1925
|
+
ByRef = 3
|
|
1926
|
+
}
|
|
1927
|
+
/**
|
|
1928
|
+
* A `GroupInfo` with associated metadata.
|
|
1929
|
+
*/
|
|
1930
|
+
export type GroupInfoBundle = {
|
|
1931
|
+
/**
|
|
1932
|
+
* How the group info is encrypted.
|
|
1933
|
+
*/
|
|
1934
|
+
encryptionType: MlsGroupInfoEncryptionType;
|
|
1935
|
+
/**
|
|
1936
|
+
* What kind of ratchet tree is used.
|
|
1937
|
+
*/
|
|
1938
|
+
ratchetTreeType: MlsRatchetTreeType;
|
|
1939
|
+
/**
|
|
1940
|
+
* The group info payload.
|
|
1941
|
+
*/
|
|
1942
|
+
payload: Uint8Array;
|
|
1943
|
+
};
|
|
1944
|
+
/**
|
|
1945
|
+
* Generated factory for {@link GroupInfoBundle} record objects.
|
|
1946
|
+
*/
|
|
1947
|
+
export declare const GroupInfoBundle: Readonly<{
|
|
1948
|
+
create: (partial: Partial<GroupInfoBundle> & Required<Omit<GroupInfoBundle, never>>) => GroupInfoBundle;
|
|
1949
|
+
new: (partial: Partial<GroupInfoBundle> & Required<Omit<GroupInfoBundle, never>>) => GroupInfoBundle;
|
|
1950
|
+
defaults: () => Partial<GroupInfoBundle>;
|
|
1951
|
+
}>;
|
|
1952
|
+
/**
|
|
1953
|
+
* Information returned when a commit is created.
|
|
1954
|
+
*/
|
|
1955
|
+
export type CommitBundle = {
|
|
1956
|
+
/**
|
|
1957
|
+
* A welcome message, present when there are pending Add proposals.
|
|
1958
|
+
*/
|
|
1959
|
+
welcome?: WelcomeLike;
|
|
1960
|
+
/**
|
|
1961
|
+
* The MLS commit message.
|
|
1962
|
+
*/
|
|
1963
|
+
commit: Uint8Array;
|
|
1964
|
+
/**
|
|
1965
|
+
* The `GroupInfo` associated with this commit.
|
|
1966
|
+
*/
|
|
1967
|
+
groupInfo: GroupInfoBundle;
|
|
1968
|
+
/**
|
|
1969
|
+
* An encrypted message to fan out to all other conversation members in the new epoch.
|
|
1970
|
+
*/
|
|
1971
|
+
encryptedMessage?: Uint8Array;
|
|
1972
|
+
};
|
|
1973
|
+
/**
|
|
1974
|
+
* Generated factory for {@link CommitBundle} record objects.
|
|
1975
|
+
*/
|
|
1976
|
+
export declare const CommitBundle: Readonly<{
|
|
1977
|
+
create: (partial: Partial<CommitBundle> & Required<Omit<CommitBundle, "welcome" | "encryptedMessage">>) => CommitBundle;
|
|
1978
|
+
new: (partial: Partial<CommitBundle> & Required<Omit<CommitBundle, "welcome" | "encryptedMessage">>) => CommitBundle;
|
|
1979
|
+
defaults: () => Partial<CommitBundle>;
|
|
1980
|
+
}>;
|
|
1981
|
+
/**
|
|
1982
|
+
* A decrypted message and various associated metadata.
|
|
1983
|
+
*/
|
|
1984
|
+
export type DecryptedMessage = {
|
|
1985
|
+
/**
|
|
1986
|
+
* Decrypted plaintext
|
|
1987
|
+
*/
|
|
1988
|
+
message?: Uint8Array;
|
|
1989
|
+
/**
|
|
1990
|
+
* False if processing this message caused the client to be removed from the group, i.e. due to a Remove commit.
|
|
1991
|
+
*/
|
|
1992
|
+
isActive: boolean;
|
|
1993
|
+
/**
|
|
1994
|
+
* Commit delay in seconds.
|
|
1995
|
+
*
|
|
1996
|
+
* When set, clients must delay this long before processing a commit.
|
|
1997
|
+
* This reduces load on the backend, which otherwise would receive epoch change notifications from all clients
|
|
1998
|
+
* simultaneously.
|
|
1999
|
+
*/
|
|
2000
|
+
commitDelay?: bigint;
|
|
2001
|
+
/**
|
|
2002
|
+
* `ClientId` of the sender of the message being decrypted. Only present for application messages.
|
|
2003
|
+
*/
|
|
2004
|
+
senderClientId?: ClientIdLike;
|
|
2005
|
+
/**
|
|
2006
|
+
* Identity claims present in the sender credential.
|
|
2007
|
+
*/
|
|
2008
|
+
identity: WireIdentity;
|
|
2009
|
+
/**
|
|
2010
|
+
* Only set when the decrypted message is a commit.
|
|
2011
|
+
*
|
|
2012
|
+
* Contains buffered messages for next epoch which were received before the commit creating the epoch
|
|
2013
|
+
* because the DS did not fan them out in order.
|
|
2014
|
+
*/
|
|
2015
|
+
bufferedMessages?: Array<BufferedDecryptedMessage>;
|
|
2016
|
+
};
|
|
2017
|
+
/**
|
|
2018
|
+
* Generated factory for {@link DecryptedMessage} record objects.
|
|
2019
|
+
*/
|
|
2020
|
+
export declare const DecryptedMessage: Readonly<{
|
|
2021
|
+
create: (partial: Partial<DecryptedMessage> & Required<Omit<DecryptedMessage, "message" | "commitDelay" | "senderClientId" | "bufferedMessages">>) => DecryptedMessage;
|
|
2022
|
+
new: (partial: Partial<DecryptedMessage> & Required<Omit<DecryptedMessage, "message" | "commitDelay" | "senderClientId" | "bufferedMessages">>) => DecryptedMessage;
|
|
2023
|
+
defaults: () => Partial<DecryptedMessage>;
|
|
2024
|
+
}>;
|
|
2025
|
+
/**
|
|
2026
|
+
* A `HistorySecret` encodes sufficient client state that it can be used to instantiate an
|
|
2027
|
+
* ephemeral client.
|
|
2028
|
+
*/
|
|
2029
|
+
export type HistorySecret = {
|
|
2030
|
+
/**
|
|
2031
|
+
* Client id of the associated history client.
|
|
2032
|
+
*/
|
|
2033
|
+
clientId: ClientIdLike;
|
|
2034
|
+
/**
|
|
2035
|
+
* Opaque secret data sufficient to reconstruct a history client.
|
|
2036
|
+
*/
|
|
2037
|
+
data: Uint8Array;
|
|
2038
|
+
};
|
|
2039
|
+
/**
|
|
2040
|
+
* Generated factory for {@link HistorySecret} record objects.
|
|
2041
|
+
*/
|
|
2042
|
+
export declare const HistorySecret: Readonly<{
|
|
2043
|
+
create: (partial: Partial<HistorySecret> & Required<Omit<HistorySecret, never>>) => HistorySecret;
|
|
2044
|
+
new: (partial: Partial<HistorySecret> & Required<Omit<HistorySecret, never>>) => HistorySecret;
|
|
2045
|
+
defaults: () => Partial<HistorySecret>;
|
|
2046
|
+
}>;
|
|
2047
|
+
/**
|
|
2048
|
+
* An HttpHeader used for PKI hooks.
|
|
2049
|
+
*/
|
|
2050
|
+
export type HttpHeader = {
|
|
2051
|
+
/**
|
|
2052
|
+
* Header name
|
|
2053
|
+
*/
|
|
2054
|
+
name: string;
|
|
2055
|
+
/**
|
|
2056
|
+
* Header value
|
|
2057
|
+
*/
|
|
2058
|
+
value: string;
|
|
2059
|
+
};
|
|
2060
|
+
/**
|
|
2061
|
+
* Generated factory for {@link HttpHeader} record objects.
|
|
2062
|
+
*/
|
|
2063
|
+
export declare const HttpHeader: Readonly<{
|
|
2064
|
+
create: (partial: Partial<HttpHeader> & Required<Omit<HttpHeader, never>>) => HttpHeader;
|
|
2065
|
+
new: (partial: Partial<HttpHeader> & Required<Omit<HttpHeader, never>>) => HttpHeader;
|
|
2066
|
+
defaults: () => Partial<HttpHeader>;
|
|
2067
|
+
}>;
|
|
2068
|
+
/**
|
|
2069
|
+
* An HttpResponse used for PKI hooks.
|
|
2070
|
+
*/
|
|
2071
|
+
export type HttpResponse = {
|
|
2072
|
+
/**
|
|
2073
|
+
* HTTP status code
|
|
2074
|
+
*/
|
|
2075
|
+
status: number;
|
|
2076
|
+
/**
|
|
2077
|
+
* List of header fields
|
|
2078
|
+
*/
|
|
2079
|
+
headers: Array<HttpHeader>;
|
|
2080
|
+
/**
|
|
2081
|
+
* HTTP body
|
|
2082
|
+
*/
|
|
2083
|
+
body: Uint8Array;
|
|
2084
|
+
};
|
|
2085
|
+
/**
|
|
2086
|
+
* Generated factory for {@link HttpResponse} record objects.
|
|
2087
|
+
*/
|
|
2088
|
+
export declare const HttpResponse: Readonly<{
|
|
2089
|
+
create: (partial: Partial<HttpResponse> & Required<Omit<HttpResponse, never>>) => HttpResponse;
|
|
2090
|
+
new: (partial: Partial<HttpResponse> & Required<Omit<HttpResponse, never>>) => HttpResponse;
|
|
2091
|
+
defaults: () => Partial<HttpResponse>;
|
|
2092
|
+
}>;
|
|
2093
|
+
/**
|
|
2094
|
+
* Encapsulates a prekey id and a CBOR-serialized prekey.
|
|
2095
|
+
*/
|
|
2096
|
+
export type ProteusAutoPrekeyBundle = {
|
|
2097
|
+
/**
|
|
2098
|
+
* Prekey id (automatically incremented)
|
|
2099
|
+
*/
|
|
2100
|
+
id: number;
|
|
2101
|
+
/**
|
|
2102
|
+
* CBOR serialization of prekey
|
|
2103
|
+
*/
|
|
2104
|
+
pkb: Uint8Array;
|
|
2105
|
+
};
|
|
2106
|
+
/**
|
|
2107
|
+
* Generated factory for {@link ProteusAutoPrekeyBundle} record objects.
|
|
2108
|
+
*/
|
|
2109
|
+
export declare const ProteusAutoPrekeyBundle: Readonly<{
|
|
2110
|
+
create: (partial: Partial<ProteusAutoPrekeyBundle> & Required<Omit<ProteusAutoPrekeyBundle, never>>) => ProteusAutoPrekeyBundle;
|
|
2111
|
+
new: (partial: Partial<ProteusAutoPrekeyBundle> & Required<Omit<ProteusAutoPrekeyBundle, never>>) => ProteusAutoPrekeyBundle;
|
|
2112
|
+
defaults: () => Partial<ProteusAutoPrekeyBundle>;
|
|
2113
|
+
}>;
|
|
2114
|
+
/**
|
|
2115
|
+
* MLS cipher suites
|
|
2116
|
+
*/
|
|
2117
|
+
export declare enum CipherSuite {
|
|
2118
|
+
/**
|
|
2119
|
+
* DH KEM x25519 | AES-GCM 128 | SHA2-256 | Ed25519
|
|
2120
|
+
*/
|
|
2121
|
+
Mls128Dhkemx25519Aes128gcmSha256Ed25519 = 1,
|
|
2122
|
+
/**
|
|
2123
|
+
* DH KEM P256 | AES-GCM 128 | SHA2-256 | EcDSA P256
|
|
2124
|
+
*/
|
|
2125
|
+
Mls128Dhkemp256Aes128gcmSha256P256 = 2,
|
|
2126
|
+
/**
|
|
2127
|
+
* DH KEM x25519 | Chacha20Poly1305 | SHA2-256 | Ed25519
|
|
2128
|
+
*/
|
|
2129
|
+
Mls128Dhkemx25519Chacha20poly1305Sha256Ed25519 = 3,
|
|
2130
|
+
/**
|
|
2131
|
+
* DH KEM x448 | AES-GCM 256 | SHA2-512 | Ed448
|
|
2132
|
+
*/
|
|
2133
|
+
Mls256Dhkemx448Aes256gcmSha512Ed448 = 4,
|
|
2134
|
+
/**
|
|
2135
|
+
* DH KEM P521 | AES-GCM 256 | SHA2-512 | EcDSA P521
|
|
2136
|
+
*/
|
|
2137
|
+
Mls256Dhkemp521Aes256gcmSha512P521 = 5,
|
|
2138
|
+
/**
|
|
2139
|
+
* DH KEM x448 | Chacha20Poly1305 | SHA2-512 | Ed448
|
|
2140
|
+
*/
|
|
2141
|
+
Mls256Dhkemx448Chacha20poly1305Sha512Ed448 = 6,
|
|
2142
|
+
/**
|
|
2143
|
+
* DH KEM P384 | AES-GCM 256 | SHA2-384 | EcDSA P384
|
|
2144
|
+
*/
|
|
2145
|
+
Mls256Dhkemp384Aes256gcmSha384P384 = 7
|
|
2146
|
+
}
|
|
2147
|
+
/**
|
|
2148
|
+
* Configuration for an X509 credential acquisition flow.
|
|
2149
|
+
*/
|
|
2150
|
+
export type X509CredentialAcquisitionConfiguration = {
|
|
2151
|
+
/**
|
|
2152
|
+
* ACME directory URL.
|
|
2153
|
+
*/
|
|
2154
|
+
acmeDirectoryUrl: string;
|
|
2155
|
+
/**
|
|
2156
|
+
* Ciphersuite of the acquired credential.
|
|
2157
|
+
*/
|
|
2158
|
+
cipherSuite: CipherSuite;
|
|
2159
|
+
/**
|
|
2160
|
+
* User-visible display name.
|
|
2161
|
+
*/
|
|
2162
|
+
displayName: string;
|
|
2163
|
+
/**
|
|
2164
|
+
* Wire client id for the device acquiring the credential.
|
|
2165
|
+
*/
|
|
2166
|
+
clientId: ClientIdLike;
|
|
2167
|
+
/**
|
|
2168
|
+
* Wire handle without the domain suffix.
|
|
2169
|
+
*/
|
|
2170
|
+
handle: string;
|
|
2171
|
+
/**
|
|
2172
|
+
* Wire domain.
|
|
2173
|
+
*/
|
|
2174
|
+
domain: string;
|
|
2175
|
+
/**
|
|
2176
|
+
* Optional Wire team id.
|
|
2177
|
+
*/
|
|
2178
|
+
team?: string;
|
|
2179
|
+
/**
|
|
2180
|
+
* Certificate validity period in seconds.
|
|
2181
|
+
*/
|
|
2182
|
+
validityPeriodSecs: bigint;
|
|
2183
|
+
};
|
|
2184
|
+
/**
|
|
2185
|
+
* Generated factory for {@link X509CredentialAcquisitionConfiguration} record objects.
|
|
2186
|
+
*/
|
|
2187
|
+
export declare const X509CredentialAcquisitionConfiguration: Readonly<{
|
|
2188
|
+
create: (partial: Partial<X509CredentialAcquisitionConfiguration> & Required<Omit<X509CredentialAcquisitionConfiguration, "team">>) => X509CredentialAcquisitionConfiguration;
|
|
2189
|
+
new: (partial: Partial<X509CredentialAcquisitionConfiguration> & Required<Omit<X509CredentialAcquisitionConfiguration, "team">>) => X509CredentialAcquisitionConfiguration;
|
|
2190
|
+
defaults: () => Partial<X509CredentialAcquisitionConfiguration>;
|
|
2191
|
+
}>;
|
|
2192
|
+
/**
|
|
2193
|
+
* Defines the log level for CoreCrypto.
|
|
2194
|
+
*/
|
|
2195
|
+
export declare enum CoreCryptoLogLevel {
|
|
2196
|
+
Off = 1,
|
|
2197
|
+
Trace = 2,
|
|
2198
|
+
Debug = 3,
|
|
2199
|
+
Info = 4,
|
|
2200
|
+
Warn = 5,
|
|
2201
|
+
Error = 6
|
|
2202
|
+
}
|
|
2203
|
+
/**
|
|
2204
|
+
* The end-to-end identity verification state of a conversation.
|
|
2205
|
+
*
|
|
2206
|
+
* Note: this does not check pending state (pending commit, pending proposals), so it does not
|
|
2207
|
+
* consider members about to be added or removed.
|
|
2208
|
+
*/
|
|
2209
|
+
export declare enum E2eiConversationState {
|
|
2210
|
+
/**
|
|
2211
|
+
* All clients have a valid E2EI certificate.
|
|
2212
|
+
*/
|
|
2213
|
+
Verified = 1,
|
|
2214
|
+
/**
|
|
2215
|
+
* Some clients are either still using Basic credentials or their certificate has expired.
|
|
2216
|
+
*/
|
|
2217
|
+
NotVerified = 2,
|
|
2218
|
+
/**
|
|
2219
|
+
* All clients are still using Basic credentials.
|
|
2220
|
+
*
|
|
2221
|
+
* Note: if all clients have expired certificates, `NotVerified` is returned instead.
|
|
2222
|
+
*/
|
|
2223
|
+
NotEnabled = 3
|
|
2224
|
+
}
|
|
2225
|
+
export declare enum EpochChangedReportingError_Tags {
|
|
2226
|
+
Ffi = "Ffi"
|
|
2227
|
+
}
|
|
2228
|
+
/**
|
|
2229
|
+
* An error returned by an `EpochObserver` callback implementation.
|
|
2230
|
+
*/
|
|
2231
|
+
export declare const EpochChangedReportingError: {
|
|
2232
|
+
Ffi: {
|
|
2233
|
+
new (message: string): {
|
|
2234
|
+
readonly tag: EpochChangedReportingError_Tags.Ffi;
|
|
2235
|
+
/**
|
|
2236
|
+
* @private
|
|
2237
|
+
* This field is private and should not be used.
|
|
2238
|
+
*/
|
|
2239
|
+
readonly [uniffiTypeNameSymbol]: string;
|
|
2240
|
+
/**
|
|
2241
|
+
* @private
|
|
2242
|
+
* This field is private and should not be used.
|
|
2243
|
+
*/
|
|
2244
|
+
readonly [variantOrdinalSymbol]: 1;
|
|
2245
|
+
name: string;
|
|
2246
|
+
message: string;
|
|
2247
|
+
stack?: string;
|
|
2248
|
+
cause?: unknown;
|
|
2249
|
+
};
|
|
2250
|
+
instanceOf(e: any): e is {
|
|
2251
|
+
readonly tag: EpochChangedReportingError_Tags.Ffi;
|
|
2252
|
+
/**
|
|
2253
|
+
* @private
|
|
2254
|
+
* This field is private and should not be used.
|
|
2255
|
+
*/
|
|
2256
|
+
readonly [uniffiTypeNameSymbol]: string;
|
|
2257
|
+
/**
|
|
2258
|
+
* @private
|
|
2259
|
+
* This field is private and should not be used.
|
|
2260
|
+
*/
|
|
2261
|
+
readonly [variantOrdinalSymbol]: 1;
|
|
2262
|
+
name: string;
|
|
2263
|
+
message: string;
|
|
2264
|
+
stack?: string;
|
|
2265
|
+
cause?: unknown;
|
|
2266
|
+
};
|
|
2267
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
2268
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
2269
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
2270
|
+
stackTraceLimit: number;
|
|
2271
|
+
isError(value: unknown): value is Error;
|
|
2272
|
+
};
|
|
2273
|
+
instanceOf: (e: any) => e is EpochChangedReportingError;
|
|
2274
|
+
};
|
|
2275
|
+
/**
|
|
2276
|
+
* An error returned by an `EpochObserver` callback implementation.
|
|
2277
|
+
*/
|
|
2278
|
+
export type EpochChangedReportingError = InstanceType<(typeof EpochChangedReportingError)["Ffi"]>;
|
|
2279
|
+
/**
|
|
2280
|
+
* HttpMethod used for PKI hooks.
|
|
2281
|
+
*/
|
|
2282
|
+
export declare enum HttpMethod {
|
|
2283
|
+
/**
|
|
2284
|
+
* GET
|
|
2285
|
+
*/
|
|
2286
|
+
Get = 0,
|
|
2287
|
+
/**
|
|
2288
|
+
* POST
|
|
2289
|
+
*/
|
|
2290
|
+
Post = 1,
|
|
2291
|
+
/**
|
|
2292
|
+
* PUT
|
|
2293
|
+
*/
|
|
2294
|
+
Put = 2,
|
|
2295
|
+
/**
|
|
2296
|
+
* DELETE
|
|
2297
|
+
*/
|
|
2298
|
+
Delete = 3,
|
|
2299
|
+
/**
|
|
2300
|
+
* PATCH
|
|
2301
|
+
*/
|
|
2302
|
+
Patch = 4,
|
|
2303
|
+
/**
|
|
2304
|
+
* HEAD
|
|
2305
|
+
*/
|
|
2306
|
+
Head = 5
|
|
2307
|
+
}
|
|
2308
|
+
export declare enum LoggingError_Tags {
|
|
2309
|
+
Ffi = "Ffi"
|
|
2310
|
+
}
|
|
2311
|
+
/**
|
|
2312
|
+
* An error returned by a `CoreCryptoLogger` callback implementation.
|
|
2313
|
+
*/
|
|
2314
|
+
export declare const LoggingError: {
|
|
2315
|
+
Ffi: {
|
|
2316
|
+
new (message: string): {
|
|
2317
|
+
readonly tag: LoggingError_Tags.Ffi;
|
|
2318
|
+
/**
|
|
2319
|
+
* @private
|
|
2320
|
+
* This field is private and should not be used.
|
|
2321
|
+
*/
|
|
2322
|
+
readonly [uniffiTypeNameSymbol]: string;
|
|
2323
|
+
/**
|
|
2324
|
+
* @private
|
|
2325
|
+
* This field is private and should not be used.
|
|
2326
|
+
*/
|
|
2327
|
+
readonly [variantOrdinalSymbol]: 1;
|
|
2328
|
+
name: string;
|
|
2329
|
+
message: string;
|
|
2330
|
+
stack?: string;
|
|
2331
|
+
cause?: unknown;
|
|
2332
|
+
};
|
|
2333
|
+
instanceOf(e: any): e is {
|
|
2334
|
+
readonly tag: LoggingError_Tags.Ffi;
|
|
2335
|
+
/**
|
|
2336
|
+
* @private
|
|
2337
|
+
* This field is private and should not be used.
|
|
2338
|
+
*/
|
|
2339
|
+
readonly [uniffiTypeNameSymbol]: string;
|
|
2340
|
+
/**
|
|
2341
|
+
* @private
|
|
2342
|
+
* This field is private and should not be used.
|
|
2343
|
+
*/
|
|
2344
|
+
readonly [variantOrdinalSymbol]: 1;
|
|
2345
|
+
name: string;
|
|
2346
|
+
message: string;
|
|
2347
|
+
stack?: string;
|
|
2348
|
+
cause?: unknown;
|
|
2349
|
+
};
|
|
2350
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
2351
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
2352
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
2353
|
+
stackTraceLimit: number;
|
|
2354
|
+
isError(value: unknown): value is Error;
|
|
2355
|
+
};
|
|
2356
|
+
instanceOf: (e: any) => e is LoggingError;
|
|
2357
|
+
};
|
|
2358
|
+
/**
|
|
2359
|
+
* An error returned by a `CoreCryptoLogger` callback implementation.
|
|
2360
|
+
*/
|
|
2361
|
+
export type LoggingError = InstanceType<(typeof LoggingError)["Ffi"]>;
|
|
2362
|
+
declare enum MlsTransportError_Tags {
|
|
2363
|
+
MessageRejected = "MessageRejected"
|
|
2364
|
+
}
|
|
2365
|
+
/**
|
|
2366
|
+
* Errors returned by MLS transport callbacks exposed through FFI.
|
|
2367
|
+
*/
|
|
2368
|
+
export declare const MlsTransportError: Readonly<{
|
|
2369
|
+
instanceOf: (obj: any) => obj is MlsTransportError;
|
|
2370
|
+
MessageRejected: {
|
|
2371
|
+
new (inner: {
|
|
2372
|
+
reason: string;
|
|
2373
|
+
}): {
|
|
2374
|
+
readonly tag: MlsTransportError_Tags.MessageRejected;
|
|
2375
|
+
readonly inner: Readonly<{
|
|
2376
|
+
reason: string;
|
|
2377
|
+
}>;
|
|
2378
|
+
/**
|
|
2379
|
+
* @private
|
|
2380
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2381
|
+
*/
|
|
2382
|
+
readonly [uniffiTypeNameSymbol]: "MlsTransportError";
|
|
2383
|
+
name: string;
|
|
2384
|
+
message: string;
|
|
2385
|
+
stack?: string;
|
|
2386
|
+
cause?: unknown;
|
|
2387
|
+
};
|
|
2388
|
+
"new"(inner: {
|
|
2389
|
+
reason: string;
|
|
2390
|
+
}): {
|
|
2391
|
+
readonly tag: MlsTransportError_Tags.MessageRejected;
|
|
2392
|
+
readonly inner: Readonly<{
|
|
2393
|
+
reason: string;
|
|
2394
|
+
}>;
|
|
2395
|
+
/**
|
|
2396
|
+
* @private
|
|
2397
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2398
|
+
*/
|
|
2399
|
+
readonly [uniffiTypeNameSymbol]: "MlsTransportError";
|
|
2400
|
+
name: string;
|
|
2401
|
+
message: string;
|
|
2402
|
+
stack?: string;
|
|
2403
|
+
cause?: unknown;
|
|
2404
|
+
};
|
|
2405
|
+
instanceOf(obj: any): obj is {
|
|
2406
|
+
readonly tag: MlsTransportError_Tags.MessageRejected;
|
|
2407
|
+
readonly inner: Readonly<{
|
|
2408
|
+
reason: string;
|
|
2409
|
+
}>;
|
|
2410
|
+
/**
|
|
2411
|
+
* @private
|
|
2412
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2413
|
+
*/
|
|
2414
|
+
readonly [uniffiTypeNameSymbol]: "MlsTransportError";
|
|
2415
|
+
name: string;
|
|
2416
|
+
message: string;
|
|
2417
|
+
stack?: string;
|
|
2418
|
+
cause?: unknown;
|
|
2419
|
+
};
|
|
2420
|
+
hasInner(obj: any): obj is {
|
|
2421
|
+
readonly tag: MlsTransportError_Tags.MessageRejected;
|
|
2422
|
+
readonly inner: Readonly<{
|
|
2423
|
+
reason: string;
|
|
2424
|
+
}>;
|
|
2425
|
+
/**
|
|
2426
|
+
* @private
|
|
2427
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2428
|
+
*/
|
|
2429
|
+
readonly [uniffiTypeNameSymbol]: "MlsTransportError";
|
|
2430
|
+
name: string;
|
|
2431
|
+
message: string;
|
|
2432
|
+
stack?: string;
|
|
2433
|
+
cause?: unknown;
|
|
2434
|
+
};
|
|
2435
|
+
getInner(obj: {
|
|
2436
|
+
readonly tag: MlsTransportError_Tags.MessageRejected;
|
|
2437
|
+
readonly inner: Readonly<{
|
|
2438
|
+
reason: string;
|
|
2439
|
+
}>;
|
|
2440
|
+
/**
|
|
2441
|
+
* @private
|
|
2442
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2443
|
+
*/
|
|
2444
|
+
readonly [uniffiTypeNameSymbol]: "MlsTransportError";
|
|
2445
|
+
name: string;
|
|
2446
|
+
message: string;
|
|
2447
|
+
stack?: string;
|
|
2448
|
+
cause?: unknown;
|
|
2449
|
+
}): Readonly<{
|
|
2450
|
+
reason: string;
|
|
2451
|
+
}>;
|
|
2452
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
2453
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
2454
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
2455
|
+
stackTraceLimit: number;
|
|
2456
|
+
isError(value: unknown): value is Error;
|
|
2457
|
+
};
|
|
2458
|
+
}>;
|
|
2459
|
+
/**
|
|
2460
|
+
* Errors returned by MLS transport callbacks exposed through FFI.
|
|
2461
|
+
*/
|
|
2462
|
+
export type MlsTransportError = InstanceType<(typeof MlsTransportError)["MessageRejected"]>;
|
|
2463
|
+
declare enum NewHistoryClientReportingError_Tags {
|
|
2464
|
+
Ffi = "Ffi"
|
|
2465
|
+
}
|
|
2466
|
+
/**
|
|
2467
|
+
* An error returned by a `HistoryObserver` callback implementation.
|
|
2468
|
+
*/
|
|
2469
|
+
export declare const NewHistoryClientReportingError: {
|
|
2470
|
+
Ffi: {
|
|
2471
|
+
new (message: string): {
|
|
2472
|
+
readonly tag: NewHistoryClientReportingError_Tags.Ffi;
|
|
2473
|
+
/**
|
|
2474
|
+
* @private
|
|
2475
|
+
* This field is private and should not be used.
|
|
2476
|
+
*/
|
|
2477
|
+
readonly [uniffiTypeNameSymbol]: string;
|
|
2478
|
+
/**
|
|
2479
|
+
* @private
|
|
2480
|
+
* This field is private and should not be used.
|
|
2481
|
+
*/
|
|
2482
|
+
readonly [variantOrdinalSymbol]: 1;
|
|
2483
|
+
name: string;
|
|
2484
|
+
message: string;
|
|
2485
|
+
stack?: string;
|
|
2486
|
+
cause?: unknown;
|
|
2487
|
+
};
|
|
2488
|
+
instanceOf(e: any): e is {
|
|
2489
|
+
readonly tag: NewHistoryClientReportingError_Tags.Ffi;
|
|
2490
|
+
/**
|
|
2491
|
+
* @private
|
|
2492
|
+
* This field is private and should not be used.
|
|
2493
|
+
*/
|
|
2494
|
+
readonly [uniffiTypeNameSymbol]: string;
|
|
2495
|
+
/**
|
|
2496
|
+
* @private
|
|
2497
|
+
* This field is private and should not be used.
|
|
2498
|
+
*/
|
|
2499
|
+
readonly [variantOrdinalSymbol]: 1;
|
|
2500
|
+
name: string;
|
|
2501
|
+
message: string;
|
|
2502
|
+
stack?: string;
|
|
2503
|
+
cause?: unknown;
|
|
2504
|
+
};
|
|
2505
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
2506
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
2507
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
2508
|
+
stackTraceLimit: number;
|
|
2509
|
+
isError(value: unknown): value is Error;
|
|
2510
|
+
};
|
|
2511
|
+
instanceOf: (e: any) => e is NewHistoryClientReportingError;
|
|
2512
|
+
};
|
|
2513
|
+
/**
|
|
2514
|
+
* An error returned by a `HistoryObserver` callback implementation.
|
|
2515
|
+
*/
|
|
2516
|
+
export type NewHistoryClientReportingError = InstanceType<(typeof NewHistoryClientReportingError)["Ffi"]>;
|
|
2517
|
+
declare enum PkiEnvironmentHooksError_Tags {
|
|
2518
|
+
Error = "Error"
|
|
2519
|
+
}
|
|
2520
|
+
/**
|
|
2521
|
+
* An error returned by a `PkiEnvironmentHooks` callback implementation.
|
|
2522
|
+
*/
|
|
2523
|
+
export declare const PkiEnvironmentHooksError: Readonly<{
|
|
2524
|
+
instanceOf: (obj: any) => obj is PkiEnvironmentHooksError;
|
|
2525
|
+
Error: {
|
|
2526
|
+
new (inner: {
|
|
2527
|
+
reason: string;
|
|
2528
|
+
}): {
|
|
2529
|
+
readonly tag: PkiEnvironmentHooksError_Tags.Error;
|
|
2530
|
+
readonly inner: Readonly<{
|
|
2531
|
+
reason: string;
|
|
2532
|
+
}>;
|
|
2533
|
+
/**
|
|
2534
|
+
* @private
|
|
2535
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2536
|
+
*/
|
|
2537
|
+
readonly [uniffiTypeNameSymbol]: "PkiEnvironmentHooksError";
|
|
2538
|
+
name: string;
|
|
2539
|
+
message: string;
|
|
2540
|
+
stack?: string;
|
|
2541
|
+
cause?: unknown;
|
|
2542
|
+
};
|
|
2543
|
+
"new"(inner: {
|
|
2544
|
+
reason: string;
|
|
2545
|
+
}): {
|
|
2546
|
+
readonly tag: PkiEnvironmentHooksError_Tags.Error;
|
|
2547
|
+
readonly inner: Readonly<{
|
|
2548
|
+
reason: string;
|
|
2549
|
+
}>;
|
|
2550
|
+
/**
|
|
2551
|
+
* @private
|
|
2552
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2553
|
+
*/
|
|
2554
|
+
readonly [uniffiTypeNameSymbol]: "PkiEnvironmentHooksError";
|
|
2555
|
+
name: string;
|
|
2556
|
+
message: string;
|
|
2557
|
+
stack?: string;
|
|
2558
|
+
cause?: unknown;
|
|
2559
|
+
};
|
|
2560
|
+
instanceOf(obj: any): obj is {
|
|
2561
|
+
readonly tag: PkiEnvironmentHooksError_Tags.Error;
|
|
2562
|
+
readonly inner: Readonly<{
|
|
2563
|
+
reason: string;
|
|
2564
|
+
}>;
|
|
2565
|
+
/**
|
|
2566
|
+
* @private
|
|
2567
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2568
|
+
*/
|
|
2569
|
+
readonly [uniffiTypeNameSymbol]: "PkiEnvironmentHooksError";
|
|
2570
|
+
name: string;
|
|
2571
|
+
message: string;
|
|
2572
|
+
stack?: string;
|
|
2573
|
+
cause?: unknown;
|
|
2574
|
+
};
|
|
2575
|
+
hasInner(obj: any): obj is {
|
|
2576
|
+
readonly tag: PkiEnvironmentHooksError_Tags.Error;
|
|
2577
|
+
readonly inner: Readonly<{
|
|
2578
|
+
reason: string;
|
|
2579
|
+
}>;
|
|
2580
|
+
/**
|
|
2581
|
+
* @private
|
|
2582
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2583
|
+
*/
|
|
2584
|
+
readonly [uniffiTypeNameSymbol]: "PkiEnvironmentHooksError";
|
|
2585
|
+
name: string;
|
|
2586
|
+
message: string;
|
|
2587
|
+
stack?: string;
|
|
2588
|
+
cause?: unknown;
|
|
2589
|
+
};
|
|
2590
|
+
getInner(obj: {
|
|
2591
|
+
readonly tag: PkiEnvironmentHooksError_Tags.Error;
|
|
2592
|
+
readonly inner: Readonly<{
|
|
2593
|
+
reason: string;
|
|
2594
|
+
}>;
|
|
2595
|
+
/**
|
|
2596
|
+
* @private
|
|
2597
|
+
* This field is private and should not be used, use `tag` instead.
|
|
2598
|
+
*/
|
|
2599
|
+
readonly [uniffiTypeNameSymbol]: "PkiEnvironmentHooksError";
|
|
2600
|
+
name: string;
|
|
2601
|
+
message: string;
|
|
2602
|
+
stack?: string;
|
|
2603
|
+
cause?: unknown;
|
|
2604
|
+
}): Readonly<{
|
|
2605
|
+
reason: string;
|
|
2606
|
+
}>;
|
|
2607
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
2608
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
2609
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
2610
|
+
stackTraceLimit: number;
|
|
2611
|
+
isError(value: unknown): value is Error;
|
|
2612
|
+
};
|
|
2613
|
+
}>;
|
|
2614
|
+
/**
|
|
2615
|
+
* An error returned by a `PkiEnvironmentHooks` callback implementation.
|
|
2616
|
+
*/
|
|
2617
|
+
export type PkiEnvironmentHooksError = InstanceType<(typeof PkiEnvironmentHooksError)["Error"]>;
|
|
2618
|
+
/**
|
|
2619
|
+
* Signature schemes supported by MLS, as defined in RFC 9420.
|
|
2620
|
+
*/
|
|
2621
|
+
export declare enum SignatureScheme {
|
|
2622
|
+
/**
|
|
2623
|
+
* ECDSA with secp256r1 (P-256) and SHA-256
|
|
2624
|
+
*/
|
|
2625
|
+
EcdsaSecp256r1Sha256 = 1027,
|
|
2626
|
+
/**
|
|
2627
|
+
* ECDSA with secp384r1 (P-384) and SHA-384
|
|
2628
|
+
*/
|
|
2629
|
+
EcdsaSecp384r1Sha384 = 1283,
|
|
2630
|
+
/**
|
|
2631
|
+
* ECDSA with secp521r1 (P-521) and SHA-512
|
|
2632
|
+
*/
|
|
2633
|
+
EcdsaSecp521r1Sha512 = 1539,
|
|
2634
|
+
/**
|
|
2635
|
+
* Deterministic EdDSA with Curve25519 (Ed25519)
|
|
2636
|
+
*/
|
|
2637
|
+
Ed25519 = 2055,
|
|
2638
|
+
/**
|
|
2639
|
+
* Deterministic EdDSA with Curve448 (Ed448)
|
|
2640
|
+
*/
|
|
2641
|
+
Ed448 = 2056
|
|
2642
|
+
}
|
|
2643
|
+
/**
|
|
2644
|
+
* Typealias from the type name used in the UDL file to the builtin type. This
|
|
2645
|
+
* is needed because the UDL type name is used in function/method signatures.
|
|
2646
|
+
*/
|
|
2647
|
+
export type MlsTransportData = Uint8Array;
|
|
2648
|
+
type ConversationIdLike = ConversationId;
|
|
2649
|
+
/**
|
|
2650
|
+
* A unique identifier for a single conversation.
|
|
2651
|
+
*
|
|
2652
|
+
* The backend provides an opaque string identifying a new conversation.
|
|
2653
|
+
* Construct an instance of this newtype to pass that identifier to Rust.
|
|
2654
|
+
*/
|
|
2655
|
+
export declare class ConversationId extends UniffiAbstractObject {
|
|
2656
|
+
readonly [uniffiTypeNameSymbol] = "ConversationId";
|
|
2657
|
+
readonly [destructorGuardSymbol]: UniffiGcObject;
|
|
2658
|
+
readonly [pointerLiteralSymbol]: UniffiHandle;
|
|
2659
|
+
/**
|
|
2660
|
+
* Infallibly instantiate an instance from a byte array.
|
|
2661
|
+
*/
|
|
2662
|
+
constructor(bytes: Uint8Array);
|
|
2663
|
+
/**
|
|
2664
|
+
* Copy the wrapped data into a new byte array.
|
|
2665
|
+
*/
|
|
2666
|
+
copyBytes(): Uint8Array;
|
|
2667
|
+
toString(): string;
|
|
2668
|
+
toDebugString(): string;
|
|
2669
|
+
equals(other: ConversationId): boolean;
|
|
2670
|
+
hashCode(): bigint;
|
|
2671
|
+
uniffiDestroy(): void;
|
|
2672
|
+
static instanceOf(obj_: any): obj_ is ConversationId;
|
|
2673
|
+
}
|
|
2674
|
+
type KeyPackageRefLike = KeyPackageRef;
|
|
2675
|
+
/**
|
|
2676
|
+
* A lightweight distinct reference to a `KeyPackage`, sufficient to uniquely identify it.
|
|
2677
|
+
*
|
|
2678
|
+
* This contains some metadata to assist in sorting and filtering refs without needing to perform the
|
|
2679
|
+
* relatively heavy operation of converting to a full keypackage.
|
|
2680
|
+
*/
|
|
2681
|
+
export declare class KeyPackageRef extends UniffiAbstractObject {
|
|
2682
|
+
readonly [uniffiTypeNameSymbol] = "KeyPackageRef";
|
|
2683
|
+
readonly [destructorGuardSymbol]: UniffiGcObject;
|
|
2684
|
+
readonly [pointerLiteralSymbol]: UniffiHandle;
|
|
2685
|
+
private constructor();
|
|
2686
|
+
/**
|
|
2687
|
+
* Get the cipher_suite associated with this key package ref.
|
|
2688
|
+
*/
|
|
2689
|
+
cipherSuite(): CipherSuite;
|
|
2690
|
+
/**
|
|
2691
|
+
* Get the credential type associated with this key package ref.
|
|
2692
|
+
*/
|
|
2693
|
+
credentialType(): CredentialType;
|
|
2694
|
+
/**
|
|
2695
|
+
* Get the bytes of the hash reference to a keypackage.
|
|
2696
|
+
*/
|
|
2697
|
+
hashRef(): Uint8Array;
|
|
2698
|
+
/**
|
|
2699
|
+
* Returns true if this keypackage's lifetime has not expired, or if no lifetime is present.
|
|
2700
|
+
*/
|
|
2701
|
+
isValid(): boolean;
|
|
2702
|
+
/**
|
|
2703
|
+
* Get the signature scheme associated with this key package ref.
|
|
2704
|
+
*/
|
|
2705
|
+
signatureScheme(): SignatureScheme;
|
|
2706
|
+
uniffiDestroy(): void;
|
|
2707
|
+
static instanceOf(obj_: any): obj_ is KeyPackageRef;
|
|
2708
|
+
}
|
|
2709
|
+
type KeyPackageLike = KeyPackage;
|
|
2710
|
+
/**
|
|
2711
|
+
* A signed object describing a client's identity and capabilities.
|
|
2712
|
+
*
|
|
2713
|
+
* Includes a public key that can be used to encrypt to that client.
|
|
2714
|
+
* Other clients can use a client's KeyPackage to introduce that client to a new group.
|
|
2715
|
+
*/
|
|
2716
|
+
export declare class KeyPackage extends UniffiAbstractObject {
|
|
2717
|
+
readonly [uniffiTypeNameSymbol] = "KeyPackage";
|
|
2718
|
+
readonly [destructorGuardSymbol]: UniffiGcObject;
|
|
2719
|
+
readonly [pointerLiteralSymbol]: UniffiHandle;
|
|
2720
|
+
/**
|
|
2721
|
+
* Construct a new `Keypackage` from a byte array.
|
|
2722
|
+
*/
|
|
2723
|
+
constructor(bytes: Uint8Array);
|
|
2724
|
+
/**
|
|
2725
|
+
* Convert this to a reference.
|
|
2726
|
+
*/
|
|
2727
|
+
ref(): KeyPackageRefLike;
|
|
2728
|
+
/**
|
|
2729
|
+
* Serialize this to a byte vector.
|
|
2730
|
+
*/
|
|
2731
|
+
serialize(): Uint8Array;
|
|
2732
|
+
uniffiDestroy(): void;
|
|
2733
|
+
static instanceOf(obj_: any): obj_ is KeyPackage;
|
|
2734
|
+
}
|
|
2735
|
+
type CredentialLike = Credential$1;
|
|
2736
|
+
/**
|
|
2737
|
+
* A cryptographic credential.
|
|
2738
|
+
*
|
|
2739
|
+
* This is tied to a particular client via either its client id or certificate bundle,
|
|
2740
|
+
* depending on its credential type, but is independent of any client instance or storage.
|
|
2741
|
+
*
|
|
2742
|
+
* To attach a credential to a client instance and store it, call `add_credential` on a `CoreCryptoContext`.
|
|
2743
|
+
*/
|
|
2744
|
+
declare class Credential$1 extends UniffiAbstractObject {
|
|
2745
|
+
readonly [uniffiTypeNameSymbol] = "Credential";
|
|
2746
|
+
readonly [destructorGuardSymbol]: UniffiGcObject;
|
|
2747
|
+
readonly [pointerLiteralSymbol]: UniffiHandle;
|
|
2748
|
+
private constructor();
|
|
2749
|
+
/**
|
|
2750
|
+
* Generate a basic credential.
|
|
2751
|
+
*
|
|
2752
|
+
* The result is independent of any client instance and the database; it lives in memory only.
|
|
2753
|
+
*/
|
|
2754
|
+
static basic(cipherSuite: CipherSuite, clientId: ClientIdLike): CredentialLike;
|
|
2755
|
+
/**
|
|
2756
|
+
* Get the earliest possible validity of this credential, expressed as seconds after the unix epoch.
|
|
2757
|
+
*
|
|
2758
|
+
* Basic credentials have no defined earliest validity and will always return 0.
|
|
2759
|
+
*/
|
|
2760
|
+
earliestValidity(): bigint;
|
|
2761
|
+
/**
|
|
2762
|
+
* Export a PEM string containing the public portion of this credential.
|
|
2763
|
+
*
|
|
2764
|
+
* - Basic credentials export their public key.
|
|
2765
|
+
* - x509 credentials export the full certificate chain. This enables external tools such as `openssl` to validate
|
|
2766
|
+
* the certificate chain.
|
|
2767
|
+
*/
|
|
2768
|
+
exportPem(): string;
|
|
2769
|
+
/**
|
|
2770
|
+
* Get the signature scheme of this credential.
|
|
2771
|
+
*/
|
|
2772
|
+
signatureScheme(): SignatureScheme;
|
|
2773
|
+
/**
|
|
2774
|
+
* Get the type of this credential.
|
|
2775
|
+
*/
|
|
2776
|
+
type(): CredentialType;
|
|
2777
|
+
uniffiDestroy(): void;
|
|
2778
|
+
static instanceOf(obj_: any): obj_ is Credential$1;
|
|
2779
|
+
}
|
|
2780
|
+
type CredentialRefLike = CredentialRef;
|
|
2781
|
+
/**
|
|
2782
|
+
* A compact reference to a credential that has been persisted in CoreCrypto.
|
|
2783
|
+
*
|
|
2784
|
+
* Credentials can be quite large; this type avoids passing them back and forth across the FFI
|
|
2785
|
+
* boundary more than strictly required.
|
|
2786
|
+
*
|
|
2787
|
+
* Created by calling `add_credential` on a `CoreCryptoContext`.
|
|
2788
|
+
*
|
|
2789
|
+
* This reference is not a literal in-memory reference.
|
|
2790
|
+
* It is instead the key from which a credential can be retrieved,
|
|
2791
|
+
* and is stable over time and across the FFI boundary.
|
|
2792
|
+
*/
|
|
2793
|
+
export declare class CredentialRef extends UniffiAbstractObject {
|
|
2794
|
+
readonly [uniffiTypeNameSymbol] = "CredentialRef";
|
|
2795
|
+
readonly [destructorGuardSymbol]: UniffiGcObject;
|
|
2796
|
+
readonly [pointerLiteralSymbol]: UniffiHandle;
|
|
2797
|
+
private constructor();
|
|
2798
|
+
/**
|
|
2799
|
+
* Get the cipher suite of this credential ref.
|
|
2800
|
+
*/
|
|
2801
|
+
cipherSuite(): CipherSuite;
|
|
2802
|
+
/**
|
|
2803
|
+
* Get the client id associated with this credential ref.
|
|
2804
|
+
*/
|
|
2805
|
+
clientId(): ClientIdLike;
|
|
2806
|
+
/**
|
|
2807
|
+
* Get the earliest possible validity of this credential, expressed as seconds after the unix epoch.
|
|
2808
|
+
*
|
|
2809
|
+
* Basic credentials have no defined earliest validity and will always return 0.
|
|
2810
|
+
*/
|
|
2811
|
+
earliestValidity(): bigint;
|
|
2812
|
+
/**
|
|
2813
|
+
* Get the SHA256 hash of the public key associated with this credential ref.
|
|
2814
|
+
*/
|
|
2815
|
+
publicKeyHash(): Uint8Array;
|
|
2816
|
+
/**
|
|
2817
|
+
* Get the signature scheme of this credential ref.
|
|
2818
|
+
*/
|
|
2819
|
+
signatureScheme(): SignatureScheme;
|
|
2820
|
+
/**
|
|
2821
|
+
* Get the type of this credential ref.
|
|
2822
|
+
*/
|
|
2823
|
+
type(): CredentialType;
|
|
2824
|
+
toDebugString(): string;
|
|
2825
|
+
toString(): string;
|
|
2826
|
+
uniffiDestroy(): void;
|
|
2827
|
+
static instanceOf(obj_: any): obj_ is CredentialRef;
|
|
2828
|
+
}
|
|
2829
|
+
type ExternalSenderLike = ExternalSender;
|
|
2830
|
+
/**
|
|
2831
|
+
* A RFC 9420 External Sender
|
|
2832
|
+
*
|
|
2833
|
+
* This can be used to initialize a subconversation.
|
|
2834
|
+
*/
|
|
2835
|
+
export declare class ExternalSender extends UniffiAbstractObject {
|
|
2836
|
+
readonly [uniffiTypeNameSymbol] = "ExternalSender";
|
|
2837
|
+
readonly [destructorGuardSymbol]: UniffiGcObject;
|
|
2838
|
+
readonly [pointerLiteralSymbol]: UniffiHandle;
|
|
2839
|
+
private constructor();
|
|
2840
|
+
/**
|
|
2841
|
+
* Parse an external sender.
|
|
2842
|
+
*
|
|
2843
|
+
* This first attempts to parse this as a JWK per `parse_jwk`,
|
|
2844
|
+
* and falls back to `parse_public_key` if the former method fails.
|
|
2845
|
+
*/
|
|
2846
|
+
static parse(key: Uint8Array, signatureScheme: SignatureScheme): ExternalSenderLike;
|
|
2847
|
+
/**
|
|
2848
|
+
* Parse an external sender given a JWK.
|
|
2849
|
+
*
|
|
2850
|
+
* This expects a raw json serialized JWK. It works with any Signature scheme.
|
|
2851
|
+
*/
|
|
2852
|
+
static parseJwk(jwk: Uint8Array): ExternalSenderLike;
|
|
2853
|
+
/**
|
|
2854
|
+
* Parse an external sender given a raw public key.
|
|
2855
|
+
*
|
|
2856
|
+
* This supports the legacy behaviour where the server was providing the external sender public key
|
|
2857
|
+
* raw.
|
|
2858
|
+
*/
|
|
2859
|
+
static parsePublicKey(key: Uint8Array, signatureScheme: SignatureScheme): ExternalSenderLike;
|
|
2860
|
+
/**
|
|
2861
|
+
* Serialize this external sender into a byte vector.
|
|
2862
|
+
*
|
|
2863
|
+
* This produces the public key and matches `parse_public_key`.
|
|
2864
|
+
*/
|
|
2865
|
+
serialize(): Uint8Array;
|
|
2866
|
+
equals(other: ExternalSender): boolean;
|
|
2867
|
+
uniffiDestroy(): void;
|
|
2868
|
+
static instanceOf(obj_: any): obj_ is ExternalSender;
|
|
2869
|
+
}
|
|
2870
|
+
type SecretKeyLike = SecretKey;
|
|
2871
|
+
/**
|
|
2872
|
+
* A secret key derived from the group secret.
|
|
2873
|
+
*
|
|
2874
|
+
* This is intended to be used for AVS.
|
|
2875
|
+
*/
|
|
2876
|
+
export declare class SecretKey extends UniffiAbstractObject {
|
|
2877
|
+
readonly [uniffiTypeNameSymbol] = "SecretKey";
|
|
2878
|
+
readonly [destructorGuardSymbol]: UniffiGcObject;
|
|
2879
|
+
readonly [pointerLiteralSymbol]: UniffiHandle;
|
|
2880
|
+
/**
|
|
2881
|
+
* Infallibly instantiate an instance from a byte array.
|
|
2882
|
+
*/
|
|
2883
|
+
constructor(bytes: Uint8Array);
|
|
2884
|
+
/**
|
|
2885
|
+
* Copy the wrapped data into a new byte array.
|
|
2886
|
+
*/
|
|
2887
|
+
copyBytes(): Uint8Array;
|
|
2888
|
+
toString(): string;
|
|
2889
|
+
equals(other: SecretKey): boolean;
|
|
2890
|
+
hashCode(): bigint;
|
|
2891
|
+
uniffiDestroy(): void;
|
|
2892
|
+
static instanceOf(obj_: any): obj_ is SecretKey;
|
|
2893
|
+
}
|
|
2894
|
+
type GroupInfoLike = GroupInfo;
|
|
2895
|
+
/**
|
|
2896
|
+
* MLS Group Information
|
|
2897
|
+
*
|
|
2898
|
+
* This is used when joining by external commit.
|
|
2899
|
+
* It can be found within the `GroupInfoBundle` within a `CommitBundle`.
|
|
2900
|
+
*/
|
|
2901
|
+
export declare class GroupInfo extends UniffiAbstractObject {
|
|
2902
|
+
readonly [uniffiTypeNameSymbol] = "GroupInfo";
|
|
2903
|
+
readonly [destructorGuardSymbol]: UniffiGcObject;
|
|
2904
|
+
readonly [pointerLiteralSymbol]: UniffiHandle;
|
|
2905
|
+
/**
|
|
2906
|
+
* Fallibly instantiate an instance from a TLS-serialized byte array.
|
|
2907
|
+
*/
|
|
2908
|
+
constructor(bytes: Uint8Array);
|
|
2909
|
+
uniffiDestroy(): void;
|
|
2910
|
+
static instanceOf(obj_: any): obj_ is GroupInfo;
|
|
2911
|
+
}
|
|
2912
|
+
/**
|
|
2913
|
+
* Used by CoreCrypto to send commits or application messages to the delivery service.
|
|
2914
|
+
*
|
|
2915
|
+
* This trait must be implemented before calling any functions that produce commits.
|
|
2916
|
+
*/
|
|
2917
|
+
export interface MlsTransport {
|
|
2918
|
+
/**
|
|
2919
|
+
* Send a commit bundle to the corresponding endpoint.
|
|
2920
|
+
*/
|
|
2921
|
+
sendCommitBundle(commitBundle: CommitBundle, asyncOpts_?: {
|
|
2922
|
+
signal: AbortSignal;
|
|
2923
|
+
}): Promise<void>;
|
|
2924
|
+
/**
|
|
2925
|
+
* Prepare a history secret before transmission.
|
|
2926
|
+
*/
|
|
2927
|
+
prepareForTransport(historySecret: HistorySecret, asyncOpts_?: {
|
|
2928
|
+
signal: AbortSignal;
|
|
2929
|
+
}): Promise<MlsTransportData>;
|
|
2930
|
+
}
|
|
2931
|
+
type CoreCryptoContextLike = CoreCryptoContext;
|
|
2932
|
+
declare class CoreCryptoContext extends UniffiAbstractObject {
|
|
2933
|
+
readonly [uniffiTypeNameSymbol] = "CoreCryptoContext";
|
|
2934
|
+
readonly [destructorGuardSymbol]: UniffiGcObject;
|
|
2935
|
+
readonly [pointerLiteralSymbol]: UniffiHandle;
|
|
2936
|
+
/**
|
|
2937
|
+
* This is only needed to allow TS inheritance and should be hidden from library consumers.
|
|
2938
|
+
*/
|
|
2939
|
+
constructor(instance: CoreCryptoContextLike);
|
|
2940
|
+
/**
|
|
2941
|
+
* Adds members to the conversation using their key packages, sending the resulting commit via the transport.
|
|
2942
|
+
*/
|
|
2943
|
+
addClientsToConversation(conversationId: ConversationIdLike, keyPackages: Array<KeyPackageLike>, asyncOpts_?: {
|
|
2944
|
+
signal: AbortSignal;
|
|
2945
|
+
}): Promise<void>;
|
|
2946
|
+
/**
|
|
2947
|
+
* Adds a `Credential` to this client.
|
|
2948
|
+
*
|
|
2949
|
+
* Note that while an arbitrary number of credentials can be generated,
|
|
2950
|
+
* those which are added to a CoreCrypto instance must be distinct in credential type,
|
|
2951
|
+
* signature scheme, and the timestamp of creation. This timestamp has only
|
|
2952
|
+
* 1 second of resolution, limiting the number of credentials which
|
|
2953
|
+
* can be added. This is a known limitation and will be relaxed in the future.
|
|
2954
|
+
*/
|
|
2955
|
+
addCredential(credential: CredentialLike, asyncOpts_?: {
|
|
2956
|
+
signal: AbortSignal;
|
|
2957
|
+
}): Promise<CredentialRefLike>;
|
|
2958
|
+
/**
|
|
2959
|
+
* Check all X509 credentials for expiration and revocation
|
|
2960
|
+
*
|
|
2961
|
+
* This function must be called at least once every 24 hours. It is recommended to do this during an idle period,
|
|
2962
|
+
* because in case x509 credentials are used, HTTP requests are done to fetch new certificate revocation lists.
|
|
2963
|
+
*/
|
|
2964
|
+
checkCredentials(asyncOpts_?: {
|
|
2965
|
+
signal: AbortSignal;
|
|
2966
|
+
}): Promise<void>;
|
|
2967
|
+
/**
|
|
2968
|
+
* Commits all pending proposals in the conversation, sending the resulting commit via the transport.
|
|
2969
|
+
*/
|
|
2970
|
+
commitPendingProposals(conversationId: ConversationIdLike, asyncOpts_?: {
|
|
2971
|
+
signal: AbortSignal;
|
|
2972
|
+
}): Promise<void>;
|
|
2973
|
+
/**
|
|
2974
|
+
* Returns the cipher suite in use for the given conversation.
|
|
2975
|
+
*/
|
|
2976
|
+
conversationCipherSuite(conversationId: ConversationIdLike, asyncOpts_?: {
|
|
2977
|
+
signal: AbortSignal;
|
|
2978
|
+
}): Promise<CipherSuite>;
|
|
2979
|
+
/**
|
|
2980
|
+
* Get the credential ref for the given conversation.
|
|
2981
|
+
*/
|
|
2982
|
+
conversationCredential(conversationId: ConversationIdLike, asyncOpts_?: {
|
|
2983
|
+
signal: AbortSignal;
|
|
2984
|
+
}): Promise<CredentialRefLike>;
|
|
2985
|
+
/**
|
|
2986
|
+
* Returns the current MLS epoch of the given conversation.
|
|
2987
|
+
*/
|
|
2988
|
+
conversationEpoch(conversationId: ConversationIdLike, asyncOpts_?: {
|
|
2989
|
+
signal: AbortSignal;
|
|
2990
|
+
}): Promise<bigint>;
|
|
2991
|
+
/**
|
|
2992
|
+
* Returns true if a conversation with the given id exists in the local state.
|
|
2993
|
+
*/
|
|
2994
|
+
conversationExists(conversationId: ConversationIdLike, asyncOpts_?: {
|
|
2995
|
+
signal: AbortSignal;
|
|
2996
|
+
}): Promise<boolean>;
|
|
2997
|
+
/**
|
|
2998
|
+
* Creates a new MLS group with the given conversation ID, using the specified credential.
|
|
2999
|
+
*/
|
|
3000
|
+
createConversation(conversationId: ConversationIdLike, credentialRef: CredentialRefLike, externalSender?: ExternalSenderLike | undefined, asyncOpts_?: {
|
|
3001
|
+
signal: AbortSignal;
|
|
3002
|
+
}): Promise<void>;
|
|
3003
|
+
/**
|
|
3004
|
+
* Decrypts an MLS message received in the given conversation.
|
|
3005
|
+
* **Note**: this will discard any local pending operations.
|
|
3006
|
+
*/
|
|
3007
|
+
decryptMessage(conversationId: ConversationIdLike, payload: Uint8Array, asyncOpts_?: {
|
|
3008
|
+
signal: AbortSignal;
|
|
3009
|
+
}): Promise<DecryptedMessage>;
|
|
3010
|
+
/**
|
|
3011
|
+
* Disables history sharing for the given conversation.
|
|
3012
|
+
*/
|
|
3013
|
+
disableHistorySharing(conversationId: ConversationIdLike, asyncOpts_?: {
|
|
3014
|
+
signal: AbortSignal;
|
|
3015
|
+
}): Promise<void>;
|
|
3016
|
+
/**
|
|
3017
|
+
* Returns the end-to-end identity verification state of the given conversation.
|
|
3018
|
+
*/
|
|
3019
|
+
e2eiConversationState(conversationId: ConversationIdLike, asyncOpts_?: {
|
|
3020
|
+
signal: AbortSignal;
|
|
3021
|
+
}): Promise<E2eiConversationState>;
|
|
3022
|
+
/**
|
|
3023
|
+
* Returns true if end-to-end identity is enabled for the given cipher_suite.
|
|
3024
|
+
*/
|
|
3025
|
+
e2eiIsEnabled(cipherSuite: CipherSuite, asyncOpts_?: {
|
|
3026
|
+
signal: AbortSignal;
|
|
3027
|
+
}): Promise<boolean>;
|
|
3028
|
+
/**
|
|
3029
|
+
* Enables history sharing for the given conversation.
|
|
3030
|
+
*/
|
|
3031
|
+
enableHistorySharing(conversationId: ConversationIdLike, asyncOpts_?: {
|
|
3032
|
+
signal: AbortSignal;
|
|
3033
|
+
}): Promise<void>;
|
|
3034
|
+
/**
|
|
3035
|
+
* Encrypts a plaintext message for all members of the given conversation.
|
|
3036
|
+
*/
|
|
3037
|
+
encryptMessage(conversationId: ConversationIdLike, message: Uint8Array, asyncOpts_?: {
|
|
3038
|
+
signal: AbortSignal;
|
|
3039
|
+
}): Promise<Uint8Array>;
|
|
3040
|
+
/**
|
|
3041
|
+
* Derives and exports a secret of `key_length` bytes for the given conversation.
|
|
3042
|
+
*
|
|
3043
|
+
* The secret is derived from the MLS key schedule's exporter mechanism (RFC 9420 §8.5),
|
|
3044
|
+
* which produces output bound to the current group state and epoch. The exported value
|
|
3045
|
+
* changes whenever the epoch advances.
|
|
3046
|
+
*/
|
|
3047
|
+
exportSecretKey(conversationId: ConversationIdLike, keyLength: number, asyncOpts_?: {
|
|
3048
|
+
signal: AbortSignal;
|
|
3049
|
+
}): Promise<SecretKeyLike>;
|
|
3050
|
+
/**
|
|
3051
|
+
* Generate a `KeyPackage` from the referenced credential.
|
|
3052
|
+
*
|
|
3053
|
+
* Makes no attempt to look up or prune existing keypackages.
|
|
3054
|
+
*
|
|
3055
|
+
* If `lifetime` is set, the keypackages will expire that span into the future.
|
|
3056
|
+
* If it is unset, a default lifetime of approximately 3 months is used.
|
|
3057
|
+
*/
|
|
3058
|
+
generateKeyPackage(credentialRef: CredentialRefLike, lifetime?: number | undefined, asyncOpts_?: {
|
|
3059
|
+
signal: AbortSignal;
|
|
3060
|
+
}): Promise<KeyPackageLike>;
|
|
3061
|
+
/**
|
|
3062
|
+
* Returns the client ids of all members of the given conversation.
|
|
3063
|
+
*/
|
|
3064
|
+
getClientIds(conversationId: ConversationIdLike, asyncOpts_?: {
|
|
3065
|
+
signal: AbortSignal;
|
|
3066
|
+
}): Promise<Array<ClientIdLike>>;
|
|
3067
|
+
/**
|
|
3068
|
+
* Returns data previously stored by `set_data`, or `None` if no data has been stored.
|
|
3069
|
+
*/
|
|
3070
|
+
getData(asyncOpts_?: {
|
|
3071
|
+
signal: AbortSignal;
|
|
3072
|
+
}): Promise<Uint8Array | undefined>;
|
|
3073
|
+
/**
|
|
3074
|
+
* Returns the E2EI identity claims for the specified devices in the given conversation.
|
|
3075
|
+
*/
|
|
3076
|
+
getDeviceIdentities(conversationId: ConversationIdLike, deviceIds: Array<ClientIdLike>, asyncOpts_?: {
|
|
3077
|
+
signal: AbortSignal;
|
|
3078
|
+
}): Promise<Array<WireIdentity>>;
|
|
3079
|
+
/**
|
|
3080
|
+
* Returns the serialized public key of the external sender for the given conversation.
|
|
3081
|
+
*/
|
|
3082
|
+
getExternalSender(conversationId: ConversationIdLike, asyncOpts_?: {
|
|
3083
|
+
signal: AbortSignal;
|
|
3084
|
+
}): Promise<ExternalSenderLike>;
|
|
3085
|
+
/**
|
|
3086
|
+
* Get a reference to each `KeyPackage` in the database.
|
|
3087
|
+
*/
|
|
3088
|
+
getKeyPackages(asyncOpts_?: {
|
|
3089
|
+
signal: AbortSignal;
|
|
3090
|
+
}): Promise<Array<KeyPackageRefLike>>;
|
|
3091
|
+
/**
|
|
3092
|
+
* Returns the E2EI identity claims for the specified users in the given conversation, grouped by user ID.
|
|
3093
|
+
*/
|
|
3094
|
+
getUserIdentities(conversationId: ConversationIdLike, userIds: Array<string>, asyncOpts_?: {
|
|
3095
|
+
signal: AbortSignal;
|
|
3096
|
+
}): Promise<Map<string, Array<WireIdentity>>>;
|
|
3097
|
+
/**
|
|
3098
|
+
* Joins an existing conversation by constructing an external commit from the given group info.
|
|
3099
|
+
*/
|
|
3100
|
+
joinByExternalCommit(groupInfo: GroupInfoLike, credentialRef: CredentialRefLike, asyncOpts_?: {
|
|
3101
|
+
signal: AbortSignal;
|
|
3102
|
+
}): Promise<ConversationIdLike>;
|
|
3103
|
+
/**
|
|
3104
|
+
* Initializes the MLS client with the given client ID and message transport.
|
|
3105
|
+
*
|
|
3106
|
+
* In general this method should be called at most once per core-crypto instance.
|
|
3107
|
+
* Calling it multiple times with the same parameters should silently succeed, but this is not
|
|
3108
|
+
* a supported or tested mode of operation.
|
|
3109
|
+
* Calling it multiple times with varying parameters might succeed, but this is not a supported or tested mode of
|
|
3110
|
+
* operation.
|
|
3111
|
+
*/
|
|
3112
|
+
mlsInit(clientId: ClientIdLike, transport: MlsTransport, asyncOpts_?: {
|
|
3113
|
+
signal: AbortSignal;
|
|
3114
|
+
}): Promise<void>;
|
|
3115
|
+
/**
|
|
3116
|
+
* Joins a conversation by processing an MLS Welcome message, returning the new conversation's ID.
|
|
3117
|
+
*/
|
|
3118
|
+
processWelcomeMessage(welcomeMessage: WelcomeLike, asyncOpts_?: {
|
|
3119
|
+
signal: AbortSignal;
|
|
3120
|
+
}): Promise<ConversationIdLike>;
|
|
3121
|
+
/**
|
|
3122
|
+
* Decrypts a Proteus ciphertext in the given session, returning the plaintext.
|
|
3123
|
+
*/
|
|
3124
|
+
proteusDecrypt(sessionId: string, ciphertext: Uint8Array, asyncOpts_?: {
|
|
3125
|
+
signal: AbortSignal;
|
|
3126
|
+
}): Promise<Uint8Array>;
|
|
3127
|
+
/**
|
|
3128
|
+
* Decrypt a message whether or not the proteus session already exists, and saves the session.
|
|
3129
|
+
*
|
|
3130
|
+
* This is intended to replace simple usages of `proteusDecrypt`.
|
|
3131
|
+
*
|
|
3132
|
+
* However, when decrypting large numbers of messages in a single session, the existing methods
|
|
3133
|
+
* may be more efficient.
|
|
3134
|
+
*/
|
|
3135
|
+
proteusDecryptSafe(sessionId: string, ciphertext: Uint8Array, asyncOpts_?: {
|
|
3136
|
+
signal: AbortSignal;
|
|
3137
|
+
}): Promise<Uint8Array>;
|
|
3138
|
+
/**
|
|
3139
|
+
* Encrypts a plaintext message in the given Proteus session.
|
|
3140
|
+
*/
|
|
3141
|
+
proteusEncrypt(sessionId: string, plaintext: Uint8Array, asyncOpts_?: {
|
|
3142
|
+
signal: AbortSignal;
|
|
3143
|
+
}): Promise<Uint8Array>;
|
|
3144
|
+
/**
|
|
3145
|
+
* Encrypts a plaintext message in multiple Proteus sessions, returning a map from session ID to ciphertext.
|
|
3146
|
+
*/
|
|
3147
|
+
proteusEncryptBatched(sessions: Array<string>, plaintext: Uint8Array, asyncOpts_?: {
|
|
3148
|
+
signal: AbortSignal;
|
|
3149
|
+
}): Promise<Map<string, Uint8Array>>;
|
|
3150
|
+
/**
|
|
3151
|
+
* Returns the hex-encoded public key fingerprint of this device's Proteus identity.
|
|
3152
|
+
*/
|
|
3153
|
+
proteusFingerprint(asyncOpts_?: {
|
|
3154
|
+
signal: AbortSignal;
|
|
3155
|
+
}): Promise<string>;
|
|
3156
|
+
/**
|
|
3157
|
+
* Returns the hex-encoded local public key fingerprint for the Proteus session with the given ID.
|
|
3158
|
+
*/
|
|
3159
|
+
proteusFingerprintLocal(sessionId: string, asyncOpts_?: {
|
|
3160
|
+
signal: AbortSignal;
|
|
3161
|
+
}): Promise<string>;
|
|
3162
|
+
/**
|
|
3163
|
+
* Returns the hex-encoded remote public key fingerprint for the Proteus session with the given ID.
|
|
3164
|
+
*/
|
|
3165
|
+
proteusFingerprintRemote(sessionId: string, asyncOpts_?: {
|
|
3166
|
+
signal: AbortSignal;
|
|
3167
|
+
}): Promise<string>;
|
|
3168
|
+
/**
|
|
3169
|
+
* Initializes the Proteus client.
|
|
3170
|
+
*
|
|
3171
|
+
* In general this method should be called at most once per core-crypto instance.
|
|
3172
|
+
* Calling it multiple times with the same parameters should silently succeed, but this is not
|
|
3173
|
+
* a supported or tested mode of operation.
|
|
3174
|
+
* Calling it multiple times with varying parameters might succeed, but this is not a supported or tested mode of
|
|
3175
|
+
* operation.
|
|
3176
|
+
*/
|
|
3177
|
+
proteusInit(asyncOpts_?: {
|
|
3178
|
+
signal: AbortSignal;
|
|
3179
|
+
}): Promise<void>;
|
|
3180
|
+
/**
|
|
3181
|
+
* Returns the CBOR-serialized last resort prekey bundle, creating it if it does not yet exist.
|
|
3182
|
+
*/
|
|
3183
|
+
proteusLastResortPrekey(asyncOpts_?: {
|
|
3184
|
+
signal: AbortSignal;
|
|
3185
|
+
}): Promise<Uint8Array>;
|
|
3186
|
+
/**
|
|
3187
|
+
* Creates a new Proteus prekey with the given ID and returns its CBOR-serialized bundle.
|
|
3188
|
+
*
|
|
3189
|
+
* Warning: the Proteus client must be initialized with `proteus_init` first or an error will be returned.
|
|
3190
|
+
*/
|
|
3191
|
+
proteusNewPrekey(prekeyId: number, asyncOpts_?: {
|
|
3192
|
+
signal: AbortSignal;
|
|
3193
|
+
}): Promise<Uint8Array>;
|
|
3194
|
+
/**
|
|
3195
|
+
* Creates a new Proteus prekey with an automatically assigned ID and returns its CBOR-serialized bundle.
|
|
3196
|
+
*
|
|
3197
|
+
* Warning: the Proteus client must be initialized with `proteus_init` first or an error will be returned.
|
|
3198
|
+
*/
|
|
3199
|
+
proteusNewPrekeyAuto(asyncOpts_?: {
|
|
3200
|
+
signal: AbortSignal;
|
|
3201
|
+
}): Promise<ProteusAutoPrekeyBundle>;
|
|
3202
|
+
/**
|
|
3203
|
+
* Deletes the Proteus session with the given ID from local storage.
|
|
3204
|
+
*/
|
|
3205
|
+
proteusSessionDelete(sessionId: string, asyncOpts_?: {
|
|
3206
|
+
signal: AbortSignal;
|
|
3207
|
+
}): Promise<void>;
|
|
3208
|
+
/**
|
|
3209
|
+
* Returns true if a Proteus session with the given ID exists in local storage.
|
|
3210
|
+
*/
|
|
3211
|
+
proteusSessionExists(sessionId: string, asyncOpts_?: {
|
|
3212
|
+
signal: AbortSignal;
|
|
3213
|
+
}): Promise<boolean>;
|
|
3214
|
+
/**
|
|
3215
|
+
* Creates a new Proteus session from an incoming encrypted message, returning the decrypted message payload.
|
|
3216
|
+
*/
|
|
3217
|
+
proteusSessionFromMessage(sessionId: string, envelope: Uint8Array, asyncOpts_?: {
|
|
3218
|
+
signal: AbortSignal;
|
|
3219
|
+
}): Promise<Uint8Array>;
|
|
3220
|
+
/**
|
|
3221
|
+
* Creates a new Proteus session from the given prekey bundle bytes, stored under the given session ID.
|
|
3222
|
+
*/
|
|
3223
|
+
proteusSessionFromPrekey(sessionId: string, prekey: Uint8Array, asyncOpts_?: {
|
|
3224
|
+
signal: AbortSignal;
|
|
3225
|
+
}): Promise<void>;
|
|
3226
|
+
/**
|
|
3227
|
+
* Saves the Proteus session with the given ID to the keystore.
|
|
3228
|
+
*
|
|
3229
|
+
* Note: this is not usually needed, as sessions are persisted automatically when
|
|
3230
|
+
* decrypting or encrypting messages and when initializing sessions.
|
|
3231
|
+
*/
|
|
3232
|
+
proteusSessionSave(sessionId: string, asyncOpts_?: {
|
|
3233
|
+
signal: AbortSignal;
|
|
3234
|
+
}): Promise<void>;
|
|
3235
|
+
/**
|
|
3236
|
+
* Generates `len` random bytes from the cryptographically secure RNG.
|
|
3237
|
+
*/
|
|
3238
|
+
randomBytes(len: number, asyncOpts_?: {
|
|
3239
|
+
signal: AbortSignal;
|
|
3240
|
+
}): Promise<Uint8Array>;
|
|
3241
|
+
/**
|
|
3242
|
+
* Removes the specified clients from the conversation, sending the resulting commit via the transport.
|
|
3243
|
+
*/
|
|
3244
|
+
removeClientsFromConversation(conversationId: ConversationIdLike, clients: Array<ClientIdLike>, asyncOpts_?: {
|
|
3245
|
+
signal: AbortSignal;
|
|
3246
|
+
}): Promise<void>;
|
|
3247
|
+
/**
|
|
3248
|
+
* Removes a `Credential` from this client.
|
|
3249
|
+
*/
|
|
3250
|
+
removeCredential(credentialRef: CredentialRefLike, asyncOpts_?: {
|
|
3251
|
+
signal: AbortSignal;
|
|
3252
|
+
}): Promise<void>;
|
|
3253
|
+
/**
|
|
3254
|
+
* Remove a `KeyPackage` from the database.
|
|
3255
|
+
*/
|
|
3256
|
+
removeKeyPackage(kpRef: KeyPackageRefLike, asyncOpts_?: {
|
|
3257
|
+
signal: AbortSignal;
|
|
3258
|
+
}): Promise<void>;
|
|
3259
|
+
/**
|
|
3260
|
+
* Remove all `KeyPackage`s associated with this credential ref.
|
|
3261
|
+
*/
|
|
3262
|
+
removeKeyPackagesFor(credentialRef: CredentialRefLike, asyncOpts_?: {
|
|
3263
|
+
signal: AbortSignal;
|
|
3264
|
+
}): Promise<void>;
|
|
3265
|
+
/**
|
|
3266
|
+
* Set the credential ref for the given conversation.
|
|
3267
|
+
*/
|
|
3268
|
+
setConversationCredential(conversationId: ConversationIdLike, credentialRef: CredentialRefLike, asyncOpts_?: {
|
|
3269
|
+
signal: AbortSignal;
|
|
3270
|
+
}): Promise<void>;
|
|
3271
|
+
/**
|
|
3272
|
+
* Stores arbitrary data to be used as a transaction checkpoint.
|
|
3273
|
+
*
|
|
3274
|
+
* The stored data can be retrieved via `get_data`. Keep the data size reasonable;
|
|
3275
|
+
* this is not a general-purpose key-value store.
|
|
3276
|
+
*/
|
|
3277
|
+
setData(data: Uint8Array, asyncOpts_?: {
|
|
3278
|
+
signal: AbortSignal;
|
|
3279
|
+
}): Promise<void>;
|
|
3280
|
+
/**
|
|
3281
|
+
* Updates this client's key material in the conversation by sending an update commit.
|
|
3282
|
+
*/
|
|
3283
|
+
updateKeyingMaterial(conversationId: ConversationIdLike, asyncOpts_?: {
|
|
3284
|
+
signal: AbortSignal;
|
|
3285
|
+
}): Promise<void>;
|
|
3286
|
+
/**
|
|
3287
|
+
* Destroys the local state of the given conversation; it can no longer be used locally after this call.
|
|
3288
|
+
*/
|
|
3289
|
+
wipeConversation(conversationId: ConversationIdLike, asyncOpts_?: {
|
|
3290
|
+
signal: AbortSignal;
|
|
3291
|
+
}): Promise<void>;
|
|
3292
|
+
uniffiDestroy(): void;
|
|
3293
|
+
static instanceOf(obj_: any): obj_ is CoreCryptoContext;
|
|
3294
|
+
}
|
|
3295
|
+
interface CoreCryptoCommand {
|
|
3296
|
+
/**
|
|
3297
|
+
* Will be called inside a transaction in CoreCrypto
|
|
3298
|
+
*/
|
|
3299
|
+
execute(context: CoreCryptoContextLike, asyncOpts_?: {
|
|
3300
|
+
signal: AbortSignal;
|
|
3301
|
+
}): Promise<void>;
|
|
3302
|
+
}
|
|
3303
|
+
type PkiEnvironmentLike = PkiEnvironment;
|
|
3304
|
+
/**
|
|
3305
|
+
* The PKI environment used for certificate management during X509 credential acquisition.
|
|
3306
|
+
*/
|
|
3307
|
+
export declare class PkiEnvironment extends UniffiAbstractObject {
|
|
3308
|
+
readonly [uniffiTypeNameSymbol] = "PkiEnvironment";
|
|
3309
|
+
readonly [destructorGuardSymbol]: UniffiGcObject;
|
|
3310
|
+
readonly [pointerLiteralSymbol]: UniffiHandle;
|
|
3311
|
+
private constructor();
|
|
3312
|
+
/**
|
|
3313
|
+
* Create a new PKI environment.
|
|
3314
|
+
*/
|
|
3315
|
+
static create(hooks: PkiEnvironmentHooks, database: DatabaseLike, asyncOpts_?: {
|
|
3316
|
+
signal: AbortSignal;
|
|
3317
|
+
}): Promise<PkiEnvironmentLike>;
|
|
3318
|
+
/**
|
|
3319
|
+
* Add a PEM-encoded certificate as an intermediate certificate.
|
|
3320
|
+
*/
|
|
3321
|
+
addIntermediateCert(certPem: string, asyncOpts_?: {
|
|
3322
|
+
signal: AbortSignal;
|
|
3323
|
+
}): Promise<void>;
|
|
3324
|
+
/**
|
|
3325
|
+
* Add a PEM-encoded certificate as a trust anchor.
|
|
3326
|
+
*
|
|
3327
|
+
* NOTE: currently we only support storing a single trust anchor, calling this method multiple
|
|
3328
|
+
* times will overwrite any previously added trust anchor.
|
|
3329
|
+
*/
|
|
3330
|
+
addTrustAnchor(certPem: string, asyncOpts_?: {
|
|
3331
|
+
signal: AbortSignal;
|
|
3332
|
+
}): Promise<void>;
|
|
3333
|
+
uniffiDestroy(): void;
|
|
3334
|
+
static instanceOf(obj_: any): obj_ is PkiEnvironment;
|
|
3335
|
+
}
|
|
3336
|
+
/**
|
|
3337
|
+
* An `EpochObserver` is notified whenever a conversation's epoch changes.
|
|
3338
|
+
*/
|
|
3339
|
+
export interface EpochObserver {
|
|
3340
|
+
/**
|
|
3341
|
+
* This function will be called every time a conversation's epoch changes.
|
|
3342
|
+
*
|
|
3343
|
+
* The `epoch` parameter contains the new epoch number.
|
|
3344
|
+
*
|
|
3345
|
+
* Warning: this function must not block. Foreign implementors can spawn a task,
|
|
3346
|
+
* send on a channel, or take any other non-blocking approach, as long as the
|
|
3347
|
+
* operation completes quickly.
|
|
3348
|
+
*
|
|
3349
|
+
* Though the signature includes an error type, that error is only present because
|
|
3350
|
+
* it is required by `uniffi` in order to handle panics. This function should suppress
|
|
3351
|
+
* and ignore internal errors instead of propagating them, to the maximum extent possible.
|
|
3352
|
+
*/
|
|
3353
|
+
epochChanged(conversationId: ConversationIdLike, epoch: bigint, asyncOpts_?: {
|
|
3354
|
+
signal: AbortSignal;
|
|
3355
|
+
}): Promise<void>;
|
|
3356
|
+
}
|
|
3357
|
+
/**
|
|
3358
|
+
* A `HistoryObserver` is notified whenever a new history client is created.
|
|
3359
|
+
*/
|
|
3360
|
+
export interface HistoryObserver {
|
|
3361
|
+
/**
|
|
3362
|
+
* This function will be called every time a new history client is created.
|
|
3363
|
+
*
|
|
3364
|
+
* The `secret` parameter is the secret associated with the new history client.
|
|
3365
|
+
*
|
|
3366
|
+
* Warning: this function must not block. Foreign implementors can spawn a task,
|
|
3367
|
+
* send on a channel, or take any other non-blocking approach, as long as the
|
|
3368
|
+
* operation completes quickly.
|
|
3369
|
+
*
|
|
3370
|
+
* Though the signature includes an error type, that error is only present because
|
|
3371
|
+
* it is required by `uniffi` in order to handle panics. This function should suppress
|
|
3372
|
+
* and ignore internal errors instead of propagating them, to the maximum extent possible.
|
|
3373
|
+
*/
|
|
3374
|
+
historyClientCreated(conversationId: ConversationIdLike, secret: HistorySecret, asyncOpts_?: {
|
|
3375
|
+
signal: AbortSignal;
|
|
3376
|
+
}): Promise<void>;
|
|
3377
|
+
}
|
|
3378
|
+
type CoreCryptoFfiLike = CoreCryptoFfi;
|
|
3379
|
+
declare class CoreCryptoFfi extends UniffiAbstractObject {
|
|
3380
|
+
readonly [uniffiTypeNameSymbol] = "CoreCryptoFfi";
|
|
3381
|
+
readonly [destructorGuardSymbol]: UniffiGcObject;
|
|
3382
|
+
readonly [pointerLiteralSymbol]: UniffiHandle;
|
|
3383
|
+
/**
|
|
3384
|
+
* This is only needed to allow TS inheritance and should be hidden from library consumers.
|
|
3385
|
+
*/
|
|
3386
|
+
constructor(instance: CoreCryptoFfiLike);
|
|
3387
|
+
/**
|
|
3388
|
+
* Returns the cipher_suite in use for the given conversation.
|
|
3389
|
+
*/
|
|
3390
|
+
conversationCipherSuite(conversationId: ConversationIdLike, asyncOpts_?: {
|
|
3391
|
+
signal: AbortSignal;
|
|
3392
|
+
}): Promise<CipherSuite>;
|
|
3393
|
+
/**
|
|
3394
|
+
* Get the credential ref for the given conversation.
|
|
3395
|
+
*/
|
|
3396
|
+
conversationCredential(conversationId: ConversationIdLike, asyncOpts_?: {
|
|
3397
|
+
signal: AbortSignal;
|
|
3398
|
+
}): Promise<CredentialRefLike>;
|
|
3399
|
+
/**
|
|
3400
|
+
* Returns the current MLS epoch of the given conversation.
|
|
3401
|
+
*/
|
|
3402
|
+
conversationEpoch(conversationId: ConversationIdLike, asyncOpts_?: {
|
|
3403
|
+
signal: AbortSignal;
|
|
3404
|
+
}): Promise<bigint>;
|
|
3405
|
+
/**
|
|
3406
|
+
* Returns true if a conversation with the given id exists in the local state.
|
|
3407
|
+
*/
|
|
3408
|
+
conversationExists(conversationId: ConversationIdLike, asyncOpts_?: {
|
|
3409
|
+
signal: AbortSignal;
|
|
3410
|
+
}): Promise<boolean>;
|
|
3411
|
+
/**
|
|
3412
|
+
* Returns the end-to-end identity verification state of the given conversation.
|
|
3413
|
+
*/
|
|
3414
|
+
e2eiConversationState(conversationId: ConversationIdLike, asyncOpts_?: {
|
|
3415
|
+
signal: AbortSignal;
|
|
3416
|
+
}): Promise<E2eiConversationState>;
|
|
3417
|
+
/**
|
|
3418
|
+
* Returns true if end-to-end identity is enabled for the given cipher_suite.
|
|
3419
|
+
*/
|
|
3420
|
+
e2eiIsEnabled(cipherSuite: CipherSuite, asyncOpts_?: {
|
|
3421
|
+
signal: AbortSignal;
|
|
3422
|
+
}): Promise<boolean>;
|
|
3423
|
+
/**
|
|
3424
|
+
* Returns true if the PKI environment has been set up and its provider is configured.
|
|
3425
|
+
*/
|
|
3426
|
+
e2eiIsPkiEnvSetup(asyncOpts_?: {
|
|
3427
|
+
signal: AbortSignal;
|
|
3428
|
+
}): Promise<boolean>;
|
|
3429
|
+
/**
|
|
3430
|
+
* Derives and exports a secret of `key_length` bytes for the given conversation.
|
|
3431
|
+
*
|
|
3432
|
+
* The secret is derived from the MLS key schedule's exporter mechanism (RFC 9420 §8.5),
|
|
3433
|
+
* which produces output bound to the current group state and epoch. The exported value
|
|
3434
|
+
* changes whenever the epoch advances.
|
|
3435
|
+
*/
|
|
3436
|
+
exportSecretKey(conversationId: ConversationIdLike, keyLength: number, asyncOpts_?: {
|
|
3437
|
+
signal: AbortSignal;
|
|
3438
|
+
}): Promise<SecretKeyLike>;
|
|
3439
|
+
/**
|
|
3440
|
+
* Get all credentials from this client which match the provided parameters.
|
|
3441
|
+
*
|
|
3442
|
+
* Parameters which are unset or `None` match anything. Those with a particular value find only credentials
|
|
3443
|
+
* matching that value.
|
|
3444
|
+
*/
|
|
3445
|
+
findCredentialsFfi(clientId?: ClientIdLike | undefined, publicKey?: Uint8Array | undefined, cipherSuite?: CipherSuite | undefined, credentialType?: CredentialType | undefined, earliestValidity?: bigint | undefined, asyncOpts_?: {
|
|
3446
|
+
signal: AbortSignal;
|
|
3447
|
+
}): Promise<Array<CredentialRefLike>>;
|
|
3448
|
+
/**
|
|
3449
|
+
* Returns the client ids of all members of the given conversation.
|
|
3450
|
+
*/
|
|
3451
|
+
getClientIds(conversationId: ConversationIdLike, asyncOpts_?: {
|
|
3452
|
+
signal: AbortSignal;
|
|
3453
|
+
}): Promise<Array<ClientIdLike>>;
|
|
3454
|
+
/**
|
|
3455
|
+
* Get all credentials from this client.
|
|
3456
|
+
*/
|
|
3457
|
+
getCredentials(asyncOpts_?: {
|
|
3458
|
+
signal: AbortSignal;
|
|
3459
|
+
}): Promise<Array<CredentialRefLike>>;
|
|
3460
|
+
/**
|
|
3461
|
+
* Returns the E2EI identity claims for the specified devices in the given conversation.
|
|
3462
|
+
*/
|
|
3463
|
+
getDeviceIdentities(conversationId: ConversationIdLike, deviceIds: Array<ClientIdLike>, asyncOpts_?: {
|
|
3464
|
+
signal: AbortSignal;
|
|
3465
|
+
}): Promise<Array<WireIdentity>>;
|
|
3466
|
+
/**
|
|
3467
|
+
* Returns the external sender for the given conversation.
|
|
3468
|
+
*/
|
|
3469
|
+
getExternalSender(conversationId: ConversationIdLike, asyncOpts_?: {
|
|
3470
|
+
signal: AbortSignal;
|
|
3471
|
+
}): Promise<ExternalSenderLike>;
|
|
3472
|
+
/**
|
|
3473
|
+
* Get the PKI environment of the CoreCrypto instance.
|
|
3474
|
+
*
|
|
3475
|
+
* Returns null if it is not set.
|
|
3476
|
+
*/
|
|
3477
|
+
getPkiEnvironment(asyncOpts_?: {
|
|
3478
|
+
signal: AbortSignal;
|
|
3479
|
+
}): Promise<PkiEnvironmentLike | undefined>;
|
|
3480
|
+
/**
|
|
3481
|
+
* Returns the E2EI identity claims for the specified users in the given conversation, grouped by user ID.
|
|
3482
|
+
*/
|
|
3483
|
+
getUserIdentities(conversationId: ConversationIdLike, userIds: Array<string>, asyncOpts_?: {
|
|
3484
|
+
signal: AbortSignal;
|
|
3485
|
+
}): Promise<Map<string, Array<WireIdentity>>>;
|
|
3486
|
+
/**
|
|
3487
|
+
* Returns true if history sharing is currently enabled for the given conversation.
|
|
3488
|
+
*/
|
|
3489
|
+
isHistorySharingEnabled(conversationId: ConversationIdLike, asyncOpts_?: {
|
|
3490
|
+
signal: AbortSignal;
|
|
3491
|
+
}): Promise<boolean>;
|
|
3492
|
+
/**
|
|
3493
|
+
* Returns the hex-encoded public key fingerprint of this device's Proteus identity.
|
|
3494
|
+
*/
|
|
3495
|
+
proteusFingerprint(asyncOpts_?: {
|
|
3496
|
+
signal: AbortSignal;
|
|
3497
|
+
}): Promise<string>;
|
|
3498
|
+
/**
|
|
3499
|
+
* Returns the hex-encoded local public key fingerprint for the Proteus session with the given ID.
|
|
3500
|
+
*/
|
|
3501
|
+
proteusFingerprintLocal(sessionId: string, asyncOpts_?: {
|
|
3502
|
+
signal: AbortSignal;
|
|
3503
|
+
}): Promise<string>;
|
|
3504
|
+
/**
|
|
3505
|
+
* Returns the hex-encoded remote public key fingerprint for the Proteus session with the given ID.
|
|
3506
|
+
*/
|
|
3507
|
+
proteusFingerprintRemote(sessionId: string, asyncOpts_?: {
|
|
3508
|
+
signal: AbortSignal;
|
|
3509
|
+
}): Promise<string>;
|
|
3510
|
+
/**
|
|
3511
|
+
* Returns true if a Proteus session with the given ID exists in local storage.
|
|
3512
|
+
*/
|
|
3513
|
+
proteusSessionExists(sessionId: string, asyncOpts_?: {
|
|
3514
|
+
signal: AbortSignal;
|
|
3515
|
+
}): Promise<boolean>;
|
|
3516
|
+
/**
|
|
3517
|
+
* Get the public key associated with this credential
|
|
3518
|
+
*/
|
|
3519
|
+
publicKey(credentialRef: CredentialRefLike, asyncOpts_?: {
|
|
3520
|
+
signal: AbortSignal;
|
|
3521
|
+
}): Promise<Uint8Array>;
|
|
3522
|
+
/**
|
|
3523
|
+
* Add an epoch observer to this client.
|
|
3524
|
+
*
|
|
3525
|
+
* This function should be called 0 or 1 times in a session's lifetime. If called
|
|
3526
|
+
* when an epoch observer already exists, this will return an error.
|
|
3527
|
+
*/
|
|
3528
|
+
registerEpochObserver(epochObserver: EpochObserver, asyncOpts_?: {
|
|
3529
|
+
signal: AbortSignal;
|
|
3530
|
+
}): Promise<void>;
|
|
3531
|
+
/**
|
|
3532
|
+
* Add a history observer to this client.
|
|
3533
|
+
*
|
|
3534
|
+
* This function should be called 0 or 1 times in a session's lifetime. If called
|
|
3535
|
+
* when a history observer already exists, this will return an error.
|
|
3536
|
+
*/
|
|
3537
|
+
registerHistoryObserver(historyObserver: HistoryObserver, asyncOpts_?: {
|
|
3538
|
+
signal: AbortSignal;
|
|
3539
|
+
}): Promise<void>;
|
|
3540
|
+
/**
|
|
3541
|
+
* Set the PKI environment of the CoreCrypto instance.
|
|
3542
|
+
*/
|
|
3543
|
+
setPkiEnvironment(pkiEnvironment: PkiEnvironmentLike | undefined, asyncOpts_?: {
|
|
3544
|
+
signal: AbortSignal;
|
|
3545
|
+
}): Promise<void>;
|
|
3546
|
+
/**
|
|
3547
|
+
* Starts a new transaction in Core Crypto. If the callback succeeds, it will be committed,
|
|
3548
|
+
* otherwise, every operation performed with the context will be discarded.
|
|
3549
|
+
*
|
|
3550
|
+
* When calling this function from within Rust, async functions accepting a context
|
|
3551
|
+
* implement `CoreCryptoCommand`, so operations can be defined inline as follows:
|
|
3552
|
+
*
|
|
3553
|
+
* ```ignore
|
|
3554
|
+
* core_crypto.transaction(Arc::new(async |context| {
|
|
3555
|
+
* // your implementation here
|
|
3556
|
+
* Ok(())
|
|
3557
|
+
* }))?;
|
|
3558
|
+
* ```
|
|
3559
|
+
*/
|
|
3560
|
+
transactionFfi(command: CoreCryptoCommand, asyncOpts_?: {
|
|
3561
|
+
signal: AbortSignal;
|
|
3562
|
+
}): Promise<void>;
|
|
3563
|
+
uniffiDestroy(): void;
|
|
3564
|
+
static instanceOf(obj_: any): obj_ is CoreCryptoFfi;
|
|
3565
|
+
}
|
|
3566
|
+
/**
|
|
3567
|
+
* A callback interface for forwarding CoreCrypto log messages to the platform's logging system.
|
|
3568
|
+
*/
|
|
3569
|
+
export interface CoreCryptoLogger {
|
|
3570
|
+
/**
|
|
3571
|
+
* CoreCrypto will call this method whenever it needs to log a message.
|
|
3572
|
+
*
|
|
3573
|
+
* This function catches panics and other unexpected errors. In those cases, it writes to `stderr`.
|
|
3574
|
+
*/
|
|
3575
|
+
log(level: CoreCryptoLogLevel, message: string, context: string | undefined): void;
|
|
3576
|
+
}
|
|
3577
|
+
type DatabaseKeyLike = DatabaseKey;
|
|
3578
|
+
/**
|
|
3579
|
+
* A unique identifier for an MLS client.
|
|
3580
|
+
*
|
|
3581
|
+
* Each app instance a user is running, such as desktop or mobile, is a separate client
|
|
3582
|
+
* with its own client id. A single user may therefore have multiple clients.
|
|
3583
|
+
* More information: <https://messaginglayersecurity.rocks/mls-architecture/draft-ietf-mls-architecture.html#name-group-members-and-clients>
|
|
3584
|
+
*/
|
|
3585
|
+
export declare class DatabaseKey extends UniffiAbstractObject {
|
|
3586
|
+
readonly [uniffiTypeNameSymbol] = "DatabaseKey";
|
|
3587
|
+
readonly [destructorGuardSymbol]: UniffiGcObject;
|
|
3588
|
+
readonly [pointerLiteralSymbol]: UniffiHandle;
|
|
3589
|
+
/**
|
|
3590
|
+
* Fallibly instantiate an instance from a byte array.
|
|
3591
|
+
*/
|
|
3592
|
+
constructor(bytes: Uint8Array);
|
|
3593
|
+
toDebugString(): string;
|
|
3594
|
+
toString(): string;
|
|
3595
|
+
equals(other: DatabaseKey): boolean;
|
|
3596
|
+
uniffiDestroy(): void;
|
|
3597
|
+
static instanceOf(obj_: any): obj_ is DatabaseKey;
|
|
3598
|
+
}
|
|
3599
|
+
type DatabaseLike = Database;
|
|
3600
|
+
/**
|
|
3601
|
+
* The database acting as a core crypto keystore.
|
|
3602
|
+
*/
|
|
3603
|
+
export declare class Database extends UniffiAbstractObject {
|
|
3604
|
+
readonly [uniffiTypeNameSymbol] = "Database";
|
|
3605
|
+
readonly [destructorGuardSymbol]: UniffiGcObject;
|
|
3606
|
+
readonly [pointerLiteralSymbol]: UniffiHandle;
|
|
3607
|
+
private constructor();
|
|
3608
|
+
/**
|
|
3609
|
+
* Create an in-memory database whose data will be lost when the instance is dropped.
|
|
3610
|
+
*/
|
|
3611
|
+
static inMemory(key: DatabaseKeyLike, asyncOpts_?: {
|
|
3612
|
+
signal: AbortSignal;
|
|
3613
|
+
}): Promise<DatabaseLike>;
|
|
3614
|
+
/**
|
|
3615
|
+
* Open or create a database.
|
|
3616
|
+
*/
|
|
3617
|
+
static open(location: string, key: DatabaseKeyLike, asyncOpts_?: {
|
|
3618
|
+
signal: AbortSignal;
|
|
3619
|
+
}): Promise<DatabaseLike>;
|
|
3620
|
+
/**
|
|
3621
|
+
* Get the location of the database.
|
|
3622
|
+
*
|
|
3623
|
+
* Returns null if the database is in-memory.
|
|
3624
|
+
*/
|
|
3625
|
+
getLocation(asyncOpts_?: {
|
|
3626
|
+
signal: AbortSignal;
|
|
3627
|
+
}): Promise<string | undefined>;
|
|
3628
|
+
/**
|
|
3629
|
+
* Updates the key of the database.
|
|
3630
|
+
*
|
|
3631
|
+
* This reencrypts it with the new key.
|
|
3632
|
+
*/
|
|
3633
|
+
updateKey(key: DatabaseKeyLike, asyncOpts_?: {
|
|
3634
|
+
signal: AbortSignal;
|
|
3635
|
+
}): Promise<void>;
|
|
3636
|
+
uniffiDestroy(): void;
|
|
3637
|
+
static instanceOf(obj_: any): obj_ is Database;
|
|
3638
|
+
}
|
|
3639
|
+
/**
|
|
3640
|
+
* Callbacks for external calls made by CoreCrypto during X509 credential acquisition.
|
|
3641
|
+
*
|
|
3642
|
+
* When communicating with the Identity Provider (IDP) and Wire server,
|
|
3643
|
+
* CoreCrypto delegates to the client app by calling the relevant methods.
|
|
3644
|
+
*
|
|
3645
|
+
* Client App CoreCrypto Acme IDP
|
|
3646
|
+
* | | | |
|
|
3647
|
+
* | X509CredentialAcquisition().finalize() | |
|
|
3648
|
+
* |-------------------------->| | |
|
|
3649
|
+
* | | GET acme/root.pem | |
|
|
3650
|
+
* | |------------------------> | |
|
|
3651
|
+
* | | 200 OK | |
|
|
3652
|
+
* | |<------------------------ | |
|
|
3653
|
+
* | authenticate() | | |
|
|
3654
|
+
* |<--------------------------| | |
|
|
3655
|
+
* | | Authentication flow | |
|
|
3656
|
+
* | ----------------------------------------------------------------------------> |
|
|
3657
|
+
* |<----------------------------------------------------------------------------- |
|
|
3658
|
+
* | return Success [PKiEnvironmentHooks.authenticate()] | |
|
|
3659
|
+
* |<--------------------------| | |
|
|
3660
|
+
* | | (excluded several calls for brevity) |
|
|
3661
|
+
* | return Success(Credential) [X509CredentialAcquisition().finalize()] |
|
|
3662
|
+
* |<--------------------------| | |
|
|
3663
|
+
*/
|
|
3664
|
+
export interface PkiEnvironmentHooks {
|
|
3665
|
+
/**
|
|
3666
|
+
* Make an HTTP request.
|
|
3667
|
+
*
|
|
3668
|
+
* Used for requests to ACME servers, CRL distributors, etc.
|
|
3669
|
+
*/
|
|
3670
|
+
httpRequest(method: HttpMethod, url: string, headers: Array<HttpHeader>, body: Uint8Array, asyncOpts_?: {
|
|
3671
|
+
signal: AbortSignal;
|
|
3672
|
+
}): Promise<HttpResponse>;
|
|
3673
|
+
/**
|
|
3674
|
+
* Authenticate with the user's identity provider (IdP)
|
|
3675
|
+
*
|
|
3676
|
+
* The implementation should perform authentication using the authorization code flow
|
|
3677
|
+
* (<https://openid.net/specs/openid-connect-core-1_0.html#CodeFlowAuth>) with the PKCE
|
|
3678
|
+
* (<https://www.rfc-editor.org/rfc/rfc7636>) extension. As part of the authorization
|
|
3679
|
+
* request, the implementation should specify `key_auth` and `acme_aud` claims, along with
|
|
3680
|
+
* their values, in the `claims` parameter. This is to instruct the IdP to add the `key_auth`
|
|
3681
|
+
* and `acme_aud` claims to the ID token that will be returned as part of the access token.
|
|
3682
|
+
*
|
|
3683
|
+
* Once the authentication is completed successfully, the implementation should request
|
|
3684
|
+
* an access token from the IdP, extract the ID token from it and return it to the caller.
|
|
3685
|
+
*/
|
|
3686
|
+
authenticate(idp: string, keyAuth: string, acmeAud: string, acquisitionSnapshot: Uint8Array, asyncOpts_?: {
|
|
3687
|
+
signal: AbortSignal;
|
|
3688
|
+
}): Promise<string>;
|
|
3689
|
+
/**
|
|
3690
|
+
* Get a nonce from the backend.
|
|
3691
|
+
*/
|
|
3692
|
+
getBackendNonce(asyncOpts_?: {
|
|
3693
|
+
signal: AbortSignal;
|
|
3694
|
+
}): Promise<string>;
|
|
3695
|
+
/**
|
|
3696
|
+
* Fetch an access token to be used for the DPoP challenge (`wire-dpop-01`)
|
|
3697
|
+
*
|
|
3698
|
+
* The implementation should take the provided DPoP token (`dpop`) and make a request to the
|
|
3699
|
+
* backend to obtain an access token, which should be returned to the caller.
|
|
3700
|
+
*/
|
|
3701
|
+
fetchBackendAccessToken(dpop: string, asyncOpts_?: {
|
|
3702
|
+
signal: AbortSignal;
|
|
3703
|
+
}): Promise<string>;
|
|
3704
|
+
}
|
|
3705
|
+
type X509CredentialAcquisitionLike = X509CredentialAcquisition;
|
|
3706
|
+
declare class X509CredentialAcquisition extends UniffiAbstractObject {
|
|
3707
|
+
readonly [uniffiTypeNameSymbol] = "X509CredentialAcquisition";
|
|
3708
|
+
readonly [destructorGuardSymbol]: UniffiGcObject;
|
|
3709
|
+
readonly [pointerLiteralSymbol]: UniffiHandle;
|
|
3710
|
+
/**
|
|
3711
|
+
* Create a new credential acquisition
|
|
3712
|
+
*/
|
|
3713
|
+
constructor(pkiEnvironment: PkiEnvironmentLike, config: X509CredentialAcquisitionConfiguration);
|
|
3714
|
+
/**
|
|
3715
|
+
* Deserialize a credential acquisition flow.
|
|
3716
|
+
*/
|
|
3717
|
+
static fromBytes(pkiEnvironment: PkiEnvironmentLike, bytes: Uint8Array): X509CredentialAcquisitionLike;
|
|
3718
|
+
/**
|
|
3719
|
+
* Create a new credential acquisition from an existing credential. This API is temporary until our system
|
|
3720
|
+
* decouples client identities from a client's public signature key.
|
|
3721
|
+
* See <https://wearezeta.atlassian.net/wiki/x/RABtrQ>.
|
|
3722
|
+
*
|
|
3723
|
+
* Provide `core_crypto_database` if you're using distinct DB instances for `PkiEnvironment` and `CoreCrypto`.
|
|
3724
|
+
* Otherwise, the `PkiEnvironment`'s DB will be used to load the full credential.
|
|
3725
|
+
*/
|
|
3726
|
+
static newFromCredentialRef(pkiEnvironment: PkiEnvironmentLike, config: X509CredentialAcquisitionConfiguration, credentialRef: CredentialRefLike, coreCryptoDatabase: DatabaseLike | undefined, asyncOpts_?: {
|
|
3727
|
+
signal: AbortSignal;
|
|
3728
|
+
}): Promise<X509CredentialAcquisitionLike>;
|
|
3729
|
+
/**
|
|
3730
|
+
* Complete the DPoP and OIDC challenges and return the acquired X509 credential.
|
|
3731
|
+
*/
|
|
3732
|
+
finalize(asyncOpts_?: {
|
|
3733
|
+
signal: AbortSignal;
|
|
3734
|
+
}): Promise<CredentialLike>;
|
|
3735
|
+
uniffiDestroy(): void;
|
|
3736
|
+
static instanceOf(obj_: any): obj_ is X509CredentialAcquisition;
|
|
3737
|
+
}
|
|
3738
|
+
declare class CoreCryptoContext$1 extends CoreCryptoContext {
|
|
3739
|
+
}
|
|
3740
|
+
export interface CredentialFindFilters {
|
|
3741
|
+
clientId?: ClientId;
|
|
3742
|
+
publicKey?: Uint8Array;
|
|
3743
|
+
cipherSuite?: CipherSuite;
|
|
3744
|
+
credentialType?: CredentialType;
|
|
3745
|
+
earliestValidity?: bigint;
|
|
3746
|
+
}
|
|
3747
|
+
/**
|
|
3748
|
+
* Wrapper for the WASM-compiled version of CoreCrypto
|
|
3749
|
+
*/
|
|
3750
|
+
export declare class CoreCrypto extends CoreCryptoFfi {
|
|
3751
|
+
private constructor();
|
|
3752
|
+
/**
|
|
3753
|
+
* Construct a new {@link CoreCrypto} instance.
|
|
3754
|
+
* MLS or proteus can be initialized with {@link CoreCryptoContext.mlsInit} or
|
|
3755
|
+
* {@link CoreCryptoContext.proteusInit}, respectively.
|
|
3756
|
+
*/
|
|
3757
|
+
static new(database: Database): CoreCrypto;
|
|
3758
|
+
/**
|
|
3759
|
+
* Instantiate a history client.
|
|
3760
|
+
*
|
|
3761
|
+
* This client exposes the full interface of {@link CoreCrypto}, but it should only be used to decrypt messages.
|
|
3762
|
+
* Other use is a logic error.
|
|
3763
|
+
*/
|
|
3764
|
+
static historyClient(historySecret: HistorySecret): Promise<CoreCrypto>;
|
|
3765
|
+
/**
|
|
3766
|
+
* Starts a new transaction in Core Crypto. If the callback succeeds, it will be committed,
|
|
3767
|
+
* otherwise, every operation performed with the context will be discarded.
|
|
3768
|
+
*
|
|
3769
|
+
* @param callback - The callback to execute within the transaction
|
|
3770
|
+
*
|
|
3771
|
+
* @returns the result of the callback will be returned from this call
|
|
3772
|
+
*/
|
|
3773
|
+
transaction<R>(callback: (ctx: CoreCryptoContext$1) => Promise<R>): Promise<R>;
|
|
3774
|
+
/**
|
|
3775
|
+
* Get those credentials known to this instance which match the provided filters
|
|
3776
|
+
*
|
|
3777
|
+
* @param findFilters a set of filters defining which credentials are of interest.
|
|
3778
|
+
*/
|
|
3779
|
+
findCredentials(findFilters: CredentialFindFilters): Promise<CredentialRef[]>;
|
|
3780
|
+
}
|
|
3781
|
+
declare class X509CredentialAcquisition$1 extends X509CredentialAcquisition {
|
|
3782
|
+
/**
|
|
3783
|
+
* Create a new credential acquisition from an existing credential.
|
|
3784
|
+
* This API is temporary until our system decouples client identities from a client's public signature key.
|
|
3785
|
+
* See <https://wearezeta.atlassian.net/wiki/x/RABtrQ>.
|
|
3786
|
+
*
|
|
3787
|
+
* Provide `coreCryptoDatabase` if you're using distinct DB instances for `PkiEnvironment` and `CoreCrypto`.
|
|
3788
|
+
* Otherwise, the `PkiEnvironment`'s DB will be used to load the full credential.
|
|
3789
|
+
*/
|
|
3790
|
+
static newFromCredentialRef(pkiEnvironment: PkiEnvironmentLike, config: X509CredentialAcquisitionConfiguration, credentialRef: CredentialRefLike, coreCryptoDatabase?: DatabaseLike): Promise<X509CredentialAcquisition$1>;
|
|
3791
|
+
}
|
|
3792
|
+
|
|
3793
|
+
export {
|
|
3794
|
+
CoreCryptoContext$1 as CoreCryptoContext,
|
|
3795
|
+
Credential$1 as Credential,
|
|
3796
|
+
MlsGroupInfoEncryptionType as GroupInfoEncryptionType,
|
|
3797
|
+
MlsRatchetTreeType as RatchetTreeType,
|
|
3798
|
+
X509CredentialAcquisition$1 as X509CredentialAcquisition,
|
|
3799
|
+
proteusLastResortPrekeyIdFfi as proteusLastResortPrekeyId,
|
|
3800
|
+
};
|
|
3801
|
+
|
|
3802
|
+
export {};
|