Socket
Socket
Sign inDemoInstall

@types/leaflet

Package Overview
Dependencies
Maintainers
1
Versions
137
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/leaflet - npm Package Compare versions

Comparing version 1.0.57 to 1.0.58

161

leaflet/index.d.ts

@@ -41,46 +41,46 @@ // Type definitions for Leaflet.js 1.0

namespace LineUtil {
function simplify(points: PointExpression[], tolerance: number): Point[];
function simplify(points: Point[], tolerance: number): Point[];
function pointToSegmentDistance(p: PointExpression, p1: PointExpression, p2: PointExpression): number;
function pointToSegmentDistance(p: Point, p1: Point, p2: Point): number;
function closestPointOnSegment(p: PointExpression, p1: PointExpression, p2: PointExpression): Point;
function closestPointOnSegment(p: Point, p1: Point, p2: Point): Point;
}
namespace PolyUtil {
function clipPolygon(points: PointExpression[], bounds: BoundsExpression, round?: boolean): Point[];
function clipPolygon(points: Point[], bounds: BoundsExpression, round?: boolean): Point[];
}
class DomUtil {
module DomUtil {
/**
* Get Element by its ID or with the given HTML-Element
*/
static get(element: string | HTMLElement): HTMLElement;
static getStyle(el: HTMLElement, styleAttrib: string): string;
static create(tagName: string, className?: string, container?: HTMLElement): HTMLElement;
static remove(el: HTMLElement): void;
static empty(el: HTMLElement): void;
static toFront(el: HTMLElement): void;
static toBack(el: HTMLElement): void;
static hasClass(el: HTMLElement, name: string): boolean;
static addClass(el: HTMLElement, name: string): void;
static removeClass(el: HTMLElement, name: string): void;
static setClass(el: HTMLElement, name: string): void;
static getClass(el: HTMLElement): string;
static setOpacity(el: HTMLElement, opacity: number): void;
static testProp(props: string[]): string | boolean/*=false*/;
static setTransform(el: HTMLElement, offset: Point, scale?: number): void;
static setPosition(el: HTMLElement, position: Point): void;
static getPosition(el: HTMLElement): Point;
static disableTextSelection(): void;
static enableTextSelection(): void;
static disableImageDrag(): void;
static enableImageDrag(): void;
static preventOutline(el: HTMLElement): void;
static restoreOutline(): void;
function get(element: string | HTMLElement): HTMLElement | null;
function getStyle(el: HTMLElement, styleAttrib: string): string | null;
function create(tagName: string, className?: string, container?: HTMLElement): HTMLElement;
function remove(el: HTMLElement): void;
function empty(el: HTMLElement): void;
function toFront(el: HTMLElement): void;
function toBack(el: HTMLElement): void;
function hasClass(el: HTMLElement, name: string): boolean;
function addClass(el: HTMLElement, name: string): void;
function removeClass(el: HTMLElement, name: string): void;
function setClass(el: HTMLElement, name: string): void;
function getClass(el: HTMLElement): string;
function setOpacity(el: HTMLElement, opacity: number): void;
function testProp(props: string[]): string | false;
function setTransform(el: HTMLElement, offset: Point, scale?: number): void;
function setPosition(el: HTMLElement, position: Point): void;
function getPosition(el: HTMLElement): Point;
function disableTextSelection(): void;
function enableTextSelection(): void;
function disableImageDrag(): void;
function enableImageDrag(): void;
function preventOutline(el: HTMLElement): void;
function restoreOutline(): void;
}
abstract class CRS {
interface CRS {
latLngToPoint(latlng: LatLngExpression, zoom: number): Point;
pointToLatLng(point: PointExpression, zoom: number): LatLng;
project(latlng: LatLngExpression): Point;
project(latlng: LatLng | LatLngLiteral): Point;
unproject(point: PointExpression): LatLng;

@@ -91,7 +91,7 @@ scale(zoom: number): number;

distance(latlng1: LatLngExpression, latlng2: LatLngExpression): number;
wrapLatLng(latlng: LatLngExpression): LatLng;
wrapLatLng(latlng: LatLng | LatLngLiteral): LatLng;
code: string;
wrapLng: [number, number];
wrapLat: [number, number];
code?: string;
wrapLng?: [number, number];
wrapLat?: [number, number];
infinite: boolean;

@@ -109,6 +109,6 @@ }

interface Projection {
project(latlng: LatLngExpression): Point;
project(latlng: LatLng | LatLngLiteral): Point;
unproject(point: PointExpression): LatLng;
bounds: LatLngBounds;
bounds: Bounds;
}

@@ -124,3 +124,2 @@

constructor(latitude: number, longitude: number, altitude?: number);
constructor(coords: LatLngTuple | [number, number, number] | LatLngLiteral | {lat: number, lng: number, alt?: number});
equals(otherLatLng: LatLngExpression, maxMargin?: number): boolean;

@@ -134,3 +133,3 @@ toString(): string;

lng: number;
alt: number;
alt?: number;
}

@@ -185,5 +184,4 @@

constructor(x: number, y: number, round?: boolean);
constructor(coords: PointTuple | {x: number, y: number});
clone(): Point;
add(otherPoint: PointExpression): Point; // investigate if this mutates or returns a new instance
add(otherPoint: PointExpression): Point; // non-destructive, returns a new point
subtract(otherPoint: PointExpression): Point;

@@ -225,4 +223,4 @@ divideBy(num: number): Point;

min: Point;
max: Point;
min?: Point;
max?: Point;
}

