Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@types/react-leaflet

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/react-leaflet - npm Package Compare versions

Comparing version 1.1.6 to 2.2.0

316

react-leaflet/index.d.ts

@@ -1,2 +0,2 @@

// Type definitions for react-leaflet 1.1
// Type definitions for react-leaflet 2.2
// Project: https://github.com/PaulLeCam/react-leaflet

@@ -121,3 +121,8 @@ // Definitions by: Dave Leaver <https://github.com/danzel>, David Schneider <https://github.com/davschne>, Yui T. <https://github.com/yuit>

export class MapComponent<P, E extends Leaflet.Class> extends React.Component<P> {
export interface MapComponentProps {
leaflet?: LeafletContext;
pane?: string;
}
export class MapEvented<P, E extends Leaflet.Evented> extends React.Component<P> {
_leafletEvents: LeafletEvents;

@@ -128,2 +133,5 @@ leafletElement: E;

fireLeafletEvent(type: string, data: any): void;
}
export class MapComponent<P extends MapComponentProps, E extends Leaflet.Evented> extends MapEvented<P, E> {
getOptions(props: P): P;

@@ -136,21 +144,21 @@ }

boundsOptions?: Leaflet.FitBoundsOptions;
center?: Leaflet.LatLngExpression;
children?: Children;
children: Children;
className?: string;
id?: string;
maxBounds?: Leaflet.LatLngBoundsExpression;
maxZoom?: number;
minZoom?: number;
style?: React.CSSProperties;
useFlyTo?: boolean;
zoom?: number;
viewport?: Viewport;
whenReady?: () => void;
}
export class Map<P extends MapProps = MapProps, E extends Leaflet.Map = Leaflet.Map> extends MapComponent<P, E> {
className?: string;
container: HTMLDivElement;
getChildContext(): { layerContainer: E, map: E };
export class Map<P extends MapProps = MapProps, E extends Leaflet.Map = Leaflet.Map> extends MapEvented<P, E> {
className: string | null | undefined;
contextValue: LeafletContext | null | undefined;
container: HTMLDivElement | null | undefined;
viewport: Viewport;
createLeafletElement(props: P): E;
updateLeafletElement(fromProps: P, toProps: P): void;
bindContainer(container: HTMLDivElement): void;
onViewportChange: (viewport: Viewport | null) => void;
onViewportChanged: (viewport: Viewport | null) => void;
bindContainer(container: HTMLDivElement | null | undefined): void;
shouldUpdateCenter(next: Leaflet.LatLngExpression, prev: Leaflet.LatLngExpression): boolean;

@@ -160,7 +168,26 @@ shouldUpdateBounds(next: Leaflet.LatLngBoundsExpression, prev: Leaflet.LatLngBoundsExpression): boolean;

export interface DivOverlayProps extends MapComponentProps, Leaflet.DivOverlayOptions {
children: Children;
onClose?: () => void;
onOpen?: () => void;
}
export interface DivOverlayTypes extends Leaflet.Evented {
isOpen: () => boolean;
update: () => void;
}
export class DivOverlay<P extends DivOverlayProps, E extends DivOverlayTypes> extends MapComponent<P, E> {
createLeafletElement(_props: P): void;
updateLeafletElement(_prevProps: P, _props: P): void;
onClose: () => void;
onOpen: () => void;
onRender: () => void;
}
export interface PaneProps {
name?: string;
children?: Children;
map?: Leaflet.Map;
className?: string;
leaflet?: LeafletContext;
name?: string;
style?: React.CSSProperties;

@@ -170,21 +197,48 @@ pane?: string;

export interface PaneState {
name?: string;
name: string | null | undefined;
context: LeafletContext | null | undefined;
}
export class Pane<P extends PaneProps = PaneProps, S extends PaneState = PaneState> extends React.Component<P, S> {
getChildContext(): { pane: string };
createPane(props: P): void;
removePane(): void;
setStyle(arg: { style?: string, className?: string }): void;
getParentPane(): HTMLElement | undefined;
getPane(name: string): HTMLElement | undefined;
getParentPane(): HTMLElement | null | undefined;
getPane(name: string | null | undefined): HTMLElement | null | undefined;
}
export interface MapLayerProps {
export interface MapLayerProps extends MapComponentProps {
attribution?: string;
children?: Children;
}
export type AddLayerHandler = (layer: Leaflet.Layer, name: string, checked?: boolean) => void;
export type RemoveLayerHandler = (layer: Leaflet.Layer) => void;
export interface LayerContainer {
addLayer(layer: Leaflet.Layer): this;
removeLayer(layer: number | Leaflet.Layer): this;
addLayer: AddLayerHandler;
removeLayer: RemoveLayerHandler;
}
export class MapLayer<P extends MapLayerProps = MapLayerProps, E extends Leaflet.Class = Leaflet.Class> extends MapComponent<P, E> {
export interface LeafletContext {
map?: Leaflet.Map;
pane?: string;
layerContainer?: LayerContainer;
popupContainer?: Leaflet.Layer;
}
export type LatLng = Leaflet.LatLng | number[] | object;
export type LatLngBounds = Leaflet.LatLngBounds | LatLng[];
export type Point = [number, number] | Leaflet.Point;
export interface Viewport {
center: [number, number] | null | undefined;
zoom: number | null | undefined;
}
export class MapLayer<P extends MapLayerProps = MapLayerProps, E extends Leaflet.Layer = Leaflet.Layer> extends MapComponent<P, E> {
contextValue: LeafletContext | null | undefined;
leafletElement: E;
createLeafletElement(props: P): E;

@@ -195,45 +249,51 @@ updateLeafletElement(fromProps: P, toProps: P): void;

export interface GridLayerProps extends Leaflet.GridLayerOptions {
children?: Children;
export interface GridLayerProps extends MapLayerProps, Leaflet.GridLayerOptions { }
export class GridLayer<P extends GridLayerProps = GridLayerProps, E extends Leaflet.GridLayer = Leaflet.GridLayer> extends MapLayer<P, E> {
createLeafletElement(props: P): E;
updateLeafletElement(fromProps: P, toProps: P): void;
getOptions(props: P): P;
}
export class GridLayer<P extends GridLayerProps = GridLayerProps, E extends Leaflet.GridLayer = Leaflet.GridLayer> extends MapLayer<P, E> {}
export interface TileLayerProps extends TileLayerEvents, Leaflet.TileLayerOptions {
children?: Children;
export interface TileLayerProps extends GridLayerProps, TileLayerEvents, Leaflet.TileLayerOptions {
url: string;
}
export class TileLayer<P extends TileLayerProps = TileLayerProps, E extends Leaflet.TileLayer = Leaflet.TileLayer> extends GridLayer<P, E> { }
export class TileLayer<P extends TileLayerProps = TileLayerProps, E extends Leaflet.TileLayer = Leaflet.TileLayer> extends GridLayer<P, E> {
createLeafletElement(props: P): E;
updateLeafletElement(fromProps: P, toProps: P): void;
}
export interface WMSTileLayerProps extends TileLayerEvents, Leaflet.WMSOptions {
export interface WMSTileLayerProps extends TileLayerEvents, Leaflet.WMSOptions, GridLayerProps {
children?: Children;
url: string;
}
export class WMSTileLayer<P extends WMSTileLayerProps = WMSTileLayerProps, E extends Leaflet.TileLayer.WMS = Leaflet.TileLayer.WMS> extends GridLayer<P, E> { }
export class WMSTileLayer<P extends WMSTileLayerProps = WMSTileLayerProps, E extends Leaflet.TileLayer.WMS = Leaflet.TileLayer.WMS> extends GridLayer<P, E> {
createLeafletElement(props: P): E;
updateLeafletElement(fromProps: P, toProps: P): void;
getOptions(params: P): P;
}
export interface ImageOverlayProps extends Leaflet.ImageOverlayOptions {
bounds: Leaflet.LatLngBoundsExpression;
children?: Children;
url: string;
export interface ImageOverlayProps extends MapLayerProps, Leaflet.ImageOverlayOptions {
bounds?: Leaflet.LatLngBoundsExpression;
url: string | HTMLImageElement;
zIndex?: number;
}
export class ImageOverlay<P extends ImageOverlayProps = ImageOverlayProps, E extends Leaflet.ImageOverlay = Leaflet.ImageOverlay> extends MapLayer<P, E> {
getChildContext(): { popupContainer: E };
createLeafletElement(props: P): E;
updateLeafletElement(fromProps: P, toProps: P): void;
}
export interface LayerGroupProps {
children?: Children;
export class LayerGroup<P extends MapLayerProps = MapLayerProps, E extends Leaflet.LayerGroup = Leaflet.LayerGroup> extends MapLayer<P, E> {
createLeafletElement(props: P): E;
}
export class LayerGroup<P extends LayerGroupProps = LayerGroupProps, E extends Leaflet.LayerGroup = Leaflet.LayerGroup> extends MapLayer<P, E> {
getChildContext(): { layerContainer: E };
}
export interface MarkerProps extends MarkerEvents, Leaflet.MarkerOptions {
children?: Children;
export interface MarkerProps extends MapLayerProps, MarkerEvents, Leaflet.MarkerOptions {
position: Leaflet.LatLngExpression;
}
export class Marker<P extends MarkerProps = MarkerProps, E extends Leaflet.Marker = Leaflet.Marker> extends MapLayer<P, E> {
getChildContext(): { popupContainer: E };
createLeafletElement(props: P): E;
updateLeafletElement(fromProps: P, toProps: P): void;
}
export interface PathProps extends PathEvents, Leaflet.PathOptions, MapLayerProps { }
export abstract class Path<P extends PathProps, E> extends MapLayer<P, E> {
export abstract class Path<P extends PathProps, E extends Leaflet.Path> extends MapLayer<P, E> {
getChildContext(): { popupContainer: E };

@@ -245,72 +305,79 @@ getPathOptions(props: P): Leaflet.PathOptions;

export interface CircleProps extends PathEvents, Leaflet.CircleMarkerOptions {
export interface CircleProps extends MapLayerProps, PathEvents, Leaflet.CircleMarkerOptions {
center: Leaflet.LatLngExpression;
children?: Children;
radius: number;
}
export class Circle<P extends CircleProps = CircleProps, E extends Leaflet.Circle = Leaflet.Circle> extends Path<P, E> { }
export class Circle<P extends CircleProps = CircleProps, E extends Leaflet.Circle = Leaflet.Circle> extends Path<P, E> {
createLeafletElement(props: P): E;
updateLeafletElement(fromProps: P, toProps: P): void;
}
export interface CircleMarkerProps extends PathEvents, Leaflet.CircleMarkerOptions {
export interface CircleMarkerProps extends PathProps, PathEvents, Leaflet.CircleMarkerOptions {
center: Leaflet.LatLngExpression;
children?: Children;
radius: number;
}
export class CircleMarker<P extends CircleMarkerProps = CircleMarkerProps, E extends Leaflet.CircleMarker = Leaflet.CircleMarker> extends Path<P, E> { }
export class CircleMarker<P extends CircleMarkerProps = CircleMarkerProps, E extends Leaflet.CircleMarker = Leaflet.CircleMarker> extends Path<P, E> {
createLeafletElement(props: P): E;
updateLeafletElement(fromProps: P, toProps: P): void;
}
export interface FeatureGroupProps extends FeatureGroupEvents, Leaflet.PathOptions {
children?: Children;
export interface FeatureGroupProps extends MapLayerProps, FeatureGroupEvents, Leaflet.PathOptions { }
export class FeatureGroup<P extends FeatureGroupProps = FeatureGroupProps, E extends Leaflet.FeatureGroup = Leaflet.FeatureGroup> extends LayerGroup<P, E> {
createLeafletElement(props: P): E;
}
export class FeatureGroup<P extends FeatureGroupProps = FeatureGroupProps, E extends Leaflet.FeatureGroup = Leaflet.FeatureGroup> extends Path<P, E> {
getChildContext(): { layerContainer: E, popupContainer: E };
}
export interface GeoJSONProps extends FeatureGroupEvents, Leaflet.GeoJSONOptions {
children?: Children;
export interface GeoJSONProps extends PathProps, FeatureGroupEvents, Leaflet.GeoJSONOptions {
data: GeoJSON.GeoJsonObject;
style?: Leaflet.StyleFunction;
}
export class GeoJSON<P extends GeoJSONProps = GeoJSONProps, E extends Leaflet.GeoJSON = Leaflet.GeoJSON> extends Path<P, E> { }
export class GeoJSON<P extends GeoJSONProps = GeoJSONProps, E extends Leaflet.GeoJSON = Leaflet.GeoJSON> extends FeatureGroup<P, E> {
createLeafletElement(props: P): E;
updateLeafletElement(fromProps: P, toProps: P): void;
}
export interface PolylineProps extends PathEvents, Leaflet.PolylineOptions {
children?: Children;
export interface PolylineProps extends PathProps, PathEvents, Leaflet.PolylineOptions {
positions: Leaflet.LatLngExpression[] | Leaflet.LatLngExpression[][];
}
export class Polyline<P extends PolylineProps = PolylineProps, E extends Leaflet.Polyline = Leaflet.Polyline> extends Path<P, E> { }
export class Polyline<P extends PolylineProps = PolylineProps, E extends Leaflet.Polyline = Leaflet.Polyline> extends Path<P, E> {
createLeafletElement(props: P): E;
updateLeafletElement(fromProps: P, toProps: P): void;
}
export interface PolygonProps extends PathEvents, Leaflet.PolylineOptions {
children?: Children;
popupContainer?: Leaflet.FeatureGroup;
export interface PolygonProps extends PathProps, PathEvents, Leaflet.PolylineOptions {
positions: Leaflet.LatLngExpression[] | Leaflet.LatLngExpression[][] | Leaflet.LatLngExpression[][][];
}
export class Polygon<P extends PolygonProps = PolygonProps, E extends Leaflet.Polygon = Leaflet.Polygon> extends Path<P, E> { }
export class Polygon<P extends PolygonProps = PolygonProps, E extends Leaflet.Polygon = Leaflet.Polygon> extends Path<P, E> {
createLeafletElement(props: P): E;
updateLeafletElement(fromProps: P, toProps: P): void;
}
export interface RectangleProps extends PathEvents, Leaflet.PolylineOptions {
children?: Children;
export interface RectangleProps extends PathProps, PathEvents, Leaflet.PolylineOptions {
bounds: Leaflet.LatLngBoundsExpression;
popupContainer?: Leaflet.FeatureGroup;
}
export class Rectangle<P extends RectangleProps = RectangleProps, E extends Leaflet.Rectangle = Leaflet.Rectangle> extends Path<P, E> { }
export class Rectangle<P extends RectangleProps = RectangleProps, E extends Leaflet.Rectangle = Leaflet.Rectangle> extends Path<P, E> {
createLeafletElement(props: P): E;
updateLeafletElement(fromProps: P, toProps: P): void;
}
export interface PopupProps extends Leaflet.PopupOptions {
children?: Children;
export interface PopupProps extends Leaflet.PopupOptions, DivOverlayProps {
position?: Leaflet.LatLngExpression;
}
export class Popup<P extends PopupProps = PopupProps, E extends Leaflet.Popup = Leaflet.Popup> extends MapComponent<P, E> {
export class Popup<P extends PopupProps = PopupProps, E extends Leaflet.Popup = Leaflet.Popup> extends DivOverlay<P, E> {
getOptions(props: P): P;
createLeafletElement(props: P): E;
updateLeafletElement(fromProps: P, toProps: P): void;
onPopupOpen(arg: { popup: E }): void;
onPopupClose(arg: { popup: E }): void;
renderPopupContent(): void;
removePopupContent(): void;
onRender: () => void;
}
export interface TooltipProps extends Leaflet.TooltipOptions {
children?: Children;
}
export class Tooltip<P extends TooltipProps = TooltipProps, E extends Leaflet.Tooltip = Leaflet.Tooltip> extends MapComponent<P, E> {
export interface TooltipProps extends Leaflet.TooltipOptions, DivOverlayProps { }
export class Tooltip<P extends TooltipProps = TooltipProps, E extends Leaflet.Tooltip = Leaflet.Tooltip> extends DivOverlay<P, E> {
onTooltipOpen(arg: { tooltip: E }): void;
onTooltipClose(arg: { tooltip: E }): void;
renderTooltipContent(): void;
removeTooltipContent(): void;
}
export type MapControlProps = Leaflet.ControlOptions;
export type MapControlProps = {
leaflet?: LeafletContext
} & Leaflet.ControlOptions;
export class MapControl<P extends MapControlProps = MapControlProps, E extends Leaflet.Control = Leaflet.Control> extends React.Component<P> {

@@ -322,38 +389,71 @@ leafletElement: E;

export type AttributionControlProps = Leaflet.Control.AttributionOptions;
export class AttributionControl<P extends AttributionControlProps = AttributionControlProps, E extends Leaflet.Control.Attribution = Leaflet.Control.Attribution> extends MapControl<P, E> { }
export type AttributionControlProps = Leaflet.Control.AttributionOptions & MapControlProps;
export class AttributionControl<P extends AttributionControlProps = AttributionControlProps, E extends Leaflet.Control.Attribution = Leaflet.Control.Attribution> extends MapControl<P, E> {
createLeafletElement(props: P): E;
}
export interface LayersControlProps extends LayersControlEvents, Leaflet.Control.LayersOptions {
baseLayers?: Leaflet.Control.LayersObject;
children?: Children;
overlays?: Leaflet.Control.LayersObject;
export interface LayersControlProps extends MapControlProps, LayersControlEvents, Leaflet.Control.LayersOptions {
children: Children;
collapsed?: boolean;
}
export class LayersControl<P extends LayersControlProps = LayersControlProps, E extends Leaflet.Control.Layers = Leaflet.Control.Layers> extends MapControl<P, E> { }
export class LayersControl<P extends LayersControlProps = LayersControlProps, E extends Leaflet.Control.Layers = Leaflet.Control.Layers> extends MapControl<P, E> {
controlProps: {
addBaseLayer: AddLayerHandler,
addOverlay: AddLayerHandler,
removeLayer: RemoveLayerHandler,
removeLayerControl: RemoveLayerHandler
};
createLeafletElement(props: P): E;
updateLeafletElement(fromProps: P, toProps: P): void;
addBaseLayer(layer: Leaflet.Layer, name: string, checked: boolean): void;
addOverlay(layer: Leaflet.Layer, name: string, checked: boolean): void;
removeLayer(layer: Leaflet.Layer): void;
removeLayerControl(layer: Leaflet.Layer): void;
}
export namespace LayersControl {
interface BaseControlledLayerProps {
interface ControlledLayerProps {
addBaseLayer?: AddLayerHandler;
addOverlay?: AddLayerHandler;
checked?: boolean;
children?: Children;
removeLayer?(layer: Leaflet.Layer): void;
removeLayerControl?(layer: Leaflet.Layer): void;
}
interface ControlledLayerProps extends BaseControlledLayerProps {
addBaseLayer?(layer: Leaflet.Layer, name: string, checked: boolean): void;
addOverlay?(layer: Leaflet.Layer, name: string, checked: boolean): void;
children: Children;
leaflet?: LeafletContext;
name: string;
removeLayer?: RemoveLayerHandler;
removeLayerControl?: RemoveLayerHandler;
}
class ControlledLayer<P extends BaseControlledLayerProps = BaseControlledLayerProps> extends React.Component<P> {
layer?: Leaflet.Layer;
getChildContext(): { layerContainer: LayerContainer };
addLayer(): void;
class ControlledLayer<P extends ControlledLayerProps = ControlledLayerProps> extends React.Component<P> {
contextValue: LeafletContext;
layer: Leaflet.Layer | null | undefined;
removeLayer(layer: Leaflet.Layer): void;
}
class BaseLayer<P extends ControlledLayerProps = ControlledLayerProps> extends ControlledLayer<P> { }
class Overlay<P extends ControlledLayerProps = ControlledLayerProps> extends ControlledLayer<P> { }
class BaseLayer<P extends ControlledLayerProps = ControlledLayerProps> extends ControlledLayer<P> {
constructor(props: ControlledLayerProps);
addLayer: (layer: Leaflet.Layer) => void;
}
class Overlay<P extends ControlledLayerProps = ControlledLayerProps> extends ControlledLayer<P> {
constructor(props: ControlledLayerProps);
addLayer: (layer: Leaflet.Layer) => void;
}
}
export type ScaleControlProps = Leaflet.Control.ScaleOptions;
export class ScaleControl<P extends ScaleControlProps = ScaleControlProps, E extends Leaflet.Control.Scale = Leaflet.Control.Scale> extends MapControl<P, E> { }
export type ScaleControlProps = Leaflet.Control.ScaleOptions & MapControlProps;
export class ScaleControl<P extends ScaleControlProps = ScaleControlProps, E extends Leaflet.Control.Scale = Leaflet.Control.Scale> extends MapControl<P, E> {
createLeafletElement(props: P): E;
}
export type ZoomControlProps = Leaflet.Control.ZoomOptions;
export class ZoomControl<P extends ZoomControlProps = ZoomControlProps, E extends Leaflet.Control.Zoom = Leaflet.Control.Zoom> extends MapControl<P, E> { }
export type ZoomControlProps = Leaflet.Control.ZoomOptions & MapControlProps;
export class ZoomControl<P extends ZoomControlProps = ZoomControlProps, E extends Leaflet.Control.Zoom = Leaflet.Control.Zoom> extends MapControl<P, E> {
createLeafletElement(props: P): E;
}
// context.js
export const LeafletProvider: React.Provider<LeafletContext>;
export const LeafletConsumer: React.Consumer<LeafletContext>;
export interface ContextProps {
leaflet?: LeafletContext;
}
export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
export function withLeaflet<T extends ContextProps>(WrappedComponent: React.ComponentType<T>): React.ComponentType<Omit<T, 'leaflet'>>;
{
"name": "@types/react-leaflet",
"version": "1.1.6",
"version": "2.2.0",
"description": "TypeScript definitions for react-leaflet",

@@ -24,5 +24,7 @@ "license": "MIT",

"main": "",
"types": "index",
"repository": {
"type": "git",
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git"
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/react-leaflet"
},

@@ -34,4 +36,4 @@ "scripts": {},

},
"typesPublisherContentHash": "d8f794974fe4e49c2edb9bbcb0fdb05901a8dd11ba7dbbb501e2ddb8bd183899",
"typesPublisherContentHash": "1e3aef08a8598cc3d70c8018e8de273fd2ebcc927817ac73adf16316e3544f6f",
"typeScriptVersion": "2.8"
}

@@ -5,3 +5,3 @@ # Installation

# Summary
This package contains type definitions for react-leaflet (https://github.com/PaulLeCam/react-leaflet).
This package contains type definitions for react-leaflet ( https://github.com/PaulLeCam/react-leaflet ).

@@ -12,4 +12,4 @@ # Details

Additional Details
* Last updated: Mon, 23 Jul 2018 23:44:12 GMT
* Dependencies: leaflet, react
* Last updated: Thu, 28 Feb 2019 17:33:33 GMT
* Dependencies: @types/leaflet, @types/react
* Global values: none

@@ -16,0 +16,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc