blockPasteFromStorageShortcut(typeErrorCallback) {
    /** @type {!Blockly.ShortcutRegistry.KeyboardShortcut} */
    const pasteShortcut = {
      name: 'paste',
      preconditionFn: function (workspace) {
        if (workspace.options.readOnly || Blockly.Gesture.inProgress()) {
          return false;
        }
        const copyData = JSON.parse(localStorage.getItem('blocklyStash'));
        if (!copyData || !workspace.isCapacityAvailable(copyData.typeCounts)) {
          return false;
        }
        return true;
      },
      callback: function (workspace, e) {
        // Prevent the default copy behavior,
        // which may beep or otherwise indicate
        // an error due to the lack of a selection.
        e.preventDefault();
        const copyData = JSON.parse(localStorage.getItem('blocklyStash'));
        try {
          Blockly.clipboard.paste(copyData, workspace);
        } catch (e) {
          if (e instanceof TypeError && typeErrorCallback) {
            typeErrorCallback();
          } else {
            throw e;
          }
        }
        return true;
      },
    };
    Blockly.ShortcutRegistry.registry.register(pasteShortcut);

    const ctrlV = Blockly.ShortcutRegistry.registry.createSerializedKey(
      Blockly.utils.KeyCodes.V,
      [Blockly.utils.KeyCodes.CTRL],
    );
    Blockly.ShortcutRegistry.registry.addKeyMapping(ctrlV, pasteShortcut.name);

    const altV = Blockly.ShortcutRegistry.registry.createSerializedKey(
      Blockly.utils.KeyCodes.V,
      [Blockly.utils.KeyCodes.ALT],
    );
    Blockly.ShortcutRegistry.registry.addKeyMapping(altV, pasteShortcut.name);

    const metaV = Blockly.ShortcutRegistry.registry.createSerializedKey(
      Blockly.utils.KeyCodes.V,
      [Blockly.utils.KeyCodes.META],
    );
    Blockly.ShortcutRegistry.registry.addKeyMapping(metaV, pasteShortcut.name);
  }
Adds a keyboard shortcut that will paste the block stored in localStorage.
@param {Function=} typeErrorCallback
callback function to handle type errors