fix(docs): plugin usage examples using wrong package name

pull/527/head
Lucas Nogueira 2 years ago
parent 6f01bc11ab
commit 770387a429
No known key found for this signature in database
GPG Key ID: 7C32FCA95C8C95D7

@ -125,7 +125,7 @@ async function open(
* You can save it to the filesystem using [tauri-plugin-persisted-scope](https://github.com/tauri-apps/tauri-plugin-persisted-scope). * You can save it to the filesystem using [tauri-plugin-persisted-scope](https://github.com/tauri-apps/tauri-plugin-persisted-scope).
* @example * @example
* ```typescript * ```typescript
* import { open } from '@tauri-apps/api/dialog'; * import { open } from '@tauri-apps/plugin-dialog';
* // Open a selection dialog for image files * // Open a selection dialog for image files
* const selected = await open({ * const selected = await open({
* multiple: true, * multiple: true,
@ -145,7 +145,7 @@ async function open(
* *
* @example * @example
* ```typescript * ```typescript
* import { open } from '@tauri-apps/api/dialog'; * import { open } from '@tauri-apps/plugin-dialog';
* import { appDir } from '@tauri-apps/api/path'; * import { appDir } from '@tauri-apps/api/path';
* // Open a selection dialog for directories * // Open a selection dialog for directories
* const selected = await open({ * const selected = await open({
@ -187,7 +187,7 @@ async function open(
* You can save it to the filesystem using [tauri-plugin-persisted-scope](https://github.com/tauri-apps/tauri-plugin-persisted-scope). * You can save it to the filesystem using [tauri-plugin-persisted-scope](https://github.com/tauri-apps/tauri-plugin-persisted-scope).
* @example * @example
* ```typescript * ```typescript
* import { save } from '@tauri-apps/api/dialog'; * import { save } from '@tauri-apps/plugin-dialog';
* const filePath = await save({ * const filePath = await save({
* filters: [{ * filters: [{
* name: 'Image', * name: 'Image',
@ -212,7 +212,7 @@ async function save(options: SaveDialogOptions = {}): Promise<string | null> {
* Shows a message dialog with an `Ok` button. * Shows a message dialog with an `Ok` button.
* @example * @example
* ```typescript * ```typescript
* import { message } from '@tauri-apps/api/dialog'; * import { message } from '@tauri-apps/plugin-dialog';
* await message('Tauri is awesome', 'Tauri'); * await message('Tauri is awesome', 'Tauri');
* await message('File not found', { title: 'Tauri', type: 'error' }); * await message('File not found', { title: 'Tauri', type: 'error' });
* ``` * ```
@ -242,7 +242,7 @@ async function message(
* Shows a question dialog with `Yes` and `No` buttons. * Shows a question dialog with `Yes` and `No` buttons.
* @example * @example
* ```typescript * ```typescript
* import { ask } from '@tauri-apps/api/dialog'; * import { ask } from '@tauri-apps/plugin-dialog';
* const yes = await ask('Are you sure?', 'Tauri'); * const yes = await ask('Are you sure?', 'Tauri');
* const yes2 = await ask('This action cannot be reverted. Are you sure?', { title: 'Tauri', type: 'warning' }); * const yes2 = await ask('This action cannot be reverted. Are you sure?', { title: 'Tauri', type: 'warning' });
* ``` * ```
@ -272,7 +272,7 @@ async function ask(
* Shows a question dialog with `Ok` and `Cancel` buttons. * Shows a question dialog with `Ok` and `Cancel` buttons.
* @example * @example
* ```typescript * ```typescript
* import { confirm } from '@tauri-apps/api/dialog'; * import { confirm } from '@tauri-apps/plugin-dialog';
* const confirmed = await confirm('Are you sure?', 'Tauri'); * const confirmed = await confirm('Are you sure?', 'Tauri');
* const confirmed2 = await confirm('This action cannot be reverted. Are you sure?', { title: 'Tauri', type: 'warning' }); * const confirmed2 = await confirm('This action cannot be reverted. Are you sure?', { title: 'Tauri', type: 'warning' });
* ``` * ```

@ -296,7 +296,7 @@ type Permission = "granted" | "denied" | "default";
* Checks if the permission to send notifications is granted. * Checks if the permission to send notifications is granted.
* @example * @example
* ```typescript * ```typescript
* import { isPermissionGranted } from '@tauri-apps/api/notification'; * import { isPermissionGranted } from '@tauri-apps/plugin-notification';
* const permissionGranted = await isPermissionGranted(); * const permissionGranted = await isPermissionGranted();
* ``` * ```
* *
@ -313,7 +313,7 @@ async function isPermissionGranted(): Promise<boolean> {
* Requests the permission to send notifications. * Requests the permission to send notifications.
* @example * @example
* ```typescript * ```typescript
* import { isPermissionGranted, requestPermission } from '@tauri-apps/api/notification'; * import { isPermissionGranted, requestPermission } from '@tauri-apps/plugin-notification';
* let permissionGranted = await isPermissionGranted(); * let permissionGranted = await isPermissionGranted();
* if (!permissionGranted) { * if (!permissionGranted) {
* const permission = await requestPermission(); * const permission = await requestPermission();
@ -333,7 +333,7 @@ async function requestPermission(): Promise<Permission> {
* Sends a notification to the user. * Sends a notification to the user.
* @example * @example
* ```typescript * ```typescript
* import { isPermissionGranted, requestPermission, sendNotification } from '@tauri-apps/api/notification'; * import { isPermissionGranted, requestPermission, sendNotification } from '@tauri-apps/plugin-notification';
* let permissionGranted = await isPermissionGranted(); * let permissionGranted = await isPermissionGranted();
* if (!permissionGranted) { * if (!permissionGranted) {
* const permission = await requestPermission(); * const permission = await requestPermission();
@ -362,7 +362,7 @@ function sendNotification(options: Options | string): void {
* *
* @example * @example
* ```typescript * ```typescript
* import { registerActionTypes } from '@tauri-apps/api/notification'; * import { registerActionTypes } from '@tauri-apps/plugin-notification';
* await registerActionTypes([{ * await registerActionTypes([{
* id: 'tauri', * id: 'tauri',
* actions: [{ * actions: [{
@ -385,7 +385,7 @@ async function registerActionTypes(types: ActionType[]): Promise<void> {
* *
* @example * @example
* ```typescript * ```typescript
* import { pending } from '@tauri-apps/api/notification'; * import { pending } from '@tauri-apps/plugin-notification';
* const pendingNotifications = await pending(); * const pendingNotifications = await pending();
* ``` * ```
* *
@ -402,7 +402,7 @@ async function pending(): Promise<PendingNotification[]> {
* *
* @example * @example
* ```typescript * ```typescript
* import { cancel } from '@tauri-apps/api/notification'; * import { cancel } from '@tauri-apps/plugin-notification';
* await cancel([-34234, 23432, 4311]); * await cancel([-34234, 23432, 4311]);
* ``` * ```
* *
@ -419,7 +419,7 @@ async function cancel(notifications: number[]): Promise<void> {
* *
* @example * @example
* ```typescript * ```typescript
* import { cancelAll } from '@tauri-apps/api/notification'; * import { cancelAll } from '@tauri-apps/plugin-notification';
* await cancelAll(); * await cancelAll();
* ``` * ```
* *
@ -436,7 +436,7 @@ async function cancelAll(): Promise<void> {
* *
* @example * @example
* ```typescript * ```typescript
* import { active } from '@tauri-apps/api/notification'; * import { active } from '@tauri-apps/plugin-notification';
* const activeNotifications = await active(); * const activeNotifications = await active();
* ``` * ```
* *
@ -453,7 +453,7 @@ async function active(): Promise<ActiveNotification[]> {
* *
* @example * @example
* ```typescript * ```typescript
* import { cancel } from '@tauri-apps/api/notification'; * import { cancel } from '@tauri-apps/plugin-notification';
* await cancel([-34234, 23432, 4311]) * await cancel([-34234, 23432, 4311])
* ``` * ```
* *
@ -470,7 +470,7 @@ async function removeActive(notifications: number[]): Promise<void> {
* *
* @example * @example
* ```typescript * ```typescript
* import { removeAllActive } from '@tauri-apps/api/notification'; * import { removeAllActive } from '@tauri-apps/plugin-notification';
* await removeAllActive() * await removeAllActive()
* ``` * ```
* *
@ -487,7 +487,7 @@ async function removeAllActive(): Promise<void> {
* *
* @example * @example
* ```typescript * ```typescript
* import { createChannel, Importance, Visibility } from '@tauri-apps/api/notification'; * import { createChannel, Importance, Visibility } from '@tauri-apps/plugin-notification';
* await createChannel({ * await createChannel({
* id: 'new-messages', * id: 'new-messages',
* name: 'New Messages', * name: 'New Messages',
@ -511,7 +511,7 @@ async function createChannel(channel: Channel): Promise<void> {
* *
* @example * @example
* ```typescript * ```typescript
* import { removeChannel } from '@tauri-apps/api/notification'; * import { removeChannel } from '@tauri-apps/plugin-notification';
* await removeChannel(); * await removeChannel();
* ``` * ```
* *
@ -528,7 +528,7 @@ async function removeChannel(id: string): Promise<void> {
* *
* @example * @example
* ```typescript * ```typescript
* import { channels } from '@tauri-apps/api/notification'; * import { channels } from '@tauri-apps/plugin-notification';
* const notificationChannels = await channels(); * const notificationChannels = await channels();
* ``` * ```
* *

@ -166,7 +166,7 @@ async function exeExtension(): Promise<string | null> {
* Returns the host name of the operating system. * Returns the host name of the operating system.
* @example * @example
* ```typescript * ```typescript
* import { hostname } from '@tauri-apps/api/os'; * import { hostname } from '@tauri-apps/plugin-os';
* const hostname = await hostname(); * const hostname = await hostname();
* ``` * ```
*/ */

@ -1606,7 +1606,7 @@ class WindowManager extends WebviewWindowHandle {
* @example * @example
* ```typescript * ```typescript
* import { appWindow } from "@tauri-apps/plugin-window"; * import { appWindow } from "@tauri-apps/plugin-window";
* import { confirm } from '@tauri-apps/api/dialog'; * import { confirm } from '@tauri-apps/plugin-dialog';
* const unlisten = await appWindow.onCloseRequested(async (event) => { * const unlisten = await appWindow.onCloseRequested(async (event) => {
* const confirmed = await confirm('Are you sure?'); * const confirmed = await confirm('Are you sure?');
* if (!confirmed) { * if (!confirmed) {

Loading…
Cancel
Save