MES手机端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

60 lines
1.6 KiB

  1. //
  2. // Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
  3. // Released under the MIT license
  4. // https://opensource.org/licenses/mit-license.php
  5. //
  6. /*!
  7. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  8. Copyright (C) 2020 jeffy-g <hirotom1107@gmail.com>
  9. Released under the MIT license
  10. https://opensource.org/licenses/mit-license.php
  11. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  12. */
  13. export declare interface LocaleDetectorOptions {
  14. /**
  15. * Set to `false` to avoid spawning subprocesses and instead only resolve the locale from environment variables.
  16. *
  17. * @default true
  18. */
  19. readonly spawn?: boolean;
  20. /**
  21. * @default true
  22. */
  23. readonly cache?: boolean;
  24. }
  25. export declare interface LocaleDetectorBase {
  26. /**
  27. * Get the system [locale](https://en.wikipedia.org/wiki/Locale_(computer_software)).
  28. *
  29. * @returns The locale.
  30. *
  31. * @example
  32. * ```
  33. * import { osLocale } = require("os-locale-s");
  34. *
  35. * (async () => {
  36. * console.log(await osLocale());
  37. * //=> 'en-US'
  38. * })();
  39. * ```
  40. */
  41. (options?: LocaleDetectorOptions): Promise<string>;
  42. /**
  43. *
  44. */
  45. readonly version: string;
  46. }
  47. export declare interface LocaleDetector extends LocaleDetectorBase {
  48. /**
  49. * Synchronously get the system [locale](https://en.wikipedia.org/wiki/Locale_(computer_software)).
  50. *
  51. * @returns The locale.
  52. */
  53. sync(options?: LocaleDetectorOptions): string;
  54. }
  55. export declare const osLocale: LocaleDetector;
  56. export as namespace NsOsLocale;