tauri/cli/tauri.js/api-src/window.ts
nothingismagick 2681ad361b
refactor(tauri.js) rewrite API module in TypeScript, closes #679 #435 (#703)
Co-authored-by: Quentin Goinaud <armaldio@gmail.com>
Co-authored-by: Lucas Fernandes Nogueira <lucasfernandesnog@gmail.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2020-06-27 12:20:00 -03:00

31 lines
390 B
TypeScript

import { invoke } from './tauri'
/**
* sets the window title
*
* @param title the new title
*/
function setTitle(title: string): void {
invoke({
cmd: 'setTitle',
title
})
}
/**
* opens an URL on the user default browser
*
* @param url the URL to open
*/
function open(url: string): void {
invoke({
cmd: 'open',
uri: url
})
}
export {
setTitle,
open
}