mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-04-03 10:11:15 +02:00
55 lines
1.1 KiB
TypeScript
55 lines
1.1 KiB
TypeScript
// Copyright 2019-2021 Tauri Programme within The Commons Conservancy
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
/**
|
|
* Get application metadata.
|
|
* @packageDocumentation
|
|
*/
|
|
|
|
import { invokeTauriCommand } from './helpers/tauri'
|
|
|
|
/**
|
|
* Gets the application version.
|
|
*
|
|
* @returns A promise resolving to the application version.
|
|
*/
|
|
async function getVersion(): Promise<string> {
|
|
return invokeTauriCommand<string>({
|
|
__tauriModule: 'App',
|
|
message: {
|
|
cmd: 'getAppVersion'
|
|
}
|
|
})
|
|
}
|
|
|
|
/**
|
|
* Gets the application name.
|
|
*
|
|
* @returns A promise resolving to application name.
|
|
*/
|
|
async function getName(): Promise<string> {
|
|
return invokeTauriCommand<string>({
|
|
__tauriModule: 'App',
|
|
message: {
|
|
cmd: 'getAppName'
|
|
}
|
|
})
|
|
}
|
|
|
|
/**
|
|
* Gets the tauri version.
|
|
*
|
|
* @returns A promise resolving to tauri version.
|
|
*/
|
|
async function getTauriVersion(): Promise<string> {
|
|
return invokeTauriCommand<string>({
|
|
__tauriModule: 'App',
|
|
message: {
|
|
cmd: 'getTauriVersion'
|
|
}
|
|
})
|
|
}
|
|
|
|
export { getName, getVersion, getTauriVersion }
|