How would I import ts-topojson into an Angular2 project so I get Typescript typings? I installed the module using npm and tried to include with a simple import statement but the linter said it couldn't find 'topojson'.
import { Topojson } from 'topojson';
This is my first Angular2 project so I'm very new at this so I could possibly be missing a crucial step.
You could install the package @types/topojson
with npm install @types/topojson --save-dev
.
Now you can use topojson
the following way within a component:
import {topology, feature, ...} from 'topojson';
Or with:
import * as t from '@types/topojson';