mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-01-31 00:45:24 +01:00
fix(docs): plugin usage examples using wrong package name (#527)
This commit is contained in:
committed by
GitHub
parent
6f01bc11ab
commit
7f2e2dd5b8
@@ -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,
|
||||
@@ -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({
|
||||
@@ -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',
|
||||
@@ -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' });
|
||||
* ```
|
||||
@@ -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' });
|
||||
* ```
|
||||
@@ -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' });
|
||||
* ```
|
||||
|
||||
@@ -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();
|
||||
* ```
|
||||
*
|
||||
@@ -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();
|
||||
@@ -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();
|
||||
@@ -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: [{
|
||||
@@ -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();
|
||||
* ```
|
||||
*
|
||||
@@ -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]);
|
||||
* ```
|
||||
*
|
||||
@@ -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();
|
||||
* ```
|
||||
*
|
||||
@@ -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();
|
||||
* ```
|
||||
*
|
||||
@@ -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])
|
||||
* ```
|
||||
*
|
||||
@@ -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()
|
||||
* ```
|
||||
*
|
||||
@@ -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',
|
||||
@@ -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();
|
||||
* ```
|
||||
*
|
||||
@@ -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();
|
||||
* ```
|
||||
*
|
||||
|
||||
@@ -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();
|
||||
* ```
|
||||
*/
|
||||
|
||||
@@ -102,7 +102,7 @@ class PhysicalSize {
|
||||
* Converts the physical size to a logical one.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { appWindow } from '@tauri-apps/window';
|
||||
* import { appWindow } from '@tauri-apps/plugin-window';
|
||||
* const factor = await appWindow.scaleFactor();
|
||||
* const size = await appWindow.innerSize();
|
||||
* const logical = size.toLogical(factor);
|
||||
@@ -148,7 +148,7 @@ class PhysicalPosition {
|
||||
* Converts the physical position to a logical one.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { appWindow } from '@tauri-apps/window';
|
||||
* import { appWindow } from '@tauri-apps/plugin-window';
|
||||
* const factor = await appWindow.scaleFactor();
|
||||
* const position = await appWindow.innerPosition();
|
||||
* const logical = position.toLogical(factor);
|
||||
@@ -291,7 +291,7 @@ class WebviewWindowHandle {
|
||||
*
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { appWindow } from '@tauri-apps/window';
|
||||
* import { appWindow } from '@tauri-apps/plugin-window';
|
||||
* const unlisten = await appWindow.listen<string>('state-changed', (event) => {
|
||||
* console.log(`Got error: ${payload}`);
|
||||
* });
|
||||
@@ -326,7 +326,7 @@ class WebviewWindowHandle {
|
||||
*
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { appWindow } from '@tauri-apps/window';
|
||||
* import { appWindow } from '@tauri-apps/plugin-window';
|
||||
* const unlisten = await appWindow.once<null>('initialized', (event) => {
|
||||
* console.log(`Window initialized!`);
|
||||
* });
|
||||
@@ -357,7 +357,7 @@ class WebviewWindowHandle {
|
||||
* Emits an event to the backend, tied to the webview window.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { appWindow } from '@tauri-apps/window';
|
||||
* import { appWindow } from '@tauri-apps/plugin-window';
|
||||
* 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.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { appWindow } from '@tauri-apps/window';
|
||||
* import { appWindow } from '@tauri-apps/plugin-window';
|
||||
* 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.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { appWindow } from '@tauri-apps/window';
|
||||
* import { appWindow } from '@tauri-apps/plugin-window';
|
||||
* 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.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { appWindow } from '@tauri-apps/window';
|
||||
* import { appWindow } from '@tauri-apps/plugin-window';
|
||||
* 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.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { appWindow } from '@tauri-apps/window';
|
||||
* import { appWindow } from '@tauri-apps/plugin-window';
|
||||
* 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.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { appWindow } from '@tauri-apps/window';
|
||||
* import { appWindow } from '@tauri-apps/plugin-window';
|
||||
* const size = await appWindow.outerSize();
|
||||
* ```
|
||||
*
|
||||
@@ -515,7 +515,7 @@ class WindowManager extends WebviewWindowHandle {
|
||||
* Gets the window's current fullscreen state.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { appWindow } from '@tauri-apps/window';
|
||||
* import { appWindow } from '@tauri-apps/plugin-window';
|
||||
* const fullscreen = await appWindow.isFullscreen();
|
||||
* ```
|
||||
*
|
||||
@@ -533,7 +533,7 @@ class WindowManager extends WebviewWindowHandle {
|
||||
* Gets the window's current minimized state.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { appWindow } from '@tauri-apps/window';
|
||||
* import { appWindow } from '@tauri-apps/plugin-window';
|
||||
* const minimized = await appWindow.isMinimized();
|
||||
* ```
|
||||
*
|
||||
@@ -549,7 +549,7 @@ class WindowManager extends WebviewWindowHandle {
|
||||
* Gets the window's current maximized state.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { appWindow } from '@tauri-apps/window';
|
||||
* import { appWindow } from '@tauri-apps/plugin-window';
|
||||
* const maximized = await appWindow.isMaximized();
|
||||
* ```
|
||||
*
|
||||
@@ -585,7 +585,7 @@ class WindowManager extends WebviewWindowHandle {
|
||||
* Gets the window's current decorated state.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { appWindow } from '@tauri-apps/window';
|
||||
* import { appWindow } from '@tauri-apps/plugin-window';
|
||||
* const decorated = await appWindow.isDecorated();
|
||||
* ```
|
||||
*
|
||||
@@ -603,7 +603,7 @@ class WindowManager extends WebviewWindowHandle {
|
||||
* Gets the window's current resizable state.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { appWindow } from '@tauri-apps/window';
|
||||
* import { appWindow } from '@tauri-apps/plugin-window';
|
||||
* const resizable = await appWindow.isResizable();
|
||||
* ```
|
||||
*
|
||||
@@ -684,7 +684,7 @@ class WindowManager extends WebviewWindowHandle {
|
||||
* Gets the window's current visible state.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { appWindow } from '@tauri-apps/window';
|
||||
* import { appWindow } from '@tauri-apps/plugin-window';
|
||||
* const visible = await appWindow.isVisible();
|
||||
* ```
|
||||
*
|
||||
@@ -702,7 +702,7 @@ class WindowManager extends WebviewWindowHandle {
|
||||
* Gets the window's current title.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { appWindow } from '@tauri-apps/window';
|
||||
* import { appWindow } from '@tauri-apps/plugin-window';
|
||||
* const title = await appWindow.title();
|
||||
* ```
|
||||
*
|
||||
@@ -723,7 +723,7 @@ class WindowManager extends WebviewWindowHandle {
|
||||
*
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { appWindow } from '@tauri-apps/window';
|
||||
* import { appWindow } from '@tauri-apps/plugin-window';
|
||||
* const theme = await appWindow.theme();
|
||||
* ```
|
||||
*
|
||||
@@ -743,7 +743,7 @@ class WindowManager extends WebviewWindowHandle {
|
||||
* Centers the window.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { appWindow } from '@tauri-apps/window';
|
||||
* import { appWindow } from '@tauri-apps/plugin-window';
|
||||
* await appWindow.center();
|
||||
* ```
|
||||
*
|
||||
@@ -772,7 +772,7 @@ class WindowManager extends WebviewWindowHandle {
|
||||
* - **Linux:** Urgency levels have the same effect.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { appWindow } from '@tauri-apps/window';
|
||||
* import { appWindow } from '@tauri-apps/plugin-window';
|
||||
* await appWindow.requestUserAttention();
|
||||
* ```
|
||||
*
|
||||
@@ -803,7 +803,7 @@ class WindowManager extends WebviewWindowHandle {
|
||||
* Updates the window resizable flag.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { appWindow } from '@tauri-apps/window';
|
||||
* import { appWindow } from '@tauri-apps/plugin-window';
|
||||
* await appWindow.setResizable(false);
|
||||
* ```
|
||||
*
|
||||
@@ -895,7 +895,7 @@ class WindowManager extends WebviewWindowHandle {
|
||||
* Sets the window title.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { appWindow } from '@tauri-apps/window';
|
||||
* import { appWindow } from '@tauri-apps/plugin-window';
|
||||
* await appWindow.setTitle('Tauri');
|
||||
* ```
|
||||
*
|
||||
@@ -915,7 +915,7 @@ class WindowManager extends WebviewWindowHandle {
|
||||
* Maximizes the window.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { appWindow } from '@tauri-apps/window';
|
||||
* import { appWindow } from '@tauri-apps/plugin-window';
|
||||
* await appWindow.maximize();
|
||||
* ```
|
||||
*
|
||||
@@ -933,7 +933,7 @@ class WindowManager extends WebviewWindowHandle {
|
||||
* Unmaximizes the window.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { appWindow } from '@tauri-apps/window';
|
||||
* import { appWindow } from '@tauri-apps/plugin-window';
|
||||
* await appWindow.unmaximize();
|
||||
* ```
|
||||
*
|
||||
@@ -951,7 +951,7 @@ class WindowManager extends WebviewWindowHandle {
|
||||
* Toggles the window maximized state.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { appWindow } from '@tauri-apps/window';
|
||||
* import { appWindow } from '@tauri-apps/plugin-window';
|
||||
* await appWindow.toggleMaximize();
|
||||
* ```
|
||||
*
|
||||
@@ -969,7 +969,7 @@ class WindowManager extends WebviewWindowHandle {
|
||||
* Minimizes the window.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { appWindow } from '@tauri-apps/window';
|
||||
* import { appWindow } from '@tauri-apps/plugin-window';
|
||||
* await appWindow.minimize();
|
||||
* ```
|
||||
*
|
||||
@@ -987,7 +987,7 @@ class WindowManager extends WebviewWindowHandle {
|
||||
* Unminimizes the window.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { appWindow } from '@tauri-apps/window';
|
||||
* import { appWindow } from '@tauri-apps/plugin-window';
|
||||
* await appWindow.unminimize();
|
||||
* ```
|
||||
*
|
||||
@@ -1005,7 +1005,7 @@ class WindowManager extends WebviewWindowHandle {
|
||||
* Sets the window visibility to true.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { appWindow } from '@tauri-apps/window';
|
||||
* import { appWindow } from '@tauri-apps/plugin-window';
|
||||
* await appWindow.show();
|
||||
* ```
|
||||
*
|
||||
@@ -1023,7 +1023,7 @@ class WindowManager extends WebviewWindowHandle {
|
||||
* Sets the window visibility to false.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { appWindow } from '@tauri-apps/window';
|
||||
* import { appWindow } from '@tauri-apps/plugin-window';
|
||||
* await appWindow.hide();
|
||||
* ```
|
||||
*
|
||||
@@ -1041,7 +1041,7 @@ class WindowManager extends WebviewWindowHandle {
|
||||
* Closes the window.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { appWindow } from '@tauri-apps/window';
|
||||
* import { appWindow } from '@tauri-apps/plugin-window';
|
||||
* await appWindow.close();
|
||||
* ```
|
||||
*
|
||||
@@ -1059,7 +1059,7 @@ class WindowManager extends WebviewWindowHandle {
|
||||
* Whether the window should have borders and bars.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { appWindow } from '@tauri-apps/window';
|
||||
* import { appWindow } from '@tauri-apps/plugin-window';
|
||||
* await appWindow.setDecorations(false);
|
||||
* ```
|
||||
*
|
||||
@@ -1088,7 +1088,7 @@ class WindowManager extends WebviewWindowHandle {
|
||||
*
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { appWindow } from '@tauri-apps/window';
|
||||
* import { appWindow } from '@tauri-apps/plugin-window';
|
||||
* await appWindow.setShadow(false);
|
||||
* ```
|
||||
*
|
||||
@@ -1131,7 +1131,7 @@ class WindowManager extends WebviewWindowHandle {
|
||||
* Whether the window should always be on top of other windows.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { appWindow } from '@tauri-apps/window';
|
||||
* import { appWindow } from '@tauri-apps/plugin-window';
|
||||
* await appWindow.setAlwaysOnTop(true);
|
||||
* ```
|
||||
*
|
||||
@@ -1151,7 +1151,7 @@ class WindowManager extends WebviewWindowHandle {
|
||||
* Prevents the window contents from being captured by other apps.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { appWindow } from '@tauri-apps/window';
|
||||
* import { appWindow } from '@tauri-apps/plugin-window';
|
||||
* await appWindow.setContentProtected(true);
|
||||
* ```
|
||||
*
|
||||
@@ -1170,7 +1170,7 @@ class WindowManager extends WebviewWindowHandle {
|
||||
* Resizes the window with a new inner size.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { appWindow, LogicalSize } from '@tauri-apps/window';
|
||||
* import { appWindow, LogicalSize } from '@tauri-apps/plugin-window';
|
||||
* 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.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { appWindow, PhysicalSize } from '@tauri-apps/window';
|
||||
* import { appWindow, PhysicalSize } from '@tauri-apps/plugin-window';
|
||||
* 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.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { appWindow, LogicalSize } from '@tauri-apps/window';
|
||||
* import { appWindow, LogicalSize } from '@tauri-apps/plugin-window';
|
||||
* await appWindow.setMaxSize(new LogicalSize(600, 500));
|
||||
* ```
|
||||
*
|
||||
@@ -1274,7 +1274,7 @@ class WindowManager extends WebviewWindowHandle {
|
||||
* Sets the window outer position.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { appWindow, LogicalPosition } from '@tauri-apps/window';
|
||||
* import { appWindow, LogicalPosition } from '@tauri-apps/plugin-window';
|
||||
* await appWindow.setPosition(new LogicalPosition(600, 500));
|
||||
* ```
|
||||
*
|
||||
@@ -1311,7 +1311,7 @@ class WindowManager extends WebviewWindowHandle {
|
||||
* Sets the window fullscreen state.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { appWindow } from '@tauri-apps/window';
|
||||
* import { appWindow } from '@tauri-apps/plugin-window';
|
||||
* await appWindow.setFullscreen(true);
|
||||
* ```
|
||||
*
|
||||
@@ -1331,7 +1331,7 @@ class WindowManager extends WebviewWindowHandle {
|
||||
* Bring the window to front and focus.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { appWindow } from '@tauri-apps/window';
|
||||
* import { appWindow } from '@tauri-apps/plugin-window';
|
||||
* await appWindow.setFocus();
|
||||
* ```
|
||||
*
|
||||
@@ -1349,7 +1349,7 @@ class WindowManager extends WebviewWindowHandle {
|
||||
* Sets the window icon.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { appWindow } from '@tauri-apps/window';
|
||||
* import { appWindow } from '@tauri-apps/plugin-window';
|
||||
* await appWindow.setIcon('/tauri/awesome.png');
|
||||
* ```
|
||||
*
|
||||
@@ -1380,7 +1380,7 @@ class WindowManager extends WebviewWindowHandle {
|
||||
* - **macOS:** Unsupported.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { appWindow } from '@tauri-apps/window';
|
||||
* import { appWindow } from '@tauri-apps/plugin-window';
|
||||
* 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.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { appWindow } from '@tauri-apps/window';
|
||||
* import { appWindow } from '@tauri-apps/plugin-window';
|
||||
* await appWindow.setCursorGrab(true);
|
||||
* ```
|
||||
*
|
||||
@@ -1434,7 +1434,7 @@ class WindowManager extends WebviewWindowHandle {
|
||||
* outside of the window.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { appWindow } from '@tauri-apps/window';
|
||||
* import { appWindow } from '@tauri-apps/plugin-window';
|
||||
* await appWindow.setCursorVisible(false);
|
||||
* ```
|
||||
*
|
||||
@@ -1454,7 +1454,7 @@ class WindowManager extends WebviewWindowHandle {
|
||||
* Modifies the cursor icon of the window.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { appWindow } from '@tauri-apps/window';
|
||||
* import { appWindow } from '@tauri-apps/plugin-window';
|
||||
* await appWindow.setCursorIcon('help');
|
||||
* ```
|
||||
*
|
||||
@@ -1474,7 +1474,7 @@ class WindowManager extends WebviewWindowHandle {
|
||||
* Changes the position of the cursor in window coordinates.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { appWindow, LogicalPosition } from '@tauri-apps/window';
|
||||
* import { appWindow, LogicalPosition } from '@tauri-apps/plugin-window';
|
||||
* await appWindow.setCursorPosition(new LogicalPosition(600, 300));
|
||||
* ```
|
||||
*
|
||||
@@ -1512,7 +1512,7 @@ class WindowManager extends WebviewWindowHandle {
|
||||
*
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { appWindow } from '@tauri-apps/window';
|
||||
* import { appWindow } from '@tauri-apps/plugin-window';
|
||||
* await appWindow.setIgnoreCursorEvents(true);
|
||||
* ```
|
||||
*
|
||||
@@ -1532,7 +1532,7 @@ class WindowManager extends WebviewWindowHandle {
|
||||
* Starts dragging the window.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { appWindow } from '@tauri-apps/window';
|
||||
* import { appWindow } from '@tauri-apps/plugin-window';
|
||||
* await appWindow.startDragging();
|
||||
* ```
|
||||
*
|
||||
@@ -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) {
|
||||
@@ -1879,7 +1879,7 @@ class WebviewWindow extends WindowManager {
|
||||
* Creates a new WebviewWindow.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { WebviewWindow } from '@tauri-apps/window';
|
||||
* import { WebviewWindow } from '@tauri-apps/plugin-window';
|
||||
* const webview = new WebviewWindow('my-label', {
|
||||
* 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.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { WebviewWindow } from '@tauri-apps/window';
|
||||
* import { WebviewWindow } from '@tauri-apps/plugin-window';
|
||||
* const mainWindow = WebviewWindow.getByLabel('main');
|
||||
* ```
|
||||
*
|
||||
@@ -2296,7 +2296,7 @@ function mapPhysicalSize(m: PhysicalSize): PhysicalSize {
|
||||
* Returns `null` if current monitor can't be detected.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { currentMonitor } from '@tauri-apps/window';
|
||||
* import { currentMonitor } from '@tauri-apps/plugin-window';
|
||||
* 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.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { primaryMonitor } from '@tauri-apps/window';
|
||||
* import { primaryMonitor } from '@tauri-apps/plugin-window';
|
||||
* const monitor = primaryMonitor();
|
||||
* ```
|
||||
*
|
||||
@@ -2329,7 +2329,7 @@ async function primaryMonitor(): Promise<Monitor | null> {
|
||||
* Returns the list of all the monitors available on the system.
|
||||
* @example
|
||||
* ```typescript
|
||||
* import { availableMonitors } from '@tauri-apps/window';
|
||||
* import { availableMonitors } from '@tauri-apps/plugin-window';
|
||||
* const monitors = availableMonitors();
|
||||
* ```
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user