Skip to content

Commit

Permalink
fix(docs): plugin usage examples using wrong package name
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog committed Jul 31, 2023
1 parent 6f01bc1 commit 770387a
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
12 changes: 6 additions & 6 deletions plugins/dialog/guest-js/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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).
* @example
* ```typescript
* import { open } from '@tauri-apps/api/dialog';
* import { open } from '@tauri-apps/plugin-dialog';
* // Open a selection dialog for image files
* const selected = await open({
* multiple: true,
Expand All @@ -145,7 +145,7 @@ async function open(
*
* @example
* ```typescript
* import { open } from '@tauri-apps/api/dialog';
* import { open } from '@tauri-apps/plugin-dialog';
* import { appDir } from '@tauri-apps/api/path';
* // Open a selection dialog for directories
* const selected = await open({
Expand Down Expand Up @@ -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).
* @example
* ```typescript
* import { save } from '@tauri-apps/api/dialog';
* import { save } from '@tauri-apps/plugin-dialog';
* const filePath = await save({
* filters: [{
* name: 'Image',
Expand All @@ -212,7 +212,7 @@ async function save(options: SaveDialogOptions = {}): Promise<string | null> {
* Shows a message dialog with an `Ok` button.
* @example
* ```typescript
* import { message } from '@tauri-apps/api/dialog';
* import { message } from '@tauri-apps/plugin-dialog';
* await message('Tauri is awesome', 'Tauri');
* await message('File not found', { title: 'Tauri', type: 'error' });
* ```
Expand Down Expand Up @@ -242,7 +242,7 @@ async function message(
* Shows a question dialog with `Yes` and `No` buttons.
* @example
* ```typescript
* import { ask } from '@tauri-apps/api/dialog';
* import { ask } from '@tauri-apps/plugin-dialog';
* const yes = await ask('Are you sure?', 'Tauri');
* const yes2 = await ask('This action cannot be reverted. Are you sure?', { title: 'Tauri', type: 'warning' });
* ```
Expand Down Expand Up @@ -272,7 +272,7 @@ async function ask(
* Shows a question dialog with `Ok` and `Cancel` buttons.
* @example
* ```typescript
* import { confirm } from '@tauri-apps/api/dialog';
* import { confirm } from '@tauri-apps/plugin-dialog';
* const confirmed = await confirm('Are you sure?', 'Tauri');
* const confirmed2 = await confirm('This action cannot be reverted. Are you sure?', { title: 'Tauri', type: 'warning' });
* ```
Expand Down
26 changes: 13 additions & 13 deletions plugins/notification/guest-js/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ type Permission = "granted" | "denied" | "default";
* Checks if the permission to send notifications is granted.
* @example
* ```typescript
* import { isPermissionGranted } from '@tauri-apps/api/notification';
* import { isPermissionGranted } from '@tauri-apps/plugin-notification';
* const permissionGranted = await isPermissionGranted();
* ```
*
Expand All @@ -313,7 +313,7 @@ async function isPermissionGranted(): Promise<boolean> {
* Requests the permission to send notifications.
* @example
* ```typescript
* import { isPermissionGranted, requestPermission } from '@tauri-apps/api/notification';
* import { isPermissionGranted, requestPermission } from '@tauri-apps/plugin-notification';
* let permissionGranted = await isPermissionGranted();
* if (!permissionGranted) {
* const permission = await requestPermission();
Expand All @@ -333,7 +333,7 @@ async function requestPermission(): Promise<Permission> {
* Sends a notification to the user.
* @example
* ```typescript
* import { isPermissionGranted, requestPermission, sendNotification } from '@tauri-apps/api/notification';
* import { isPermissionGranted, requestPermission, sendNotification } from '@tauri-apps/plugin-notification';
* let permissionGranted = await isPermissionGranted();
* if (!permissionGranted) {
* const permission = await requestPermission();
Expand Down Expand Up @@ -362,7 +362,7 @@ function sendNotification(options: Options | string): void {
*
* @example
* ```typescript
* import { registerActionTypes } from '@tauri-apps/api/notification';
* import { registerActionTypes } from '@tauri-apps/plugin-notification';
* await registerActionTypes([{
* id: 'tauri',
* actions: [{
Expand All @@ -385,7 +385,7 @@ async function registerActionTypes(types: ActionType[]): Promise<void> {
*
* @example
* ```typescript
* import { pending } from '@tauri-apps/api/notification';
* import { pending } from '@tauri-apps/plugin-notification';
* const pendingNotifications = await pending();
* ```
*
Expand All @@ -402,7 +402,7 @@ async function pending(): Promise<PendingNotification[]> {
*
* @example
* ```typescript
* import { cancel } from '@tauri-apps/api/notification';
* import { cancel } from '@tauri-apps/plugin-notification';
* await cancel([-34234, 23432, 4311]);
* ```
*
Expand All @@ -419,7 +419,7 @@ async function cancel(notifications: number[]): Promise<void> {
*
* @example
* ```typescript
* import { cancelAll } from '@tauri-apps/api/notification';
* import { cancelAll } from '@tauri-apps/plugin-notification';
* await cancelAll();
* ```
*
Expand All @@ -436,7 +436,7 @@ async function cancelAll(): Promise<void> {
*
* @example
* ```typescript
* import { active } from '@tauri-apps/api/notification';
* import { active } from '@tauri-apps/plugin-notification';
* const activeNotifications = await active();
* ```
*
Expand All @@ -453,7 +453,7 @@ async function active(): Promise<ActiveNotification[]> {
*
* @example
* ```typescript
* import { cancel } from '@tauri-apps/api/notification';
* import { cancel } from '@tauri-apps/plugin-notification';
* await cancel([-34234, 23432, 4311])
* ```
*
Expand All @@ -470,7 +470,7 @@ async function removeActive(notifications: number[]): Promise<void> {
*
* @example
* ```typescript
* import { removeAllActive } from '@tauri-apps/api/notification';
* import { removeAllActive } from '@tauri-apps/plugin-notification';
* await removeAllActive()
* ```
*
Expand All @@ -487,7 +487,7 @@ async function removeAllActive(): Promise<void> {
*
* @example
* ```typescript
* import { createChannel, Importance, Visibility } from '@tauri-apps/api/notification';
* import { createChannel, Importance, Visibility } from '@tauri-apps/plugin-notification';
* await createChannel({
* id: 'new-messages',
* name: 'New Messages',
Expand All @@ -511,7 +511,7 @@ async function createChannel(channel: Channel): Promise<void> {
*
* @example
* ```typescript
* import { removeChannel } from '@tauri-apps/api/notification';
* import { removeChannel } from '@tauri-apps/plugin-notification';
* await removeChannel();
* ```
*
Expand All @@ -528,7 +528,7 @@ async function removeChannel(id: string): Promise<void> {
*
* @example
* ```typescript
* import { channels } from '@tauri-apps/api/notification';
* import { channels } from '@tauri-apps/plugin-notification';
* const notificationChannels = await channels();
* ```
*
Expand Down
2 changes: 1 addition & 1 deletion plugins/os/guest-js/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ async function exeExtension(): Promise<string | null> {
* Returns the host name of the operating system.
* @example
* ```typescript
* import { hostname } from '@tauri-apps/api/os';
* import { hostname } from '@tauri-apps/plugin-os';
* const hostname = await hostname();
* ```
*/
Expand Down
2 changes: 1 addition & 1 deletion plugins/window/guest-js/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1606,7 +1606,7 @@ class WindowManager extends WebviewWindowHandle {
* @example
* ```typescript
* 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 confirmed = await confirm('Are you sure?');
* if (!confirmed) {
Expand Down

0 comments on commit 770387a

Please sign in to comment.