Prechádzať zdrojové kódy

chore(deps) Update Tauri API Definitions (#4523)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
renovate[bot] 3 rokov pred
rodič
commit
9217d88f94

+ 2 - 2
tooling/api/package.json

@@ -64,8 +64,8 @@
     "rollup": "2.75.7",
     "rollup-plugin-terser": "7.0.2",
     "tslib": "2.4.0",
-    "typedoc": "0.22.17",
-    "typedoc-plugin-markdown": "3.12.1",
+    "typedoc": "0.23.2",
+    "typedoc-plugin-markdown": "3.13.2",
     "typescript": "4.7.4"
   },
   "dependencies": {

+ 5 - 3
tooling/api/src/dialog.ts

@@ -90,9 +90,10 @@ interface MessageDialogOptions {
  *
  * Note that the allowlist scope change is not persisted, so the values are cleared when the application is restarted.
  * You can save it to the filesystem using [tauri-plugin-persisted-scope](https://github.com/tauri-apps/tauri-plugin-persisted-scope).
- * @example Open a selection dialog for image files
+ * @example
  * ```typescript
  * import { open } from '@tauri-apps/api/dialog';
+ * // Open a selection dialog for image files
  * const selected = await open({
  *   multiple: true,
  *   filters: [{
@@ -109,10 +110,11 @@ interface MessageDialogOptions {
  * }
  * ```
  *
- * @example Open a selection dialog for directories
+ * @example
  * ```typescript
  * import { open } from '@tauri-apps/api/dialog';
  * import { appDir } from '@tauri-apps/api/path';
+ * // Open a selection dialog for directories
  * const selected = await open({
  *   directory: true,
  *   multiple: true,
@@ -154,7 +156,7 @@ async function open(
  *
  * Note that the allowlist scope change is not persisted, so the values are cleared when the application is restarted.
  * You can save it to the filesystem using [tauri-plugin-persisted-scope](https://github.com/tauri-apps/tauri-plugin-persisted-scope).
- * @example Open a save dialog with a defined file extension
+ * @example
  * ```typescript
  * import { save } from '@tauri-apps/api/dialog';
  * const filePath = await save({

+ 3 - 3
tooling/api/src/event.ts

@@ -19,7 +19,7 @@ import type {
 
 /**
  * Listen to an event from the backend.
- * @example Listen to the `error` event expecting a string payload
+ * @example
  * ```typescript
  * import { listen } from '@tauri-apps/api/event';
  * const unlisten = await listen<string>('error', (event) => {
@@ -43,7 +43,7 @@ async function listen<T>(
 
 /**
  * Listen to an one-off event from the backend.
- * @example Listen to the `loaded` event that is only triggered once
+ * @example
  * ```typescript
  * import { once } from '@tauri-apps/api/event';
  * interface LoadedPayload {
@@ -68,7 +68,7 @@ async function once<T>(
 
 /**
  * Emits an event to the backend.
- * @example Emits the `frontend-loaded` event with the given payload
+ * @example
  * ```typescript
  * import { emit } from '@tauri-apps/api/event';
  * await emit('frontend-loaded', { loggedIn: true, token: 'authToken' });

+ 24 - 12
tooling/api/src/fs.ts

@@ -135,9 +135,10 @@ interface FileEntry {
 
 /**
  * Reads a file as an UTF-8 encoded string.
- * @example Read the text file in the `$APPDIR/app.conf` path
+ * @example
  * ```typescript
  * import { readTextFile, BaseDirectory } from '@tauri-apps/api/fs';
+ * // Read the text file in the `$APPDIR/app.conf` path
  * const contents = await readTextFile('app.conf', { dir: BaseDirectory.App });
  * ```
  *
@@ -161,9 +162,10 @@ async function readTextFile(
 
 /**
  * Reads a file as byte array.
- * @example Read the image file in the `$RESOURCEDIR/avatar.png` path
+ * @example
  * ```typescript
  * import { readBinaryFile, BaseDirectory } from '@tauri-apps/api/fs';
+ * // Read the image file in the `$RESOURCEDIR/avatar.png` path
  * const contents = await readBinaryFile('avatar.png', { dir: BaseDirectory.Resource });
  * ```
  *
@@ -189,9 +191,10 @@ async function readBinaryFile(
 
 /**
  * Writes a UTF-8 text file.
- * @example Write a text file to the `$APPDIR/app.conf` path
+ * @example
  * ```typescript
  * import { writeTextFile, BaseDirectory } from '@tauri-apps/api/fs';
+ * // Write a text file to the `$APPDIR/app.conf` path
  * await writeTextFile('app.conf', 'file contents', { dir: BaseDirectory.App });
  * ```
  *
@@ -208,9 +211,10 @@ async function writeTextFile(
 
 /**
  * Writes a UTF-8 text file.
- * @example Write a text file to the `$APPDIR/app.conf` path
+ * @example
  * ```typescript
  * import { writeTextFile, BaseDirectory } from '@tauri-apps/api/fs';
+ * // Write a text file to the `$APPDIR/app.conf` path
  * await writeTextFile({ path: 'app.conf', contents: 'file contents' }, { dir: BaseDirectory.App });
  * ```
  *
@@ -271,9 +275,10 @@ async function writeTextFile(
 
 /**
  * Writes a byte array content to a file.
- * @example Write a binary file to the `$APPDIR/avatar.png` path
+ * @example
  * ```typescript
  * import { writeBinaryFile, BaseDirectory } from '@tauri-apps/api/fs';
+ * // Write a binary file to the `$APPDIR/avatar.png` path
  * await writeBinaryFile('avatar.png', new Uint8Array([]), { dir: BaseDirectory.App });
  * ```
  *
@@ -290,9 +295,10 @@ async function writeBinaryFile(
 
 /**
  * Writes a byte array content to a file.
- * @example Write a binary file to the `$APPDIR/avatar.png` path
+ * @example
  * ```typescript
  * import { writeBinaryFile, BaseDirectory } from '@tauri-apps/api/fs';
+ * // Write a binary file to the `$APPDIR/avatar.png` path
  * await writeBinaryFile({ path: 'avatar.png', contents: new Uint8Array([]) }, { dir: BaseDirectory.App });
  * ```
  *
@@ -354,9 +360,10 @@ async function writeBinaryFile(
 
 /**
  * List directory files.
- * @example Reads the `$APPDIR/users` directory recursively
+ * @example
  * ```typescript
  * import { readDir, BaseDirectory } from '@tauri-apps/api/fs';
+ * // Reads the `$APPDIR/users` directory recursively
  * const entries = await readDir('users', { dir: BaseDirectory.App, recursive: true });
  *
  * function processEntries(entries) {
@@ -391,9 +398,10 @@ async function readDir(
  * Creates a directory.
  * If one of the path's parent components doesn't exist
  * and the `recursive` option isn't set to true, the promise will be rejected.
- * @example Create the `$APPDIR/users` directory
+ * @example
  * ```typescript
  * import { createDir, BaseDirectory } from '@tauri-apps/api/fs';
+ * // Create the `$APPDIR/users` directory
  * await createDir('users', { dir: BaseDirectory.App, recursive: true });
  * ```
  *
@@ -418,9 +426,10 @@ async function createDir(
 /**
  * Removes a directory.
  * If the directory is not empty and the `recursive` option isn't set to true, the promise will be rejected.
- * @example Remove the directory `$APPDIR/users`
+ * @example
  * ```typescript
  * import { removeDir, BaseDirectory } from '@tauri-apps/api/fs';
+ * // Remove the directory `$APPDIR/users`
  * await removeDir('users', { dir: BaseDirectory.App });
  * ```
  *
@@ -444,9 +453,10 @@ async function removeDir(
 
 /**
  * Copys a file to a destination.
- * @example Copy the `$APPDIR/app.conf` file to `$APPDIR/app.conf.bk`
+ * @example
  * ```typescript
  * import { copyFile, BaseDirectory } from '@tauri-apps/api/fs';
+ * // Copy the `$APPDIR/app.conf` file to `$APPDIR/app.conf.bk`
  * await copyFile('app.conf', 'app.conf.bk', { dir: BaseDirectory.App });
  * ```
  *
@@ -473,9 +483,10 @@ async function copyFile(
 
 /**
  * Removes a file.
- * @example Remove the `$APPDIR/app.conf` file
+ * @example
  * ```typescript
  * import { removeFile, BaseDirectory } from '@tauri-apps/api/fs';
+ * // Remove the `$APPDIR/app.conf` file
  * await removeFile('app.conf', { dir: BaseDirectory.App });
  * ```
  *
@@ -499,9 +510,10 @@ async function removeFile(
 
 /**
  * Renames a file.
- * @example Rename the `$APPDIR/avatar.png` file
+ * @example
  * ```typescript
  * import { renameFile, BaseDirectory } from '@tauri-apps/api/fs';
+ * // Rename the `$APPDIR/avatar.png` file
  * await renameFile('avatar.png', 'deleted.png', { dir: BaseDirectory.App });
  * ```
  *

+ 9 - 21
tooling/api/yarn.lock

@@ -2207,17 +2207,6 @@ glob@^7.1.3, glob@^7.1.6:
     once "^1.3.0"
     path-is-absolute "^1.0.0"
 
-glob@^8.0.3:
-  version "8.0.3"
-  resolved "https://registry.yarnpkg.com/glob/-/glob-8.0.3.tgz#415c6eb2deed9e502c68fa44a272e6da6eeca42e"
-  integrity sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ==
-  dependencies:
-    fs.realpath "^1.0.0"
-    inflight "^1.0.4"
-    inherits "2"
-    minimatch "^5.0.1"
-    once "^1.3.0"
-
 globals@^11.1.0:
   version "11.12.0"
   resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e"
@@ -2636,7 +2625,7 @@ minimatch@^3.1.2:
   dependencies:
     brace-expansion "^1.1.7"
 
-minimatch@^5.0.1, minimatch@^5.1.0:
+minimatch@^5.1.0:
   version "5.1.0"
   resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.1.0.tgz#1717b464f4971b144f6aabe8f2d0b8e4511e09c7"
   integrity sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==
@@ -3276,19 +3265,18 @@ type-fest@^0.20.2:
   resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4"
   integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==
 
-typedoc-plugin-markdown@3.12.1:
-  version "3.12.1"
-  resolved "https://registry.yarnpkg.com/typedoc-plugin-markdown/-/typedoc-plugin-markdown-3.12.1.tgz#2a33ca0018bdd7ed512e29960d3eb344ecb65f4a"
-  integrity sha512-gMntJq7+JlGJZ5sVjrkzO/rG2dsmNBbWk5ZkcKvYu6QOeBwGcK5tzEyS0aqnFTJj9GCHCB+brAnTuKtAyotNwA==
+typedoc-plugin-markdown@3.13.2:
+  version "3.13.2"
+  resolved "https://registry.yarnpkg.com/typedoc-plugin-markdown/-/typedoc-plugin-markdown-3.13.2.tgz#988846ab68365ef215fbae35a75745fa7641a8af"
+  integrity sha512-WpP+XW4TZ7yVIM9jSjTWUznZitXWY8OwSVRZAu65+lOI6tiIeUYEsgiFzIdGjNcWbwD6THNcJqATDoMVIp9RKw==
   dependencies:
     handlebars "^4.7.7"
 
-typedoc@0.22.17:
-  version "0.22.17"
-  resolved "https://registry.yarnpkg.com/typedoc/-/typedoc-0.22.17.tgz#bc51cc95f569040112504300831cdac4f8089b7b"
-  integrity sha512-h6+uXHVVCPDaANzjwzdsj9aePBjZiBTpiMpBBeyh1zcN2odVsDCNajz8zyKnixF93HJeGpl34j/70yoEE5BfNg==
+typedoc@0.23.2:
+  version "0.23.2"
+  resolved "https://registry.yarnpkg.com/typedoc/-/typedoc-0.23.2.tgz#c5f82752530749c8b541ff9b17883f6fb9e72f14"
+  integrity sha512-THpC4vtb3wu1yck6YHzEc4ck6W4lScf8TD0Rg7XAetDih8BzP+ErYO0/6DtdzYcZyKkDwEoujkMeWW7CffCbrQ==
   dependencies:
-    glob "^8.0.3"
     lunr "^2.3.9"
     marked "^4.0.16"
     minimatch "^5.1.0"