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

pull/428/head
Lucas Fernandes Nogueira 2 years ago committed by GitHub
parent 6f01bc11ab
commit 7f2e2dd5b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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();
* ``` * ```
*/ */

@ -102,7 +102,7 @@ class PhysicalSize {
* Converts the physical size to a logical one. * Converts the physical size to a logical one.
* @example * @example
* ```typescript * ```typescript
* import { appWindow } from '@tauri-apps/window'; * import { appWindow } from '@tauri-apps/plugin-window';
* const factor = await appWindow.scaleFactor(); * const factor = await appWindow.scaleFactor();
* const size = await appWindow.innerSize(); * const size = await appWindow.innerSize();
* const logical = size.toLogical(factor); * const logical = size.toLogical(factor);
@ -148,7 +148,7 @@ class PhysicalPosition {
* Converts the physical position to a logical one. * Converts the physical position to a logical one.
* @example * @example
* ```typescript * ```typescript
* import { appWindow } from '@tauri-apps/window'; * import { appWindow } from '@tauri-apps/plugin-window';
* const factor = await appWindow.scaleFactor(); * const factor = await appWindow.scaleFactor();
* const position = await appWindow.innerPosition(); * const position = await appWindow.innerPosition();
* const logical = position.toLogical(factor); * const logical = position.toLogical(factor);
@ -291,7 +291,7 @@ class WebviewWindowHandle {
* *
* @example * @example
* ```typescript * ```typescript
* import { appWindow } from '@tauri-apps/window'; * import { appWindow } from '@tauri-apps/plugin-window';
* const unlisten = await appWindow.listen<string>('state-changed', (event) => { * const unlisten = await appWindow.listen<string>('state-changed', (event) => {
* console.log(`Got error: ${payload}`); * console.log(`Got error: ${payload}`);
* }); * });
@ -326,7 +326,7 @@ class WebviewWindowHandle {
* *
* @example * @example
* ```typescript * ```typescript
* import { appWindow } from '@tauri-apps/window'; * import { appWindow } from '@tauri-apps/plugin-window';
* const unlisten = await appWindow.once<null>('initialized', (event) => { * const unlisten = await appWindow.once<null>('initialized', (event) => {
* console.log(`Window initialized!`); * console.log(`Window initialized!`);
* }); * });
@ -357,7 +357,7 @@ class WebviewWindowHandle {
* Emits an event to the backend, tied to the webview window. * Emits an event to the backend, tied to the webview window.
* @example * @example
* ```typescript * ```typescript
* import { appWindow } from '@tauri-apps/window'; * import { appWindow } from '@tauri-apps/plugin-window';
* await appWindow.emit('window-loaded', { loggedIn: true, token: 'authToken' }); * await appWindow.emit('window-loaded', { loggedIn: true, token: 'authToken' });
* ``` * ```
* *
@ -403,7 +403,7 @@ class WindowManager extends WebviewWindowHandle {
* The scale factor that can be used to map physical pixels to logical pixels. * The scale factor that can be used to map physical pixels to logical pixels.
* @example * @example
* ```typescript * ```typescript
* import { appWindow } from '@tauri-apps/window'; * import { appWindow } from '@tauri-apps/plugin-window';
* const factor = await appWindow.scaleFactor(); * const factor = await appWindow.scaleFactor();
* ``` * ```
* *
@ -421,7 +421,7 @@ class WindowManager extends WebviewWindowHandle {
* The position of the top-left hand corner of the window's client area relative to the top-left hand corner of the desktop. * The position of the top-left hand corner of the window's client area relative to the top-left hand corner of the desktop.
* @example * @example
* ```typescript * ```typescript
* import { appWindow } from '@tauri-apps/window'; * import { appWindow } from '@tauri-apps/plugin-window';
* const position = await appWindow.innerPosition(); * const position = await appWindow.innerPosition();
* ``` * ```
* *
@ -444,7 +444,7 @@ class WindowManager extends WebviewWindowHandle {
* The position of the top-left hand corner of the window relative to the top-left hand corner of the desktop. * The position of the top-left hand corner of the window relative to the top-left hand corner of the desktop.
* @example * @example
* ```typescript * ```typescript
* import { appWindow } from '@tauri-apps/window'; * import { appWindow } from '@tauri-apps/plugin-window';
* const position = await appWindow.outerPosition(); * const position = await appWindow.outerPosition();
* ``` * ```
* *
@ -468,7 +468,7 @@ class WindowManager extends WebviewWindowHandle {
* The client area is the content of the window, excluding the title bar and borders. * The client area is the content of the window, excluding the title bar and borders.
* @example * @example
* ```typescript * ```typescript
* import { appWindow } from '@tauri-apps/window'; * import { appWindow } from '@tauri-apps/plugin-window';
* const size = await appWindow.innerSize(); * const size = await appWindow.innerSize();
* ``` * ```
* *
@ -492,7 +492,7 @@ class WindowManager extends WebviewWindowHandle {
* These dimensions include the title bar and borders. If you don't want that (and you usually don't), use inner_size instead. * These dimensions include the title bar and borders. If you don't want that (and you usually don't), use inner_size instead.
* @example * @example
* ```typescript * ```typescript
* import { appWindow } from '@tauri-apps/window'; * import { appWindow } from '@tauri-apps/plugin-window';
* const size = await appWindow.outerSize(); * const size = await appWindow.outerSize();
* ``` * ```
* *
@ -515,7 +515,7 @@ class WindowManager extends WebviewWindowHandle {
* Gets the window's current fullscreen state. * Gets the window's current fullscreen state.
* @example * @example
* ```typescript * ```typescript
* import { appWindow } from '@tauri-apps/window'; * import { appWindow } from '@tauri-apps/plugin-window';
* const fullscreen = await appWindow.isFullscreen(); * const fullscreen = await appWindow.isFullscreen();
* ``` * ```
* *
@ -533,7 +533,7 @@ class WindowManager extends WebviewWindowHandle {
* Gets the window's current minimized state. * Gets the window's current minimized state.
* @example * @example
* ```typescript * ```typescript
* import { appWindow } from '@tauri-apps/window'; * import { appWindow } from '@tauri-apps/plugin-window';
* const minimized = await appWindow.isMinimized(); * const minimized = await appWindow.isMinimized();
* ``` * ```
* *
@ -549,7 +549,7 @@ class WindowManager extends WebviewWindowHandle {
* Gets the window's current maximized state. * Gets the window's current maximized state.
* @example * @example
* ```typescript * ```typescript
* import { appWindow } from '@tauri-apps/window'; * import { appWindow } from '@tauri-apps/plugin-window';
* const maximized = await appWindow.isMaximized(); * const maximized = await appWindow.isMaximized();
* ``` * ```
* *
@ -585,7 +585,7 @@ class WindowManager extends WebviewWindowHandle {
* Gets the window's current decorated state. * Gets the window's current decorated state.
* @example * @example
* ```typescript * ```typescript
* import { appWindow } from '@tauri-apps/window'; * import { appWindow } from '@tauri-apps/plugin-window';
* const decorated = await appWindow.isDecorated(); * const decorated = await appWindow.isDecorated();
* ``` * ```
* *
@ -603,7 +603,7 @@ class WindowManager extends WebviewWindowHandle {
* Gets the window's current resizable state. * Gets the window's current resizable state.
* @example * @example
* ```typescript * ```typescript
* import { appWindow } from '@tauri-apps/window'; * import { appWindow } from '@tauri-apps/plugin-window';
* const resizable = await appWindow.isResizable(); * const resizable = await appWindow.isResizable();
* ``` * ```
* *
@ -684,7 +684,7 @@ class WindowManager extends WebviewWindowHandle {
* Gets the window's current visible state. * Gets the window's current visible state.
* @example * @example
* ```typescript * ```typescript
* import { appWindow } from '@tauri-apps/window'; * import { appWindow } from '@tauri-apps/plugin-window';
* const visible = await appWindow.isVisible(); * const visible = await appWindow.isVisible();
* ``` * ```
* *
@ -702,7 +702,7 @@ class WindowManager extends WebviewWindowHandle {
* Gets the window's current title. * Gets the window's current title.
* @example * @example
* ```typescript * ```typescript
* import { appWindow } from '@tauri-apps/window'; * import { appWindow } from '@tauri-apps/plugin-window';
* const title = await appWindow.title(); * const title = await appWindow.title();
* ``` * ```
* *
@ -723,7 +723,7 @@ class WindowManager extends WebviewWindowHandle {
* *
* @example * @example
* ```typescript * ```typescript
* import { appWindow } from '@tauri-apps/window'; * import { appWindow } from '@tauri-apps/plugin-window';
* const theme = await appWindow.theme(); * const theme = await appWindow.theme();
* ``` * ```
* *
@ -743,7 +743,7 @@ class WindowManager extends WebviewWindowHandle {
* Centers the window. * Centers the window.
* @example * @example
* ```typescript * ```typescript
* import { appWindow } from '@tauri-apps/window'; * import { appWindow } from '@tauri-apps/plugin-window';
* await appWindow.center(); * await appWindow.center();
* ``` * ```
* *
@ -772,7 +772,7 @@ class WindowManager extends WebviewWindowHandle {
* - **Linux:** Urgency levels have the same effect. * - **Linux:** Urgency levels have the same effect.
* @example * @example
* ```typescript * ```typescript
* import { appWindow } from '@tauri-apps/window'; * import { appWindow } from '@tauri-apps/plugin-window';
* await appWindow.requestUserAttention(); * await appWindow.requestUserAttention();
* ``` * ```
* *
@ -803,7 +803,7 @@ class WindowManager extends WebviewWindowHandle {
* Updates the window resizable flag. * Updates the window resizable flag.
* @example * @example
* ```typescript * ```typescript
* import { appWindow } from '@tauri-apps/window'; * import { appWindow } from '@tauri-apps/plugin-window';
* await appWindow.setResizable(false); * await appWindow.setResizable(false);
* ``` * ```
* *
@ -895,7 +895,7 @@ class WindowManager extends WebviewWindowHandle {
* Sets the window title. * Sets the window title.
* @example * @example
* ```typescript * ```typescript
* import { appWindow } from '@tauri-apps/window'; * import { appWindow } from '@tauri-apps/plugin-window';
* await appWindow.setTitle('Tauri'); * await appWindow.setTitle('Tauri');
* ``` * ```
* *
@ -915,7 +915,7 @@ class WindowManager extends WebviewWindowHandle {
* Maximizes the window. * Maximizes the window.
* @example * @example
* ```typescript * ```typescript
* import { appWindow } from '@tauri-apps/window'; * import { appWindow } from '@tauri-apps/plugin-window';
* await appWindow.maximize(); * await appWindow.maximize();
* ``` * ```
* *
@ -933,7 +933,7 @@ class WindowManager extends WebviewWindowHandle {
* Unmaximizes the window. * Unmaximizes the window.
* @example * @example
* ```typescript * ```typescript
* import { appWindow } from '@tauri-apps/window'; * import { appWindow } from '@tauri-apps/plugin-window';
* await appWindow.unmaximize(); * await appWindow.unmaximize();
* ``` * ```
* *
@ -951,7 +951,7 @@ class WindowManager extends WebviewWindowHandle {
* Toggles the window maximized state. * Toggles the window maximized state.
* @example * @example
* ```typescript * ```typescript
* import { appWindow } from '@tauri-apps/window'; * import { appWindow } from '@tauri-apps/plugin-window';
* await appWindow.toggleMaximize(); * await appWindow.toggleMaximize();
* ``` * ```
* *
@ -969,7 +969,7 @@ class WindowManager extends WebviewWindowHandle {
* Minimizes the window. * Minimizes the window.
* @example * @example
* ```typescript * ```typescript
* import { appWindow } from '@tauri-apps/window'; * import { appWindow } from '@tauri-apps/plugin-window';
* await appWindow.minimize(); * await appWindow.minimize();
* ``` * ```
* *
@ -987,7 +987,7 @@ class WindowManager extends WebviewWindowHandle {
* Unminimizes the window. * Unminimizes the window.
* @example * @example
* ```typescript * ```typescript
* import { appWindow } from '@tauri-apps/window'; * import { appWindow } from '@tauri-apps/plugin-window';
* await appWindow.unminimize(); * await appWindow.unminimize();
* ``` * ```
* *
@ -1005,7 +1005,7 @@ class WindowManager extends WebviewWindowHandle {
* Sets the window visibility to true. * Sets the window visibility to true.
* @example * @example
* ```typescript * ```typescript
* import { appWindow } from '@tauri-apps/window'; * import { appWindow } from '@tauri-apps/plugin-window';
* await appWindow.show(); * await appWindow.show();
* ``` * ```
* *
@ -1023,7 +1023,7 @@ class WindowManager extends WebviewWindowHandle {
* Sets the window visibility to false. * Sets the window visibility to false.
* @example * @example
* ```typescript * ```typescript
* import { appWindow } from '@tauri-apps/window'; * import { appWindow } from '@tauri-apps/plugin-window';
* await appWindow.hide(); * await appWindow.hide();
* ``` * ```
* *
@ -1041,7 +1041,7 @@ class WindowManager extends WebviewWindowHandle {
* Closes the window. * Closes the window.
* @example * @example
* ```typescript * ```typescript
* import { appWindow } from '@tauri-apps/window'; * import { appWindow } from '@tauri-apps/plugin-window';
* await appWindow.close(); * await appWindow.close();
* ``` * ```
* *
@ -1059,7 +1059,7 @@ class WindowManager extends WebviewWindowHandle {
* Whether the window should have borders and bars. * Whether the window should have borders and bars.
* @example * @example
* ```typescript * ```typescript
* import { appWindow } from '@tauri-apps/window'; * import { appWindow } from '@tauri-apps/plugin-window';
* await appWindow.setDecorations(false); * await appWindow.setDecorations(false);
* ``` * ```
* *
@ -1088,7 +1088,7 @@ class WindowManager extends WebviewWindowHandle {
* *
* @example * @example
* ```typescript * ```typescript
* import { appWindow } from '@tauri-apps/window'; * import { appWindow } from '@tauri-apps/plugin-window';
* await appWindow.setShadow(false); * await appWindow.setShadow(false);
* ``` * ```
* *
@ -1131,7 +1131,7 @@ class WindowManager extends WebviewWindowHandle {
* Whether the window should always be on top of other windows. * Whether the window should always be on top of other windows.
* @example * @example
* ```typescript * ```typescript
* import { appWindow } from '@tauri-apps/window'; * import { appWindow } from '@tauri-apps/plugin-window';
* await appWindow.setAlwaysOnTop(true); * await appWindow.setAlwaysOnTop(true);
* ``` * ```
* *
@ -1151,7 +1151,7 @@ class WindowManager extends WebviewWindowHandle {
* Prevents the window contents from being captured by other apps. * Prevents the window contents from being captured by other apps.
* @example * @example
* ```typescript * ```typescript
* import { appWindow } from '@tauri-apps/window'; * import { appWindow } from '@tauri-apps/plugin-window';
* await appWindow.setContentProtected(true); * await appWindow.setContentProtected(true);
* ``` * ```
* *
@ -1170,7 +1170,7 @@ class WindowManager extends WebviewWindowHandle {
* Resizes the window with a new inner size. * Resizes the window with a new inner size.
* @example * @example
* ```typescript * ```typescript
* import { appWindow, LogicalSize } from '@tauri-apps/window'; * import { appWindow, LogicalSize } from '@tauri-apps/plugin-window';
* await appWindow.setSize(new LogicalSize(600, 500)); * await appWindow.setSize(new LogicalSize(600, 500));
* ``` * ```
* *
@ -1202,7 +1202,7 @@ class WindowManager extends WebviewWindowHandle {
* Sets the window minimum inner size. If the `size` argument is not provided, the constraint is unset. * Sets the window minimum inner size. If the `size` argument is not provided, the constraint is unset.
* @example * @example
* ```typescript * ```typescript
* import { appWindow, PhysicalSize } from '@tauri-apps/window'; * import { appWindow, PhysicalSize } from '@tauri-apps/plugin-window';
* await appWindow.setMinSize(new PhysicalSize(600, 500)); * await appWindow.setMinSize(new PhysicalSize(600, 500));
* ``` * ```
* *
@ -1238,7 +1238,7 @@ class WindowManager extends WebviewWindowHandle {
* Sets the window maximum inner size. If the `size` argument is undefined, the constraint is unset. * Sets the window maximum inner size. If the `size` argument is undefined, the constraint is unset.
* @example * @example
* ```typescript * ```typescript
* import { appWindow, LogicalSize } from '@tauri-apps/window'; * import { appWindow, LogicalSize } from '@tauri-apps/plugin-window';
* await appWindow.setMaxSize(new LogicalSize(600, 500)); * await appWindow.setMaxSize(new LogicalSize(600, 500));
* ``` * ```
* *
@ -1274,7 +1274,7 @@ class WindowManager extends WebviewWindowHandle {
* Sets the window outer position. * Sets the window outer position.
* @example * @example
* ```typescript * ```typescript
* import { appWindow, LogicalPosition } from '@tauri-apps/window'; * import { appWindow, LogicalPosition } from '@tauri-apps/plugin-window';
* await appWindow.setPosition(new LogicalPosition(600, 500)); * await appWindow.setPosition(new LogicalPosition(600, 500));
* ``` * ```
* *
@ -1311,7 +1311,7 @@ class WindowManager extends WebviewWindowHandle {
* Sets the window fullscreen state. * Sets the window fullscreen state.
* @example * @example
* ```typescript * ```typescript
* import { appWindow } from '@tauri-apps/window'; * import { appWindow } from '@tauri-apps/plugin-window';
* await appWindow.setFullscreen(true); * await appWindow.setFullscreen(true);
* ``` * ```
* *
@ -1331,7 +1331,7 @@ class WindowManager extends WebviewWindowHandle {
* Bring the window to front and focus. * Bring the window to front and focus.
* @example * @example
* ```typescript * ```typescript
* import { appWindow } from '@tauri-apps/window'; * import { appWindow } from '@tauri-apps/plugin-window';
* await appWindow.setFocus(); * await appWindow.setFocus();
* ``` * ```
* *
@ -1349,7 +1349,7 @@ class WindowManager extends WebviewWindowHandle {
* Sets the window icon. * Sets the window icon.
* @example * @example
* ```typescript * ```typescript
* import { appWindow } from '@tauri-apps/window'; * import { appWindow } from '@tauri-apps/plugin-window';
* await appWindow.setIcon('/tauri/awesome.png'); * await appWindow.setIcon('/tauri/awesome.png');
* ``` * ```
* *
@ -1380,7 +1380,7 @@ class WindowManager extends WebviewWindowHandle {
* - **macOS:** Unsupported. * - **macOS:** Unsupported.
* @example * @example
* ```typescript * ```typescript
* import { appWindow } from '@tauri-apps/window'; * import { appWindow } from '@tauri-apps/plugin-window';
* await appWindow.setSkipTaskbar(true); * await appWindow.setSkipTaskbar(true);
* ``` * ```
* *
@ -1408,7 +1408,7 @@ class WindowManager extends WebviewWindowHandle {
* - **macOS:** This locks the cursor in a fixed location, which looks visually awkward. * - **macOS:** This locks the cursor in a fixed location, which looks visually awkward.
* @example * @example
* ```typescript * ```typescript
* import { appWindow } from '@tauri-apps/window'; * import { appWindow } from '@tauri-apps/plugin-window';
* await appWindow.setCursorGrab(true); * await appWindow.setCursorGrab(true);
* ``` * ```
* *
@ -1434,7 +1434,7 @@ class WindowManager extends WebviewWindowHandle {
* outside of the window. * outside of the window.
* @example * @example
* ```typescript * ```typescript
* import { appWindow } from '@tauri-apps/window'; * import { appWindow } from '@tauri-apps/plugin-window';
* await appWindow.setCursorVisible(false); * await appWindow.setCursorVisible(false);
* ``` * ```
* *
@ -1454,7 +1454,7 @@ class WindowManager extends WebviewWindowHandle {
* Modifies the cursor icon of the window. * Modifies the cursor icon of the window.
* @example * @example
* ```typescript * ```typescript
* import { appWindow } from '@tauri-apps/window'; * import { appWindow } from '@tauri-apps/plugin-window';
* await appWindow.setCursorIcon('help'); * await appWindow.setCursorIcon('help');
* ``` * ```
* *
@ -1474,7 +1474,7 @@ class WindowManager extends WebviewWindowHandle {
* Changes the position of the cursor in window coordinates. * Changes the position of the cursor in window coordinates.
* @example * @example
* ```typescript * ```typescript
* import { appWindow, LogicalPosition } from '@tauri-apps/window'; * import { appWindow, LogicalPosition } from '@tauri-apps/plugin-window';
* await appWindow.setCursorPosition(new LogicalPosition(600, 300)); * await appWindow.setCursorPosition(new LogicalPosition(600, 300));
* ``` * ```
* *
@ -1512,7 +1512,7 @@ class WindowManager extends WebviewWindowHandle {
* *
* @example * @example
* ```typescript * ```typescript
* import { appWindow } from '@tauri-apps/window'; * import { appWindow } from '@tauri-apps/plugin-window';
* await appWindow.setIgnoreCursorEvents(true); * await appWindow.setIgnoreCursorEvents(true);
* ``` * ```
* *
@ -1532,7 +1532,7 @@ class WindowManager extends WebviewWindowHandle {
* Starts dragging the window. * Starts dragging the window.
* @example * @example
* ```typescript * ```typescript
* import { appWindow } from '@tauri-apps/window'; * import { appWindow } from '@tauri-apps/plugin-window';
* await appWindow.startDragging(); * await appWindow.startDragging();
* ``` * ```
* *
@ -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) {
@ -1879,7 +1879,7 @@ class WebviewWindow extends WindowManager {
* Creates a new WebviewWindow. * Creates a new WebviewWindow.
* @example * @example
* ```typescript * ```typescript
* import { WebviewWindow } from '@tauri-apps/window'; * import { WebviewWindow } from '@tauri-apps/plugin-window';
* const webview = new WebviewWindow('my-label', { * const webview = new WebviewWindow('my-label', {
* url: 'https://github.com/tauri-apps/tauri' * url: 'https://github.com/tauri-apps/tauri'
* }); * });
@ -1916,7 +1916,7 @@ class WebviewWindow extends WindowManager {
* Gets the WebviewWindow for the webview associated with the given label. * Gets the WebviewWindow for the webview associated with the given label.
* @example * @example
* ```typescript * ```typescript
* import { WebviewWindow } from '@tauri-apps/window'; * import { WebviewWindow } from '@tauri-apps/plugin-window';
* const mainWindow = WebviewWindow.getByLabel('main'); * const mainWindow = WebviewWindow.getByLabel('main');
* ``` * ```
* *
@ -2296,7 +2296,7 @@ function mapPhysicalSize(m: PhysicalSize): PhysicalSize {
* Returns `null` if current monitor can't be detected. * Returns `null` if current monitor can't be detected.
* @example * @example
* ```typescript * ```typescript
* import { currentMonitor } from '@tauri-apps/window'; * import { currentMonitor } from '@tauri-apps/plugin-window';
* const monitor = currentMonitor(); * const monitor = currentMonitor();
* ``` * ```
* *
@ -2313,7 +2313,7 @@ async function currentMonitor(): Promise<Monitor | null> {
* Returns `null` if it can't identify any monitor as a primary one. * Returns `null` if it can't identify any monitor as a primary one.
* @example * @example
* ```typescript * ```typescript
* import { primaryMonitor } from '@tauri-apps/window'; * import { primaryMonitor } from '@tauri-apps/plugin-window';
* const monitor = primaryMonitor(); * const monitor = primaryMonitor();
* ``` * ```
* *
@ -2329,7 +2329,7 @@ async function primaryMonitor(): Promise<Monitor | null> {
* Returns the list of all the monitors available on the system. * Returns the list of all the monitors available on the system.
* @example * @example
* ```typescript * ```typescript
* import { availableMonitors } from '@tauri-apps/window'; * import { availableMonitors } from '@tauri-apps/plugin-window';
* const monitors = availableMonitors(); * const monitors = availableMonitors();
* ``` * ```
* *

Loading…
Cancel
Save