Skip to content

Latest commit

 

History

History
30 lines (20 loc) · 930 Bytes

third-party-lib.md

File metadata and controls

30 lines (20 loc) · 930 Bytes

3rd Party Library Installation

Simply install your library via npm install lib-name --save and import it in your code.

If the library does not include typings, you can install them using npm:

npm install d3 --save
npm install @types/d3 --save-dev

If the library doesn't have typings available at @types/, you can still use it by manually adding typings for it:

  1. First, create a typings.d.ts file in your src/ folder. This file will be automatically included as global type definition.

  2. Then, in src/typings.d.ts, add the following code:

declare module 'typeless-package';
  1. Finally, in the component or file that uses the library, add the following code:
import * as typelessPackage from 'typeless-package';
typelessPackage.method();

Done. Note: you might need or find useful to define more typings for the library that you're trying to use.