@filen/sdk-rs 0.3.18 → 0.3.20

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.
@@ -1,8 +1,22 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
+ /**
4
+ * Decrypts note data using the provided chat key.
5
+ * Meant to be used in socket event handlers where this cannot currently be done automatically.
6
+ *
7
+ * Should not be used outside of that context.
8
+ */
9
+ export function decrypMetaWithNoteKey(note: Note, encrypted: EncryptedString): string;
3
10
  export function main_js(): void;
4
- export function login(email: string, password: string, twoFactorCode?: string | null): Promise<Client>;
5
11
  export function fromStringified(serialized: StringifiedClient): Client;
12
+ export function login(email: string, password: string, twoFactorCode?: string | null): Promise<Client>;
13
+ /**
14
+ * Decrypts chat metadata (like chat name or message content) using the provided chat key.
15
+ * Meant to be used in socket event handlers where this cannot currently be done automatically.
16
+ *
17
+ * Should not be used outside of that context.
18
+ */
19
+ export function decryptMetaWithChatKey(chat: Chat, encrypted: EncryptedString): string;
6
20
  /**
7
21
  * The `ReadableStreamType` enum.
8
22
  *
@@ -21,16 +35,16 @@ export interface StringifiedClient {
21
35
  maxIoMemoryUsage?: number;
22
36
  }
23
37
 
24
- export interface ManagedFuture {
25
- abortSignal?: AbortSignal;
26
- pauseSignal?: PauseSignal;
27
- }
28
-
29
38
  /**
30
39
  * Enum for all the error kinds that can occur in the SDK.
31
40
  */
32
41
  export type ErrorKind = "Server" | "Unauthenticated" | "Reqwest" | "Response" | "RetryFailed" | "Conversion" | "IO" | "ChunkTooLarge" | "InvalidState" | "InvalidType" | "InvalidName" | "ImageError" | "MetadataWasNotDecrypted" | "Cancelled";
33
42
 
