1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import { unionize, ofType, UnionOf } from "~/common/unionize";
6 import { Dispatch } from "redux";
7 import { RootState } from '~/store/store';
9 export interface UploadFile {
20 export const fileUploaderActions = unionize({
21 CLEAR_UPLOAD: ofType(),
22 SET_UPLOAD_FILES: ofType<File[]>(),
23 UPDATE_UPLOAD_FILES: ofType<File[]>(),
24 SET_UPLOAD_PROGRESS: ofType<{ fileId: number, loaded: number, total: number, currentTime: number }>(),
25 START_UPLOAD: ofType(),
28 export type FileUploaderAction = UnionOf<typeof fileUploaderActions>;
30 export const getFileUploaderState = () => (dispatch: Dispatch, getState: () => RootState) => {
31 return getState().fileUploader;