Build and Publish Site / docker (push) Successful in 23s
ABER: Die Applikation funktioniert nur lokal. Die deployte Version geht noch nicht.
74 lines
1.8 KiB
TypeScript
74 lines
1.8 KiB
TypeScript
/*!
|
|
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
Copyright (C) 2020 jeffy-g <hirotom1107@gmail.com>
|
|
Released under the MIT license
|
|
https://opensource.org/licenses/mit-license.php
|
|
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
*/
|
|
/// <reference path="./extra-types.d.ts" preserve="true"/>
|
|
|
|
|
|
declare global {
|
|
type SelectIf<T, A, B> = void extends T ? B : A;
|
|
}
|
|
|
|
export declare interface LocaleDetectorOptions {
|
|
/**
|
|
* Set to `false` to avoid spawning subprocesses and instead only resolve the locale from environment variables.
|
|
*
|
|
* @default true
|
|
*/
|
|
readonly spawn?: boolean;
|
|
/**
|
|
* The first result is cached and used the next time.
|
|
*
|
|
* @default true
|
|
*/
|
|
readonly cache?: boolean;
|
|
}
|
|
export declare interface LocaleDetectorBase {
|
|
/**
|
|
* Get the system [locale](https://en.wikipedia.org/wiki/Locale_(computer_software)).
|
|
*
|
|
* @returns The locale.
|
|
*
|
|
* @example
|
|
* ```
|
|
* import { osLocale } = require("os-locale-s");
|
|
*
|
|
* (async () => {
|
|
* console.log(await osLocale());
|
|
* //=> 'en-US'
|
|
* })();
|
|
* ```
|
|
*/
|
|
(options?: LocaleDetectorOptions): Promise<string>;
|
|
/**
|
|
*
|
|
*/
|
|
readonly version: string;
|
|
}
|
|
|
|
export declare interface LocaleDetector extends LocaleDetectorBase {
|
|
/**
|
|
* Synchronously get the system [locale](https://en.wikipedia.org/wiki/Locale_(computer_software)).
|
|
*
|
|
* @returns The locale.
|
|
*/
|
|
sync(options?: LocaleDetectorOptions): string;
|
|
}
|
|
|
|
// /**
|
|
// * @internal
|
|
// */
|
|
// export type TInternalLocaleDetectorSig = {
|
|
// bivarianceHack<
|
|
// IsAsync extends true | void,
|
|
// R extends SelectIf<IsAsync, Promise<string>, string>
|
|
// >(options?: LocaleDetectorOptions, isAsync?: IsAsync): R;
|
|
// }["bivarianceHack"];
|
|
|
|
|
|
export declare const osLocale: LocaleDetector;
|
|
export as namespace NsOsLocale;
|