handleLoadTypeForm = ({ paramObject: { mode, id, output } }) => {

  const outTRef = output;
  const type = (mode === 'manage-edge-types' ? EdgeType.getInstance(id) : NodeType.getInstance(id));

  // inject all the type data as fields into the dialog output
  type.save(outTRef, true);

  // fields that need preprocessing

  if (mode === 'manage-edge-types') {
    const usage = $tm.adapter.selectEdgesByType(type);
    const count = Object.keys(usage).length;
    utils.setField(outTRef, 'temp.usageCount', count);
  }

  $tw.wiki.addTiddler(new $tw.Tiddler(
    utils.getTiddler(outTRef),
    {
      'typeTRef': type.fullPath,
      'temp.idImmutable': (type.isShipped ? 'true' : ''),
      'temp.newId': type.id,
      'inherited-style':
        JSON.stringify(
          (mode === 'manage-edge-types'
            ? $tm.config.vis.edges
            : $tm.config.vis.nodes
          ) || {}
        )
    }
  ));

  // reset the tabs to default
  utils.deleteByPrefix('$:/state/tabs/MapElementTypeManager');

}
@param {string} id - The id of a {@link MapElementType}
@param {('manage-edge-types'|'manage-node-types')} mode
@param {TiddlerReference} output