@qadeer-xtech/whatsapp-rust-bridge 0.0.0-stage → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2015 -0
- package/package.json +46 -4
- package/pkg/whatsapp_rust_bridge.d.ts +446 -0
package/package.json
CHANGED
|
@@ -1,6 +1,48 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qadeer-xtech/whatsapp-rust-bridge",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "A high-performance utilities for WhatsApp, powered by Rust and WebAssembly.",
|
|
5
|
+
"author": "Qadeer-Xtech",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist/index.js",
|
|
10
|
+
"dist/index.d.ts",
|
|
11
|
+
"pkg/whatsapp_rust_bridge.d.ts"
|
|
12
|
+
],
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"import": "./dist/index.js",
|
|
16
|
+
"types": "./dist/index.d.ts"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"scripts": {
|
|
20
|
+
"bench": "bun run build && bun run benches/binary.ts && bun run benches/signal.ts && bun run benches/curve.ts && bun run benches/crypto.ts",
|
|
21
|
+
"bench:node": "bun run build && node --expose-gc benches/binary.ts && node --expose-gc benches/signal.ts && node --expose-gc benches/curve.ts && node --expose-gc benches/crypto.ts",
|
|
22
|
+
"build:wasm": "node scripts/build-wasm.mjs",
|
|
23
|
+
"build:ts": "bun build ts/index.ts --outfile dist/index.js",
|
|
24
|
+
"prebuild": "rm -rf dist",
|
|
25
|
+
"postbuild": "tsc -p tsconfig.json --outDir dist",
|
|
26
|
+
"build": "bun run prebuild && bun run build:wasm && bun run build:ts && bun run postbuild"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@mitata/counters": "^0.0.8",
|
|
30
|
+
"@types/bun": "^1.3.2",
|
|
31
|
+
"@types/node": "^24.10.1",
|
|
32
|
+
"@whiskeysockets/libsignal-node": "git+https://github.com/whiskeysockets/libsignal-node",
|
|
33
|
+
"audio-decode": "^2.1.3",
|
|
34
|
+
"baileys": "^7.0.0-rc.9",
|
|
35
|
+
"mitata": "^1.0.34",
|
|
36
|
+
"sharp": "^0.34.5",
|
|
37
|
+
"typescript": "^5.9.3"
|
|
38
|
+
},
|
|
39
|
+
"private": false,
|
|
40
|
+
"repository": {
|
|
41
|
+
"type": "git",
|
|
42
|
+
"url": "git+https://github.com/Qadeer-Xtech/whatsapp-rust-bridge.git"
|
|
43
|
+
},
|
|
44
|
+
"homepage": "https://github.com/Qadeer-Xtech/whatsapp-rust-bridge#readme",
|
|
45
|
+
"bugs": {
|
|
46
|
+
"url": "https://github.com/Qadeer-Xtech/whatsapp-rust-bridge/issues"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,446 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
|
|
4
|
+
export interface BinaryNode {
|
|
5
|
+
tag: string;
|
|
6
|
+
attrs: { [key: string]: string };
|
|
7
|
+
content?: BinaryNode[] | string | Uint8Array;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
export interface ILogger {
|
|
13
|
+
level: string;
|
|
14
|
+
trace(obj: object, msg?: string): void;
|
|
15
|
+
debug(obj: object, msg?: string): void;
|
|
16
|
+
info(obj: object, msg?: string): void;
|
|
17
|
+
warn(obj: object, msg?: string): void;
|
|
18
|
+
error(obj: object, msg?: string): void;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
export interface SignalStorage {
|
|
24
|
+
loadSession(address: string): Uint8Array | null | undefined | Promise<Uint8Array | null | undefined>;
|
|
25
|
+
storeSession(address: string, record: SessionRecord): void | Promise<void>;
|
|
26
|
+
getOurIdentity(): KeyPair | Promise<KeyPair>;
|
|
27
|
+
getOurRegistrationId(): number | Promise<number>;
|
|
28
|
+
isTrustedIdentity(name: string, identityKey: Uint8Array, direction: number): boolean | Promise<boolean>;
|
|
29
|
+
loadPreKey(id: number): KeyPair | null | undefined | Promise<KeyPair | null | undefined>;
|
|
30
|
+
removePreKey(id: number): void | Promise<void>;
|
|
31
|
+
loadSignedPreKey(id: number): SignedPreKey | null | undefined | Promise<SignedPreKey | null | undefined>;
|
|
32
|
+
loadSenderKey(keyId: string): Uint8Array | null | undefined | Promise<Uint8Array | null | undefined>;
|
|
33
|
+
storeSenderKey(keyId: string, record: Uint8Array): void | Promise<void>;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* A cryptographic key pair containing public and private keys
|
|
39
|
+
*/
|
|
40
|
+
export interface KeyPair {
|
|
41
|
+
pubKey: Uint8Array;
|
|
42
|
+
privKey: Uint8Array;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Enabled features in this build.
|
|
47
|
+
* Use this to check feature availability at runtime before calling feature-gated functions.
|
|
48
|
+
*/
|
|
49
|
+
export interface EnabledFeatures {
|
|
50
|
+
/**
|
|
51
|
+
* Audio processing support (waveform generation, duration detection)
|
|
52
|
+
*/
|
|
53
|
+
audio: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Image processing support (thumbnails, profile pictures, format conversion)
|
|
56
|
+
*/
|
|
57
|
+
image: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Sticker metadata support (WebP EXIF for WhatsApp stickers)
|
|
60
|
+
*/
|
|
61
|
+
sticker: boolean;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface HkdfInfo {
|
|
65
|
+
salt?: Uint8Array | undefined;
|
|
66
|
+
info?: string | undefined;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export interface PreKey {
|
|
70
|
+
keyId: number;
|
|
71
|
+
keyPair: KeyPair;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export interface PreKeyBundleInput {
|
|
75
|
+
registrationId: number;
|
|
76
|
+
identityKey: Uint8Array;
|
|
77
|
+
preKey?: PreKeyPublicKey | undefined;
|
|
78
|
+
signedPreKey: SignedPreKeyPublicKey;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export interface PreKeyPublicKey {
|
|
82
|
+
keyId: number;
|
|
83
|
+
publicKey: Uint8Array;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export interface SignedPreKey {
|
|
87
|
+
keyId: number;
|
|
88
|
+
keyPair: KeyPair;
|
|
89
|
+
signature: Uint8Array;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export interface SignedPreKeyPublicKey {
|
|
93
|
+
keyId: number;
|
|
94
|
+
publicKey: Uint8Array;
|
|
95
|
+
signature: Uint8Array;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
export class ExpandedAppStateKeys {
|
|
100
|
+
private constructor();
|
|
101
|
+
free(): void;
|
|
102
|
+
[Symbol.dispose](): void;
|
|
103
|
+
readonly indexKey: Uint8Array;
|
|
104
|
+
readonly patchMacKey: Uint8Array;
|
|
105
|
+
readonly snapshotMacKey: Uint8Array;
|
|
106
|
+
readonly valueEncryptionKey: Uint8Array;
|
|
107
|
+
readonly valueMacKey: Uint8Array;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export class GroupCipher {
|
|
111
|
+
free(): void;
|
|
112
|
+
[Symbol.dispose](): void;
|
|
113
|
+
decrypt(ciphertext: Uint8Array): Promise<Uint8Array>;
|
|
114
|
+
encrypt(plaintext: Uint8Array): Promise<Uint8Array>;
|
|
115
|
+
constructor(storage: SignalStorage, group_id: string, sender: ProtocolAddress);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export class GroupSessionBuilder {
|
|
119
|
+
free(): void;
|
|
120
|
+
[Symbol.dispose](): void;
|
|
121
|
+
create(sender_key_name: SenderKeyName): Promise<SenderKeyDistributionMessage>;
|
|
122
|
+
constructor(storage: SignalStorage);
|
|
123
|
+
process(sender_key_name: SenderKeyName, skdm: SenderKeyDistributionMessage): Promise<void>;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export class InternalBinaryNode {
|
|
127
|
+
private constructor();
|
|
128
|
+
free(): void;
|
|
129
|
+
[Symbol.dispose](): void;
|
|
130
|
+
toJSON(): any;
|
|
131
|
+
attrs: { [key: string]: string };
|
|
132
|
+
get content(): BinaryNode[] | string | Uint8Array | undefined;
|
|
133
|
+
set content(value: BinaryNode[] | string | Uint8Array);
|
|
134
|
+
readonly tag: string;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export class LTHashAntiTampering {
|
|
138
|
+
free(): void;
|
|
139
|
+
[Symbol.dispose](): void;
|
|
140
|
+
constructor();
|
|
141
|
+
subtractThenAdd(base: Uint8Array, subtract: Uint8Array[], add: Uint8Array[]): Uint8Array;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export class LTHashState {
|
|
145
|
+
free(): void;
|
|
146
|
+
[Symbol.dispose](): void;
|
|
147
|
+
clone(): LTHashState;
|
|
148
|
+
deleteValueMac(index_mac_base64: string): boolean;
|
|
149
|
+
getValueMac(index_mac_base64: string): Uint8Array | undefined;
|
|
150
|
+
hasValueMac(index_mac_base64: string): boolean;
|
|
151
|
+
constructor();
|
|
152
|
+
setValueMac(index_mac_base64: string, value_mac: Uint8Array): void;
|
|
153
|
+
hash: Uint8Array;
|
|
154
|
+
version: bigint;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* NoiseSession implements the Noise_XX_25519_AESGCM_SHA256 protocol pattern
|
|
159
|
+
* with combined binary encoding/decoding operations for reduced WASM boundary crossings.
|
|
160
|
+
*/
|
|
161
|
+
export class NoiseSession {
|
|
162
|
+
free(): void;
|
|
163
|
+
[Symbol.dispose](): void;
|
|
164
|
+
/**
|
|
165
|
+
* Updates the session hash with the given data (no-op after handshake).
|
|
166
|
+
*/
|
|
167
|
+
authenticate(data: Uint8Array): void;
|
|
168
|
+
clearBuffer(): void;
|
|
169
|
+
decodeFrame(new_data: Uint8Array): Array<any>;
|
|
170
|
+
decrypt(ciphertext: Uint8Array): Uint8Array;
|
|
171
|
+
encodeFrame(node: EncodingNode): Uint8Array;
|
|
172
|
+
encodeFrameRaw(data: Uint8Array): Uint8Array;
|
|
173
|
+
encrypt(plaintext: Uint8Array): Uint8Array;
|
|
174
|
+
finishInit(): void;
|
|
175
|
+
getHash(): Uint8Array;
|
|
176
|
+
mixIntoKey(data: Uint8Array): void;
|
|
177
|
+
constructor(public_key: Uint8Array, noise_header: Uint8Array, routing_info?: Uint8Array | null);
|
|
178
|
+
processHandshakeFinish(noise_public_key: Uint8Array, noise_private_key: Uint8Array, server_ephemeral: Uint8Array): Uint8Array;
|
|
179
|
+
processHandshakeInit(server_ephemeral: Uint8Array, server_static_encrypted: Uint8Array, server_payload_encrypted: Uint8Array, private_key: Uint8Array): Uint8Array;
|
|
180
|
+
readonly bufferedBytes: number;
|
|
181
|
+
readonly isFinished: boolean;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export class ProtocolAddress {
|
|
185
|
+
free(): void;
|
|
186
|
+
[Symbol.dispose](): void;
|
|
187
|
+
static from(encoded: string): ProtocolAddress;
|
|
188
|
+
is(other: ProtocolAddress): boolean;
|
|
189
|
+
constructor(id: string, device_id: number);
|
|
190
|
+
toString(): string;
|
|
191
|
+
readonly deviceId: number;
|
|
192
|
+
readonly id: string;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
export class SenderKeyDistributionMessage {
|
|
196
|
+
private constructor();
|
|
197
|
+
free(): void;
|
|
198
|
+
[Symbol.dispose](): void;
|
|
199
|
+
static deserialize(serialized: Uint8Array): SenderKeyDistributionMessage;
|
|
200
|
+
serialize(): Uint8Array;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
export class SenderKeyName {
|
|
204
|
+
free(): void;
|
|
205
|
+
[Symbol.dispose](): void;
|
|
206
|
+
constructor(group_id: string, sender: ProtocolAddress);
|
|
207
|
+
toString(): string;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
export class SenderKeyRecord {
|
|
211
|
+
free(): void;
|
|
212
|
+
[Symbol.dispose](): void;
|
|
213
|
+
static deserialize(serialized: Uint8Array): SenderKeyRecord;
|
|
214
|
+
isEmpty(): boolean;
|
|
215
|
+
constructor();
|
|
216
|
+
serialize(): Uint8Array;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
export class SessionBuilder {
|
|
220
|
+
free(): void;
|
|
221
|
+
[Symbol.dispose](): void;
|
|
222
|
+
initOutgoing(bundle_input: PreKeyBundleInput): Promise<void>;
|
|
223
|
+
constructor(storage: SignalStorage, remote_address: ProtocolAddress);
|
|
224
|
+
processPreKeyBundle(bundle_input: PreKeyBundleInput): Promise<void>;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
export class SessionCipher {
|
|
228
|
+
free(): void;
|
|
229
|
+
[Symbol.dispose](): void;
|
|
230
|
+
decryptPreKeyWhisperMessage(ciphertext: Uint8Array): Promise<Uint8Array>;
|
|
231
|
+
decryptWhisperMessage(ciphertext: Uint8Array): Promise<Uint8Array>;
|
|
232
|
+
encrypt(plaintext: Uint8Array): Promise<{ type: number; body: Uint8Array }>;
|
|
233
|
+
hasOpenSession(): Promise<boolean>;
|
|
234
|
+
constructor(storage: SignalStorage, remote_address: ProtocolAddress);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
export class SessionRecord {
|
|
238
|
+
private constructor();
|
|
239
|
+
free(): void;
|
|
240
|
+
[Symbol.dispose](): void;
|
|
241
|
+
static deserialize(val: any): SessionRecord;
|
|
242
|
+
haveOpenSession(): boolean;
|
|
243
|
+
serialize(): Uint8Array;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
export function _serializeIdentityKeyPair(key_pair: KeyPair): Uint8Array;
|
|
247
|
+
|
|
248
|
+
export function calculateAgreement(public_key_bytes: Uint8Array, private_key_bytes: Uint8Array): Uint8Array;
|
|
249
|
+
|
|
250
|
+
export function calculateSignature(private_key_bytes: Uint8Array, message: Uint8Array): Uint8Array;
|
|
251
|
+
|
|
252
|
+
export function decodeNode(data: Uint8Array): InternalBinaryNode;
|
|
253
|
+
|
|
254
|
+
export function encodeNode(node_val: EncodingNode): Uint8Array;
|
|
255
|
+
|
|
256
|
+
export function expandAppStateKeys(key_data: Uint8Array): ExpandedAppStateKeys;
|
|
257
|
+
|
|
258
|
+
export function generateContentMac(operation: number, data: Uint8Array, key_id: Uint8Array, key: Uint8Array): Uint8Array;
|
|
259
|
+
|
|
260
|
+
export function generateIdentityKeyPair(): KeyPair;
|
|
261
|
+
|
|
262
|
+
export function generateIndexMac(index_bytes: Uint8Array, key: Uint8Array): Uint8Array;
|
|
263
|
+
|
|
264
|
+
export function generateKeyPair(): KeyPair;
|
|
265
|
+
|
|
266
|
+
export function generatePatchMac(snapshot_mac: Uint8Array, value_macs: Uint8Array[], version: bigint, name: string, key: Uint8Array): Uint8Array;
|
|
267
|
+
|
|
268
|
+
export function generatePreKey(key_id: number): PreKey;
|
|
269
|
+
|
|
270
|
+
export function generateRegistrationId(): number;
|
|
271
|
+
|
|
272
|
+
export function generateSignedPreKey(identity_key_pair: KeyPair, signed_key_id: number): SignedPreKey;
|
|
273
|
+
|
|
274
|
+
export function generateSnapshotMac(lt_hash: Uint8Array, version: bigint, name: string, key: Uint8Array): Uint8Array;
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* Returns which optional features are enabled in this build.
|
|
278
|
+
* Use this to conditionally call feature-gated functions.
|
|
279
|
+
*/
|
|
280
|
+
export function getEnabledFeatures(): EnabledFeatures;
|
|
281
|
+
|
|
282
|
+
export function getPublicFromPrivateKey(private_key_bytes: Uint8Array): Uint8Array;
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* Returns the WhatsApp connection header (WA_CONN_HEADER).
|
|
286
|
+
* This is the 4-byte header sent at the start of a WebSocket connection.
|
|
287
|
+
*/
|
|
288
|
+
export function getWAConnHeader(): Uint8Array;
|
|
289
|
+
|
|
290
|
+
export function hasLogger(): boolean;
|
|
291
|
+
|
|
292
|
+
export function hkdf(buffer: Uint8Array, expanded_length: number, info: HkdfInfo): Uint8Array;
|
|
293
|
+
|
|
294
|
+
export function logMessage(level: string, message: string): void;
|
|
295
|
+
|
|
296
|
+
export function md5(buffer: Uint8Array): Uint8Array;
|
|
297
|
+
|
|
298
|
+
export function setLogger(logger: ILogger): void;
|
|
299
|
+
|
|
300
|
+
export function updateLogger(logger: ILogger): void;
|
|
301
|
+
|
|
302
|
+
export function verifySignature(public_key_bytes: Uint8Array, message: Uint8Array, signature: Uint8Array): boolean;
|
|
303
|
+
|
|
304
|
+
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
305
|
+
|
|
306
|
+
export interface InitOutput {
|
|
307
|
+
readonly memory: WebAssembly.Memory;
|
|
308
|
+
readonly __wbg_expandedappstatekeys_free: (a: number, b: number) => void;
|
|
309
|
+
readonly __wbg_groupcipher_free: (a: number, b: number) => void;
|
|
310
|
+
readonly __wbg_groupsessionbuilder_free: (a: number, b: number) => void;
|
|
311
|
+
readonly __wbg_internalbinarynode_free: (a: number, b: number) => void;
|
|
312
|
+
readonly __wbg_lthashantitampering_free: (a: number, b: number) => void;
|
|
313
|
+
readonly __wbg_lthashstate_free: (a: number, b: number) => void;
|
|
314
|
+
readonly __wbg_noisesession_free: (a: number, b: number) => void;
|
|
315
|
+
readonly __wbg_protocoladdress_free: (a: number, b: number) => void;
|
|
316
|
+
readonly __wbg_senderkeydistributionmessage_free: (a: number, b: number) => void;
|
|
317
|
+
readonly __wbg_senderkeyname_free: (a: number, b: number) => void;
|
|
318
|
+
readonly __wbg_senderkeyrecord_free: (a: number, b: number) => void;
|
|
319
|
+
readonly __wbg_sessionbuilder_free: (a: number, b: number) => void;
|
|
320
|
+
readonly __wbg_sessionrecord_free: (a: number, b: number) => void;
|
|
321
|
+
readonly _serializeIdentityKeyPair: (a: number) => number;
|
|
322
|
+
readonly calculateAgreement: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
323
|
+
readonly calculateSignature: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
324
|
+
readonly decodeNode: (a: number, b: number, c: number) => void;
|
|
325
|
+
readonly encodeNode: (a: number, b: number) => void;
|
|
326
|
+
readonly expandAppStateKeys: (a: number, b: number) => number;
|
|
327
|
+
readonly expandedappstatekeys_indexKey: (a: number) => number;
|
|
328
|
+
readonly expandedappstatekeys_patchMacKey: (a: number) => number;
|
|
329
|
+
readonly expandedappstatekeys_snapshotMacKey: (a: number) => number;
|
|
330
|
+
readonly expandedappstatekeys_valueEncryptionKey: (a: number) => number;
|
|
331
|
+
readonly expandedappstatekeys_valueMacKey: (a: number) => number;
|
|
332
|
+
readonly generateContentMac: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
|
|
333
|
+
readonly generateIdentityKeyPair: () => number;
|
|
334
|
+
readonly generateIndexMac: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
335
|
+
readonly generatePatchMac: (a: number, b: number, c: number, d: number, e: number, f: bigint, g: number, h: number, i: number, j: number) => void;
|
|
336
|
+
readonly generatePreKey: (a: number) => number;
|
|
337
|
+
readonly generateRegistrationId: () => number;
|
|
338
|
+
readonly generateSignedPreKey: (a: number, b: number, c: number) => void;
|
|
339
|
+
readonly generateSnapshotMac: (a: number, b: number, c: number, d: bigint, e: number, f: number, g: number, h: number) => void;
|
|
340
|
+
readonly getEnabledFeatures: () => number;
|
|
341
|
+
readonly getPublicFromPrivateKey: (a: number, b: number, c: number) => void;
|
|
342
|
+
readonly getWAConnHeader: () => number;
|
|
343
|
+
readonly groupcipher_decrypt: (a: number, b: number, c: number) => number;
|
|
344
|
+
readonly groupcipher_encrypt: (a: number, b: number, c: number) => number;
|
|
345
|
+
readonly groupcipher_new: (a: number, b: number, c: number, d: number) => number;
|
|
346
|
+
readonly groupsessionbuilder_create: (a: number, b: number) => number;
|
|
347
|
+
readonly groupsessionbuilder_new: (a: number) => number;
|
|
348
|
+
readonly groupsessionbuilder_process: (a: number, b: number, c: number) => number;
|
|
349
|
+
readonly hasLogger: () => number;
|
|
350
|
+
readonly hkdf: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
351
|
+
readonly internalbinarynode_attrs: (a: number) => number;
|
|
352
|
+
readonly internalbinarynode_content: (a: number) => number;
|
|
353
|
+
readonly internalbinarynode_set_attrs: (a: number, b: number) => void;
|
|
354
|
+
readonly internalbinarynode_set_content: (a: number, b: number) => void;
|
|
355
|
+
readonly internalbinarynode_tag: (a: number, b: number) => void;
|
|
356
|
+
readonly internalbinarynode_toJSON: (a: number) => number;
|
|
357
|
+
readonly logMessage: (a: number, b: number, c: number, d: number) => void;
|
|
358
|
+
readonly lthashantitampering_new: () => number;
|
|
359
|
+
readonly lthashantitampering_subtractThenAdd: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
|
|
360
|
+
readonly lthashstate_clone: (a: number) => number;
|
|
361
|
+
readonly lthashstate_deleteValueMac: (a: number, b: number, c: number) => number;
|
|
362
|
+
readonly lthashstate_getValueMac: (a: number, b: number, c: number) => number;
|
|
363
|
+
readonly lthashstate_hasValueMac: (a: number, b: number, c: number) => number;
|
|
364
|
+
readonly lthashstate_hash: (a: number) => number;
|
|
365
|
+
readonly lthashstate_new: () => number;
|
|
366
|
+
readonly lthashstate_setValueMac: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
367
|
+
readonly lthashstate_set_hash: (a: number, b: number, c: number) => void;
|
|
368
|
+
readonly lthashstate_set_version: (a: number, b: bigint) => void;
|
|
369
|
+
readonly lthashstate_version: (a: number) => bigint;
|
|
370
|
+
readonly md5: (a: number, b: number) => number;
|
|
371
|
+
readonly noisesession_authenticate: (a: number, b: number, c: number) => void;
|
|
372
|
+
readonly noisesession_bufferedBytes: (a: number) => number;
|
|
373
|
+
readonly noisesession_clearBuffer: (a: number) => void;
|
|
374
|
+
readonly noisesession_decodeFrame: (a: number, b: number, c: number, d: number) => void;
|
|
375
|
+
readonly noisesession_decrypt: (a: number, b: number, c: number, d: number) => void;
|
|
376
|
+
readonly noisesession_encodeFrame: (a: number, b: number, c: number) => void;
|
|
377
|
+
readonly noisesession_encodeFrameRaw: (a: number, b: number, c: number, d: number) => void;
|
|
378
|
+
readonly noisesession_encrypt: (a: number, b: number, c: number, d: number) => void;
|
|
379
|
+
readonly noisesession_finishInit: (a: number, b: number) => void;
|
|
380
|
+
readonly noisesession_getHash: (a: number) => number;
|
|
381
|
+
readonly noisesession_isFinished: (a: number) => number;
|
|
382
|
+
readonly noisesession_mixIntoKey: (a: number, b: number, c: number, d: number) => void;
|
|
383
|
+
readonly noisesession_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
384
|
+
readonly noisesession_processHandshakeFinish: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
|
|
385
|
+
readonly noisesession_processHandshakeInit: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
|
|
386
|
+
readonly protocoladdress_deviceId: (a: number) => number;
|
|
387
|
+
readonly protocoladdress_from: (a: number, b: number) => void;
|
|
388
|
+
readonly protocoladdress_id: (a: number, b: number) => void;
|
|
389
|
+
readonly protocoladdress_is: (a: number, b: number) => number;
|
|
390
|
+
readonly protocoladdress_new: (a: number, b: number, c: number) => void;
|
|
391
|
+
readonly protocoladdress_toString: (a: number, b: number) => void;
|
|
392
|
+
readonly senderkeydistributionmessage_deserialize: (a: number, b: number, c: number) => void;
|
|
393
|
+
readonly senderkeydistributionmessage_serialize: (a: number) => number;
|
|
394
|
+
readonly senderkeyname_new: (a: number, b: number, c: number) => number;
|
|
395
|
+
readonly senderkeyname_toString: (a: number, b: number) => void;
|
|
396
|
+
readonly senderkeyrecord_deserialize: (a: number, b: number, c: number) => void;
|
|
397
|
+
readonly senderkeyrecord_isEmpty: (a: number) => number;
|
|
398
|
+
readonly senderkeyrecord_new: () => number;
|
|
399
|
+
readonly senderkeyrecord_serialize: (a: number, b: number) => void;
|
|
400
|
+
readonly sessionbuilder_initOutgoing: (a: number, b: number) => number;
|
|
401
|
+
readonly sessionbuilder_new: (a: number, b: number) => number;
|
|
402
|
+
readonly sessionbuilder_processPreKeyBundle: (a: number, b: number) => number;
|
|
403
|
+
readonly sessioncipher_decryptPreKeyWhisperMessage: (a: number, b: number, c: number) => number;
|
|
404
|
+
readonly sessioncipher_decryptWhisperMessage: (a: number, b: number, c: number) => number;
|
|
405
|
+
readonly sessioncipher_encrypt: (a: number, b: number, c: number) => number;
|
|
406
|
+
readonly sessioncipher_hasOpenSession: (a: number) => number;
|
|
407
|
+
readonly sessionrecord_deserialize: (a: number, b: number) => void;
|
|
408
|
+
readonly sessionrecord_haveOpenSession: (a: number) => number;
|
|
409
|
+
readonly sessionrecord_serialize: (a: number) => number;
|
|
410
|
+
readonly setLogger: (a: number, b: number) => void;
|
|
411
|
+
readonly verifySignature: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
412
|
+
readonly sessioncipher_new: (a: number, b: number) => number;
|
|
413
|
+
readonly generateKeyPair: () => number;
|
|
414
|
+
readonly updateLogger: (a: number) => void;
|
|
415
|
+
readonly __wbg_sessioncipher_free: (a: number, b: number) => void;
|
|
416
|
+
readonly __wasm_bindgen_func_elem_694: (a: number, b: number) => void;
|
|
417
|
+
readonly __wasm_bindgen_func_elem_699: (a: number, b: number, c: number, d: number) => void;
|
|
418
|
+
readonly __wasm_bindgen_func_elem_1248: (a: number, b: number, c: number, d: number) => void;
|
|
419
|
+
readonly __wbindgen_export: (a: number, b: number) => number;
|
|
420
|
+
readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
421
|
+
readonly __wbindgen_export3: (a: number) => void;
|
|
422
|
+
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
423
|
+
readonly __wbindgen_export4: (a: number, b: number, c: number) => void;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
427
|
+
|
|
428
|
+
/**
|
|
429
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
430
|
+
* a precompiled `WebAssembly.Module`.
|
|
431
|
+
*
|
|
432
|
+
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
433
|
+
*
|
|
434
|
+
* @returns {InitOutput}
|
|
435
|
+
*/
|
|
436
|
+
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
437
|
+
|
|
438
|
+
/**
|
|
439
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
440
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
441
|
+
*
|
|
442
|
+
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
443
|
+
*
|
|
444
|
+
* @returns {Promise<InitOutput>}
|
|
445
|
+
*/
|
|
446
|
+
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|