Interface IOs

interface IOs {
    arch: () => Promise<Arch>;
    eol: () => Promise<string>;
    exeExtension: () => Promise<string>;
    family: () => Promise<Family>;
    hostname: () => Promise<string | null>;
    locale: () => Promise<string | null>;
    platform: () => Promise<Platform>;
    version: () => Promise<string>;
}

Properties

arch: () => Promise<Arch>
eol: () => Promise<string>
exeExtension: () => Promise<string>
family: () => Promise<Family>
hostname: () => Promise<string | null>

Type declaration

    • (): Promise<string | null>
    • Returns the host name of the operating system.

      Returns Promise<string | null>

      import { hostname } from '@tauri-apps/plugin-os';
      const hostname = await hostname();
locale: () => Promise<string | null>

Type declaration

    • (): Promise<string | null>
    • Returns a String with a BCP-47 language tag inside. If the locale couldn’t be obtained, null is returned instead.

      Returns Promise<string | null>

      import { locale } from '@tauri-apps/plugin-os';
      const locale = await locale();
      if (locale) {
      // use the locale string here
      }

      2.0.0

platform: () => Promise<Platform>
version: () => Promise<string>