Selaa lähdekoodia

fix(docs): use appdir instead of resourcedir in writeFile examples. Fix dialog docs. (#4337)

Fabian-Lars 3 vuotta sitten
vanhempi
sitoutus
6e1667998a
2 muutettua tiedostoa jossa 5 lisäystä ja 4 poistoa
  1. 1 0
      tooling/api/src/dialog.ts
  2. 4 4
      tooling/api/src/fs.ts

+ 1 - 0
tooling/api/src/dialog.ts

@@ -107,6 +107,7 @@ interface MessageDialogOptions {
  * } else {
  *   // user selected a single file
  * }
+ * ```
  *
  * @example Open a selection dialog for directories
  * ```typescript

+ 4 - 4
tooling/api/src/fs.ts

@@ -271,10 +271,10 @@ async function writeTextFile(
 
 /**
  * Writes a byte array content to a file.
- * @example Write a binary file to the `$RESOURCEDIR/avatar.png` path
+ * @example Write a binary file to the `$APPDIR/avatar.png` path
  * ```typescript
  * import { writeBinaryFile, BaseDirectory } from '@tauri-apps/api/fs';
- * await writeBinaryFile('avatar.png', new Uint8Array([]), { dir: BaseDirectory.Resource });
+ * await writeBinaryFile('avatar.png', new Uint8Array([]), { dir: BaseDirectory.App });
  * ```
  *
  * @param path The file path.
@@ -290,10 +290,10 @@ async function writeBinaryFile(
 
 /**
  * Writes a byte array content to a file.
- * @example Write a binary file to the `$RESOURCEDIR/avatar.png` path
+ * @example Write a binary file to the `$APPEDIR/avatar.png` path
  * ```typescript
  * import { writeBinaryFile, BaseDirectory } from '@tauri-apps/api/fs';
- * await writeBinaryFile({ path: 'avatar.png', contents: new Uint8Array([]) }, { dir: BaseDirectory.Resource });
+ * await writeBinaryFile({ path: 'avatar.png', contents: new Uint8Array([]) }, { dir: BaseDirectory.App });
  * ```
  *
  * @param file The object containing the file path and contents.