@types/leaflet
Advanced tools
Comparing version 1.2.1 to 1.2.2
@@ -584,5 +584,5 @@ // Type definitions for Leaflet.js 1.2 | ||
export class Polyline<T extends geojson.GeometryObject = geojson.LineString | geojson.MultiLineString> extends Path { | ||
export class Polyline<T extends geojson.GeometryObject = geojson.LineString | geojson.MultiLineString, P = any> extends Path { | ||
constructor(latlngs: LatLngExpression[], options?: PolylineOptions); | ||
toGeoJSON(): geojson.Feature<T>; | ||
toGeoJSON(): geojson.Feature<T, P>; | ||
getLatLngs(): LatLng[]; | ||
@@ -595,3 +595,3 @@ setLatLngs(latlngs: LatLngExpression[]): this; | ||
feature?: geojson.Feature<T>; | ||
feature?: geojson.Feature<T, P>; | ||
options: PolylineOptions; | ||
@@ -602,3 +602,3 @@ } | ||
export class Polygon extends Polyline<geojson.Polygon | geojson.MultiPolygon> { | ||
export class Polygon<P = any> extends Polyline<geojson.Polygon | geojson.MultiPolygon, P> { | ||
constructor(latlngs: LatLngExpression[] | LatLngExpression[][], options?: PolylineOptions); | ||
@@ -609,3 +609,3 @@ } | ||
export class Rectangle extends Polygon { | ||
export class Rectangle<P = any> extends Polygon<P> { | ||
constructor(latLngBounds: LatLngBoundsExpression, options?: PolylineOptions); | ||
@@ -621,5 +621,5 @@ setBounds(latLngBounds: LatLngBoundsExpression): this; | ||
export class CircleMarker extends Path { | ||
export class CircleMarker<P = any> extends Path { | ||
constructor(latlng: LatLngExpression, options?: CircleMarkerOptions); | ||
toGeoJSON(): geojson.Feature<geojson.Point>; | ||
toGeoJSON(): geojson.Feature<geojson.Point, P>; | ||
setLatLng(latLng: LatLngExpression): this; | ||
@@ -631,3 +631,3 @@ getLatLng(): LatLng; | ||
options: CircleMarkerOptions; | ||
feature?: geojson.Feature<geojson.Point>; | ||
feature?: geojson.Feature<geojson.Point, P>; | ||
} | ||
@@ -637,3 +637,3 @@ | ||
export class Circle extends CircleMarker { | ||
export class Circle<P = any> extends CircleMarker<P> { | ||
constructor(latlng: LatLngExpression, options?: CircleMarkerOptions); | ||
@@ -676,3 +676,3 @@ constructor(latlng: LatLngExpression, radius: number, options?: CircleMarkerOptions); // deprecated! | ||
*/ | ||
export class LayerGroup extends Layer { | ||
export class LayerGroup<P = any> extends Layer { | ||
constructor(layers?: Layer[]); | ||
@@ -682,3 +682,3 @@ /** | ||
*/ | ||
toGeoJSON(): geojson.FeatureCollection<geojson.GeometryObject> | geojson.Feature<geojson.MultiPoint> | geojson.GeometryCollection; | ||
toGeoJSON(): geojson.FeatureCollection<geojson.GeometryObject, P> | geojson.Feature<geojson.MultiPoint, P> | geojson.GeometryCollection; | ||
@@ -737,3 +737,3 @@ /** | ||
feature?: geojson.FeatureCollection<geojson.GeometryObject> | geojson.Feature<geojson.MultiPoint> | geojson.GeometryCollection; | ||
feature?: geojson.FeatureCollection<geojson.GeometryObject, P> | geojson.Feature<geojson.MultiPoint, P> | geojson.GeometryCollection; | ||
} | ||
@@ -750,7 +750,7 @@ | ||
*/ | ||
export class FeatureGroup extends LayerGroup { | ||
export class FeatureGroup<P = any> extends LayerGroup<P> { | ||
/** | ||
* Sets the given path options to each layer of the group that has a setStyle method. | ||
*/ | ||
setStyle(style: StyleFunction): this; | ||
setStyle(style: PathOptions): this; | ||
@@ -779,5 +779,5 @@ /** | ||
export type StyleFunction = (feature?: geojson.Feature<geojson.GeometryObject>) => PathOptions; | ||
export type StyleFunction<P = any> = (feature?: geojson.Feature<geojson.GeometryObject, P>) => PathOptions; | ||
export interface GeoJSONOptions extends LayerOptions { | ||
export interface GeoJSONOptions<P = any> extends LayerOptions { | ||
/** | ||
@@ -796,3 +796,3 @@ * A Function defining how GeoJSON points spawn Leaflet layers. | ||
*/ | ||
pointToLayer?(geoJsonPoint: geojson.Feature<geojson.Point>, latlng: LatLng): Layer; // should import GeoJSON typings | ||
pointToLayer?(geoJsonPoint: geojson.Feature<geojson.Point, P>, latlng: LatLng): Layer; // should import GeoJSON typings | ||
@@ -811,3 +811,3 @@ /** | ||
*/ | ||
style?: StyleFunction; | ||
style?: StyleFunction<P>; | ||
@@ -824,3 +824,3 @@ /** | ||
*/ | ||
onEachFeature?(feature: geojson.Feature<geojson.GeometryObject>, layer: Layer): void; | ||
onEachFeature?(feature: geojson.Feature<geojson.GeometryObject, P>, layer: Layer): void; | ||
@@ -838,3 +838,3 @@ /** | ||
*/ | ||
filter?(geoJsonFeature: geojson.Feature<geojson.GeometryObject>): boolean; | ||
filter?(geoJsonFeature: geojson.Feature<geojson.GeometryObject, P>): boolean; | ||
@@ -852,3 +852,3 @@ /** | ||
*/ | ||
export class GeoJSON extends FeatureGroup { | ||
export class GeoJSON<P = any> extends FeatureGroup<P> { | ||
/** | ||
@@ -858,3 +858,3 @@ * Creates a Layer from a given GeoJSON feature. Can use a custom pointToLayer | ||
*/ | ||
static geometryToLayer(featureData: geojson.Feature<geojson.GeometryObject>, options?: GeoJSONOptions): Layer; | ||
static geometryToLayer<P = any>(featureData: geojson.Feature<geojson.GeometryObject, P>, options?: GeoJSONOptions<P>): Layer; | ||
@@ -893,5 +893,5 @@ /** | ||
*/ | ||
static asFeature(geojson: geojson.Feature<geojson.GeometryObject> | geojson.GeometryObject): geojson.Feature<geojson.GeometryObject>; | ||
static asFeature<P = any>(geojson: geojson.Feature<geojson.GeometryObject, P> | geojson.GeometryObject): geojson.Feature<geojson.GeometryObject, P>; | ||
constructor(geojson?: geojson.GeoJsonObject, options?: GeoJSONOptions) | ||
constructor(geojson?: geojson.GeoJsonObject, options?: GeoJSONOptions<P>) | ||
/** | ||
@@ -908,8 +908,3 @@ * Adds a GeoJSON object to the layer. | ||
/** | ||
* Changes styles of GeoJSON vector layers with the given style function. | ||
*/ | ||
setStyle(style: StyleFunction): this; | ||
options: GeoJSONOptions; | ||
options: GeoJSONOptions<P>; | ||
} | ||
@@ -924,3 +919,3 @@ | ||
*/ | ||
export function geoJSON(geojson?: geojson.GeoJsonObject, options?: GeoJSONOptions): GeoJSON; | ||
export function geoJSON<P = any>(geojson?: geojson.GeoJsonObject, options?: GeoJSONOptions<P>): GeoJSON<P>; | ||
@@ -1481,4 +1476,5 @@ export type Zoom = boolean | 'center'; | ||
export class Marker extends Layer { | ||
export class Marker<P = any> extends Layer { | ||
constructor(latlng: LatLngExpression, options?: MarkerOptions); | ||
toGeoJSON(): geojson.Feature<geojson.Point, P>; | ||
getLatLng(): LatLng; | ||
@@ -1494,2 +1490,3 @@ setLatLng(latlng: LatLngExpression): this; | ||
dragging?: Handler; | ||
feature?: geojson.Feature<geojson.Point, P>; | ||
} | ||
@@ -1496,0 +1493,0 @@ |
{ | ||
"name": "@types/leaflet", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"description": "TypeScript definitions for Leaflet.js", | ||
@@ -27,4 +27,4 @@ "license": "MIT", | ||
}, | ||
"typesPublisherContentHash": "edd7ddbdb106a0dbdb35d0a3099814e4c4ba30b571d5658163c6c4b52d281646", | ||
"typesPublisherContentHash": "2caa10d9bbd1f247ca2974fb92ad9451a16b934acf2faceaaa64d4126680d486", | ||
"typeScriptVersion": "2.3" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
Additional Details | ||
* Last updated: Wed, 25 Oct 2017 01:03:56 GMT | ||
* Last updated: Thu, 09 Nov 2017 22:14:16 GMT | ||
* Dependencies: geojson | ||
@@ -14,0 +14,0 @@ * Global values: L |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
52034
1265