From 3760e260d6cb2aa648eb3e5160790ee26d619975 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Wed, 24 Jul 2019 02:17:51 -0700 Subject: [PATCH] Add xdg-basedir Summary: Split this up into a separate review because the file is actually sorta hand-written and just adds noise to the things I was actually doing. Reviewed By: jknoxville Differential Revision: D16441548 fbshipit-source-id: 93366d38908bbec347fd837f5dc90b11329ebf8e --- flow-typed/npm/xdg-basedir_vx.x.x.js | 93 ++++++++++++++++++++++++++++ package.json | 1 + yarn.lock | 5 ++ 3 files changed, 99 insertions(+) create mode 100644 flow-typed/npm/xdg-basedir_vx.x.x.js diff --git a/flow-typed/npm/xdg-basedir_vx.x.x.js b/flow-typed/npm/xdg-basedir_vx.x.x.js new file mode 100644 index 000000000..4903a49c0 --- /dev/null +++ b/flow-typed/npm/xdg-basedir_vx.x.x.js @@ -0,0 +1,93 @@ +// flow-typed signature: aeca92eaf2f43c625d3be06eb8dc2bc7 +// flow-typed version: <>/xdg-basedir_v4.0.0/flow_v0.102.0 + +/** + * This is an autogenerated libdef stub for: + * + * 'xdg-basedir' + * + * Fill this stub out by replacing all the `any` types. + * + * Once filled out, we encourage you to share your work with the + * community by sending a pull request to: + * https://github.com/flowtype/flow-typed + */ + +declare module 'xdg-basedir' { + declare module.exports: { + /** + * Directory for user-specific data files. + * @example ```js + * import xdgBasedir = require('xdg-basedir'); + * xdgBasedir.data; + * //=> '/home/sindresorhus/.local/share' + * ``` + */ + +data?: string, + + /** + * Directory for user-specific configuration files. + * @example ```js + * import xdgBasedir = require('xdg-basedir'); + * xdgBasedir.config; + * //=> '/home/sindresorhus/.config' + * ``` + */ + +config?: string, + + /** + * Directory for user-specific non-essential data files. + * @example ```js + * import xdgBasedir = require('xdg-basedir'); + * xdgBasedir.cache; + * //=> '/home/sindresorhus/.cache' + * ``` + */ + +cache?: string, + + /** + * Directory for user-specific non-essential runtime files and other file objects (such as sockets, named pipes, etc). + * @example ```js + * import xdgBasedir = require('xdg-basedir'); + * xdgBasedir.runtime; + * //=> '/run/user/sindresorhus' + * ``` + */ + +runtime?: string, + + /** + * Preference-ordered array of base directories to search for data files in addition to `.data`. + * @example ```js + * import xdgBasedir = require('xdg-basedir'); + * xdgBasedir.dataDirs + * //=> ['/home/sindresorhus/.local/share', '/usr/local/share/', '/usr/share/'] + * ``` + */ + +dataDirs: [string], + + /** + * Preference-ordered array of base directories to search for configuration files in addition to `.config`. + * @example ```js + * import xdgBasedir = require('xdg-basedir'); + * xdgBasedir.configDirs; + * //=> ['/home/sindresorhus/.config', '/etc/xdg'] + * ``` + */ + +configDirs: [string], + } +} + +/** + * We include stubs for each file inside this npm package in case you need to + * require those files directly. Feel free to delete any files that aren't + * needed. + */ + + +// Filename aliases +declare module 'xdg-basedir/index' { + declare module.exports: $Exports<'xdg-basedir'>; +} +declare module 'xdg-basedir/index.js' { + declare module.exports: $Exports<'xdg-basedir'>; +} diff --git a/package.json b/package.json index 3841402a7..63a367985 100644 --- a/package.json +++ b/package.json @@ -126,6 +126,7 @@ "websocket": "^1.0.24", "which": "^1.3.1", "ws": "^7.0.0", + "xdg-basedir": "^4.0.0", "xml2js": "^0.4.19", "yargs": "^13.2.2", "yazl": "^2.5.1" diff --git a/yarn.lock b/yarn.lock index 7edd342d2..16b796c7d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8313,6 +8313,11 @@ xdg-basedir@^3.0.0: resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-3.0.0.tgz#496b2cc109eca8dbacfe2dc72b603c17c5870ad4" integrity sha1-SWsswQnsqNus/i3HK2A8F8WHCtQ= +xdg-basedir@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-4.0.0.tgz#4bc8d9984403696225ef83a1573cbbcb4e79db13" + integrity sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q== + xml-name-validator@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a"