index.d.ts 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import lcidCodes = require('./lcid.json');
  2. declare const lcid: {
  3. /**
  4. Get a [standard locale identifier](https://en.wikipedia.org/wiki/Locale_(computer_software)) from a [Windows locale identifier (LCID)](http://en.wikipedia.org/wiki/Locale#Specifics_for_Microsoft_platforms).
  5. @example
  6. ```
  7. import lcid = require('lcid');
  8. lcid.from(1044);
  9. //=> 'nb_NO'
  10. ```
  11. */
  12. from(lcidCode: number): string;
  13. /**
  14. Get a [Windows locale identifier (LCID)](https://en.wikipedia.org/wiki/Locale#Specifics_for_Microsoft_platforms) from a [standard locale identifier](https://en.wikipedia.org/wiki/Locale_(computer_software)).
  15. @example
  16. ```
  17. import lcid = require('lcid');
  18. lcid.to('nb_NO');
  19. //=> 1044
  20. ```
  21. */
  22. to(localeId: string): number;
  23. /**
  24. Mapping between [standard locale identifiers](https://en.wikipedia.org/wiki/Locale_(computer_software)) and [Windows locale identifiers (LCID)](http://en.wikipedia.org/wiki/Locale#Specifics_for_Microsoft_platforms).
  25. @example
  26. ```
  27. import lcid = require('lcid');
  28. lcid.all;
  29. //=> {'af_ZA': 1078, …}
  30. ```
  31. */
  32. readonly all: typeof lcidCodes;
  33. };
  34. export = lcid;