strong type openWith paramter

pull/2019/head
amrbashir 9 months ago
parent f5da785902
commit adf4d52445
No known key found for this signature in database
GPG Key ID: BBD7A47A2003FF33

@ -20,6 +20,19 @@
import { invoke } from '@tauri-apps/api/core'
export type Program =
| 'firefox'
| 'google chrome'
| 'chromium'
| 'safari'
| 'open'
| 'start'
| 'xdg-open'
| 'gio'
| 'gnome-open'
| 'kde-open'
| 'wslview'
/**
* Opens a path or URL with the system's default app,
* or the one specified with `openWith`.
@ -44,7 +57,7 @@ import { invoke } from '@tauri-apps/api/core'
*
* @since 2.0.0
*/
export async function open(path: string, openWith?: string): Promise<void> {
export async function open(path: string, openWith?: Program): Promise<void> {
await invoke('plugin:opener|open', {
path,
with: openWith

Loading…
Cancel
Save