From 94cee905101111c85c32e7542bd57c396957f1ff Mon Sep 17 00:00:00 2001 From: Dimitri Benin Date: Sun, 16 Jul 2017 15:38:47 +0200 Subject: [PATCH] [proj4leaflet] remove types duplicated from proj4 --- types/proj4leaflet/index.d.ts | 38 +++++++++-------------------------- 1 file changed, 10 insertions(+), 28 deletions(-) diff --git a/types/proj4leaflet/index.d.ts b/types/proj4leaflet/index.d.ts index bed6682dc8..e40ecbfe89 100644 --- a/types/proj4leaflet/index.d.ts +++ b/types/proj4leaflet/index.d.ts @@ -3,11 +3,12 @@ // Definitions by: BendingBender // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// +import * as proj4 from "../proj4"; +import * as Leaflet from "leaflet"; -declare namespace L { - namespace Proj { - class CRS implements L.CRS { +declare global { + namespace L.Proj { + class CRS implements Leaflet.CRS { projection: Projection; transformation: Transformation; code?: string; @@ -15,7 +16,7 @@ declare namespace L { wrapLat?: [number, number]; infinite: boolean; - constructor(projection: InterfaceProjection, options?: ProjCRSOptions); + constructor(projection: proj4.InterfaceProjection, options?: ProjCRSOptions); constructor(code: string, proj4def: string, options?: ProjCRSOptions); latLngToPoint(latlng: LatLngExpression, zoom: number): Point; @@ -37,12 +38,12 @@ declare namespace L { wrapLatLng(latlng: LatLng | LatLngLiteral): LatLng; } - class GeoJSON extends L.GeoJSON { + class GeoJSON extends Leaflet.GeoJSON { } const geoJson: (geojson?: GeoJSONGeoJsonObject, options?: GeoJSONOptions) => GeoJSON; - class ImageOverlay extends L.ImageOverlay { + class ImageOverlay extends Leaflet.ImageOverlay { } const imageOverlay: (imageUrl: string, bounds: LatLngBoundsExpression, options?: ImageOverlayOptions) => ImageOverlay; @@ -54,26 +55,7 @@ declare namespace L { resolutions?: number[]; transformation?: Transformation; } - - interface InterfaceProjection { - datum: string; - b: number; - rf: number; - sphere: number; - es: number; - e: number; - ep2: number; - forward(coordinates: TemplateCoordinates): number[]; - inverse(coordinates: TemplateCoordinates): number[]; - } - - type TemplateCoordinates = number[] | InterfaceCoordinates; - - interface InterfaceCoordinates { - x: number; - y: number; - z?: number; - m?: number; - } } } + +export = L;