@filen/sdk-rs 0.2.2 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,130 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ export function from_serialized(serialized: StringifiedClient): FilenState;
4
+ export function main_js(): void;
5
+ export function login(email: string, password: string, two_factor_code?: string | null): Promise<FilenState>;
6
+ /**
7
+ * Chroma subsampling format
8
+ */
9
+ export enum ChromaSampling {
10
+ /**
11
+ * Both vertically and horizontally subsampled.
12
+ */
13
+ Cs420 = 0,
14
+ /**
15
+ * Horizontally subsampled.
16
+ */
17
+ Cs422 = 1,
18
+ /**
19
+ * Not subsampled.
20
+ */
21
+ Cs444 = 2,
22
+ /**
23
+ * Monochrome.
24
+ */
25
+ Cs400 = 3,
26
+ }
27
+ /**
28
+ * The `ReadableStreamType` enum.
29
+ *
30
+ * *This API requires the following crate features to be activated: `ReadableStreamType`*
31
+ */
32
+ type ReadableStreamType = "bytes";
33
+ export interface DownloadFileStreamParams {
34
+ writer: WritableStream<Uint8Array>;
35
+ progress?: (bytes: bigint) => void;
36
+ }
37
+
38
+ export interface FileMeta {
39
+ name: string;
40
+ mime: string;
41
+ created: Date | undefined;
42
+ modified: Date;
43
+ hash: Uint8Array | undefined;
44
+ }
45
+
46
+ export interface UploadFileStreamParams extends UploadFileParams {
47
+ reader: ReadableStream<Uint8Array>;
48
+ known_size?: bigint;
49
+ progress?: (bytes: bigint) => void;
50
+ }
51
+
52
+ export interface DirMeta {
53
+ name: string;
54
+ created: Date | undefined;
55
+ }
56
+
57
+ export interface UploadFileParams {
58
+ name: string;
59
+ created?: Date;
60
+ modified?: Date;
61
+ mime?: string;
62
+ }
63
+
64
+ export interface StringifiedClient {
65
+ email: string;
66
+ rootUuid: string;
67
+ authInfo: string;
68
+ privateKey: string;
69
+ apiKey: string;
70
+ authVersion: number;
71
+ }
72
+
73
+ export class Dir {
74
+ private constructor();
75
+ free(): void;
76
+ readonly color: string;
77
+ readonly uuid: string;
78
+ readonly favorited: boolean;
79
+ readonly parent: string;
80
+ readonly meta: DirMeta | undefined;
81
+ }
82
+ export class File {
83
+ private constructor();
84
+ free(): void;
85
+ readonly uuid: string;
86
+ readonly favorited: boolean;
87
+ readonly parent: string;
88
+ readonly meta: FileMeta | undefined;
89
+ readonly size: bigint;
90
+ }
91
+ export class FilenState {
92
+ private constructor();
93
+ free(): void;
94
+ serialize(): StringifiedClient;
95
+ createDir(parent: Dir, name: string): Promise<Dir>;
96
+ dirExists(parent: Dir, name: string): Promise<void>;
97
+ listDir(dir: Dir): Promise<[Dir[], File[]]>;
98
+ root(): Dir;
99
+ findItemInDir(dir: Dir, name_or_uuid: string): Promise<Dir | File | undefined>;
100
+ deleteDirPermanently(dir: Dir): Promise<void>;
101
+ trashDir(dir: Dir): Promise<void>;
102
+ uploadFileStream(parent: Dir, params: UploadFileStreamParams): Promise<File>;
103
+ uploadFile(parent: Dir, data: Uint8Array, params: UploadFileParams): Promise<File>;
104
+ downloadFile(file: File): Promise<Uint8Array>;
105
+ trashFile(file: File): Promise<void>;
106
+ downloadFileToWriter(file: File, params: DownloadFileStreamParams): Promise<void>;
107
+ deleteFilePermanently(file: File): Promise<void>;
108
+ }
109
+ export class IntoUnderlyingByteSource {
110
+ private constructor();
111
+ free(): void;
112
+ pull(controller: ReadableByteStreamController): Promise<any>;
113
+ start(controller: ReadableByteStreamController): void;
114
+ cancel(): void;
115
+ readonly type: ReadableStreamType;
116
+ readonly autoAllocateChunkSize: number;
117
+ }
118
+ export class IntoUnderlyingSink {
119
+ private constructor();
120
+ free(): void;
121
+ close(): Promise<any>;
122
+ write(chunk: any): Promise<any>;
123
+ abort(reason: any): Promise<any>;
124
+ }
125
+ export class IntoUnderlyingSource {
126
+ private constructor();
127
+ free(): void;
128
+ pull(controller: ReadableStreamDefaultController): Promise<any>;
129
+ cancel(): void;
130
+ }
@@ -0,0 +1,5 @@
1
+ import * as wasm from "./sdk-rs_bg.wasm";
2
+ export * from "./sdk-rs_bg.js";
3
+ import { __wbg_set_wasm } from "./sdk-rs_bg.js";
4
+ __wbg_set_wasm(wasm);
5
+ wasm.__wbindgen_start();