mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 12:56:46 +08:00
* Update `TypeScript Version`s to be at least as high as dependencies' versions * Run through again
60 lines
1.7 KiB
TypeScript
60 lines
1.7 KiB
TypeScript
// Type definitions for proj4leaflet 1.0
|
|
// Project: https://github.com/kartena/Proj4Leaflet#readme
|
|
// Definitions by: BendingBender <https://github.com/BendingBender>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
// TypeScript Version: 2.3
|
|
|
|
import * as geojson from 'geojson';
|
|
import * as L from 'leaflet';
|
|
import * as proj4 from 'proj4';
|
|
|
|
declare module 'leaflet' {
|
|
namespace Proj {
|
|
class CRS implements CRS {
|
|
projection: Projection;
|
|
transformation: Transformation;
|
|
code?: string;
|
|
wrapLng?: [number, number];
|
|
wrapLat?: [number, number];
|
|
infinite: boolean;
|
|
|
|
constructor(projection: proj4.InterfaceProjection, options?: ProjCRSOptions);
|
|
constructor(code: string, proj4def: string, options?: ProjCRSOptions);
|
|
|
|
latLngToPoint(latlng: LatLngExpression, zoom: number): Point;
|
|
|
|
pointToLatLng(point: PointExpression, zoom: number): LatLng;
|
|
|
|
project(latlng: LatLng | LatLngLiteral): Point;
|
|
|
|
unproject(point: PointExpression): LatLng;
|
|
|
|
scale(zoom: number): number;
|
|
|
|
zoom(scale: number): number;
|
|
|
|
getProjectedBounds(zoom: number): Bounds;
|
|
|
|
distance(latlng1: LatLngExpression, latlng2: LatLngExpression): number;
|
|
|
|
wrapLatLng(latlng: LatLng | LatLngLiteral): LatLng;
|
|
}
|
|
|
|
class GeoJSON extends L.GeoJSON {}
|
|
|
|
const geoJson: (geojson?: geojson.GeoJsonObject, options?: GeoJSONOptions) => GeoJSON;
|
|
|
|
class ImageOverlay extends L.ImageOverlay {}
|
|
|
|
const imageOverlay: (imageUrl: string, bounds: LatLngBoundsExpression, options?: ImageOverlayOptions) => ImageOverlay;
|
|
|
|
interface ProjCRSOptions {
|
|
bounds?: Bounds;
|
|
origin?: [number, number];
|
|
scales?: number[];
|
|
resolutions?: number[];
|
|
transformation?: Transformation;
|
|
}
|
|
}
|
|
}
|