code: function addStackSpecificToolState(element, toolType, data) {
      // If this is a tool type to apply to the stack, do so
      if (toolTypes.indexOf(toolType) >= 0) {
        // If we don't have tool state for this type of tool, add an empty object
        if (toolState.hasOwnProperty(toolType) === false) {
          toolState[toolType] = {
            data: [],
          };
        }
  
        const toolData = toolState[toolType];
  
        // Finally, add this new tool to the state
        toolData.data.push(data);
      } else {
        // Call the imageId specific tool state manager
        return oldStateManager.add(element, toolType, data);
      }
    }
docs: Here we add tool state, this is done by tools as well As modules that restore saved state