@verdocs/js-sdk 1.1.13 → 1.1.17
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/Documents/Initials.d.ts +2 -2
- package/Templates/Types.d.ts +7 -7
- package/Utils/Files.d.ts +12 -0
- package/Utils/Files.js +25 -0
- package/Utils/index.d.ts +1 -0
- package/Utils/index.js +1 -0
- package/package.json +1 -1
package/Documents/Initials.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ export interface IInitials {
|
|
|
2
2
|
id?: string;
|
|
3
3
|
profile_id: string;
|
|
4
4
|
url: string;
|
|
5
|
-
created_at?:
|
|
6
|
-
updated_at?:
|
|
5
|
+
created_at?: string;
|
|
6
|
+
updated_at?: string;
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
9
|
* Create an initials block. In a typical signing workflow, the user is asked at the beginning of the process to "adopt"
|
package/Templates/Types.d.ts
CHANGED
|
@@ -8,9 +8,9 @@ export interface ITemplate {
|
|
|
8
8
|
name: string;
|
|
9
9
|
id?: string;
|
|
10
10
|
profile_id?: string;
|
|
11
|
-
created_at?:
|
|
12
|
-
updated_at?:
|
|
13
|
-
last_used_at?:
|
|
11
|
+
created_at?: string;
|
|
12
|
+
updated_at?: string;
|
|
13
|
+
last_used_at?: string;
|
|
14
14
|
token?: string;
|
|
15
15
|
reminder_id?: string;
|
|
16
16
|
reminder?: IReminder;
|
|
@@ -117,7 +117,7 @@ export interface ITag {
|
|
|
117
117
|
export interface ITags {
|
|
118
118
|
name: string;
|
|
119
119
|
featured?: boolean;
|
|
120
|
-
created_at?:
|
|
120
|
+
created_at?: string;
|
|
121
121
|
}
|
|
122
122
|
export interface IStar {
|
|
123
123
|
template_id: string;
|
|
@@ -141,8 +141,8 @@ export interface ITemplateAsset {
|
|
|
141
141
|
name: string;
|
|
142
142
|
page_numbers: number;
|
|
143
143
|
id?: string;
|
|
144
|
-
updated_at?:
|
|
145
|
-
created_at?:
|
|
144
|
+
updated_at?: string;
|
|
145
|
+
created_at?: string;
|
|
146
146
|
template_id: string;
|
|
147
147
|
mime: string;
|
|
148
148
|
thumbnail_url: string;
|
|
@@ -188,7 +188,7 @@ export interface IPage {
|
|
|
188
188
|
}
|
|
189
189
|
export interface IReminder {
|
|
190
190
|
id?: string;
|
|
191
|
-
created_at?:
|
|
191
|
+
created_at?: string;
|
|
192
192
|
is_on: boolean;
|
|
193
193
|
setup_time: number;
|
|
194
194
|
interval_time: number;
|
package/Utils/Files.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface FileWithData {
|
|
2
|
+
lastModified: number;
|
|
3
|
+
size: number;
|
|
4
|
+
type: string;
|
|
5
|
+
name: string;
|
|
6
|
+
data: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Given a File, extract the file's content as a base64 encoded data URL. The response will have a prefix that
|
|
10
|
+
* includes the MIME type of the file, e.g. "data:image/jpeg;base64,iVBORw0K......"
|
|
11
|
+
*/
|
|
12
|
+
export declare const fileToDataUrl: (file: File) => Promise<FileWithData>;
|
package/Utils/Files.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Given a File, extract the file's content as a base64 encoded data URL. The response will have a prefix that
|
|
3
|
+
* includes the MIME type of the file, e.g. "data:image/jpeg;base64,iVBORw0K......"
|
|
4
|
+
*/
|
|
5
|
+
export var fileToDataUrl = function (file) {
|
|
6
|
+
return new Promise(function (resolve, reject) {
|
|
7
|
+
var reader = new FileReader();
|
|
8
|
+
reader.onload = function () {
|
|
9
|
+
return resolve({
|
|
10
|
+
lastModified: file.lastModified,
|
|
11
|
+
size: file.size,
|
|
12
|
+
type: file.type,
|
|
13
|
+
name: file.name,
|
|
14
|
+
data: reader.result,
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
reader.onerror = reject;
|
|
18
|
+
if (file) {
|
|
19
|
+
reader.readAsDataURL(file);
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
reject(new Error('Invalid file'));
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
};
|
package/Utils/index.d.ts
CHANGED
package/Utils/index.js
CHANGED