diff --git a/types/d3-geo/d3-geo-tests.ts b/types/d3-geo/d3-geo-tests.ts index c4508351a0..5124694378 100644 --- a/types/d3-geo/d3-geo-tests.ts +++ b/types/d3-geo/d3-geo-tests.ts @@ -395,6 +395,9 @@ constructedProjection = constructedProjection.translate([480, 250]); const center: [number, number] = constructedProjection.center(); constructedProjection = constructedProjection.center([0, 0]); +const angle = constructedProjection.angle(); +constructedProjection = constructedProjection.angle(45); + const rotate: [number, number, number] = constructedProjection.rotate(); constructedProjection = constructedProjection.rotate([0, 0]); constructedProjection = constructedProjection.rotate([0, 0, 0]); diff --git a/types/d3-geo/index.d.ts b/types/d3-geo/index.d.ts index 7efbb72010..d9f0931269 100644 --- a/types/d3-geo/index.d.ts +++ b/types/d3-geo/index.d.ts @@ -1,10 +1,10 @@ -// Type definitions for D3JS d3-geo module 1.9 +// Type definitions for D3JS d3-geo module 1.10 // Project: https://github.com/d3/d3-geo/ // Definitions by: Hugues Stefanski , Tom Wanzek , Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -// Last module patch version validated against: 1.9.0 +// Last module patch version validated against: 1.10.0 import * as GeoJSON from 'geojson'; @@ -887,7 +887,15 @@ export interface GeoProjection extends GeoStreamWrapper { * @param precision A numeric value in pixels to use as the threshold for the projection’s adaptive resampling. */ precision(precision: number): this; - + /** + * Returns the projection’s current angle, which defaults to 0°. + */ + angle(): number; + /** + * Sets the projection’s post-projection planar rotation angle to the specified angle in degrees and returns the projection. + * @param angle The new rotation angle of the projection. + */ + angle(angle: number): this; /** * Returns the current rotation [lambda, phi, gamma] specifying the rotation angles in degrees about each spherical axis. * (These correspond to yaw, pitch and roll.) which defaults [0, 0, 0].