Procházet zdrojové kódy

docs(clipboard): Added allowlist section to the Clipboard module (#5014)

Mateo Gallardo před 3 roky
rodič
revize
d35cc77831
1 změnil soubory, kde provedl 17 přidání a 0 odebrání
  1. 17 0
      tooling/api/src/clipboard.ts

+ 17 - 0
tooling/api/src/clipboard.ts

@@ -6,6 +6,23 @@
  * Read and write to the system clipboard.
  *
  * This package is also accessible with `window.__TAURI__.clipboard` when [`build.withGlobalTauri`](https://tauri.app/v1/api/config/#buildconfig.withglobaltauri) in `tauri.conf.json` is set to `true`.
+ *
+ * The APIs must be added to [`tauri.allowlist.clipboard`](https://tauri.app/v1/api/config/#allowlistconfig.clipboard) in `tauri.conf.json`:
+ * ```json
+ * {
+ *   "tauri": {
+ *     "allowlist": {
+ *       "clipboard": {
+ *         "all": true, // enable all Clipboard APIs
+ *         "writeText": true,
+ *         "readText": true
+ *       }
+ *     }
+ *   }
+ * }
+ * ```
+ * It is recommended to allowlist only the APIs you use for optimal bundle size and security.
+ *
  * @module
  */