How to use the @shd101wyy/mume.utility.uploadImage function in @shd101wyy/mume

To help you get started, we’ve selected a few @shd101wyy/mume examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github shd101wyy / vscode-markdown-preview-enhanced / src / image-helper.ts View on Github external
const hint = `![Uploading ${imageFileName}… (${uid})]()`;
      const curPos = editor.selection.active;

      editor.edit((textEditorEdit) => {
        textEditorEdit.insert(curPos, hint);
      });

      const config = vscode.workspace.getConfiguration(
        "markdown-preview-enhanced",
      );
      const AccessKey = config.get("AccessKey") || "";
      const SecretKey = config.get("SecretKey") || "";
      const Bucket = config.get("Bucket") || "";
      const Domain = config.get("Domain") || "";

      utility
        .uploadImage(imageFilePath, {
          method: imageUploader,
          qiniu: { AccessKey, SecretKey, Bucket, Domain },
        })
        .then((url) => {
          setUploadedImageURL(imageFileName, url, editor, hint, curPos);
        })
        .catch((error) => {
          vscode.window.showErrorMessage(error.toString());
        });
    });
}