43
+ export interface ManagedFuture {
44
+ abortSignal?: AbortSignal;
45
+ pauseSignal?: PauseSignal;
46
+ }
47
+
34
48
  export interface FileMetaChanges {
35
49
  name?: string;
36
50
  mime?: string;
@@ -38,46 +52,46 @@ export interface FileMetaChanges {
38
52
  created?: bigint | null;
39
53
  }
40
54
 
41
- export type DirColor = "default" | "blue" | "green" | "purple" | "red" | "gray" | string;
42
-
43
- export type DirEnum = Dir | Root;
44
-
45
- export interface Root {
55
+ export interface Dir {
46
56
  uuid: UuidStr;
57
+ parent: ParentUuid;
58
+ color: DirColor;
59
+ timestamp: bigint;
60
+ favorited: boolean;
61
+ meta?: DecryptedDirMeta;
47
62
  }
48
63
 
49
- export interface DecryptedDirMeta {
50
- name: string;
51
- created?: bigint;
52
- }
53
-
54
- export type AnyDirEnumWithShareInfo = Dir | SharedDir | Root;
55
-
56
64
  export interface SharedDir {
57
65
  dir: DirWithMetaEnum;
58
66
  sharingRole: SharingRole;
59
67
  writeAccess: boolean;
60
68
  }
61
69
 
62
- export interface Dir {
70
+ export interface RootWithMeta {
63
71
  uuid: UuidStr;
64
- parent: ParentUuid;
65
72
  color: DirColor;
66
73
  timestamp: bigint;
67
- favorited: boolean;
68
74
  meta?: DecryptedDirMeta;
69
75
  }
70
76
 
71
- export interface RootWithMeta {
77
+ export type AnyDirEnumWithShareInfo = Dir | SharedDir | Root;
78
+
79
+ export type DirWithMetaEnum = Dir | RootWithMeta;
80
+
81
+ export interface Root {
72
82
  uuid: UuidStr;
73
- color: DirColor;
74
- timestamp: bigint;
75
- meta?: DecryptedDirMeta;
76
83
  }
77
84
 
78
85
  export type AnyDirEnum = Dir | RootWithMeta | Root;
79
86
 
80
- export type DirWithMetaEnum = Dir | RootWithMeta;
87
+ export interface DecryptedDirMeta {
88
+ name: string;
89
+ created?: bigint;
90
+ }
91
+
92
+ export type DirColor = "default" | "blue" | "green" | "purple" | "red" | "gray" | string;
93
+
94
+ export type DirEnum = Dir | Root;
81
95
 
82
96
  export interface File {
83
97
  uuid: UuidStr;
@@ -92,6 +106,8 @@ export interface File {
92
106
  canMakeThumbnail: boolean;
93
107
  }
94
108
 
109
+ export type FileEnum = File | RootFile;
110
+
95
111
  export interface RootFile {
96
112
  uuid: UuidStr;
97
113
  size: bigint;
@@ -108,8 +124,6 @@ export interface SharedFile {
108
124
  sharingRole: SharingRole;
109
125
  }
110
126
 
111
- export type FileEnum = File | RootFile;
112
-
113
127
  export interface DecryptedFileMeta {
114
128
  name: string;
115
129
  mime: string;
@@ -138,11 +152,6 @@ export interface FilePublicLink {
138
152
  salt: Uint8Array;
139
153
  }
140
154
 
141
- export interface DirectoryMetaChanges {
142
- name?: string;
143
- created?: bigint | null;
144
- }
145
-
146
155
  export interface Chat {
147
156
  uuid: UuidStr;
148
157
  lastMessage?: ChatMessage;
@@ -155,15 +164,13 @@ export interface Chat {
155
164
  lastFocus: bigint;
156
165
  }
157
166
 
158
- export interface ChatParticipant {
159
- userId: bigint;
160
- email: string;
161
- avatar?: string;
162
- nickName: string;
163
- permissionsAdd: boolean;
164
- added: bigint;
165
- appearOffline: boolean;
166
- lastActive: bigint;
167
+ export interface ChatMessage extends ChatMessagePartial {
168
+ chat: UuidStr;
169
+ replyTo?: ChatMessagePartial;
170
+ embedDisabled: boolean;
171
+ edited: boolean;
172
+ editedTimestamp: bigint;
173
+ sentTimestamp: bigint;
167
174
  }
168
175
 
169
176
  export interface ChatMessagePartial {
@@ -175,21 +182,20 @@ export interface ChatMessagePartial {
175
182
  message?: string;
176
183
  }
177
184
 
178
- export interface ChatMessage extends ChatMessagePartial {
179
- chat: UuidStr;
180
- replyTo?: ChatMessagePartial;
181
- embedDisabled: boolean;
182
- edited: boolean;
183
- editedTimestamp: bigint;
184
- sentTimestamp: bigint;
185
+ export interface ChatParticipant {
186
+ userId: bigint;
187
+ email: string;
188
+ avatar?: string;
189
+ nickName: string;
190
+ permissionsAdd: boolean;
191
+ added: bigint;
192
+ appearOffline: boolean;
193
+ lastActive: bigint;
185
194
  }
186
195
 
187
- export type NonRootItem = File | Dir;
188
-
189
- export interface UploadFileStreamParams extends UploadFileParams {
190
- reader: ReadableStream<Uint8Array>;
191
- knownSize: bigint | undefined;
192
- progress?: (bytes: bigint) => void;
196
+ export interface DirectoryMetaChanges {
197
+ name?: string;
198
+ created?: bigint | null;
193
199
  }
194
200
 
195
201
  export interface DownloadFileToZipParams {
@@ -199,14 +205,14 @@ export interface DownloadFileToZipParams {
199
205
  managedFuture?: ManagedFuture;
200
206
  }
201
207
 
202
- export interface FileBuilderParams {
203
- parent: DirEnum;
204
- name: string;
205
- created?: bigint;
206
- modified?: bigint;
207
- mime?: string;
208
+ export interface UploadFileStreamParams extends UploadFileParams {
209
+ reader: ReadableStream<Uint8Array>;
210
+ knownSize: bigint | undefined;
211
+ progress?: (bytes: bigint) => void;
208
212
  }
209
213
 
214
+ export type NonRootItem = File | Dir;
215
+
210
216
  export interface DownloadFileStreamParams {
211
217
  file: FileEnum;
212
218
  writer: WritableStream<Uint8Array>;
@@ -220,6 +226,14 @@ export interface UploadFileParams extends FileBuilderParams {
220
226
  managedFuture?: ManagedFuture;
221
227
  }
222
228
 
229
+ export interface FileBuilderParams {
230
+ parent: DirEnum;
231
+ name: string;
232
+ created?: bigint;
233
+ modified?: bigint;
234
+ mime?: string;
235
+ }
236
+
223
237
  export interface Note {
224
238
  uuid: UuidStr;
225
239
  ownerId: bigint;
@@ -265,6 +279,11 @@ export interface NoteHistory {
265
279
  noteType: NoteType;
266
280
  }
267
281
 
282
+ export interface DuplicateNoteResponse {
283
+ original: Note;
284
+ duplicated: Note;
285
+ }
286
+
268
287
  export interface AcquireLockParams {
269
288
  resource: string;
270
289
  maxSleepTime?: number;
@@ -283,24 +302,23 @@ export interface MakeThumbnailInMemoryParams {
283
302
  maxHeight: number;
284
303
  }
285
304
 
286
- export interface BlockedContact {
305
+ export interface Contact {
287
306
  uuid: UuidStr;
288
307
  userId: bigint;
289
308
  email: string;
290
309
  avatar?: string;
291
310
  nickName: string;
311
+ lastActive: bigint;
292
312
  timestamp: bigint;
313
+ publicKey: string;
293
314
  }
294
315
 
295
- export interface Contact {
316
+ export interface ContactRequestIn {
296
317
  uuid: UuidStr;
297
318
  userId: bigint;
298
319
  email: string;
299
320
  avatar?: string;
300
321
  nickName: string;
301
- lastActive: bigint;
302
- timestamp: bigint;
303
- publicKey: string;
304
322
  }
305
323
 
306
324
  export interface ContactRequestOut {
@@ -310,156 +328,426 @@ export interface ContactRequestOut {
310
328
  nickName: string;
311
329
  }
312
330
 
313
- export interface ContactRequestIn {
331
+ export interface BlockedContact {
314
332
  uuid: UuidStr;
315
333
  userId: bigint;
316
334
  email: string;
317
335
  avatar?: string;
318
336
  nickName: string;
337
+ timestamp: bigint;
319
338
  }
320
339
 
340
+ export type SharingRole = ({ role: "sharer" } & ShareInfo) | ({ role: "receiver" } & ShareInfo);
341
+
321
342
  export interface ShareInfo {
322
343
  email: string;
323
344
  id: number;
324
345
  }
325
346
 
326
- export type SharingRole = ({ role: "sharer" } & ShareInfo) | ({ role: "receiver" } & ShareInfo);
327
-
328
- export interface DuplicateNoteResponse {
329
- original: Note;
330
- duplicated: Note;
331
- }
332
-
333
347
  export interface ItemMatch {
334
348
  item: NonRootItemTagged;
335
349
  path: string;
336
350
  }
337
351
 
338
- export type NonRootItemTagged = ({ type: "dir" } & Dir) | ({ type: "file" } & File);
339
-
340
352
  export interface DirSizeResponse {
341
353
  size: bigint;
342
354
  files: bigint;
343
355
  dirs: bigint;
344
356
  }
345
357
 
346
- export type UuidStr = string;
358
+ export type NonRootItemTagged = ({ type: "dir" } & Dir) | ({ type: "file" } & File);
347
359
 
348
- export type ParentUuid = UuidStr | "trash" | "recents" | "favorites" | "links";
360
+ export interface NoteTitleEdited {
361
+ note: UuidStr;
362
+ title: EncryptedString;
363
+ }
349
364
 
350
- export type NoteType = "text" | "md" | "code" | "rich" | "checklist";
365
+ export interface NoteContentEdited {
366
+ note: UuidStr;
367
+ content: EncryptedString;
368
+ type: NoteType;
369
+ editorId: bigint;
370
+ editedTimestamp: bigint;
371
+ }
351
372
 
352
- export type ChatTypingType = "up" | "down";
373
+ export interface ChatMessageDelete {
374
+ uuid: UuidStr;
375
+ }
353
376
 
354
- export type FileEncryptionVersion = 1 | 2 | 3;
377
+ export interface FolderDeletedPermanent {
378
+ uuid: UuidStr;
379
+ }
355
380
 
356
- export type PublicLinkExpiration = "never" | "1h" | "6h" | "1d" | "3d" | "7d" | "14d" | "30d";
381
+ export interface FolderRestore {
382
+ name: EncryptedString;
383
+ uuid: UuidStr;
384
+ parent: UuidStr;
385
+ timestamp: bigint;
386
+ favorited: boolean;
387
+ }
357
388
 
358
- export class Client {
359
- private constructor();
360
- free(): void;
361
- toStringified(): StringifiedClient;
362
- lockDrive(): Promise<ResourceLock>;
363
- acquireLock(params: AcquireLockParams): Promise<ResourceLock>;
364
- makeThumbnailInMemory(params: MakeThumbnailInMemoryParams): Promise<MakeThumbnailInMemoryResult | undefined>;
365
- cancelContactRequest(contact_uuid: string): Promise<void>;
366
- updateDirLink(dir: Dir, link: DirPublicLink): Promise<void>;
367
- removeDirLink(link: DirPublicLink): Promise<void>;
368
- removeSharedLinkOut(link_uuid: string, receiver_id: bigint): Promise<void>;
369
- updateFileLink(file: File, link: FilePublicLink): Promise<void>;
370
- shareFile(file: File, contact: Contact): Promise<void>;
371
- listIncomingContactRequests(): Promise<ContactRequestIn[]>;
372
- denyContactRequest(contact_uuid: string): Promise<void>;
373
- getDirLinkStatus(dir: Dir): Promise<DirPublicLink | undefined>;
374
- shareDir(dir: Dir, contact: Contact): Promise<void>;
375
- removeSharedLinkIn(link_uuid: string): Promise<void>;
376
- getBlockedContacts(): Promise<BlockedContact[]>;
377
- deleteContact(contact_uuid: string): Promise<void>;
378
- acceptContactRequest(contact_uuid: string): Promise<string>;
379
- listInShared(dir?: DirWithMetaEnum | null): Promise<[SharedDirectory[], SharedFile[]]>;
380
- getContacts(): Promise<Contact[]>;
381
- blockContact(email: string): Promise<string>;
382
- unblockContact(contact_uuid: string): Promise<void>;
383
- listOutShared(dir?: DirWithMetaEnum | null, contact?: Contact | null): Promise<[SharedDirectory[], SharedFile[]]>;
384
- sendContactRequest(email: string): Promise<string>;
385
- publicLinkDir(dir: Dir): Promise<DirPublicLink>;
386
- getFileLinkStatus(file: File): Promise<FilePublicLink | undefined>;
387
- publicLinkFile(file: File): Promise<FilePublicLink>;
388
- listLinkedDir(dir: DirWithMetaEnum, link: DirPublicLink): Promise<[Dir[], File[]]>;
389
- listOutgoingContactRequests(): Promise<ContactRequestOut[]>;
390
- listDir(dir: DirEnum): Promise<[Dir[], File[]]>;
391
- dirExists(parent: AnyDirEnum, name: string): Promise<void>;
392
- listFavorites(): Promise<[Dir[], File[]]>;
393
- trashDir(dir: Dir): Promise<Dir>;
394
- deleteDirPermanently(dir: Dir): Promise<void>;
395
- findItemInDir(dir: AnyDirEnum, nameOrUuid: string): Promise<NonRootItemTagged | undefined>;
396
- createDir(parent: DirEnum, name: string): Promise<Dir>;
397
- listDirRecursive(dir: DirEnum): Promise<[Dir[], File[]]>;
398
- getDirSize(dir: AnyDirEnumWithShareInfo): Promise<DirSizeResponse>;
399
- updateDirMetadata(dir: Dir, changes: DirectoryMetaChanges): Promise<Dir>;
400
- root(): Root;
401
- getDir(uuid: string): Promise<Dir>;
402
- setDirColor(dir: Dir, color: DirColor): Promise<Dir>;
403
- listRecents(): Promise<[Dir[], File[]]>;
404
- getNote(note_uuid: string): Promise<Note | undefined>;
405
- getNoteHistory(note: Note): Promise<NoteHistory[]>;
406
- removeTagFromNote(note: Note, tag: NoteTag): Promise<Note>;
407
- createNote(title?: string | null): Promise<Note>;
408
- setNoteContent(note: Note, new_content: string, new_preview: string): Promise<Note>;
409
- setNoteParticipantPermission(noteUuid: string, participant: NoteParticipant, write: boolean): Promise<NoteParticipant>;
410
- setNoteTagFavorited(tag: NoteTag, favorite: boolean): Promise<NoteTag>;
411
- deleteNote(note: Note): Promise<void>;
412
- removeNoteParticipant(note: Note, participant_id: bigint): Promise<Note>;
413
- deleteNoteTag(tag: NoteTag): Promise<void>;
414
- listNotes(): Promise<Note[]>;
415
- getNoteContent(note: Note): Promise<string | undefined>;
416
- setNoteTitle(note: Note, new_title: string): Promise<Note>;
417
- archiveNote(note: Note): Promise<Note>;
418
- restoreNoteFromHistory(note: Note, history: NoteHistory): Promise<Note>;
419
- addNoteParticipant(note: Note, contact: Contact, write: boolean): Promise<Note>;
420
- createNoteTag(name: string): Promise<NoteTag>;
421
- listNoteTags(): Promise<NoteTag[]>;
422
- setNoteFavorited(note: Note, favorite: boolean): Promise<Note>;
423
- setNoteType(note: Note, note_type: NoteType, known_content?: string | null): Promise<Note>;
424
- restoreNote(note: Note): Promise<Note>;
425
- duplicateNote(note: Note): Promise<DuplicateNoteResponse>;
426
- renameNoteTag(tag: NoteTag, new_name: string): Promise<NoteTag>;
427
- trashNote(note: Note): Promise<Note>;
428
- setNotePinned(note: Note, pinned: boolean): Promise<Note>;
429
- addTagToNote(note: Note, tag: NoteTag): Promise<[Note, NoteTag]>;
430
- findItemMatchesForName(name: string): Promise<ItemMatch[]>;
431
- listMessages(chat: Chat): Promise<ChatMessage[]>;
432
- listChats(): Promise<Chat[]>;
433
- leaveChat(chat: Chat): Promise<void>;
434
- createChat(contacts: Contact[]): Promise<Chat>;
435
- getAllChatsUnreadCount(): Promise<bigint>;
436
- deleteChat(chat: Chat): Promise<void>;
437
- deleteMessage(chat: Chat, message: ChatMessage): Promise<Chat>;
438
- getChat(uuid: string): Promise<Chat | undefined>;
439
- sendTypingSignal(chat: Chat, signal_type: ChatTypingType): Promise<void>;
389
+ export interface NoteParticipantRemoved {
390
+ note: UuidStr;
391
+ userId: bigint;
392
+ }
393
+
394
+ export interface ChatConversationParticipantLeft {
395
+ uuid: UuidStr;
396
+ userId: bigint;
397
+ }
398
+
399
+ export interface FileMetadataChanged {
400
+ uuid: UuidStr;
401
+ name: EncryptedString;
402
+ metadata: EncryptedString;
403
+ oldMetadata: EncryptedString;
404
+ }
405
+
406
+ export interface NoteRestored {
407
+ note: UuidStr;
408
+ }
409
+
410
+ export interface NoteArchived {
411
+ note: UuidStr;
412
+ }
413
+
414
+ export interface ChatConversationDeleted {
415
+ uuid: UuidStr;
416
+ }
417
+
418
+ export interface NoteNew {
419
+ note: UuidStr;
420
+ }
421
+
422
+ export interface FolderSubCreated {
423
+ name: EncryptedString;
424
+ uuid: UuidStr;
425
+ parent: UuidStr;
426
+ timestamp: bigint;
427
+ favorited: boolean;
428
+ }
429
+
430
+ export interface ChatMessageEmbedDisabled {
431
+ uuid: UuidStr;
432
+ }
433
+
434
+ export interface FolderMove {
435
+ name: EncryptedString;
436
+ uuid: UuidStr;
437
+ parent: UuidStr;
438
+ timestamp: bigint;
439
+ favorited: boolean;
440
+ }
441
+
442
+ export interface NoteParticipantPermissions {
443
+ note: UuidStr;
444
+ userId: bigint;
445
+ permissionsWrite: boolean;
446
+ }
447
+
448
+ export interface ChatMessageNew extends ChatMessagePartialEncrypted {
449
+ conversation: UuidStr;
450
+ replyTo?: ChatMessagePartialEncrypted;
451
+ embedDisabled: boolean;
452
+ sentTimestamp: DateTime<Utc>;
453
+ }
454
+
455
+ export interface NewEvent {
456
+ uuid: UuidStr;
457
+ type: string;
458
+ timestamp: bigint;
459
+ info: string;
460
+ }
461
+
462
+ export interface FileRename {
463
+ uuid: UuidStr;
464
+ metadata: EncryptedString;
465
+ }
466
+
467
+ export interface FolderColorChanged {
468
+ uuid: UuidStr;
469
+ color: DirColor;
470
+ }
471
+
472
+ export interface NoteParticipantNew extends NoteParticipant {
473
+ note: UuidStr;
474
+ }
475
+
476
+ export interface FileMove {
477
+ parent: UuidStr;
478
+ uuid: UuidStr;
479
+ metadata: EncryptedString;
480
+ timestamp: bigint;
481
+ chunks: bigint;
482
+ bucket: string;
483
+ region: string;
484
+ version: FileEncryptionVersion;
485
+ favorited: boolean;
486
+ }
487
+
488
+ export interface FileArchived {
489
+ uuid: UuidStr;
490
+ }
491
+
492
+ export interface ChatConversationsNew {
493
+ uuid: UuidStr;
494
+ metadata: EncryptedString;
495
+ addedTimestamp: bigint;
496
+ }
497
+
498
+ export interface FileTrash {
499
+ uuid: UuidStr;
500
+ }
501
+
502
+ export interface ChatConversationNameEdited {
503
+ uuid: UuidStr;
504
+ name: EncryptedString;
505
+ }
506
+
507
+ export interface ItemFavorite {
508
+ uuid: UuidStr;
509
+ type: ObjectType;
510
+ value: boolean;
511
+ metadata: EncryptedString;
512
+ }
513
+
514
+ export interface FileDeletedPermanent {
515
+ uuid: UuidStr;
516
+ }
517
+
518
+ export interface ChatConversationParticipantNew {
519
+ conversation: UuidStr;
520
+ userId: bigint;
521
+ email: string;
522
+ avatar: string | undefined;
523
+ nickName: string | undefined;
524
+ metadata: EncryptedString;
525
+ permissionsAdd: boolean;
526
+ addedTimestamp: bigint;
527
+ }
528
+
529
+ export interface ContactRequestReceived {
530
+ uuid: UuidStr;
531
+ senderId: bigint;
532
+ senderEmail: string;
533
+ senderAvatar: string | undefined;
534
+ senderNickName: string | undefined;
535
+ sentTimestamp: bigint;
536
+ }
537
+
538
+ export interface FolderRename {
539
+ name: EncryptedString;
540
+ uuid: UuidStr;
541
+ }
542
+
543
+ export interface ChatTyping {
544
+ conversation: UuidStr;
545
+ senderAvatar: string | undefined;
546
+ senderEmail: string;
547
+ senderNickName: string;
548
+ senderId: bigint;
549
+ timestamp: bigint;
550
+ type: ChatTypingType;
551
+ }
552
+
553
+ export interface ChatMessageEdited {
554
+ conversation: UuidStr;
555
+ uuid: UuidStr;
556
+ message: EncryptedString;
557
+ editedTimestamp: bigint;
558
+ }
559
+
560
+ export interface FileArchiveRestored {
561
+ currentUuid: UuidStr;
562
+ parent: UuidStr;
563
+ uuid: UuidStr;
564
+ metadata: EncryptedString;
565
+ timestamp: bigint;
566
+ chunks: bigint;
567
+ bucket: string;
568
+ region: string;
569
+ version: FileEncryptionVersion;
570
+ favorited: boolean;
571
+ }
572
+
573
+ export interface FileRestore {
574
+ parent: UuidStr;
575
+ uuid: UuidStr;
576
+ metadata: EncryptedString;
577
+ timestamp: bigint;
578
+ chunks: bigint;
579
+ bucket: string;
580
+ region: string;
581
+ version: FileEncryptionVersion;
582
+ favorited: boolean;
583
+ }
584
+
585
+ export interface NoteDeleted {
586
+ note: UuidStr;
587
+ }
588
+
589
+ export interface FileNew {
590
+ parent: UuidStr;
591
+ uuid: UuidStr;
592
+ metadata: EncryptedString;
593
+ timestamp: bigint;
594
+ chunks: bigint;
595
+ bucket: string;
596
+ region: string;
597
+ version: FileEncryptionVersion;
598
+ favorited: boolean;
599
+ }
600
+
601
+ export interface FolderTrash {
602
+ parent: UuidStr;
603
+ uuid: UuidStr;
604
+ }
605
+
606
+ export type SocketEvent = { type: "authSuccess" } | { type: "newEvent"; data: NewEvent } | { type: "fileRename"; data: FileRename } | { type: "fileArchiveRestored"; data: FileArchiveRestored } | { type: "fileNew"; data: FileNew } | { type: "fileRestore"; data: FileRestore } | { type: "fileMove"; data: FileMove } | { type: "fileTrash"; data: FileTrash } | { type: "fileArchived"; data: FileArchived } | { type: "folderRename"; data: FolderRename } | { type: "folderTrash"; data: FolderTrash } | { type: "folderMove"; data: FolderMove } | { type: "folderSubCreated"; data: FolderSubCreated } | { type: "folderRestore"; data: FolderRestore } | { type: "folderColorChanged"; data: FolderColorChanged } | { type: "trashEmpty" } | { type: "passwordChanged" } | { type: "chatMessageNew"; data: ChatMessageNew } | { type: "chatTyping"; data: ChatTyping } | { type: "chatConversationsNew"; data: ChatConversationsNew } | { type: "chatMessageDelete"; data: ChatMessageDelete } | { type: "noteContentEdited"; data: NoteContentEdited } | { type: "noteArchived"; data: NoteArchived } | { type: "noteDeleted"; data: NoteDeleted } | { type: "noteTitleEdited"; data: NoteTitleEdited } | { type: "noteParticipantPermissions"; data: NoteParticipantPermissions } | { type: "noteRestored"; data: NoteRestored } | { type: "noteParticipantRemoved"; data: NoteParticipantRemoved } | { type: "noteParticipantNew"; data: NoteParticipantNew } | { type: "noteNew"; data: NoteNew } | { type: "chatMessageEmbedDisabled"; data: ChatMessageEmbedDisabled } | { type: "chatConversationParticipantLeft"; data: ChatConversationParticipantLeft } | { type: "chatConversationDeleted"; data: ChatConversationDeleted } | { type: "chatMessageEdited"; data: ChatMessageEdited } | { type: "chatConversationNameEdited"; data: ChatConversationNameEdited } | { type: "contactRequestReceived"; data: ContactRequestReceived } | { type: "itemFavorite"; data: ItemFavorite } | { type: "chatConversationParticipantNew"; data: ChatConversationParticipantNew } | { type: "fileDeletedPermanent"; data: FileDeletedPermanent } | { type: "folderMetadataChanged"; data: FolderMetadataChanged } | { type: "folderDeletedPermanent"; data: FolderDeletedPermanent } | { type: "fileMetadataChanged"; data: FileMetadataChanged };
607
+
608
+ export interface FolderMetadataChanged {
609
+ uuid: UuidStr;
610
+ name: EncryptedString;
611
+ }
612
+
613
+ export type NoteType = "text" | "md" | "code" | "rich" | "checklist";
614
+
615
+ export type ChatTypingType = "up" | "down";
616
+
617
+ export type ObjectType = "file" | "folder";
618
+
619
+ export type ParentUuid = UuidStr | "trash" | "recents" | "favorites" | "links";
620
+
621
+ export type UuidStr = `${string}-${string}-${string}-${string}`;
622
+
623
+ declare const encryptedStringBrand: unique symbol;
624
+ export type EncryptedString = string & {readonly [encryptedStringBrand]: "UserId"}
625
+
626
+ export type FileEncryptionVersion = 1 | 2 | 3;
627
+
628
+ export interface ChatMessagePartialEncrypted {
629
+ uuid: UuidStr;
630
+ senderId: bigint;
631
+ senderEmail: string;
632
+ senderAvatar: string | undefined;
633
+ senderNickName: string;
634
+ message: EncryptedString;
635
+ }
636
+
637
+ export type PublicLinkExpiration = "never" | "1h" | "6h" | "1d" | "3d" | "7d" | "14d" | "30d";
638
+
639
+ export class Client {
640
+ private constructor();
641
+ free(): void;
642
+ toStringified(): StringifiedClient;
643
+ setNoteTagFavorited(tag: NoteTag, favorite: boolean): Promise<NoteTag>;
644
+ addNoteParticipant(note: Note, contact: Contact, write: boolean): Promise<Note>;
645
+ setNotePinned(note: Note, pinned: boolean): Promise<Note>;
646
+ archiveNote(note: Note): Promise<Note>;
647
+ duplicateNote(note: Note): Promise<DuplicateNoteResponse>;
648
+ deleteNote(note: Note): Promise<void>;
649
+ addTagToNote(note: Note, tag: NoteTag): Promise<[Note, NoteTag]>;
650
+ createNote(title?: string | null): Promise<Note>;
651
+ setNoteContent(note: Note, new_content: string, new_preview: string): Promise<Note>;
652
+ renameNoteTag(tag: NoteTag, new_name: string): Promise<NoteTag>;
653
+ restoreNoteFromHistory(note: Note, history: NoteHistory): Promise<Note>;
654
+ listNotes(): Promise<Note[]>;
655
+ listNoteTags(): Promise<NoteTag[]>;
656
+ getNoteHistory(note: Note): Promise<NoteHistory[]>;
657
+ deleteNoteTag(tag: NoteTag): Promise<void>;
658
+ setNoteTitle(note: Note, new_title: string): Promise<Note>;
659
+ removeNoteParticipant(note: Note, participant_id: bigint): Promise<Note>;
660
+ setNoteFavorited(note: Note, favorite: boolean): Promise<Note>;
661
+ createNoteTag(name: string): Promise<NoteTag>;
662
+ trashNote(note: Note): Promise<Note>;
663
+ setNoteParticipantPermission(noteUuid: string, participant: NoteParticipant, write: boolean): Promise<NoteParticipant>;
664
+ restoreNote(note: Note): Promise<Note>;
665
+ getNoteContent(note: Note): Promise<string | undefined>;
666
+ removeTagFromNote(note: Note, tag: NoteTag): Promise<Note>;
667
+ getNote(note_uuid: string): Promise<Note | undefined>;
668
+ setNoteType(note: Note, note_type: NoteType, known_content?: string | null): Promise<Note>;
669
+ acquireLock(params: AcquireLockParams): Promise<ResourceLock>;
670
+ lockDrive(): Promise<ResourceLock>;
671
+ makeThumbnailInMemory(params: MakeThumbnailInMemoryParams): Promise<MakeThumbnailInMemoryResult | undefined>;
672
+ acceptContactRequest(contact_uuid: string): Promise<string>;
673
+ listOutgoingContactRequests(): Promise<ContactRequestOut[]>;
674
+ listIncomingContactRequests(): Promise<ContactRequestIn[]>;
675
+ getDirLinkStatus(dir: Dir): Promise<DirPublicLink | undefined>;
676
+ listOutShared(dir?: DirWithMetaEnum | null, contact?: Contact | null): Promise<[SharedDirectory[], SharedFile[]]>;
677
+ sendContactRequest(email: string): Promise<string>;
678
+ updateDirLink(dir: Dir, link: DirPublicLink): Promise<void>;
679
+ listLinkedDir(dir: DirWithMetaEnum, link: DirPublicLink): Promise<[Dir[], File[]]>;
680
+ updateFileLink(file: File, link: FilePublicLink): Promise<void>;
681
+ unblockContact(contact_uuid: string): Promise<void>;
682
+ publicLinkFile(file: File): Promise<FilePublicLink>;
683
+ removeSharedLinkIn(link_uuid: string): Promise<void>;
684
+ removeDirLink(link: DirPublicLink): Promise<void>;
685
+ shareFile(file: File, contact: Contact): Promise<void>;
686
+ removeSharedLinkOut(link_uuid: string, receiver_id: bigint): Promise<void>;
687
+ denyContactRequest(contact_uuid: string): Promise<void>;
688
+ listInShared(dir?: DirWithMetaEnum | null): Promise<[SharedDirectory[], SharedFile[]]>;
689
+ getContacts(): Promise<Contact[]>;
690
+ blockContact(email: string): Promise<string>;
691
+ shareDir(dir: Dir, contact: Contact): Promise<void>;
692
+ cancelContactRequest(contact_uuid: string): Promise<void>;
693
+ getBlockedContacts(): Promise<BlockedContact[]>;
694
+ getFileLinkStatus(file: File): Promise<FilePublicLink | undefined>;
695
+ deleteContact(contact_uuid: string): Promise<void>;
696
+ publicLinkDir(dir: Dir): Promise<DirPublicLink>;
697
+ trashDir(dir: Dir): Promise<Dir>;
698
+ getDir(uuid: string): Promise<Dir>;
699
+ deleteDirPermanently(dir: Dir): Promise<void>;
700
+ getDirSize(dir: AnyDirEnumWithShareInfo): Promise<DirSizeResponse>;
701
+ listFavorites(): Promise<[Dir[], File[]]>;
702
+ listRecents(): Promise<[Dir[], File[]]>;
703
+ root(): Root;
704
+ findItemInDir(dir: AnyDirEnum, nameOrUuid: string): Promise<NonRootItemTagged | undefined>;
705
+ dirExists(parent: AnyDirEnum, name: string): Promise<void>;
706
+ setDirColor(dir: Dir, color: DirColor): Promise<Dir>;
707
+ listDir(dir: DirEnum): Promise<[Dir[], File[]]>;
708
+ updateDirMetadata(dir: Dir, changes: DirectoryMetaChanges): Promise<Dir>;
709
+ listDirRecursive(dir: DirEnum): Promise<[Dir[], File[]]>;
710
+ createDir(parent: DirEnum, name: string): Promise<Dir>;
711
+ removeChatParticipant(chat: Chat, contact: Contact): Promise<Chat>;
712
+ getChat(uuid: string): Promise<Chat | undefined>;
713
+ muteChat(chat: Chat, mute: boolean): Promise<Chat>;
440
714
  editMessage(chat: Chat, message: ChatMessage, new_message: string): Promise<ChatMessage>;
441
- updateChatOnlineStatus(chat: Chat): Promise<Chat>;
442
- getChatUnreadCount(chat: Chat): Promise<bigint>;
443
715
  disableMessageEmbed(message: ChatMessage): Promise<ChatMessage>;
444
- muteChat(chat: Chat, mute: boolean): Promise<Chat>;
445
- addChatParticipant(chat: Chat, contact: Contact): Promise<Chat>;
446
- updateLastChatFocusTimesNow(chats: Chat[]): Promise<Chat[]>;
447
- removeChatParticipant(chat: Chat, contact: Contact): Promise<Chat>;
448
- sendChatMessage(chat: Chat, message: string, reply_to?: ChatMessagePartial | null): Promise<Chat>;
716
+ listMessages(chat: Chat): Promise<ChatMessage[]>;
717
+ deleteMessage(chat: Chat, message: ChatMessage): Promise<Chat>;
718
+ deleteChat(chat: Chat): Promise<void>;
719
+ sendTypingSignal(chat: Chat, signal_type: ChatTypingType): Promise<void>;
449
720
  markChatRead(chat: Chat): Promise<void>;
721
+ listChats(): Promise<Chat[]>;
450
722
  listMessagesBefore(chat: Chat, before: bigint): Promise<ChatMessage[]>;
723
+ addChatParticipant(chat: Chat, contact: Contact): Promise<Chat>;
724
+ leaveChat(chat: Chat): Promise<void>;
725
+ getAllChatsUnreadCount(): Promise<bigint>;
726
+ sendChatMessage(chat: Chat, message: string, reply_to?: ChatMessagePartial | null): Promise<Chat>;
727
+ createChat(contacts: Contact[]): Promise<Chat>;
728
+ getChatUnreadCount(chat: Chat): Promise<bigint>;
729
+ updateChatOnlineStatus(chat: Chat): Promise<Chat>;
451
730
  renameChat(chat: Chat, new_name: string): Promise<Chat>;
452
- trashFile(file: File): Promise<File>;
453
- updateFileMetadata(file: File, changes: FileMetaChanges): Promise<File>;
731
+ updateLastChatFocusTimesNow(chats: Chat[]): Promise<Chat[]>;
732
+ decryptMeta(encrypted: EncryptedString): string;
733
+ addSocketListener(event_types: string[] | null | undefined, listener: (event: SocketEvent) => void): Promise<EventListenerHandle>;
734
+ isSocketConnected(): boolean;
735
+ findItemMatchesForName(name: string): Promise<ItemMatch[]>;
454
736
  uploadFile(data: Uint8Array, params: UploadFileParams): Promise<File>;
455
- getFile(uuid: string): Promise<File>;
456
- downloadFileToWriter(params: DownloadFileStreamParams): Promise<void>;
457
737
  deleteFilePermanently(file: File): Promise<void>;
458
738
  uploadFileFromReader(params: UploadFileStreamParams): Promise<File>;
739
+ getFile(uuid: string): Promise<File>;
459
740
  downloadFile(file: FileEnum): Promise<Uint8Array>;
741
+ updateFileMetadata(file: File, changes: FileMetaChanges): Promise<File>;
742
+ downloadFileToWriter(params: DownloadFileStreamParams): Promise<void>;
743
+ trashFile(file: File): Promise<File>;
460
744
  setFavorite(item: NonRootItem, favorited: boolean): Promise<NonRootItemTagged>;
461
745
  downloadItemsToZip(params: DownloadFileToZipParams): Promise<void>;
462
746
  }
747
+ export class EventListenerHandle {
748
+ private constructor();
749
+ free(): void;
750
+ }
463
751
  /**
464
752
  * Custom error type for the SDK
465
753
  */
@@ -475,21 +763,21 @@ export class IntoUnderlyingByteSource {
475
763
  pull(controller: ReadableByteStreamController): Promise<any>;
476
764
  start(controller: ReadableByteStreamController): void;
477
765
  cancel(): void;
478
- readonly type: ReadableStreamType;
479
766
  readonly autoAllocateChunkSize: number;
767
+ readonly type: ReadableStreamType;
480
768
  }
481
769
  export class IntoUnderlyingSink {
482
770
  private constructor();
483
771
  free(): void;
772
+ close(): Promise<any>;
484
773
  write(chunk: any): Promise<any>;
485
774
  abort(reason: any): Promise<any>;
486
- close(): Promise<any>;
487
775
  }
488
776
  export class IntoUnderlyingSource {
489
777
  private constructor();
490
778
  free(): void;
491
- cancel(): void;
492
779
  pull(controller: ReadableStreamDefaultController): Promise<any>;
780
+ cancel(): void;
493
781
  }
494
782
  export class PauseSignal {
495
783
  free(): void;
@@ -501,14 +789,14 @@ export class PauseSignal {
501
789
  export class ResourceLock {
502
790
  private constructor();
503
791
  free(): void;
504
- /**
505
- * The resource this lock is for
506
- */
507
- resource(): string;
508
792
  /**
509
793
  * Utility function to be able to immediately drop the lock from JS
510
794
  */
511
795
  drop(): void;
796
+ /**
797
+ * The resource this lock is for
798
+ */
799
+ resource(): string;
512
800
  }
513
801
 
514
802
  export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
@@ -518,131 +806,137 @@ export interface InitOutput {
518
806
  readonly client_toStringified: (a: number) => any;
519
807
  readonly __wbg_client_free: (a: number, b: number) => void;
520
808
  readonly pausesignal_pause: (a: number) => void;
521
- readonly __wbg_pausesignal_free: (a: number, b: number) => void;
522
809
  readonly pausesignal_resume: (a: number) => void;
523
810
  readonly pausesignal_new: () => number;
811
+ readonly __wbg_pausesignal_free: (a: number, b: number) => void;
524
812
  readonly pausesignal_isPaused: (a: number) => number;
813
+ readonly __wbg_eventlistenerhandle_free: (a: number, b: number) => void;
525
814
  readonly filensdkerror_toString: (a: number) => [number, number];
526
815
  readonly __wbg_filensdkerror_free: (a: number, b: number) => void;
527
816
  readonly filensdkerror_kind: (a: number) => any;
528
- readonly resourcelock_drop: (a: number) => void;
529
- readonly client_lockDrive: (a: number) => any;
817
+ readonly client_getNoteHistory: (a: number, b: any) => any;
818
+ readonly client_duplicateNote: (a: number, b: any) => any;
819
+ readonly client_listNoteTags: (a: number) => any;
820
+ readonly client_renameNoteTag: (a: number, b: any, c: number, d: number) => any;
821
+ readonly client_archiveNote: (a: number, b: any) => any;
822
+ readonly client_addTagToNote: (a: number, b: any, c: any) => any;
823
+ readonly client_setNoteFavorited: (a: number, b: any, c: number) => any;
824
+ readonly client_createNote: (a: number, b: number, c: number) => any;
825
+ readonly client_listNotes: (a: number) => any;
826
+ readonly client_createNoteTag: (a: number, b: number, c: number) => any;
827
+ readonly client_deleteNoteTag: (a: number, b: any) => any;
828
+ readonly client_setNoteParticipantPermission: (a: number, b: number, c: number, d: any, e: number) => any;
829
+ readonly client_getNoteContent: (a: number, b: any) => any;
830
+ readonly client_getNote: (a: number, b: number, c: number) => any;
831
+ readonly client_setNoteType: (a: number, b: any, c: any, d: number, e: number) => any;
832
+ readonly decrypMetaWithNoteKey: (a: any, b: number, c: number) => [number, number, number, number];
833
+ readonly client_trashNote: (a: number, b: any) => any;
834
+ readonly client_setNotePinned: (a: number, b: any, c: number) => any;
835
+ readonly client_removeNoteParticipant: (a: number, b: any, c: bigint) => any;
836
+ readonly client_removeTagFromNote: (a: number, b: any, c: any) => any;
837
+ readonly client_restoreNoteFromHistory: (a: number, b: any, c: any) => any;
838
+ readonly client_restoreNote: (a: number, b: any) => any;
839
+ readonly client_deleteNote: (a: number, b: any) => any;
840
+ readonly client_setNoteTitle: (a: number, b: any, c: number, d: number) => any;
841
+ readonly client_setNoteContent: (a: number, b: any, c: number, d: number, e: number, f: number) => any;
842
+ readonly client_addNoteParticipant: (a: number, b: any, c: any, d: number) => any;
843
+ readonly client_setNoteTagFavorited: (a: number, b: any, c: number) => any;
530
844
  readonly __wbg_resourcelock_free: (a: number, b: number) => void;
531
- readonly resourcelock_resource: (a: number) => [number, number];
845
+ readonly client_lockDrive: (a: number) => any;
846
+ readonly resourcelock_drop: (a: number) => void;
532
847
  readonly client_acquireLock: (a: number, b: any) => any;
848
+ readonly resourcelock_resource: (a: number) => [number, number];
533
849
  readonly client_makeThumbnailInMemory: (a: number, b: any) => any;
534
- readonly client_getFileLinkStatus: (a: number, b: any) => any;
535
- readonly client_removeSharedLinkOut: (a: number, b: number, c: number, d: bigint) => any;
536
- readonly client_updateFileLink: (a: number, b: any, c: any) => any;
537
- readonly client_unblockContact: (a: number, b: number, c: number) => any;
538
- readonly client_listOutgoingContactRequests: (a: number) => any;
539
- readonly client_blockContact: (a: number, b: number, c: number) => any;
850
+ readonly client_sendContactRequest: (a: number, b: number, c: number) => any;
540
851
  readonly client_getDirLinkStatus: (a: number, b: any) => any;
541
- readonly client_updateDirLink: (a: number, b: any, c: any) => any;
542
- readonly client_shareDir: (a: number, b: any, c: any) => any;
543
- readonly client_deleteContact: (a: number, b: number, c: number) => any;
544
- readonly client_getBlockedContacts: (a: number) => any;
545
- readonly client_denyContactRequest: (a: number, b: number, c: number) => any;
852
+ readonly client_shareFile: (a: number, b: any, c: any) => any;
546
853
  readonly client_listInShared: (a: number, b: number) => any;
854
+ readonly client_getContacts: (a: number) => any;
855
+ readonly client_listIncomingContactRequests: (a: number) => any;
856
+ readonly client_shareDir: (a: number, b: any, c: any) => any;
857
+ readonly client_removeSharedLinkOut: (a: number, b: number, c: number, d: bigint) => any;
858
+ readonly client_getFileLinkStatus: (a: number, b: any) => any;
859
+ readonly client_removeDirLink: (a: number, b: any) => any;
547
860
  readonly client_listLinkedDir: (a: number, b: any, c: any) => any;
548
- readonly client_removeSharedLinkIn: (a: number, b: number, c: number) => any;
861
+ readonly client_deleteContact: (a: number, b: number, c: number) => any;
549
862
  readonly client_listOutShared: (a: number, b: number, c: number) => any;
550
- readonly client_listIncomingContactRequests: (a: number) => any;
551
- readonly client_publicLinkFile: (a: number, b: any) => any;
863
+ readonly client_cancelContactRequest: (a: number, b: number, c: number) => any;
552
864
  readonly client_acceptContactRequest: (a: number, b: number, c: number) => any;
553
- readonly client_removeDirLink: (a: number, b: any) => any;
554
- readonly client_getContacts: (a: number) => any;
865
+ readonly client_removeSharedLinkIn: (a: number, b: number, c: number) => any;
866
+ readonly client_listOutgoingContactRequests: (a: number) => any;
867
+ readonly client_publicLinkFile: (a: number, b: any) => any;
868
+ readonly client_getBlockedContacts: (a: number) => any;
869
+ readonly client_denyContactRequest: (a: number, b: number, c: number) => any;
870
+ readonly client_updateFileLink: (a: number, b: any, c: any) => any;
871
+ readonly client_updateDirLink: (a: number, b: any, c: any) => any;
555
872
  readonly client_publicLinkDir: (a: number, b: any) => any;
556
- readonly client_shareFile: (a: number, b: any, c: any) => any;
557
- readonly client_sendContactRequest: (a: number, b: number, c: number) => any;
558
- readonly client_cancelContactRequest: (a: number, b: number, c: number) => any;
559
- readonly login: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
873
+ readonly client_unblockContact: (a: number, b: number, c: number) => any;
874
+ readonly client_blockContact: (a: number, b: number, c: number) => any;
560
875
  readonly fromStringified: (a: any) => [number, number, number];
561
876
  readonly main_js: () => void;
562
- readonly client_root: (a: number) => any;
563
- readonly client_getDirSize: (a: number, b: any) => any;
877
+ readonly login: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
878
+ readonly client_updateDirMetadata: (a: number, b: any, c: any) => any;
564
879
  readonly client_getDir: (a: number, b: number, c: number) => any;
880
+ readonly client_deleteDirPermanently: (a: number, b: any) => any;
881
+ readonly client_listDirRecursive: (a: number, b: any) => any;
882
+ readonly client_root: (a: number) => any;
883
+ readonly client_trashDir: (a: number, b: any) => any;
565
884
  readonly client_setDirColor: (a: number, b: any, c: any) => any;
566
- readonly client_dirExists: (a: number, b: any, c: number, d: number) => any;
567
- readonly client_listFavorites: (a: number) => any;
568
- readonly client_updateDirMetadata: (a: number, b: any, c: any) => any;
569
885
  readonly client_createDir: (a: number, b: any, c: number, d: number) => any;
886
+ readonly client_listRecents: (a: number) => any;
887
+ readonly client_dirExists: (a: number, b: any, c: number, d: number) => any;
570
888
  readonly client_listDir: (a: number, b: any) => any;
571
- readonly client_deleteDirPermanently: (a: number, b: any) => any;
572
- readonly client_trashDir: (a: number, b: any) => any;
889
+ readonly client_listFavorites: (a: number) => any;
573
890
  readonly client_findItemInDir: (a: number, b: any, c: number, d: number) => any;
574
- readonly client_listRecents: (a: number) => any;
575
- readonly client_listDirRecursive: (a: number, b: any) => any;
576
- readonly client_createNote: (a: number, b: number, c: number) => any;
577
- readonly client_getNote: (a: number, b: number, c: number) => any;
578
- readonly client_addTagToNote: (a: number, b: any, c: any) => any;
579
- readonly client_listNoteTags: (a: number) => any;
580
- readonly client_addNoteParticipant: (a: number, b: any, c: any, d: number) => any;
581
- readonly client_restoreNoteFromHistory: (a: number, b: any, c: any) => any;
582
- readonly client_trashNote: (a: number, b: any) => any;
583
- readonly client_setNotePinned: (a: number, b: any, c: number) => any;
584
- readonly client_setNoteParticipantPermission: (a: number, b: number, c: number, d: any, e: number) => any;
585
- readonly client_setNoteTitle: (a: number, b: any, c: number, d: number) => any;
586
- readonly client_getNoteHistory: (a: number, b: any) => any;
587
- readonly client_createNoteTag: (a: number, b: number, c: number) => any;
588
- readonly client_renameNoteTag: (a: number, b: any, c: number, d: number) => any;
589
- readonly client_listNotes: (a: number) => any;
590
- readonly client_archiveNote: (a: number, b: any) => any;
591
- readonly client_restoreNote: (a: number, b: any) => any;
592
- readonly client_setNoteType: (a: number, b: any, c: any, d: number, e: number) => any;
593
- readonly client_duplicateNote: (a: number, b: any) => any;
594
- readonly client_setNoteContent: (a: number, b: any, c: number, d: number, e: number, f: number) => any;
595
- readonly client_getNoteContent: (a: number, b: any) => any;
596
- readonly client_setNoteFavorited: (a: number, b: any, c: number) => any;
597
- readonly client_deleteNoteTag: (a: number, b: any) => any;
598
- readonly client_deleteNote: (a: number, b: any) => any;
599
- readonly client_removeNoteParticipant: (a: number, b: any, c: bigint) => any;
600
- readonly client_setNoteTagFavorited: (a: number, b: any, c: number) => any;
601
- readonly client_removeTagFromNote: (a: number, b: any, c: any) => any;
602
- readonly client_findItemMatchesForName: (a: number, b: number, c: number) => any;
603
- readonly client_listChats: (a: number) => any;
604
- readonly client_getAllChatsUnreadCount: (a: number) => any;
605
- readonly client_disableMessageEmbed: (a: number, b: any) => any;
891
+ readonly client_getDirSize: (a: number, b: any) => any;
892
+ readonly client_getChat: (a: number, b: number, c: number) => any;
893
+ readonly client_sendTypingSignal: (a: number, b: any, c: any) => any;
606
894
  readonly client_updateChatOnlineStatus: (a: number, b: any) => any;
895
+ readonly client_getAllChatsUnreadCount: (a: number) => any;
607
896
  readonly client_getChatUnreadCount: (a: number, b: any) => any;
608
- readonly client_addChatParticipant: (a: number, b: any, c: any) => any;
609
- readonly client_leaveChat: (a: number, b: any) => any;
610
- readonly client_sendChatMessage: (a: number, b: any, c: number, d: number, e: number) => any;
897
+ readonly client_createChat: (a: number, b: number, c: number) => any;
898
+ readonly client_listChats: (a: number) => any;
899
+ readonly decryptMetaWithChatKey: (a: any, b: number, c: number) => [number, number, number, number];
900
+ readonly client_listMessages: (a: number, b: any) => any;
611
901
  readonly client_renameChat: (a: number, b: any, c: number, d: number) => any;
612
- readonly client_getChat: (a: number, b: number, c: number) => any;
613
- readonly client_updateLastChatFocusTimesNow: (a: number, b: number, c: number) => any;
902
+ readonly client_removeChatParticipant: (a: number, b: any, c: any) => any;
614
903
  readonly client_deleteChat: (a: number, b: any) => any;
615
- readonly client_editMessage: (a: number, b: any, c: any, d: number, e: number) => any;
904
+ readonly client_muteChat: (a: number, b: any, c: number) => any;
905
+ readonly client_sendChatMessage: (a: number, b: any, c: number, d: number, e: number) => any;
906
+ readonly client_addChatParticipant: (a: number, b: any, c: any) => any;
616
907
  readonly client_listMessagesBefore: (a: number, b: any, c: bigint) => any;
617
- readonly client_sendTypingSignal: (a: number, b: any, c: any) => any;
908
+ readonly client_disableMessageEmbed: (a: number, b: any) => any;
909
+ readonly client_editMessage: (a: number, b: any, c: any, d: number, e: number) => any;
618
910
  readonly client_deleteMessage: (a: number, b: any, c: any) => any;
619
- readonly client_listMessages: (a: number, b: any) => any;
620
- readonly client_createChat: (a: number, b: number, c: number) => any;
621
- readonly client_muteChat: (a: number, b: any, c: number) => any;
911
+ readonly client_updateLastChatFocusTimesNow: (a: number, b: number, c: number) => any;
912
+ readonly client_leaveChat: (a: number, b: any) => any;
622
913
  readonly client_markChatRead: (a: number, b: any) => any;
623
- readonly client_removeChatParticipant: (a: number, b: any, c: any) => any;
624
- readonly client_uploadFile: (a: number, b: number, c: number, d: any) => any;
625
- readonly client_updateFileMetadata: (a: number, b: any, c: any) => any;
626
- readonly client_getFile: (a: number, b: number, c: number) => any;
627
- readonly client_deleteFilePermanently: (a: number, b: any) => any;
628
- readonly client_uploadFileFromReader: (a: number, b: any) => any;
914
+ readonly client_isSocketConnected: (a: number) => number;
915
+ readonly client_addSocketListener: (a: number, b: number, c: number, d: any) => any;
916
+ readonly client_decryptMeta: (a: number, b: number, c: number) => [number, number, number, number];
917
+ readonly client_findItemMatchesForName: (a: number, b: number, c: number) => any;
629
918
  readonly client_downloadFile: (a: number, b: any) => any;
630
- readonly client_trashFile: (a: number, b: any) => any;
631
919
  readonly client_downloadFileToWriter: (a: number, b: any) => any;
920
+ readonly client_getFile: (a: number, b: number, c: number) => any;
921
+ readonly client_updateFileMetadata: (a: number, b: any, c: any) => any;
922
+ readonly client_trashFile: (a: number, b: any) => any;
923
+ readonly client_uploadFileFromReader: (a: number, b: any) => any;
924
+ readonly client_uploadFile: (a: number, b: number, c: number, d: any) => any;
925
+ readonly client_deleteFilePermanently: (a: number, b: any) => any;
632
926
  readonly client_setFavorite: (a: number, b: any, c: number) => any;
633
927
  readonly client_downloadItemsToZip: (a: number, b: any) => any;
634
- readonly intounderlyingbytesource_type: (a: number) => number;
635
- readonly intounderlyingbytesource_start: (a: number, b: any) => void;
636
928
  readonly intounderlyingbytesource_cancel: (a: number) => void;
637
929
  readonly intounderlyingbytesource_pull: (a: number, b: any) => any;
638
- readonly __wbg_intounderlyingbytesource_free: (a: number, b: number) => void;
930
+ readonly intounderlyingbytesource_type: (a: number) => number;
639
931
  readonly intounderlyingbytesource_autoAllocateChunkSize: (a: number) => number;
640
- readonly intounderlyingsource_pull: (a: number, b: any) => any;
932
+ readonly intounderlyingbytesource_start: (a: number, b: any) => void;
933
+ readonly __wbg_intounderlyingbytesource_free: (a: number, b: number) => void;
641
934
  readonly __wbg_intounderlyingsource_free: (a: number, b: number) => void;
935
+ readonly intounderlyingsource_pull: (a: number, b: any) => any;
642
936
  readonly intounderlyingsource_cancel: (a: number) => void;
643
- readonly __wbg_intounderlyingsink_free: (a: number, b: number) => void;
644
937
  readonly intounderlyingsink_write: (a: number, b: any) => any;
645
938
  readonly intounderlyingsink_abort: (a: number, b: any) => any;
939
+ readonly __wbg_intounderlyingsink_free: (a: number, b: number) => void;
646
940
  readonly intounderlyingsink_close: (a: number) => any;
647
941
  readonly __wbindgen_malloc: (a: number, b: number) => number;
648
942
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
@@ -653,10 +947,11 @@ export interface InitOutput {
653
947
  readonly __externref_drop_slice: (a: number, b: number) => void;
654
948
  readonly __wbindgen_export_7: WebAssembly.Table;
655
949
  readonly __externref_table_dealloc: (a: number) => void;
656
- readonly wasm_bindgen__convert__closures_____invoke__hbe2051c1baa1d7ae: (a: number, b: number) => void;
657
- readonly closure1428_externref_shim: (a: number, b: number, c: any) => void;
950
+ readonly closure33_externref_shim: (a: number, b: number, c: any) => void;
951
+ readonly wasm_bindgen__convert__closures_____invoke__h867acc2d5ad1a3d8: (a: number, b: number) => void;
952
+ readonly closure1529_externref_shim: (a: number, b: number, c: any) => void;
658
953
  readonly wasm_bindgen__convert__closures_____invoke__hfc6a9985192cba1d: (a: number, b: number) => void;
659
- readonly closure1580_externref_shim: (a: number, b: number, c: any, d: any) => void;
954
+ readonly closure1682_externref_shim: (a: number, b: number, c: any, d: any) => void;
660
955
  readonly __wbindgen_start: () => void;
661
956
  }
662
957