nashaofu / screenshots

A screenshot plugin for electron and react
https://nashaofu.github.io/screenshots/
MIT License
393 stars 99 forks source link

feat: add afterSave event #218

Closed ArcherGu closed 1 year ago

ArcherGu commented 1 year ago

增加了 afterSave 事件:

  // 保存后的回调事件
  screenshots.on("afterSave", (e, buffer, bounds, isSaved) => {
    console.log("capture", buffer, bounds);
    console.log("isSaved", isSaved) // 是否保存成功
  });

渲染层可能会需要是否保存成功的情况,比如微信的截图保存后,会弹出来“已保存”(取消保存的话就不显示了)