index.d.ts 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. declare const xdgBasedir: {
  2. /**
  3. Directory for user-specific data files.
  4. @example
  5. ```js
  6. import xdgBasedir = require('xdg-basedir');
  7. xdgBasedir.data;
  8. //=> '/home/sindresorhus/.local/share'
  9. ```
  10. */
  11. readonly data?: string;
  12. /**
  13. Directory for user-specific configuration files.
  14. @example
  15. ```js
  16. import xdgBasedir = require('xdg-basedir');
  17. xdgBasedir.config;
  18. //=> '/home/sindresorhus/.config'
  19. ```
  20. */
  21. readonly config?: string;
  22. /**
  23. Directory for user-specific non-essential data files.
  24. @example
  25. ```js
  26. import xdgBasedir = require('xdg-basedir');
  27. xdgBasedir.cache;
  28. //=> '/home/sindresorhus/.cache'
  29. ```
  30. */
  31. readonly cache?: string;
  32. /**
  33. Directory for user-specific non-essential runtime files and other file objects (such as sockets, named pipes, etc).
  34. @example
  35. ```js
  36. import xdgBasedir = require('xdg-basedir');
  37. xdgBasedir.runtime;
  38. //=> '/run/user/sindresorhus'
  39. ```
  40. */
  41. readonly runtime?: string;
  42. /**
  43. Preference-ordered array of base directories to search for data files in addition to `.data`.
  44. @example
  45. ```js
  46. import xdgBasedir = require('xdg-basedir');
  47. xdgBasedir.dataDirs
  48. //=> ['/home/sindresorhus/.local/share', '/usr/local/share/', '/usr/share/']
  49. ```
  50. */
  51. readonly dataDirs: readonly string[];
  52. /**
  53. Preference-ordered array of base directories to search for configuration files in addition to `.config`.
  54. @example
  55. ```js
  56. import xdgBasedir = require('xdg-basedir');
  57. xdgBasedir.configDirs;
  58. //=> ['/home/sindresorhus/.config', '/etc/xdg']
  59. ```
  60. */
  61. readonly configDirs: readonly string[];
  62. };
  63. export = xdgBasedir;