@@ -413,3 +411,3 @@

removeFrom(map: Map): this;
getPane(name?: string): HTMLElement;
getPane(name?: string): HTMLElement | undefined;

@@ -424,3 +422,3 @@ // Popup methods

setPopupContent(content: Content | Popup): this;
getPopup(): Popup;
getPopup(): Popup | undefined;

@@ -435,10 +433,10 @@ // Tooltip methods

setTooltipContent(content: Content | Tooltip): this;
getTooltip(): Tooltip;
getTooltip(): Tooltip | undefined;
// Extension methods
onAdd(map: Map): this;
onRemove(map: Map): this;
getEvents(): {[name: string]: (event: Event) => void};
getAttribution(): string;
beforeAdd(map: Map): this;
onAdd?: (map: Map) => this;
onRemove?: (map: Map) => this;
getEvents?: () => {[name: string]: (event: Event) => void};
getAttribution?: () => string | null;
beforeAdd?: (map: Map) => this;
}

@@ -467,4 +465,3 @@

bringToBack(): this;
getAttribution(): string;
getContainer(): HTMLElement;
getContainer(): HTMLElement | null;
setOpacity(opacity: number): this;

@@ -514,3 +511,3 @@ setZIndex(zIndex: number): this;

interface WMSOptions extends TileLayerOptions {
layers: string;
layers?: string;
styles?: string;

@@ -562,3 +559,3 @@ format?: string;

/** Get the img element that represents the ImageOverlay on the map */
getElement(): HTMLImageElement;
getElement(): HTMLImageElement | undefined;

@@ -598,3 +595,3 @@ options: ImageOverlayOptions;

bringToBack(): this;
getElement(): HTMLElement;
getElement(): Element | undefined;

@@ -624,3 +621,3 @@ options: PathOptions;

feature: GeoJSONFeature<GeoJSONLineString | GeoJSONMultiLineString>;
feature?: GeoJSONFeature<GeoJSONLineString | GeoJSONMultiLineString>;
}

@@ -634,3 +631,3 @@

feature: GeoJSONFeature<GeoJSONPolygon | GeoJSONMultiPolygon>;
feature?: GeoJSONFeature<GeoJSONPolygon | GeoJSONMultiPolygon>;
}

@@ -660,3 +657,3 @@

options: CircleMarkerOptions;
feature: GeoJSONFeature<GeoJSONPoint>;
feature?: GeoJSONFeature<GeoJSONPoint>;
}

@@ -746,3 +743,3 @@

*/
getLayer(id: number): Layer;
getLayer(id: number): Layer | undefined;

@@ -764,3 +761,3 @@ /**

feature: GeoJSONFeatureCollection<GeoJSONGeometryObject> | GeoJSONFeature<GeoJSONMultiPoint> | GeoJSONGeometryCollection;
feature?: GeoJSONFeatureCollection<GeoJSONGeometryObject> | GeoJSONFeature<GeoJSONMultiPoint> | GeoJSONGeometryCollection;
}

@@ -805,3 +802,3 @@

type StyleFunction = (feature: GeoJSONFeature<GeoJSONGeometryObject>) => PathOptions;
type StyleFunction = (feature?: GeoJSONFeature<GeoJSONGeometryObject>) => PathOptions;

@@ -901,3 +898,3 @@ interface GeoJSONOptions extends LayerOptions {

*/
static latLngToCoords(latlng: LatLng): [number, number, number]; // A three tuple can be assigned to a two or three tuple
static latLngToCoords(latlng: LatLng): [number, number] | [number, number, number];

