File tree Expand file tree Collapse file tree 1 file changed +16
-7
lines changed Expand file tree Collapse file tree 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
358358
359359If the library doesn't have typings available at ` @types/ ` , you can still use it by
360360manually adding typings for it:
361- ```
362- // in src/typings.d.ts
363- declare module 'typeless-package';
364361
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.
369378
370379### Global Library Installation
371380
You can’t perform that action at this time.
0 commit comments