mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-06-06 13:53:54 +02:00
chore: adjust prettier config, .gitignore and use taplo to format toml files (#1728)
* chore: adjust prettier config, .gitignore and use taplo to format toml files This brings the plugins-workspace repository to the same code style of the main tauri repo * format toml * ignore examples gen dir * add .vscode/extensions.json * remove packageManager field * fmt * fix audit * taplo ignore permissions autogenerated files * remove create dummy dist * fix prettier workflow * install fmt in prettier workflow --------- Co-authored-by: Lucas Nogueira <lucas@tauri.app>
This commit is contained in:
@@ -8,49 +8,49 @@
|
||||
* @module
|
||||
*/
|
||||
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
import { invoke } from '@tauri-apps/api/core'
|
||||
|
||||
/** @ignore */
|
||||
declare global {
|
||||
interface Window {
|
||||
__TAURI_OS_PLUGIN_INTERNALS__: {
|
||||
eol: string;
|
||||
os_type: OsType;
|
||||
platform: Platform;
|
||||
family: Family;
|
||||
version: string;
|
||||
arch: Arch;
|
||||
exe_extension: string;
|
||||
};
|
||||
eol: string
|
||||
os_type: OsType
|
||||
platform: Platform
|
||||
family: Family
|
||||
version: string
|
||||
arch: Arch
|
||||
exe_extension: string
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
type Platform =
|
||||
| "linux"
|
||||
| "macos"
|
||||
| "ios"
|
||||
| "freebsd"
|
||||
| "dragonfly"
|
||||
| "netbsd"
|
||||
| "openbsd"
|
||||
| "solaris"
|
||||
| "android"
|
||||
| "windows";
|
||||
| 'linux'
|
||||
| 'macos'
|
||||
| 'ios'
|
||||
| 'freebsd'
|
||||
| 'dragonfly'
|
||||
| 'netbsd'
|
||||
| 'openbsd'
|
||||
| 'solaris'
|
||||
| 'android'
|
||||
| 'windows'
|
||||
|
||||
type OsType = "linux" | "windows" | "macos" | "ios" | "android";
|
||||
type OsType = 'linux' | 'windows' | 'macos' | 'ios' | 'android'
|
||||
|
||||
type Arch =
|
||||
| "x86"
|
||||
| "x86_64"
|
||||
| "arm"
|
||||
| "aarch64"
|
||||
| "mips"
|
||||
| "mips64"
|
||||
| "powerpc"
|
||||
| "powerpc64"
|
||||
| "riscv64"
|
||||
| "s390x"
|
||||
| "sparc64";
|
||||
| 'x86'
|
||||
| 'x86_64'
|
||||
| 'arm'
|
||||
| 'aarch64'
|
||||
| 'mips'
|
||||
| 'mips64'
|
||||
| 'powerpc'
|
||||
| 'powerpc64'
|
||||
| 'riscv64'
|
||||
| 's390x'
|
||||
| 'sparc64'
|
||||
|
||||
/**
|
||||
* Returns the operating system-specific end-of-line marker.
|
||||
@@ -60,7 +60,7 @@ type Arch =
|
||||
* @since 2.0.0
|
||||
* */
|
||||
function eol(): string {
|
||||
return window.__TAURI_OS_PLUGIN_INTERNALS__.eol;
|
||||
return window.__TAURI_OS_PLUGIN_INTERNALS__.eol
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -77,7 +77,7 @@ function eol(): string {
|
||||
*
|
||||
*/
|
||||
function platform(): Platform {
|
||||
return window.__TAURI_OS_PLUGIN_INTERNALS__.platform;
|
||||
return window.__TAURI_OS_PLUGIN_INTERNALS__.platform
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -91,10 +91,10 @@ function platform(): Platform {
|
||||
* @since 2.0.0
|
||||
*/
|
||||
function version(): string {
|
||||
return window.__TAURI_OS_PLUGIN_INTERNALS__.version;
|
||||
return window.__TAURI_OS_PLUGIN_INTERNALS__.version
|
||||
}
|
||||
|
||||
type Family = "unix" | "windows";
|
||||
type Family = 'unix' | 'windows'
|
||||
|
||||
/**
|
||||
* Returns the current operating system family. Possible values are `'unix'`, `'windows'`.
|
||||
@@ -107,7 +107,7 @@ type Family = "unix" | "windows";
|
||||
* @since 2.0.0
|
||||
*/
|
||||
function family(): Family {
|
||||
return window.__TAURI_OS_PLUGIN_INTERNALS__.family;
|
||||
return window.__TAURI_OS_PLUGIN_INTERNALS__.family
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -121,7 +121,7 @@ function family(): Family {
|
||||
* @since 2.0.0
|
||||
*/
|
||||
function type(): OsType {
|
||||
return window.__TAURI_OS_PLUGIN_INTERNALS__.os_type;
|
||||
return window.__TAURI_OS_PLUGIN_INTERNALS__.os_type
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -136,7 +136,7 @@ function type(): OsType {
|
||||
* @since 2.0.0
|
||||
*/
|
||||
function arch(): Arch {
|
||||
return window.__TAURI_OS_PLUGIN_INTERNALS__.arch;
|
||||
return window.__TAURI_OS_PLUGIN_INTERNALS__.arch
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -150,7 +150,7 @@ function arch(): Arch {
|
||||
* @since 2.0.0
|
||||
*/
|
||||
function exeExtension(): string {
|
||||
return window.__TAURI_OS_PLUGIN_INTERNALS__.exe_extension;
|
||||
return window.__TAURI_OS_PLUGIN_INTERNALS__.exe_extension
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -167,7 +167,7 @@ function exeExtension(): string {
|
||||
* @since 2.0.0
|
||||
*/
|
||||
async function locale(): Promise<string | null> {
|
||||
return await invoke("plugin:os|locale");
|
||||
return await invoke('plugin:os|locale')
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -179,7 +179,7 @@ async function locale(): Promise<string | null> {
|
||||
* ```
|
||||
*/
|
||||
async function hostname(): Promise<string | null> {
|
||||
return await invoke("plugin:os|hostname");
|
||||
return await invoke('plugin:os|hostname')
|
||||
}
|
||||
|
||||
export {
|
||||
@@ -191,6 +191,6 @@ export {
|
||||
arch,
|
||||
locale,
|
||||
exeExtension,
|
||||
hostname,
|
||||
};
|
||||
export type { Platform, OsType, Arch, Family };
|
||||
hostname
|
||||
}
|
||||
export type { Platform, OsType, Arch, Family }
|
||||
|
||||
Reference in New Issue
Block a user