1 | export interface Options {
|
2 | /**
|
3 | Set to `false` to avoid spawning subprocesses and instead only resolve the locale from environment variables.
|
4 |
|
5 | @default true
|
6 | */
|
7 | readonly spawn?: boolean;
|
8 | }
|
9 |
|
10 | /**
|
11 | Get the system [locale](https://en.wikipedia.org/wiki/Locale_(computer_software)).
|
12 |
|
13 | @returns The locale.
|
14 |
|
15 | @example
|
16 | ```
|
17 | import {osLocale} from 'os-locale';
|
18 |
|
19 | console.log(await osLocale());
|
20 | //=> 'en-US'
|
21 | ```
|
22 | */
|
23 | export function osLocale(options?: Options): Promise<string>;
|
24 |
|
25 | /**
|
26 | Synchronously get the system [locale](https://en.wikipedia.org/wiki/Locale_(computer_software)).
|
27 |
|
28 | @returns The locale.
|
29 |
|
30 | @example
|
31 | ```
|
32 | import {osLocaleSync} from 'os-locale';
|
33 |
|
34 | console.log(osLocaleSync());
|
35 | //=> 'en-US'
|
36 | ```
|
37 | */
|
38 | export function osLocaleSync(options?: Options): string;
|