0385766f5fc76f9d055a933dcb0ad461ef1b5812
[arvados-workbench2.git] / src / store / tree-picker / tree-picker-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 import { TreeNode } from '~/models/tree';
7
8
9 export const treePickerActions = unionize({
10     LOAD_TREE_PICKER_NODE: ofType<{ id: string, pickerId: string }>(),
11     LOAD_TREE_PICKER_NODE_SUCCESS: ofType<{ id: string, nodes: Array<TreeNode<any>>, pickerId: string }>(),
12     TOGGLE_TREE_PICKER_NODE_COLLAPSE: ofType<{ id: string, pickerId: string }>(),
13     ACTIVATE_TREE_PICKER_NODE: ofType<{ id: string, pickerId: string }>(),
14     TOGGLE_TREE_PICKER_NODE_SELECTION: ofType<{ id: string, pickerId: string }>(),
15     EXPAND_TREE_PICKER_NODES: ofType<{ ids: string[], pickerId: string }>(),
16     RESET_TREE_PICKER: ofType<{ pickerId: string }>()
17 });
18
19 export type TreePickerAction = UnionOf<typeof treePickerActions>;