I looked inside the leaflet.js
definition file and there I found one strange thing: Marker<P = any>
, where I can't figure out what P = any
is for. I mean why is this not P: any
?
The class implementation:
export class Marker<P = any> extends Layer {
constructor(latlng: LatLngExpression, options?: MarkerOptions);
toGeoJSON(): geojson.Feature<geojson.Point, P>;
getLatLng(): LatLng;
setLatLng(latlng: LatLngExpression): this;
setZIndexOffset(offset: number): this;
setIcon(icon: Icon | DivIcon): this;
setOpacity(opacity: number): this;
getElement(): HTMLElement | undefined;
// Properties
options: MarkerOptions;
dragging?: Handler;
feature?: geojson.Feature<geojson.Point, P>;
}
The full definition file: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/leaflet/index.d.ts