1- import { promisified } from './tauri'
1+ import { invoke } from './tauri'
22
33export enum BaseDirectory {
44 Audio = 1 ,
@@ -61,8 +61,8 @@ async function readTextFile(
6161 filePath : string ,
6262 options : FsOptions = { }
6363) : Promise < string > {
64- return await promisified < string > ( {
65- module : 'Fs' ,
64+ return await invoke < string > ( {
65+ __tauriModule : 'Fs' ,
6666 message : {
6767 cmd : 'readTextFile' ,
6868 path : filePath ,
@@ -83,8 +83,8 @@ async function readBinaryFile(
8383 filePath : string ,
8484 options : FsOptions = { }
8585) : Promise < number [ ] > {
86- return await promisified < number [ ] > ( {
87- module : 'Fs' ,
86+ return await invoke < number [ ] > ( {
87+ __tauriModule : 'Fs' ,
8888 message : {
8989 cmd : 'readBinaryFile' ,
9090 path : filePath ,
@@ -114,8 +114,8 @@ async function writeFile(
114114 Object . freeze ( file )
115115 }
116116
117- return await promisified ( {
118- module : 'Fs' ,
117+ return await invoke < void > ( {
118+ __tauriModule : 'Fs' ,
119119 message : {
120120 cmd : 'writeFile' ,
121121 path : file . path ,
@@ -179,8 +179,8 @@ async function writeBinaryFile(
179179 Object . freeze ( file )
180180 }
181181
182- return await promisified ( {
183- module : 'Fs' ,
182+ return await invoke < void > ( {
183+ __tauriModule : 'Fs' ,
184184 message : {
185185 cmd : 'writeBinaryFile' ,
186186 path : file . path ,
@@ -203,8 +203,8 @@ async function readDir(
203203 dir : string ,
204204 options : FsDirOptions = { }
205205) : Promise < FileEntry [ ] > {
206- return await promisified ( {
207- module : 'Fs' ,
206+ return await invoke < void > ( {
207+ __tauriModule : 'Fs' ,
208208 message : {
209209 cmd : 'readDir' ,
210210 path : dir ,
@@ -228,8 +228,8 @@ async function createDir(
228228 dir : string ,
229229 options : FsDirOptions = { }
230230) : Promise < void > {
231- return await promisified ( {
232- module : 'Fs' ,
231+ return await invoke < void > ( {
232+ __tauriModule : 'Fs' ,
233233 message : {
234234 cmd : 'createDir' ,
235235 path : dir ,
@@ -252,8 +252,8 @@ async function removeDir(
252252 dir : string ,
253253 options : FsDirOptions = { }
254254) : Promise < void > {
255- return await promisified ( {
256- module : 'Fs' ,
255+ return await invoke < void > ( {
256+ __tauriModule : 'Fs' ,
257257 message : {
258258 cmd : 'removeDir' ,
259259 path : dir ,
@@ -276,8 +276,8 @@ async function copyFile(
276276 destination : string ,
277277 options : FsOptions = { }
278278) : Promise < void > {
279- return await promisified ( {
280- module : 'Fs' ,
279+ return await invoke < void > ( {
280+ __tauriModule : 'Fs' ,
281281 message : {
282282 cmd : 'copyFile' ,
283283 source,
@@ -299,8 +299,8 @@ async function removeFile(
299299 file : string ,
300300 options : FsOptions = { }
301301) : Promise < void > {
302- return await promisified ( {
303- module : 'Fs' ,
302+ return await invoke < void > ( {
303+ __tauriModule : 'Fs' ,
304304 message : {
305305 cmd : 'removeFile' ,
306306 path : file ,
@@ -323,8 +323,8 @@ async function renameFile(
323323 newPath : string ,
324324 options : FsOptions = { }
325325) : Promise < void > {
326- return await promisified ( {
327- module : 'Fs' ,
326+ return await invoke < void > ( {
327+ __tauriModule : 'Fs' ,
328328 message : {
329329 cmd : 'renameFile' ,
330330 oldPath,
0 commit comments