@@ -1014,3 +1011,3 @@ /**

setPosition(position: ControlPosition): this;
getContainer(): HTMLElement;
getContainer(): HTMLElement | undefined;
addTo(map: Map): this;

@@ -1020,4 +1017,4 @@ remove(): this;

// Extension methods
onAdd(map: Map): HTMLElement;
onRemove(map: Map): void;
onAdd?: (map: Map) => HTMLElement;
onRemove?: (map: Map) => void;

@@ -1120,7 +1117,7 @@ options: ControlOptions;

constructor(options?: PopupOptions, source?: Layer);
getLatLng(): LatLng;
getLatLng(): LatLng | undefined;
setLatLng(latlng: LatLngExpression): this;
getContent(): Content;
getContent(): Content | ((source: Layer) => Content) | undefined;
setContent(htmlContent: ((source: Layer) => Content) | Content): this;
getElement(): HTMLElement;
getElement(): HTMLElement | undefined;
update(): void;

@@ -1152,7 +1149,7 @@ isOpen(): boolean;

setOpacity(val: number): void;
getLatLng(): LatLng;
getLatLng(): LatLng | undefined;
setLatLng(latlng: LatLngExpression): this;
getContent(): Content;
getContent(): Content | undefined;
setContent(htmlContent: ((source: Layer) => Content) | Content): this;
getElement(): HTMLElement;
getElement(): HTMLElement | undefined;
update(): void;

@@ -1206,4 +1203,4 @@ isOpen(): boolean;

// Extension methods
addHooks(): void;
removeHooks(): void;
addHooks?: () => void;
removeHooks?: () => void;
}

@@ -1309,3 +1306,3 @@

function getMousePosition(ev: Event, container?: HTMLElement): Point;
function getMousePosition(ev: {clientX: number, clientY: number} /*MouseEvent from lib.d.ts*/, container?: HTMLElement): Point;

@@ -1380,3 +1377,3 @@ function getWheelDelta(ev: Event): number;

*/
getPane(pane: string | HTMLElement): HTMLElement;
getPane(pane: string | HTMLElement): HTMLElement | undefined;
getPanes(): {[name: string]: HTMLElement} & DefaultMapPanes;

@@ -1424,3 +1421,3 @@ getContainer(): HTMLElement;

scrollWheelZoom: Handler;
tap: Handler;
tap?: Handler;
touchZoom: Handler;

@@ -1481,3 +1478,3 @@

interface DivIconOptions extends BaseIconOptions {
html?: string;
html?: string | false;
bgPos?: PointExpression;

@@ -1517,7 +1514,7 @@ iconSize?: PointExpression;

setOpacity(opacity: number): this;
getElement(): HTMLElement;
getElement(): HTMLElement | undefined;
// Properties
options: MarkerOptions;
dragging: Handler;
dragging?: Handler;
}

@@ -1545,3 +1542,3 @@

const mobileWebkit: boolean;
const mobiWebkit3d: boolean;
const mobileWebkit3d: boolean;
const mobileOpera: boolean;

@@ -1565,3 +1562,3 @@ const mobileGecko: boolean;

function wrapNum(num: number, range: number[], includeMax?: boolean): number;
function falseFn(): () => false;
function falseFn(): false;
function formatNum(num: number, digits?: number): number;

@@ -1577,3 +1574,3 @@ function trim(str: string): string;

function cancelAnimFrame(id: number): void;
let lastId: string;
let lastId: number;
let emptyImageUrl: string;

@@ -1580,0 +1577,0 @@ }

{
"name": "@types/leaflet",
"version": "1.0.57",
"version": "1.0.58",
"description": "TypeScript definitions for Leaflet.js",

@@ -22,4 +22,4 @@ "license": "MIT",

"peerDependencies": {},
"typesPublisherContentHash": "88f615de932ee7435e6e806c578e5ab83acee78924d41d3841b256359b61744f",
"typesPublisherContentHash": "aacfbbc6902968427967ae6696dffb3be66cdfbaf289efabd107c130b50dc1d8",
"typeScriptVersion": "2.0"
}

@@ -11,3 +11,3 @@ # Installation

Additional Details
* Last updated: Fri, 24 Mar 2017 16:00:10 GMT
* Last updated: Mon, 27 Mar 2017 23:00:21 GMT
* Dependencies: geojson

@@ -14,0 +14,0 @@ * Global values: L

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