@tauri-apps/plugin-fs
Advanced tools
Comparing version 2.0.0-beta.2 to 2.0.0-beta.3
@@ -201,3 +201,2 @@ /** | ||
declare class FileHandle extends Resource { | ||
constructor(rid: number); | ||
/** | ||
@@ -741,7 +740,7 @@ * Reads up to `p.byteLength` bytes into `p`. It resolves to the number of | ||
*/ | ||
type WatchEvent = { | ||
interface WatchEvent { | ||
type: WatchEventKind; | ||
paths: string[]; | ||
attrs: unknown; | ||
}; | ||
} | ||
/** | ||
@@ -748,0 +747,0 @@ * @since 2.0.0 |
@@ -99,5 +99,2 @@ export { BaseDirectory } from '@tauri-apps/api/path'; | ||
class FileHandle extends Resource { | ||
constructor(rid) { | ||
super(rid); | ||
} | ||
/** | ||
@@ -176,3 +173,3 @@ * Reads up to `p.byteLength` bytes into `p`. It resolves to the number of | ||
async seek(offset, whence) { | ||
return invoke("plugin:fs|seek", { | ||
return await invoke("plugin:fs|seek", { | ||
rid: this.rid, | ||
@@ -226,3 +223,3 @@ offset, | ||
async truncate(len) { | ||
return invoke("plugin:fs|ftruncate", { | ||
await invoke("plugin:fs|ftruncate", { | ||
rid: this.rid, | ||
@@ -253,3 +250,3 @@ len, | ||
async write(data) { | ||
return invoke("plugin:fs|write", { | ||
return await invoke("plugin:fs|write", { | ||
rid: this.rid, | ||
@@ -323,3 +320,3 @@ data: Array.from(data), | ||
} | ||
return invoke("plugin:fs|copy_file", { | ||
await invoke("plugin:fs|copy_file", { | ||
fromPath: fromPath instanceof URL ? fromPath.toString() : fromPath, | ||
@@ -344,3 +341,3 @@ toPath: toPath instanceof URL ? toPath.toString() : toPath, | ||
} | ||
return invoke("plugin:fs|mkdir", { | ||
await invoke("plugin:fs|mkdir", { | ||
path: path instanceof URL ? path.toString() : path, | ||
@@ -375,3 +372,3 @@ options, | ||
} | ||
return invoke("plugin:fs|read_dir", { | ||
return await invoke("plugin:fs|read_dir", { | ||
path: path instanceof URL ? path.toString() : path, | ||
@@ -416,3 +413,3 @@ options, | ||
} | ||
return invoke("plugin:fs|read_text_file", { | ||
return await invoke("plugin:fs|read_text_file", { | ||
path: path instanceof URL ? path.toString() : path, | ||
@@ -442,7 +439,7 @@ options, | ||
const pathStr = path instanceof URL ? path.toString() : path; | ||
return Promise.resolve({ | ||
return await Promise.resolve({ | ||
path: pathStr, | ||
rid: null, | ||
async next() { | ||
if (!this.rid) { | ||
if (this.rid == null) { | ||
this.rid = await invoke("plugin:fs|read_text_file_lines", { | ||
@@ -458,2 +455,3 @@ path: pathStr, | ||
return { | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
value: done ? "" : line, | ||
@@ -484,3 +482,3 @@ done, | ||
} | ||
return invoke("plugin:fs|remove", { | ||
await invoke("plugin:fs|remove", { | ||
path: path instanceof URL ? path.toString() : path, | ||
@@ -510,3 +508,3 @@ options, | ||
} | ||
return invoke("plugin:fs|rename", { | ||
await invoke("plugin:fs|rename", { | ||
oldPath: oldPath instanceof URL ? oldPath.toString() : oldPath, | ||
@@ -582,3 +580,3 @@ newPath: newPath instanceof URL ? newPath.toString() : newPath, | ||
} | ||
return invoke("plugin:fs|truncate", { | ||
await invoke("plugin:fs|truncate", { | ||
path: path instanceof URL ? path.toString() : path, | ||
@@ -606,3 +604,3 @@ len, | ||
} | ||
return invoke("plugin:fs|write_file", { | ||
await invoke("plugin:fs|write_file", { | ||
path: path instanceof URL ? path.toString() : path, | ||
@@ -628,3 +626,3 @@ data: Array.from(data), | ||
} | ||
return invoke("plugin:fs|write_text_file", { | ||
await invoke("plugin:fs|write_text_file", { | ||
path: path instanceof URL ? path.toString() : path, | ||
@@ -650,3 +648,3 @@ data, | ||
} | ||
return invoke("plugin:fs|exists", { | ||
return await invoke("plugin:fs|exists", { | ||
path: path instanceof URL ? path.toString() : path, | ||
@@ -653,0 +651,0 @@ options, |
{ | ||
"name": "@tauri-apps/plugin-fs", | ||
"version": "2.0.0-beta.2", | ||
"version": "2.0.0-beta.3", | ||
"description": "Access the file system.", | ||
@@ -24,3 +24,3 @@ "license": "MIT or APACHE-2.0", | ||
"dependencies": { | ||
"@tauri-apps/api": "2.0.0-beta.4" | ||
"@tauri-apps/api": "2.0.0-beta.11" | ||
}, | ||
@@ -27,0 +27,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
84030
6
2244
+ Added@tauri-apps/api@2.0.0-beta.11(transitive)
- Removed@tauri-apps/api@2.0.0-beta.4(transitive)