@filen/sdk-rs 0.2.2 → 0.2.4
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/browser/sdk-rs.d.ts +130 -0
- package/browser/sdk-rs.js +5 -0
- package/browser/sdk-rs_bg.js +1558 -0
- package/browser/sdk-rs_bg.wasm +0 -0
- package/browser/sdk-rs_bg.wasm.d.ts +58 -0
- package/package.json +1 -1
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
export function from_serialized(serialized: StringifiedClient): FilenState;
|
|
4
|
+
export function login(email: string, password: string, two_factor_code?: string | null): Promise<FilenState>;
|
|
5
|
+
export function main_js(): void;
|
|
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 UploadFileStreamParams extends UploadFileParams {
|
|
34
|
+
reader: ReadableStream<Uint8Array>;
|
|
35
|
+
known_size?: bigint;
|
|
36
|
+
progress?: (bytes: bigint) => void;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface FileMeta {
|
|
40
|
+
name: string;
|
|
41
|
+
mime: string;
|
|
42
|
+
created: Date | undefined;
|
|
43
|
+
modified: Date;
|
|
44
|
+
hash: Uint8Array | undefined;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface DownloadFileStreamParams {
|
|
48
|
+
writer: WritableStream<Uint8Array>;
|
|
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 parent: string;
|
|
77
|
+
readonly favorited: boolean;
|
|
78
|
+
readonly uuid: string;
|
|
79
|
+
readonly color: string;
|
|
80
|
+
readonly meta: DirMeta | undefined;
|
|
81
|
+
}
|
|
82
|
+
export class File {
|
|
83
|
+
private constructor();
|
|
84
|
+
free(): void;
|
|
85
|
+
readonly meta: FileMeta | undefined;
|
|
86
|
+
readonly parent: string;
|
|
87
|
+
readonly uuid: string;
|
|
88
|
+
readonly size: bigint;
|
|
89
|
+
readonly favorited: boolean;
|
|
90
|
+
}
|
|
91
|
+
export class FilenState {
|
|
92
|
+
private constructor();
|
|
93
|
+
free(): void;
|
|
94
|
+
serialize(): StringifiedClient;
|
|
95
|
+
findItemInDir(dir: Dir, name_or_uuid: string): Promise<Dir | File | undefined>;
|
|
96
|
+
dirExists(parent: Dir, name: string): Promise<void>;
|
|
97
|
+
deleteDirPermanently(dir: Dir): Promise<void>;
|
|
98
|
+
trashDir(dir: Dir): Promise<void>;
|
|
99
|
+
root(): Dir;
|
|
100
|
+
createDir(parent: Dir, name: string): Promise<Dir>;
|
|
101
|
+
listDir(dir: Dir): Promise<[Dir[], File[]]>;
|
|
102
|
+
uploadFileStream(parent: Dir, params: UploadFileStreamParams): Promise<File>;
|
|
103
|
+
trashFile(file: File): Promise<void>;
|
|
104
|
+
downloadFile(file: File): Promise<Uint8Array>;
|
|
105
|
+
downloadFileToWriter(file: File, params: DownloadFileStreamParams): Promise<void>;
|
|
106
|
+
deleteFilePermanently(file: File): Promise<void>;
|
|
107
|
+
uploadFile(parent: Dir, data: Uint8Array, params: UploadFileParams): Promise<File>;
|
|
108
|
+
}
|
|
109
|
+
export class IntoUnderlyingByteSource {
|
|
110
|
+
private constructor();
|
|
111
|
+
free(): void;
|
|
112
|
+
cancel(): void;
|
|
113
|
+
pull(controller: ReadableByteStreamController): Promise<any>;
|
|
114
|
+
start(controller: ReadableByteStreamController): 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
|
+
cancel(): void;
|
|
129
|
+
pull(controller: ReadableStreamDefaultController): Promise<any>;
|
|
130
|
+
}
|