{"id":15598193,"url":"https://github.com/boneskull/all-types","last_synced_at":"2025-03-26T03:32:02.065Z","repository":{"id":57176328,"uuid":"102669609","full_name":"boneskull/all-types","owner":"boneskull","description":"All DefinitelyTyped typedefs, installed globally, for WebStorm \u0026 other JetBrains IDEs","archived":true,"fork":false,"pushed_at":"2017-09-07T05:29:10.000Z","size":27,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-01T03:18:13.670Z","etag":null,"topics":["definitelytyped","ide","inference","jetbrains","nodejs","ts","types","typescript","typings","webstorm"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/boneskull.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-06T23:55:42.000Z","updated_at":"2024-11-19T20:02:07.000Z","dependencies_parsed_at":"2022-08-26T13:11:47.909Z","dependency_job_id":null,"html_url":"https://github.com/boneskull/all-types","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boneskull%2Fall-types","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boneskull%2Fall-types/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boneskull%2Fall-types/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boneskull%2Fall-types/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/boneskull","download_url":"https://codeload.github.com/boneskull/all-types/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245585240,"owners_count":20639667,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["definitelytyped","ide","inference","jetbrains","nodejs","ts","types","typescript","typings","webstorm"],"created_at":"2024-10-03T01:29:59.772Z","updated_at":"2025-03-26T03:32:01.627Z","avatar_url":"https://github.com/boneskull.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# all-types\n\n\u003e All DefinitelyTyped typedefs, installed globally, for WebStorm \u0026 other JetBrains IDEs\n\n## Motivation\n\nI created this to be able to leverage [DefinitelyTyped](http://definitelytyped.org/)'s type definitions from within JetBrains' [WebStorm](https://www.jetbrains.com/webstorm/) (and other IDEs).  The presence of these typedefs provides better highlighting and code completion, *even if you're not using TypeScript!* \n\n*This tool will absolve you from actually adding `@types/whatever` as a development dependency to a non-TypeScript project.*\n\n## Install\n\n```sh\n$ npm i -g all-types\n```\n\nUpon installation, three (3) things happen:\n\n1.  The DefinitelyTyped [repo](https://github.com/DefinitelyTyped/DefinitelyTyped) will be cloned into a data directory.\n2.  The working copy's `types/` dir will then be symlinked to your *global* `node_modules` directory as `@types`.\n3.  The `update-types` executable will be installed globally.\n\n## Post-Install Setup\n\n### Webstorm \u0026 other JetBrains IDEs\n\nTo get this working, you need to add a new \"JavaScript library\" to your IDE.  These instructions will assume WebStorm.\n\n1. Load a Node.js or JavaScript project.\n2. Ensure the Node.js plugin is installed (it probably is).\n3. Open **Preferences**.\n4. Navigate to **Languages \u0026 Frameworks \u003e JavaScript \u003e Libraries**.  \n    ![screenshot](https://cldup.com/kCR2jZOSsX.png)\n5. Click **Add**:  \n    ![screenshot](https://cldup.com/1JrQDSz3t2.png)\n6. In the dialog, configure like so:  \n    ![screenshot](https://cldup.com/Fs_pASpv4z.png)  \n    1. Set **Name** to \"types\" or \"all-types\" (up to you).\n    2. Set **Framework type** to **node_modules**.\n    3. Set **Visibility** to **Global**.\n7. Click the **+** as shown below, then select **Attach Directories...**.  \n    ![screenshot](https://cldup.com/fxcB2GIvVN.png)  \n8. In the file chooser, navigate to your global modules dir.\n\n    \u003e This is usually something like `/usr/local/lib/node_modules` or `/usr/lib/node_modules`.  You can print this by executing `npm config get prefix` then  appending `lib/node_modules` (or just `node_modules` if on Windows).  \n    \n    From this directory, navigate *into* the newly-symlinked `@types/` dir.\n    \n    \u003e **Warning!** You *could* add the whole `@types/` dir, but I'd recommend just picking the ones you actually use.  I've had unexpected results when trying to load the whole thing (plus, indexing is slow); YMMV. \n\n    Now you should be in `/path/to/global/node_modules/@types/`.  You can select multiple directories; go ahead and command-click (or alt-click or whatever) on the packages you use.  For example, if you use `lodash` and `debug` often, pick both of these directories.\n    \n    \u003e You will probably want to get types for the Node.js core modules--but you may not want *all* of them.  So, don't add `@types/node`; instead, add `@types/node/v6` or `@types/node/v4` depending on your version.  As of this writing, `v8` was not available, so I just chose `v7`.\n\n    You don't have to choose them all now--you can go back and add more later!  Pick a handful.  When finished, click **OK**.\n9. Now, you will need to tell WebStorm the \"scope\" of this library.  Click **Manage Scopes...**:  \n    ![screenshot](https://cldup.com/SEwRMMAK4j.png)\n10. Click on the first row, in the **Library** column.  You should see something like `\u003cyour-project\u003e/nodemodules` already checked.  Find `all-types`, then select it.  \n    ![screenshot](https://cldup.com/a79zWYevyt.png)\n    \u003e `all-types` will be whatever you named it, but `all-types/nodemodules` will be `\u003cyour-project\u003e/nodemodules`; I just happened to take this screenshot from this project!\n11. Click **OK**.  Then click **OK** again to apply \u0026 save your preferences.\n12. To verify this worked, take a look at the **External libraries** in your project tree.  If it looks like this, you're set:  \n    ![screenshot](https://cldup.com/bV47nLSlAf.png)\n13. Enjoy better type inference and code completion!\n\nSince you've installed this library as a *global* library, *repeat steps 9-12 for each other project* which wants to use the globally-installed types.\n\n\u003e I've yet to discover a way to get this working in WebStorm's **Default Settings**, so it is automatically enabled in a new project. \n\n### Updating the Types\nThe working copy tracks the `master` branch of DefinitelyTyped.  The DefinitelyTyped team publishes *All* packages within the `@types` scope from `master`, as far as I can tell.\n  \nTo get any updates, execute `update-types` again; it'll pull down all of the latest changes, without cloning again from scratch.  \n\n\u003e Consider creating a cron or `launchd` job to update automatically. \n\n## Advanced Installation \u0026 Usage\n\n### Default Working Copy Path\n\nThe default path of the DefinitelyTyped working copy is `/your/xdg-data-dir/all-types/DefinitelyTyped/`.  You can discover this path via the `--show-dir` flag:\n\n```sh\n$ update-types --show-dir\n/Users/boneskull/.local/share/all-types/DefinitelyTyped\n```\n\n\u003e See [xdg-basedir](https://npm.im/xdg-basedir) for more information.\n\n### Custom Working Copy Path\n\nTo override the default path, you can specify the `--dir` option to `update-types`; the repo will then be cloned into the directory of your choosing.  To be clear, it won't create a `DefinitelyTyped/` subdirectory; the working copy root *will be at the path* you specify:\n\n```sh\n$ update-types --dir /tmp/foobar\nUpdating https://github.com/DefinitelyTyped/DefinitelyTyped.git at /tmp/foobar, please wait...\nUp-to-date.\n```\n\n**However**, this will *not* remove the default working copy (as shown with `update-types --show-dir`)!\n\n### Set Working Copy Path Globally\n\nYou can set the `ALL_TYPES_DIR` environment variable.  This will override the default path, but *not* any path specified with `-d/--dir`.\n\nYou can set this when installing, as well:\n\n```sh\n$ ALL_TYPES_DIR=/tmp/foobar npm i -g all-types\n```\n\n## Caveats\n\n- **This package is not intended to work with TypeScript projects**.  This tool is for *non-TypeScript* projects which want to take advantage of the extra type information available from DefinitelyTyped.\n- Be careful with typedefs corresponding to a version of a package you aren't using.  If you need older versions, you *may* need to manually manage the working copy, or use `npm install -D` (which we were trying to avoid). \n\n## License\n© 2017 [Christopher Hiller](https://boneskull.com).  Licensed Apache-2.0.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboneskull%2Fall-types","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fboneskull%2Fall-types","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboneskull%2Fall-types/lists"}