File tree 1 file changed +16
-7
lines changed
1 file changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -358,14 +358,23 @@ npm install @types/d3 --save-dev
358
358
359
359
If the library doesn't have typings available at ` @types/ ` , you can still use it by
360
360
manually adding typings for it:
361
- ```
362
- // in src/typings.d.ts
363
- declare module 'typeless-package';
364
361
365
- // in src/app/app.component.ts
366
- import * as typelessPackage from 'typeless-package';
367
- typelessPackage.method();
368
- ```
362
+ 1 . First, create a ` typings.d.ts ` file in your ` src/ ` folder. This file will be automatically included as global type definition.
363
+
364
+ 2 . Then, in ` src/typings.d.ts ` , add the following code:
365
+
366
+ ``` typescript
367
+ declare module ' typeless-package' ;
368
+ ```
369
+
370
+ 3 . Finally, in the component or file that uses the library, add the following code:
371
+
372
+ ``` typescript
373
+ import * as typelessPackage from ' typeless-package' ;
374
+ typelessPackage .method ();
375
+ ```
376
+
377
+ Done. Note: you might need or find useful to define more typings for the library that you're trying to use.
369
378
370
379
### Global Library Installation
371
380
You can’t perform that action at this time.
0 commit comments