Skip to content

Instantly share code, notes, and snippets.

@lucasfernog
Created July 3, 2020 20:42
Show Gist options
  • Save lucasfernog/8f7b29cadd91d92ee2cf816a20c2ef01 to your computer and use it in GitHub Desktop.
Save lucasfernog/8f7b29cadd91d92ee2cf816a20c2ef01 to your computer and use it in GitHub Desktop.
Map window.tauri to window.__TAURI__
window.tauri = {
invoke: window.__TAURI__.invoke,
promisified: window.__TAURI__.promisified,
transformCallback: window.__TAURI__.transformCallback,
listen: window.__TAURI__.event.listen,
emit: window.__TAURI__.event.emit,
Dir: window.__TAURI__.fs.Dir,
readTextFile: window.__TAURI__.fs.readTextFile,
readBinaryFile: window.__TAURI__.fs.readBinaryFile,
writeFile: window.__TAURI__.fs.writeFile,
writeBinaryFile: window.__TAURI__.fs.writeBinaryFile,
readDir: window.__TAURI__.fs.readDir,
createDir: window.__TAURI__.fs.createDir,
removeDir: window.__TAURI__.fs.removeDir,
copyFile: window.__TAURI__.fs.copyFile,
removeFile: window.__TAURI__.fs.removeFile,
renameFile: window.__TAURI__.fs.renameFile,
setTitle: window.__TAURI__.window.setTitle,
open: window.__TAURI__.window.open,
execute: window.__TAURI__.process.execute,
openDialog: window.__TAURI__.dialog.open,
saveDialog: window.__TAURI__.dialog.save,
httpRequest: window.__TAURI__.http.request,
notification: window.__TAURI__.notification.sendNotification,
isNotificationPermissionGranted: window.__TAURI__.notification.isPermissionGranted,
requestNotificationPermission: window.__TAURI__.notification.requestPermission,
loadAsset: window.__TAURI__.loadAsset,
cliMatches: window.__TAURI__.cli.getMatches,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment