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

This commit is contained in:
Fabian-Lars
2022-06-14 15:09:53 +02:00
committed by GitHub
parent d29971e22c
commit 6e1667998a
2 changed files with 5 additions and 4 deletions

View File

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

View File

@@ -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.