declare module `'tslib'`
See original GitHub issueRight now, tslib.d.ts
does not contain a module declaration for 'tslib
’ and instead declares the functions in the global namespace. As of TS 2.1.4, when I enable the --noEmitHelpers
and --importHelpers
compiler flags, my build fails because it cannot find the required 'tslib'
module.
I’m opening an issue because there’s probably a reason this hasn’t been done already, but wouldn’t it be possible to do something like:
// ... existing global typing defs
declare module 'tslib' {
export function __extends(d: Function, b: Function): void;
export function __assign(t: any, ...sources: any[]): any;
export function __rest(t: any, propertyNames: string[]): any;
export function __decorate(decorators: Function[], target: any, key?: string | symbol, desc?: any): any;
export function __param(paramIndex: number, decorator: Function): Function;
export function __metadata(metadataKey: any, metadataValue: any): Function;
export function __awaiter(thisArg: any, _arguments: any, P: Function, generator: Function): any;
export function __generator(thisArg: any, body: Function): any;
}
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
declare module `'tslib'` · Issue #16 · microsoft/tslib - GitHub
4, when I enable the --noEmitHelpers and --importHelpers compiler flags, my build fails because it cannot find the required 'tslib' module. I'm ...
Read more >"This syntax requires an imported helper but module 'tslib ...
In my case the error Cannot find module 'tslib' was caused by special builder @nrwl/node:build in my Angular repository (I'm using nrwl/nx ...
Read more >tslib - npm
Runtime library for TypeScript helper functions. Latest version: 2.4.1, last published: 2 months ago. Start using tslib in your project by ...
Read more >add module tslib - Code Examples & Solutions For This ...
TypeScript 3.9.2 or later npm install tslib // TypeScript 3.8.4 or earlier npm install ... typescript declare module · add module.ts to a...
Read more >This syntax requires an imported helper but module 'tslib ...
To solve the error "This syntax requires an imported helper but module 'tslib' cannot be found", install tslib by running npm install -D...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think part of the issue is that your
"typeRoots"
definition is incorrect. The"typeRoots"
field should point to folders only, and does not support globs. Please refer to www.typescriptlang.org/docs/handbook/tsconfig-json.html#types-typeroots-and-types for more information.Also updated in the readme: https://github.com/Microsoft/tslib/blob/master/README.md#for-bower-users