-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathmodels.ts
More file actions
37 lines (29 loc) · 981 Bytes
/
models.ts
File metadata and controls
37 lines (29 loc) · 981 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
* Copyright (c) 2023-2026 LabKey Corporation
*
* Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
*/
import { immerable } from "immer";
import { Map } from "immutable";
export class FileAttachmentModel {
[immerable] = true;
readonly filesToUpload?: Map<string, File>; // to upload files to the server
readonly savedFiles?: Array<SavedFileModel>; // to get uploaded file props from the server
constructor(values?: Partial<FileAttachmentModel>) {
Object.assign(this, values);
}
static create(raw?: any): FileAttachmentModel {
return new FileAttachmentModel({ ...raw });
}
}
export class SavedFileModel {
[immerable] = true;
readonly href: string;
readonly fileName: string;
constructor(values?: Partial<SavedFileModel>) {
Object.assign(this, values);
}
static create(raw?: any): SavedFileModel {
return new SavedFileModel({ ...raw });
}
}