d3 / d3-geo-projection

Extended geographic projections for d3-geo.
https://observablehq.com/collection/@d3/d3-geo-projection
Other
1.1k stars 201 forks source link

Could not find a declaration file #217

Closed LukaTchubabria closed 2 years ago

LukaTchubabria commented 2 years ago

Does this library have no types? How to solve this problem?

import { geoCylindricalStereographic } from "d3-geo-projectio ] Could not find a declaration file for module 'd3-geo-projection'.

mbostock commented 2 years ago

D3 does not maintain TypeScript declarations but some are maintained by the community as part of the DefinitelyTyped project.

kbtz commented 2 years ago

As a workaround one can declare the needed exports in an ambient declaration (.d.ts file) as follows:

declare module "d3-geo-projection" {
    import { GeoProjection } from "d3-geo"
    export function geoPatterson(): GeoProjection
}