A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/Microsoft/TypeScript/issues/27416 below:

Libraries specified in `lib` in tsconfig.json should be emitted as reference directives in declarations · Issue #27416 · microsoft/TypeScript · GitHub

Search Terms Suggestion

When specifying "lib": ["es2017.sharedmemory"], in tsconfig.json, I expected the output declaration files to include a reference directive to the lib, for example, /// <reference lib="es2017.sharedmemory"/>. Not doing so means that if I publish a package to npm that uses the SharedArrayBuffer type, the consumer will have to specify "lib": ["es2017.sharedmemory"], in their tsconfig.json too. This is super leaky as the original package could be used many levels deep and the requirement leaks to the top. This makes it unfeasible to use any kind of extra lib in a reusable package.

Relevant issue: sindresorhus/is#51

My current workaround is to manually add the reference directives (which is now possible in TS 3.1.1, thanks to #26497), but this doesn't scale if the package has many files.

Use Cases

Being able to use types for modern features without the consumer having to know what I'm using internally.

Examples

https://github.com/sindresorhus/is/blob/c983ffa4cd83c114b18d021c180e6ba9265070cd/source/index.ts#L181

Checklist

My suggestion meets these guidelines:

SamVerschueren and ibezkrovnyi


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4