import type { Module } from 'vuex';

export const workflow: Module<Record<string, any>, Record<string, any>> = {
  namespaced: true,
  state: {
    designerNodes: new Map(),
  },
  mutations: {
    setDesignerNodes(state, nodes: Record<string, any>) {
      state.designerNodes.set(nodes.key, nodes.list);
    },
    getDesignerNodes(state, key: string): Record<string, any> {
      return state.mapParams.get(key);
    },
    delDesignerNodes(state, key: string): Record<string, any> {
      return state.mapParams.delete(key);
    },
  },
};
