merge master
[arvados.git] / src / store / file-uploader / file-uploader-actions.ts
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import { unionize, ofType, UnionOf } from "~/common/unionize";
6
7 export interface UploadFile {
8     id: number;
9     file: File;
10     prevLoaded: number;
11     loaded: number;
12     total: number;
13     startTime: number;
14     prevTime: number;
15     currentTime: number;
16 }
17
18 export const fileUploaderActions = unionize({
19     CLEAR_UPLOAD: ofType(),
20     SET_UPLOAD_FILES: ofType<File[]>(),
21     SET_UPLOAD_PROGRESS: ofType<{ fileId: number, loaded: number, total: number, currentTime: number }>(),
22     START_UPLOAD: ofType(),
23 });
24
25 export type FileUploaderAction = UnionOf<typeof fileUploaderActions>;