;
+ }
+
+ export interface ClusterGetSettingsOptions extends GenericParams {
+ flatSettings?: boolean;
+ masterTimeout?: number | Date;
+ timeout?: number | Date;
+ }
+
+ export interface ClusterHealthOptions extends GenericParams {
+ level?: string; // cluster, indices, shards
+ local?: boolean;
+ masterTimeout?: number | Date;
+ waitForActiveShards?: number;
+ waitForNodes?: string;
+ waitForRelocatingShards?: number;
+ waitForStatus?: string; // green, yellow, red
+ index?: string | string[] | boolean;
+ }
+
+ export interface ClusterPendingTasksOptions extends GenericParams {
+ local?: boolean;
+ masterTimeout?: number | Date;
+ }
+
+ export interface ClusterPutSettingsOptions extends GenericParams {
+ flatSettings?: boolean;
+ masterTimeout?: number | Date;
+ timeout?: number | Date;
+ }
+
+ export interface ClusterRerouteOptions extends GenericParams {
+ dryRun?: boolean;
+ explain?: boolean;
+ metric?: string | string[] | boolean;
+ masterTimeout?: number | Date;
+ timeout?: number | Date;
+ }
+
+ export interface ClusterStateOptions extends GenericParams {
+ local?: boolean;
+ masterTimeout?: number | Date;
+ flatSettings?: boolean;
+ ignoreUnavailable?: boolean;
+ allowNoIndices?: boolean;
+ expandWildcards?: string; // open, closed, none, all (default open)
+ index?: string | string[] | boolean;
+ metric?: string | string[] | boolean;
+ }
+
+ export interface ClusterStatsOptions extends GenericParams {
+ flatSettings?: boolean;
+ human?: boolean;
+ timeout?: number | Date;
+ nodeId?: string | string[] | boolean;
+ }
}
declare module "elasticsearch" {
diff --git a/enzyme/enzyme.d.ts b/enzyme/enzyme.d.ts
index 4a5bf2beac..31ffce8923 100644
--- a/enzyme/enzyme.d.ts
+++ b/enzyme/enzyme.d.ts
@@ -458,6 +458,7 @@ declare module "enzyme" {
export interface ReactWrapper extends CommonWrapper
{
unmount(): ReactWrapper;
mount(): ReactWrapper;
+ render(): CheerioWrapper;
/**
* Returns a wrapper of the node that matches the provided reference name.
diff --git a/express-serve-static-core/express-serve-static-core.d.ts b/express-serve-static-core/express-serve-static-core.d.ts
index 93551ffece..e80ffa85a9 100644
--- a/express-serve-static-core/express-serve-static-core.d.ts
+++ b/express-serve-static-core/express-serve-static-core.d.ts
@@ -1046,6 +1046,11 @@ declare module "express-serve-static-core" {
* simply by removing them from this object.
*/
routes: any;
+
+ /**
+ * Using to all registered routes in Express Application
+ */
+ _router: any;
}
interface Express extends Application {
diff --git a/express/express-tests.ts b/express/express-tests.ts
index 439ef95012..92cef00b85 100644
--- a/express/express-tests.ts
+++ b/express/express-tests.ts
@@ -1,101 +1,114 @@
///
///
-
import * as express from 'express';
-var app = express();
-
-app.engine('jade', require('jade').__express);
-app.engine('html', require('ejs').renderFile);
-
-express.static.mime.define({
- 'application/fx': ['fx']
-});
-app.use('/static', express.static(__dirname + '/public'));
-
-// simple logger
-app.use(function(req, res, next){
- console.log('%s %s', req.method, req.url);
- next();
-});
-
-app.use(function(err: any, req: express.Request, res: express.Response, next: express.NextFunction) {
- console.error(err);
- next(err);
-});
-app.get('/', function(req, res){
- res.send('hello world');
-});
+namespace express_tests {
-const router = express.Router();
+ var app = express();
+ app.engine('jade', require('jade').__express);
+ app.engine('html', require('ejs').renderFile);
-const pathStr : string = 'test';
-const pathRE : RegExp = /test/;
-const path = true? pathStr : pathRE;
+ express.static.mime.define({
+ 'application/fx': ['fx']
+ });
+ app.use('/static', express.static(__dirname + '/public'));
-router.get(path);
-router.put(path)
-router.post(path);
-router.delete(path);
-router.get(pathStr);
-router.put(pathStr)
-router.post(pathStr);
-router.delete(pathStr);
-router.get(pathRE);
-router.put(pathRE)
-router.post(pathRE);
-router.delete(pathRE);
-
-router.use((req, res, next) => { next(); })
-router.route('/users')
- .get((req, res, next) => {
- let types: string[] = req.accepts();
- let type: string | boolean = req.accepts('json');
- type = req.accepts(['json', 'text']);
- type = req.accepts('json', 'text');
-
- let charsets: string[] = req.acceptsCharsets();
- let charset: string | boolean = req.acceptsCharsets('utf-8');
- charset = req.acceptsCharsets(['utf-8', 'utf-16']);
- charset = req.acceptsCharsets('utf-8', 'utf-16');
-
- let encodings: string[] = req.acceptsEncodings();
- let encoding: string | boolean = req.acceptsEncodings('gzip');
- encoding = req.acceptsEncodings(['gzip', 'deflate']);
- encoding = req.acceptsEncodings('gzip', 'deflate');
-
- let languages: string[] = req.acceptsLanguages();
- let language: string | boolean = req.acceptsLanguages('en');
- language = req.acceptsLanguages(['en', 'ja']);
- language = req.acceptsLanguages('en', 'ja');
-
- res.send(req.query['token']);
+ // simple logger
+ app.use(function(req, res, next) {
+ console.log('%s %s', req.method, req.url);
+ next();
});
-router.get('/user/:id', function(req, res, next) {
- if (req.params.id == 0) next('route');
- else next();
-}, function(req, res, next) {
- res.render('regular');
-});
+ app.use(function(err: any, req: express.Request, res: express.Response, next: express.NextFunction) {
+ console.error(err);
+ next(err);
+ });
-app.use((req, res, next) => {
- // hacky trick, router is just a handler
- router(req, res, next);
-});
-app.use(router);
+ app.get('/', function(req, res) {
+ res.send('hello world');
+ });
-app.listen(3000);
+ const router = express.Router();
-const next: express.NextFunction = () => {};
-const nextWithArgument: express.NextFunction = (err: any) => {};
-/**
- * The express.Application is compatible with http.createServer
- */
+ const pathStr: string = 'test';
+ const pathRE: RegExp = /test/;
+ const path = true ? pathStr : pathRE;
+ router.get(path);
+ router.put(path)
+ router.post(path);
+ router.delete(path);
+ router.get(pathStr);
+ router.put(pathStr)
+ router.post(pathStr);
+ router.delete(pathStr);
+ router.get(pathRE);
+ router.put(pathRE)
+ router.post(pathRE);
+ router.delete(pathRE);
+
+ router.use((req, res, next) => { next(); })
+ router.route('/users')
+ .get((req, res, next) => {
+ let types: string[] = req.accepts();
+ let type: string | boolean = req.accepts('json');
+ type = req.accepts(['json', 'text']);
+ type = req.accepts('json', 'text');
+
+ let charsets: string[] = req.acceptsCharsets();
+ let charset: string | boolean = req.acceptsCharsets('utf-8');
+ charset = req.acceptsCharsets(['utf-8', 'utf-16']);
+ charset = req.acceptsCharsets('utf-8', 'utf-16');
+
+ let encodings: string[] = req.acceptsEncodings();
+ let encoding: string | boolean = req.acceptsEncodings('gzip');
+ encoding = req.acceptsEncodings(['gzip', 'deflate']);
+ encoding = req.acceptsEncodings('gzip', 'deflate');
+
+ let languages: string[] = req.acceptsLanguages();
+ let language: string | boolean = req.acceptsLanguages('en');
+ language = req.acceptsLanguages(['en', 'ja']);
+ language = req.acceptsLanguages('en', 'ja');
+
+ res.send(req.query['token']);
+ });
+
+ router.get('/user/:id', function(req, res, next) {
+ if (req.params.id == 0) next('route');
+ else next();
+ }, function(req, res, next) {
+ res.render('regular');
+ });
+
+ app.use((req, res, next) => {
+ // hacky trick, router is just a handler
+ router(req, res, next);
+ });
+
+ app.use(router);
+
+ app.listen(3000);
+
+ const next: express.NextFunction = () => { };
+}
+
+/***************************
+ * *
+ * Test with other modules *
+ * *
+ ***************************/
import * as http from 'http';
-http.createServer(app);
+
+
+namespace node_tests {
+
+ {
+ // http.createServer can take express application
+ const app: express.Application = express();
+ http.createServer(app).listen(5678);
+ }
+}
diff --git a/facebook-js-sdk/facebook-js-sdk-tests.ts b/facebook-js-sdk/facebook-js-sdk-tests.ts
index 49e615f529..41c0eaff40 100644
--- a/facebook-js-sdk/facebook-js-sdk-tests.ts
+++ b/facebook-js-sdk/facebook-js-sdk-tests.ts
@@ -14,6 +14,12 @@ FB.getLoginStatus(function(response: fb.AuthResponse) {
console.log(response.authResponse.accessToken);
});
+FB.getLoginStatus(function(response: fb.AuthResponse) {
+ console.log(response);
+ console.log(response.status);
+ console.log(response.authResponse.accessToken);
+}, true);
+
FB.getAuthResponse(function(response: fb.AuthResponse) {
console.log(response);
console.log(response.status);
diff --git a/facebook-js-sdk/facebook-js-sdk.d.ts b/facebook-js-sdk/facebook-js-sdk.d.ts
index 5353353911..bee34f0a2c 100644
--- a/facebook-js-sdk/facebook-js-sdk.d.ts
+++ b/facebook-js-sdk/facebook-js-sdk.d.ts
@@ -8,10 +8,11 @@ declare var FB: fb.FacebookStatic;
declare namespace facebook {
interface FacebookStatic {
- // api: any;
- // AppEvents: any;
- // Canvas: any;
- // Event: any;
+ api: any;
+ AppEvents: any;
+ Canvas: any;
+ Event: any;
+
/**
* The method FB.getAuthResponse() is a synchronous accessor for the current authResponse.
* The synchronous nature of this method is what sets it apart from the other login methods.
@@ -25,7 +26,7 @@ declare namespace facebook {
*
* @param callback function to handle the response.
*/
- getLoginStatus(callback: (response: AuthResponse) => void): void;
+ getLoginStatus(callback: (response: AuthResponse) => void, roundtrip?: boolean ): void;
/**
* The method FB.init() is used to initialize and setup the SDK.
*
@@ -49,8 +50,9 @@ declare namespace facebook {
* @param callback function to handle the response
*/
logout(callback: (response: AuthResponse) => void): void;
- // ui: any;
- // XFBML: any;
+
+ ui: any;
+ XFBML: any;
}
interface InitParams {
diff --git a/fs-extra-promise/fs-extra-promise.d.ts b/fs-extra-promise/fs-extra-promise.d.ts
index bdf8360b77..2243a4d1c5 100644
--- a/fs-extra-promise/fs-extra-promise.d.ts
+++ b/fs-extra-promise/fs-extra-promise.d.ts
@@ -6,7 +6,7 @@
// Imported from: https://github.com/soywiz/typescript-node-definitions/fs-extra.d.ts via TSD fs-extra definition
///
-///
+///
declare module "fs-extra-promise" {
import stream = require("stream");
diff --git a/github-electron/github-electron-main-tests.ts b/github-electron/github-electron-main-tests.ts
index bebf0b99c8..966465ed3a 100644
--- a/github-electron/github-electron-main-tests.ts
+++ b/github-electron/github-electron-main-tests.ts
@@ -240,6 +240,63 @@ app.setUserTasks([
}
]);
app.setUserTasks([]);
+
+app.setJumpList([
+ {
+ type: 'custom',
+ name: 'Recent Projects',
+ items: [
+ { type: 'file', path: 'C:\\Projects\\project1.proj' },
+ { type: 'file', path: 'C:\\Projects\\project2.proj' }
+ ]
+ },
+ { // has a name so type is assumed to be "custom"
+ name: 'Tools',
+ items: [
+ {
+ type: 'task',
+ title: 'Tool A',
+ program: process.execPath,
+ args: '--run-tool-a',
+ iconPath: process.execPath,
+ iconIndex: 0,
+ description: 'Runs Tool A'
+ },
+ {
+ type: 'task',
+ title: 'Tool B',
+ program: process.execPath,
+ args: '--run-tool-b',
+ iconPath: process.execPath,
+ iconIndex: 0,
+ description: 'Runs Tool B'
+ }]
+ },
+ {
+ type: 'frequent'
+ },
+ { // has no name and no type so type is assumed to be "tasks"
+ items: [
+ {
+ type: 'task',
+ title: 'New Project',
+ program: process.execPath,
+ args: '--new-project',
+ description: 'Create a new project.'
+ },
+ {
+ type: 'separator'
+ },
+ {
+ type: 'task',
+ title: 'Recover Project',
+ program: process.execPath,
+ args: '--recover-project',
+ description: 'Recover Project'
+ }]
+ }
+]);
+
if (app.isUnityRunning()) {
}
if (app.isAccessibilitySupportEnabled()) {
diff --git a/github-electron/github-electron.d.ts b/github-electron/github-electron.d.ts
index 7d10fce465..64b7cf6a02 100644
--- a/github-electron/github-electron.d.ts
+++ b/github-electron/github-electron.d.ts
@@ -1,4 +1,4 @@
-// Type definitions for Electron v1.3.4
+// Type definitions for Electron v1.3.6
// Project: http://electron.atom.io/
// Definitions by: jedmao , rhysd , Milan Burda
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -62,7 +62,7 @@ declare namespace Electron {
/**
* Emitted when Electron has finished initialization.
*/
- on(event: 'ready', listener: Function): this;
+ on(event: 'ready', listener: (event: Event, launchInfo: Object) => void): this;
/**
* Emitted when all windows have been closed.
*
@@ -199,7 +199,7 @@ declare namespace Electron {
* All windows will be closed immediately without asking user
* and the before-quit and will-quit events will not be emitted.
*/
- exit(exitCode: number): void;
+ exit(exitCode?: number): void;
/**
* Relaunches the app when current instance exits.
*
@@ -218,6 +218,10 @@ declare namespace Electron {
args?: string[],
execPath?: string
}): void;
+ /**
+ * @returns Whether Electron has finished initializing.
+ */
+ isReady(): boolean;
/**
* On Linux, focuses on the first visible window.
* On macOS, makes the application the active app.
@@ -333,6 +337,19 @@ declare namespace Electron {
* Note: This API is only available on Windows.
*/
setUserTasks(tasks: Task[]): boolean;
+ /**
+ * Note: This API is only available on Windows.
+ */
+ getJumpListSettings(): JumpListSettings;
+ /**
+ * Sets or removes a custom Jump List for the application.
+ *
+ * If categories is null the previously set custom Jump List (if any) will be replaced
+ * by the standard Jump List for the app (managed by Windows).
+ *
+ * Note: This API is only available on Windows.
+ */
+ setJumpList(categories: JumpListCategory[]): SetJumpListResult;
/**
* This method makes your application a Single Instance Application instead of allowing
* multiple instances of your app to run, this will ensure that only a single instance
@@ -560,6 +577,89 @@ declare namespace Electron {
iconIndex?: number;
}
+ /**
+ * ok - Nothing went wrong.
+ * error - One or more errors occured, enable runtime logging to figure out the likely cause.
+ * invalidSeparatorError - An attempt was made to add a separator to a custom category in the Jump List.
+ * Separators are only allowed in the standard Tasks category.
+ * fileTypeRegistrationError - An attempt was made to add a file link to the Jump List
+ * for a file type the app isn't registered to handle.
+ * customCategoryAccessDeniedError - Custom categories can't be added to the Jump List
+ * due to user privacy or group policy settings.
+ */
+ type SetJumpListResult = 'ok' | 'error' | 'invalidSeparatorError' | 'fileTypeRegistrationError' | 'customCategoryAccessDeniedError';
+
+ interface JumpListSettings {
+ /**
+ * The minimum number of items that will be shown in the Jump List.
+ */
+ minItems: number;
+ /**
+ * Items that the user has explicitly removed from custom categories in the Jump List.
+ */
+ removedItems: JumpListItem[];
+ }
+
+ interface JumpListCategory {
+ /**
+ * tasks - Items in this category will be placed into the standard Tasks category.
+ * frequent - Displays a list of files frequently opened by the app, the name of the category and its items are set by Windows.
+ * recent - Displays a list of files recently opened by the app, the name of the category and its items are set by Windows.
+ * custom - Displays tasks or file links, name must be set by the app.
+ */
+ type?: 'tasks' | 'frequent' | 'recent' | 'custom';
+ /**
+ * Must be set if type is custom, otherwise it should be omitted.
+ */
+ name?: string;
+ /**
+ * Array of JumpListItem objects if type is tasks or custom, otherwise it should be omitted.
+ */
+ items?: JumpListItem[];
+ }
+
+ interface JumpListItem {
+ /**
+ * task - A task will launch an app with specific arguments.
+ * separator - Can be used to separate items in the standard Tasks category.
+ * file - A file link will open a file using the app that created the Jump List.
+ */
+ type: 'task' | 'separator' | 'file';
+ /**
+ * Path of the file to open, should only be set if type is file.
+ */
+ path?: string;
+ /**
+ * Path of the program to execute, usually you should specify process.execPath which opens the current program.
+ * Should only be set if type is task.
+ */
+ program?: string;
+ /**
+ * The command line arguments when program is executed. Should only be set if type is task.
+ */
+ args?: string;
+ /**
+ * The text to be displayed for the item in the Jump List. Should only be set if type is task.
+ */
+ title?: string;
+ /**
+ * Description of the task (displayed in a tooltip). Should only be set if type is task.
+ */
+ description?: string;
+ /**
+ * The absolute path to an icon to be displayed in a Jump List, which can be an arbitrary
+ * resource file that contains an icon (e.g. .ico, .exe, .dll).
+ * You can usually specify process.execPath to show the program icon.
+ */
+ iconPath?: string;
+ /**
+ * The index of the icon in the resource file. If a resource file contains multiple icons
+ * this value can be used to specify the zero-based index of the icon that should be displayed
+ * for this task. If a resource file contains only one icon, this property should be set to zero.
+ */
+ iconIndex?: number;
+ }
+
interface LoginItemSettings {
/**
* True if the app is set to open at login.
@@ -1271,6 +1371,12 @@ declare namespace Electron {
}
interface WebPreferences {
+ /**
+ * Whether to enable DevTools.
+ * If it is set to false, can not use BrowserWindow.webContents.openDevTools() to open DevTools.
+ * Default: true.
+ */
+ devTools?: boolean;
/**
* Whether node integration is enabled.
* Default: true.
@@ -1861,7 +1967,7 @@ declare namespace Electron {
interface CrashReporterStartOptions {
/**
- * Default: Electron
+ * Default: app.getName()
*/
productName?: string;
companyName: string;
@@ -3296,16 +3402,18 @@ declare namespace Electron {
interface Shell {
/**
* Show the given file in a file manager. If possible, select the file.
+ * @returns Whether the item was successfully shown.
*/
- showItemInFolder(fullPath: string): void;
+ showItemInFolder(fullPath: string): boolean;
/**
* Open the given file in the desktop's default manner.
+ * @returns Whether the item was successfully shown.
*/
- openItem(fullPath: string): void;
+ openItem(fullPath: string): boolean;
/**
* Open the given external protocol URL in the desktop's default manner
* (e.g., mailto: URLs in the default mail user agent).
- * @returns true if an application was available to open the URL, false otherwise.
+ * @returns Whether an application was available to open the URL.
*/
openExternal(url: string, options?: {
/**
@@ -3316,7 +3424,7 @@ declare namespace Electron {
}): boolean;
/**
* Move the given file to trash.
- * @returns boolean status for the operation.
+ * @returns Whether the item was successfully moved to the trash.
*/
moveItemToTrash(fullPath: string): boolean;
/**
@@ -3595,7 +3703,7 @@ declare namespace Electron {
interface WebContentsStatic {
/**
- * @returns An array of all web contents. This will contain web contents for all windows,
+ * @returns An array of all WebContents instances. This will contain web contents for all windows,
* webviews, opened devtools, and devtools extension background pages.
*/
getAllWebContents(): WebContents[];
@@ -3603,6 +3711,10 @@ declare namespace Electron {
* @returns The web contents that is focused in this application, otherwise returns null.
*/
getFocusedWebContents(): WebContents;
+ /**
+ * Find a WebContents instance according to its ID.
+ */
+ fromId(id: number): WebContents;
}
/**
@@ -4971,6 +5083,17 @@ declare namespace Electron {
* See webContents.sendInputEvent for detailed description of event object.
*/
sendInputEvent(event: SendInputEvent): void
+ /**
+ * Changes the zoom factor to the specified factor.
+ * Zoom factor is zoom percent divided by 100, so 300% = 3.0.
+ */
+ setZoomFactor(factor: number): void;
+ /**
+ * Changes the zoom level to the specified level.
+ * The original size is 0 and each increment above or below represents
+ * zooming 20% larger or smaller to default limits of 300% and 50% of original size, respectively.
+ */
+ setZoomLevel(level: number): void;
/**
* Shows pop-up dictionary that searches the selected word on the page.
* Note: This API is available only on macOS.
diff --git a/googlemaps/google.maps.d.ts b/googlemaps/google.maps.d.ts
index 0eaa0b9c3d..0aef3b74a6 100644
--- a/googlemaps/google.maps.d.ts
+++ b/googlemaps/google.maps.d.ts
@@ -756,7 +756,7 @@ declare namespace google.maps {
zIndex?: number;
}
- export interface PolyMouseEvent {
+ export interface PolyMouseEvent extends MouseEvent {
edge?: number;
path?: number;
vertex?: number;
diff --git a/heatmap.js/heatmap.d.ts b/heatmap.js/heatmap.d.ts
index 7cd14fc214..fb2b4eea3d 100644
--- a/heatmap.js/heatmap.d.ts
+++ b/heatmap.js/heatmap.d.ts
@@ -3,7 +3,7 @@
// Definitions by: Yang Guan
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-///
+///
/*
* Configuration object of a heatmap
diff --git a/heremaps/heremaps.d.ts b/heremaps/heremaps.d.ts
index fe79e55ecf..8d730f3ae5 100644
--- a/heremaps/heremaps.d.ts
+++ b/heremaps/heremaps.d.ts
@@ -1073,6 +1073,125 @@ declare namespace H {
*/
resizeToCenter(center: H.geo.IPoint, opt_out?: H.geo.Rect): H.geo.Rect;
}
+
+ /**
+ * A strip is a flat list of latitude, longitude, altitude tuples in a fixed order.
+ */
+ export class Strip {
+ /**
+ * Constructor
+ * @param opt_latLngAlts {Array=} - An optional array of latitude, longitude and altitude triples to initialize the strip with.
+ * @param opt_ctx {H.geo.AltitudeContext=} - An optional altitude context for all altitudes contained in this strip.
+ */
+ constructor(opt_latLngAlts?: Array, opt_ctx?: H.geo.AltitudeContext);
+
+ /**
+ * This method pushes a lat, lng, alt to the end of this strip.
+ * @param lat {H.geo.Latitude}
+ * @param lng {H.geo.Longitude}
+ * @param alt {H.geo.Altitude}
+ */
+ pushLatLngAlt(lat: H.geo.Latitude, lng: H.geo.Longitude, alt: H.geo.Altitude): void;
+
+ /**
+ * This method splices the strip at the provided index, removing the specified number of items at that index and inserting the lat, lng, alt array.
+ * @param index {number} - The index at which to splice
+ * @param opt_nRemove {number=} - The number of lat, lng, alt values to remove
+ * @param opt_latLngAlts {Array=} - The lat, lng, alt values to add
+ * @returns {Array} - an array of removed elements
+ */
+ spliceLatLngAlts(index: number, opt_nRemove?: number, opt_latLngAlts?: Array): Array;
+
+ /**
+ * This method inserts one set of lat, lng, alt values into the strip at the specified index.
+ * @param index {number} - the index at which to add the element
+ * @param lat {H.geo.Latitude} - the latitude to insert
+ * @param lng {H.geo.Longitude} - the longitude to insert
+ * @param alt {H.geo.Altitude} - the altitude to insert
+ */
+ insertLatLngAlt(index: number, lat: H.geo.Latitude, lng: H.geo.Longitude, alt: H.geo.Altitude): void;
+
+ /**
+ * This method removes one set of lat, lng, alt values from the strip at the specified index.
+ * @param index {number}
+ */
+ removeLatLngAlt(index: number): void;
+
+ /**
+ * This method pushes the lat, lng, alt values of a H.geo.Point to the end of this strip.
+ * @param geoPoint {H.geo.IPoint}
+ */
+ pushPoint(geoPoint: H.geo.IPoint): void;
+
+ /**
+ * This method inserts the lat, lng, alt values of a H.geo.Point into the list at the specified index.
+ * @param pointIndex {number}
+ * @param geoPoint {H.geo.IPoint}
+ */
+ insertPoint(pointIndex: number, geoPoint: H.geo.IPoint): void;
+
+ /**
+ * This method removes one set of lat, lng, alt values from this strip at the virtual point index specified.
+ * @param pointIndex {number} - the virtual point index
+ */
+ removePoint(pointIndex: number): void;
+
+ /**
+ * This method extracts a H.geo.Point from this strip at the virtual point index. If the extracted point has an alt value, the strip's altitude context will be supplied to the point.
+ * @param pointIndex {number} - the virtual point index in the strip
+ * @param opt_out {H.geo.Point=} - an optional point object to store the lat, lng, alt values
+ * @returns {H.geo.Point} - returns either the 'opt_out' point object or a new point object.
+ */
+ extractPoint(pointIndex: number, opt_out?: H.geo.Point): H.geo.Point;
+
+ /**
+ * This method is a utility method that iterates over the lat, lng, alt array and calls the provided function for each 3 elements passing lat, lng and alt and the virtual point index as arguments.
+ * @param eachFn {function(H.geo.Latitude, H.geo.Longitude, H.geo.Altitude, number)} - the function to be called for each 3 elements
+ * @param opt_start {number=} - an optional start index to iterate from
+ * @param opt_end {number=} - an optional end index to iterate to
+ */
+ eachLatLngAlt(eachFn: (lat: H.geo.Latitude, lng: H.geo.Longitude, alt: H.geo.Altitude, n: number) => void, opt_start?: number, opt_end?: number): void;
+
+ /**
+ * This method returns the number of times that legs in this strip cross the date border.
+ * @param opt_closed {boolean=} - indicates whether the strip is closed (i.e. whether the strip's last and first coordinates form the closing leg of a polygon)
+ * @returns {number} - the amount of times this strip crosses the date border.
+ */
+ getDBCs(opt_closed?: boolean): number;
+
+ /**
+ * This method return the number of points stored in this strip.
+ * @returns {number} - the number of points in this strip
+ */
+ getPointCount(): number;
+
+ /**
+ * This method returns the internal array keeping the lat, lng, alt values. Modifying this array directly can destroy the integrity of this strip. Use it only for read access.
+ * @returns {Array} - returns the raw lat, lng, alt values of this strip
+ */
+ getLatLngAltArray(): Array;
+
+ /**
+ * This method returns the bounding box of this strip.
+ * @returns {?H.geo.Rect} - this strip's bounding rectangle
+ */
+ getBounds(): H.geo.Rect;
+
+ /**
+ * This method checks whether two longitudes form a leg which crosses the date border.
+ * @param lng1 {H.geo.Longitude} - the start longitude of the leg
+ * @param lng2 {H.geo.Longitude} - the end longitude of the leg
+ * @returns {boolean} - true if the leg crosses the date border, otherwise false
+ */
+ static isDBC(lng1: H.geo.Longitude, lng2: H.geo.Longitude): boolean;
+
+ /**
+ * This method initializes a new strip with an array of lat, lng values. Arrays are expected to have an even length with the format [lat, lng, lat, lng, ...].
+ * @param latLngs {Array} - the array of lat, lng value.
+ * @returns {H.geo.Strip} - the strip containing the lat, lng values
+ */
+ static fromLatLngArray(latLngs: Array): H.geo.Strip;
+ }
}
/***** lang *****/
@@ -1173,6 +1292,78 @@ declare namespace H {
}
}
+ /**
+ * A Polygon with a circular shape.
+ */
+ export class Circle extends H.map.Polygon {
+ /**
+ * Constructor
+ * @param center {H.geo.IPoint} - The geographical coordinates of the circle's center
+ * @param radius {number} - The radius of the circle in meters
+ * @param opt_options {H.map.Circle.Options=} - An object that specifies circle options and their initial values (among these, precision has a significant impact on the shape of the circle - please see
+ */
+ constructor(center: H.geo.IPoint, radius: number, opt_options?: H.map.Circle.Options);
+
+ /**
+ * To set the geographical center point of this circle. If the specified center is an instance of H.geo.Point you must not modify this Point instance without calling setCenter immediately afterwards.
+ * @param center {H.geo.IPoint}
+ */
+ setCenter(center: H.geo.IPoint): void;
+
+ /**
+ * To get the center point of this circle You must not modify the returned Point instance without calling setCenter immediately afterwards.
+ * @returns {H.geo.Point}
+ */
+ getCenter(): H.geo.Point;
+
+ /**
+ * To set the length of the radius of the circle in meters. The value is clamped to the of {@code[0 ... 20015089.27787877]} (half WGS84 mean circumference)
+ * @param radius {number}
+ */
+ setRadius(radius: number): void;
+
+ /**
+ * To get the length of the radius of the circle in meters.
+ * @returns {number}
+ */
+ getRadius(): number;
+
+ /**
+ * To set the precision of this circle {@see H.map.Circle.Options#precision}
+ * @param precision {number}
+ */
+ setPrecision(precision: number): void;
+
+ /**
+ * To get the precision value of this circle
+ * @returns {number}
+ */
+ getPrecision(): number;
+ }
+
+ export module Circle {
+ /**
+ * @property style {H.map.SpatialStyle=} - the style to be used when tracing the polyline
+ * @property visibility {boolean=} - An optional boolean value indicating whether this map object is visible, default is true
+ * @property precision {number=} - The precision of a circle as a number of segments to be used when rendering the circle. The value is clamped to the range between [4 ... 360], where 60 is the default. Note that the lower the value the more angular and the less circle-like the shape appears and, conversely, the higher the value the smoother and more rounded the result. Thus, starting at the extreme low end of the possible values, 4 produces a square, 6 a hexagon, while 30 results in a circle-like shape, although it appears increasingly angular as the zoom level increases (as you zoom in), and finally 360 produces a smooth circle.
+ * @property zIndex {number=} - The z-index value of the circle, default is 0
+ * @property min {number=} - The minimum zoom level for which the circle is visible, default is -Infinity
+ * @property max {number=} - The maximum zoom level for which the circle is visible, default is Infinity
+ * @property provider {(H.map.provider.Provider | null)=} - The provider of this object. This property is only needed if a customized Implementation of ObjectProvider wants to instantiate an object.
+ * @property data {*} - Optional arbitrary data to be stored with this map object. This data can be retrieved by calling getData
+ */
+ export interface Options {
+ style?: H.map.SpatialStyle | H.map.SpatialStyle.Options;
+ visibility?: boolean;
+ precision?: number;
+ zIndex?: number;
+ min?: number;
+ max?: number;
+ provider?: H.map.provider.Provider;
+ data?: any;
+ }
+ }
+
/**
* The class represents data model of the map. It holds list of layers that are rendered by map's RenderEngine. The class listens to 'update' events from layers and dispatches them to the RenderEngine.
*/
@@ -1242,6 +1433,38 @@ declare namespace H {
}
}
+ /**
+ * This class represents a spatial shape in geographic space. It is defined by a path containing the vertices of the shape (lat, lng, alt values).
+ */
+ export class GeoShape extends H.map.Spatial {
+ /**
+ * Constructor
+ * @param isClosed {boolean} - Indicates whether this geographical shape is closed (a polygon)
+ * @param strip {H.geo.Strip} - The strip describing the shape of the spatial object
+ * @param options {H.map.Spatial.Options} - The options to apply
+ */
+ constructor(isClosed: boolean, strip: H.geo.Strip, options: H.map.Spatial.Options);
+
+ /**
+ * This method returns the strip which represents the shape of the spatial object.
+ * @returns {H.geo.Strip} - the strip
+ */
+ getStrip(): H.geo.Strip;
+
+ /**
+ * This method sets the geo-information for the spatial object
+ * @param strip {?H.geo.Strip} - The strip which represents the shape of the spatial object.
+ * @returns {H.map.GeoShape} - the Spatial instance itself
+ */
+ setStrip(strip: H.geo.Strip): H.map.GeoShape;
+
+ /**
+ * This method returns the bounding rectangle for this object. The rectangle is the smallest rectangle which encloses all points of the spatial object.
+ * @returns {H.geo.Rect}
+ */
+ getBounds(): H.geo.Rect;
+ }
+
/**
* This class represents a map object which can contain other map objects. It's visibility, zIndex and object-order influences the contained map objects
*/
@@ -1855,6 +2078,92 @@ declare namespace H {
}
}
+ /**
+ * This class represents a polygon in geo-space. It is defined by a strip containing the vertices of a geo shape object (lat, lng, alt values) and a pen to use when rendering the polyline. Polygon represents a closed plane defined by the list of verticies, projected on the map display. List of vericies which define the polygon are is a list of geo coordinates encapsulated by the strip object H.geo.Strip
+ */
+ export class Polygon extends H.map.GeoShape {
+ /**
+ * Constructor
+ * @param strip {H.geo.Strip} - the strip describing this polygon's vertices
+ * @param opt_options {H.map.Spatial.Options=} - optional initialization parameters
+ */
+ constructor(strip: H.geo.Strip, opt_options?: H.map.Spatial.Options);
+
+ /**
+ * To set the indicator whether this polygon covers the north pole. It's needed for Polygons whose strip is defined as lines arround the world on longitude axis (for example a circle whose center is one of the poles). In this case a additional information is needed to know if the southern or northern part of the world should be covered by the poygon.
+ * @param flag {boolean} - A value of true means it covers the north pole, false means south pole
+ * @returns {H.map.Polygon} - the Polygon instance itself
+ */
+ setNorthPoleCovering(flag: boolean): H.map.Polygon;
+
+ /**
+ * See H.map.Polygon#setNorthPoleCovering
+ * @returns {boolean}
+ */
+ getNorthPoleCovering(): boolean;
+ }
+
+ /**
+ * This class represents a polyline in geo-space. It is defined by a path containing the vertices of a polyline (lat, lng, alt values) and a pen to use when tracing the path on the map.
+ */
+ export class Polyline extends H.map.GeoShape {
+ /**
+ * Constructor
+ * @param strip {H.geo.Strip} - the strip describing this polygon's vertices
+ * @param opt_options {H.map.Polyline.Options=} - optional initialization parameters
+ */
+ constructor(strip: H.geo.Strip, opt_options?: H.map.Polyline.Options);
+
+ /**
+ * This method clips this polyline against a rectangular area and returns the intersecting sub-lines.
+ * @param geoRect {H.geo.Rect}
+ * @returns {Array>}
+ */
+ clip(geoRect: H.geo.Rect): Array>;
+ }
+
+ export module Polyline {
+ /**
+ * Options which are used to initialize a polyline
+ * @property style {(H.map.SpatialStyle | H.map.SpatialStyle.Options)=} - the style to be used when tracing the polyline
+ * @property arrows {(H.map.ArrowStyle | H.map.ArrowStyle.Options)=} - The arrows style to be used when rendering the polyline.
+ * @property visibility {boolean=} - An optional boolean value indicating whether this map object is visible, default is true
+ * @property zIndex {number=} - The z-index value of the map object, default is 0
+ * @property min {number=} - The minimum zoom level for which the object is visible, default is -Infinity
+ * @property max {number=} - The maximum zoom level for which the object is visible, default is Infinity
+ * @property provider {(H.map.provider.Provider | null)=} - The provider of this object. This property is only needed if a customized Implementation of ObjectProvider wants to instantiate an object.
+ * @property data {*} - Optional arbitrary data to be stored with this map object. This data can be retrieved by calling getData
+ */
+ export interface Options {
+ style?: (H.map.SpatialStyle | H.map.SpatialStyle.Options);
+ arrows?: (H.map.ArrowStyle | H.map.ArrowStyle.Options);
+ visibility?: boolean;
+ zIndex?: number;
+ min?: number;
+ max?: number;
+ provider?: H.map.provider.Provider;
+ data?: any;
+ }
+ }
+
+ /**
+ * A Polygon with a rectangular shape.
+ */
+ export class Rect extends H.map.Polygon {
+ /**
+ * Constructor
+ * @param bounds {H.geo.Rect} - The geographical bounding box for this rectangle
+ * @param opt_options {H.map.Spatial.Options=}
+ */
+ constructor(bounds: H.geo.Rect, opt_options?: H.map.Spatial.Options);
+
+ /**
+ * To set the bounds of this rectangle.
+ * @param bounds {H.geo.Rect}
+ */
+ setBounds(bounds: H.geo.Rect): void;
+ }
+
/**
* This class represents a spatial map object which provides its projected geometry.
*/
@@ -1985,8 +2294,8 @@ declare namespace H {
miterLimit: number;
lineDash: Array;
lineDashOffset: number;
- MAX_LINE_WIDTH: number;
- DEFAULT_STYLE: H.map.SpatialStyle;
+ static MAX_LINE_WIDTH: number;
+ static DEFAULT_STYLE: H.map.SpatialStyle;
}
export module SpatialStyle {
@@ -2018,7 +2327,7 @@ declare namespace H {
lineCap?: H.map.SpatialStyle.LineCap;
lineJoin?: H.map.SpatialStyle.LineJoin;
miterLimit?: number;
- lineDash: Array;
+ lineDash?: Array;
lineDashOffset?: number;
}
}
diff --git a/jest/jest.d.ts b/jest/jest.d.ts
index 10949a6691..b2484dfcc5 100644
--- a/jest/jest.d.ts
+++ b/jest/jest.d.ts
@@ -44,6 +44,7 @@ declare namespace jest {
interface Matchers {
not: Matchers;
toThrow(expected?: any): boolean;
+ toThrowError(expected?: any): boolean;
toBe(expected: any): boolean;
toEqual(expected: any): boolean;
toBeFalsy(): boolean;
diff --git a/knockout/knockout.d.ts b/knockout/knockout.d.ts
index 6321cff0a5..f0e9fe023f 100644
--- a/knockout/knockout.d.ts
+++ b/knockout/knockout.d.ts
@@ -61,8 +61,10 @@ interface KnockoutSubscription {
}
interface KnockoutSubscribable extends KnockoutSubscribableFunctions {
- subscribe(callback: (newValue: T) => void, target?: any, event?: string): KnockoutSubscription;
+ subscribe(callback: (newValue: T) => void, target: any, event: "beforeChange"): KnockoutSubscription;
+ subscribe(callback: (newValue: T) => void, target?: any, event?: "change"): KnockoutSubscription;
subscribe(callback: (newValue: TEvent) => void, target: any, event: string): KnockoutSubscription;
+
extend(requestedExtenders: { [key: string]: any; }): KnockoutSubscribable;
getSubscriptionsCount(): number;
}
@@ -91,6 +93,11 @@ interface KnockoutObservableArrayStatic {
}
interface KnockoutObservableArray extends KnockoutObservable, KnockoutObservableArrayFunctions {
+ subscribe(callback: (newValue: KnockoutArrayChange[]) => void, target: any, event: "arrayChange"): KnockoutSubscription;
+ subscribe(callback: (newValue: T[]) => void, target: any, event: "beforeChange"): KnockoutSubscription;
+ subscribe(callback: (newValue: T[]) => void, target?: any, event?: "change"): KnockoutSubscription;
+ subscribe(callback: (newValue: TEvent) => void, target: any, event: string): KnockoutSubscription;
+
extend(requestedExtenders: { [key: string]: any; }): KnockoutObservableArray;
}
@@ -325,7 +332,7 @@ interface KnockoutUtils {
}
interface KnockoutArrayChange {
- status: string;
+ status: "added" | "deleted";
value: T;
index: number;
moved?: number;
diff --git a/knockout/knockoutamd-tests.ts b/knockout/knockoutamd-tests.ts
index c874c6208b..9ee6658335 100644
--- a/knockout/knockoutamd-tests.ts
+++ b/knockout/knockoutamd-tests.ts
@@ -1,6 +1,6 @@
///
-import ko = require("knockout");
+import ko = require("knockout");
var myArray = ko.observableArray([1, 2, 3]);
diff --git a/knockout/tests/knockout-tests.ts b/knockout/tests/knockout-tests.ts
index 8da6c12950..122617b180 100644
--- a/knockout/tests/knockout-tests.ts
+++ b/knockout/tests/knockout-tests.ts
@@ -680,3 +680,38 @@ function test_tasks() {
setTimeout(callback, 0);
};
}
+
+function observableEventsTests() {
+ var observable = ko.observable(1);
+ observable.subscribe(value => {
+ var num: number = value;
+ });
+ observable.subscribe(value => {
+ var num: number = value;
+ }, null, "change");
+ observable.subscribe(value => {
+ var num: number = value;
+ }, null, "beforeChange");
+}
+
+function observableArrayEventsTests() {
+ var observableArray = ko.observableArray([1, 2, 3, 4]);
+ observableArray.subscribe(array => {
+ var arr: number[] = array;
+ });
+ observableArray.subscribe(array => {
+ var arr: number[] = array;
+ }, null, "change");
+ observableArray.subscribe(array => {
+ var arr: number[] = array;
+ }, null, "beforeChange");
+ var count = 0;
+ observableArray.subscribe(changes => {
+ changes.forEach(change => {
+ if (change.status == "added")
+ count++;
+ else if (change.status == "deleted")
+ count--;
+ });
+ }, null, "arrayChange");
+}
\ No newline at end of file
diff --git a/leaflet-curve/leaflet-curve-tests.ts b/leaflet-curve/leaflet-curve-tests.ts
index 2c5bb6b8f1..9864e71252 100644
--- a/leaflet-curve/leaflet-curve-tests.ts
+++ b/leaflet-curve/leaflet-curve-tests.ts
@@ -1,4 +1,4 @@
-///
+///
///
diff --git a/leaflet-curve/leaflet-curve.d.ts b/leaflet-curve/leaflet-curve.d.ts
index 32358c08ac..7bd64215b9 100644
--- a/leaflet-curve/leaflet-curve.d.ts
+++ b/leaflet-curve/leaflet-curve.d.ts
@@ -3,7 +3,7 @@
// Definitions by: Onikiienko
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-///
+///
declare namespace L {
/**
diff --git a/leaflet-draw/leaflet-draw-tests.ts b/leaflet-draw/leaflet-draw-tests.ts
index 9a1ed09306..396f5119d3 100644
--- a/leaflet-draw/leaflet-draw-tests.ts
+++ b/leaflet-draw/leaflet-draw-tests.ts
@@ -1,4 +1,4 @@
-///
+///
///
@@ -44,4 +44,4 @@ map.on('draw:created', function (e: L.DrawEvents.Created) {
layer = e.layer;
drawnItems.addLayer(layer);
-});
\ No newline at end of file
+});
diff --git a/leaflet-draw/leaflet-draw.d.ts b/leaflet-draw/leaflet-draw.d.ts
index 253d6c3a11..7c80f17ef2 100644
--- a/leaflet-draw/leaflet-draw.d.ts
+++ b/leaflet-draw/leaflet-draw.d.ts
@@ -3,7 +3,7 @@
// Definitions by: Matt Guest
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-///
+///
declare namespace L {
export interface MapOptions {
diff --git a/leaflet-editable/leaflet-editable.d.ts b/leaflet-editable/leaflet-editable.d.ts
index 0d7b2bcc0f..f559917b62 100644
--- a/leaflet-editable/leaflet-editable.d.ts
+++ b/leaflet-editable/leaflet-editable.d.ts
@@ -3,7 +3,7 @@
// Definitions by: Dominic Alie
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-///
+///
declare namespace L {
/**
diff --git a/leaflet-geocoder-mapzen/leaflet-geocoder-mapzen-tests.ts b/leaflet-geocoder-mapzen/leaflet-geocoder-mapzen-tests.ts
index c6519ab371..d623120a73 100644
--- a/leaflet-geocoder-mapzen/leaflet-geocoder-mapzen-tests.ts
+++ b/leaflet-geocoder-mapzen/leaflet-geocoder-mapzen-tests.ts
@@ -1,4 +1,4 @@
-///
+///
///
var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
diff --git a/leaflet-geocoder-mapzen/leaflet-geocoder-mapzen.d.ts b/leaflet-geocoder-mapzen/leaflet-geocoder-mapzen.d.ts
index 8809472e43..3e388ff515 100644
--- a/leaflet-geocoder-mapzen/leaflet-geocoder-mapzen.d.ts
+++ b/leaflet-geocoder-mapzen/leaflet-geocoder-mapzen.d.ts
@@ -4,7 +4,7 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-///
+///
declare namespace L {
namespace Control {
diff --git a/leaflet-label/leaflet-label.d.ts b/leaflet-label/leaflet-label.d.ts
index 009ded17f8..ea18df3cea 100644
--- a/leaflet-label/leaflet-label.d.ts
+++ b/leaflet-label/leaflet-label.d.ts
@@ -3,7 +3,7 @@
// Definitions by: Wim Looman
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-///
+///
declare namespace L {
export interface IconOptions {
diff --git a/leaflet-markercluster/leaflet-markercluster.d.ts b/leaflet-markercluster/leaflet-markercluster.d.ts
index 7d8757be03..b756389275 100644
--- a/leaflet-markercluster/leaflet-markercluster.d.ts
+++ b/leaflet-markercluster/leaflet-markercluster.d.ts
@@ -3,7 +3,7 @@
// Definitions by: Robert Imig
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-///
+///
declare namespace L {
export interface MarkerClusterGroupOptions {
@@ -51,7 +51,7 @@ declare namespace L {
/*
* The maximum radius that a cluster will cover from the central marker (in pixels). Default 80.
- * Decreasing will make more, smaller clusters. You can also use a function that accepts
+ * Decreasing will make more, smaller clusters. You can also use a function that accepts
* the current map zoom and returns the maximum cluster radius in pixels
*/
maxClusterRadius?: number | ((zoom: number) => number);
@@ -134,9 +134,9 @@ declare namespace L {
getAllChildMarkers(): Marker[];
/*
- * Zooms to show the given marker (spiderfying if required),
+ * Zooms to show the given marker (spiderfying if required),
* calls the callback when the marker is visible on the map.
- */
+ */
zoomToShowLayer(layer: any, callback: () => void): void;
}
}
diff --git a/leaflet.awesome-markers/leaflet.awesome-markers.d.ts b/leaflet.awesome-markers/leaflet.awesome-markers.d.ts
index 6fa754ad8d..4364743d48 100644
--- a/leaflet.awesome-markers/leaflet.awesome-markers.d.ts
+++ b/leaflet.awesome-markers/leaflet.awesome-markers.d.ts
@@ -3,7 +3,7 @@
// Definitions by: Egor Komarov
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-///
+///
declare module L {
module AwesomeMarkers {
diff --git a/leaflet.fullscreen/leaflet.fullscreen.d.ts b/leaflet.fullscreen/leaflet.fullscreen.d.ts
index b8be6604dc..f094c307dc 100644
--- a/leaflet.fullscreen/leaflet.fullscreen.d.ts
+++ b/leaflet.fullscreen/leaflet.fullscreen.d.ts
@@ -3,7 +3,7 @@
// Definitions by: William Comartin
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-///
+///
declare namespace L {
diff --git a/leaflet/leaflet-0.7-tests.ts b/leaflet/leaflet-0.7-tests.ts
new file mode 100644
index 0000000000..1a88096002
--- /dev/null
+++ b/leaflet/leaflet-0.7-tests.ts
@@ -0,0 +1,427 @@
+///
+
+// initialize the map on the "map" div with a given center and zoom
+
+var div = document.getElementById('map');
+
+var map : L.Map = L.map(div, {
+ center: L.latLng([51.505, -0.09]),
+ zoom: 13,
+ minZoom: 3,
+ maxZoom: 8,
+ maxBounds: L.latLngBounds([L.latLng(-60, -60), L.latLng(60, 60)]),
+ dragging: true,
+ touchZoom: true,
+ scrollWheelZoom: true,
+ boxZoom: true,
+ tap: true,
+
+ tapTolerance: 30,
+ trackResize: true,
+ worldCopyJump: false,
+ closePopupOnClick: true,
+ bounceAtZoomLimits: true,
+
+ keyboard: true,
+ keyboardPanOffset: 80,
+ keyboardZoomOffset: 1,
+
+ inertia: true,
+ inertiaDeceleration: 3000,
+ inertiaMaxSpeed: 1500,
+ inertiaThreshold: 32,
+
+ zoomControl: true,
+ attributionControl: true,
+
+ fadeAnimation: true,
+ zoomAnimation: true,
+ zoomAnimationThreshold: 4,
+ markerZoomAnimation: true
+
+});
+
+map.dragging.enable();
+map.touchZoom.enable();
+map.scrollWheelZoom.enable();
+map.doubleClickZoom.enable();
+map.boxZoom.enable();
+map.tap.enable();
+
+map.setView(new L.LatLng(42, 51));
+map.setView(L.latLng(42, 51));
+
+map.setView(L.latLng(42, 51), 12);
+map.setView(L.latLng(42, 51), 12, {
+ reset: true,
+ pan: {
+ animate: true,
+ duration: 0.25,
+ easeLinearity: 0.25,
+ noMoveStart: false
+ },
+ zoom: {
+ animate: true
+ }
+});
+
+map.setZoom(50);
+map.setZoom(50, {});
+
+map.zoomIn();
+map.zoomOut();
+
+map.zoomIn(2);
+map.zoomOut(2);
+
+map.zoomIn(2, { animate: true });
+map.zoomOut(2, { animate: true });
+
+map.setZoomAround(L.latLng(42, 51), 8, { animate: false });
+
+map.fitBounds(L.latLngBounds(L.latLng(10, 10), L.latLng(20, 20)));
+map.fitBounds(L.latLngBounds(L.latLng(10, 10), L.latLng(20, 20)), {
+ paddingTopLeft: L.point(20, 20),
+ paddingBottomRight: L.point(20, 20),
+ padding: L.point(0, 0),
+ maxZoom: null
+});
+
+map.fitWorld();
+
+map.fitWorld({
+ animate: false
+});
+
+map.panTo(L.latLng(42, 42));
+map.panTo(L.latLng(42, 42), {
+ animate: true
+});
+
+map.invalidateSize(true);
+map.invalidateSize({ reset: true });
+
+map.setMaxBounds(L.latLngBounds(L.latLng(10, 10), L.latLng(20, 20)));
+
+map.locate();
+map.locate({
+ watch: false,
+ setView: false,
+ maxZoom: 18,
+ timeout: 10000,
+ maximumAge: 0,
+ enableHighAccuracy: false
+});
+
+map.stopLocate();
+
+map.remove();
+
+var center : L.LatLng = map.getCenter();
+var zoom : number = map.getZoom();
+var minZoom: number = map.getMinZoom();
+var maxZoom: number = map.getMaxZoom();
+var bounds: L.LatLngBounds = map.getBounds();
+var boundsZoom: number = map.getBoundsZoom(bounds, true);
+var size: L.Point = map.getSize();
+var pixelBounds: L.Bounds = map.getPixelBounds();
+var pixelOrigin: L.Point = map.getPixelOrigin();
+
+var layer = L.tileLayer("http://{s}.example.net/{x}/{y}/{z}.png");
+
+map.addLayer(layer);
+map.addLayer(layer, false);
+map.eachLayer(l => {});
+
+map.removeLayer(layer);
+map.hasLayer(layer);
+
+map.openPopup("canard", L.latLng(42, 51));
+
+var popup = L.popup({
+ autoPan: true
+});
+
+map.openPopup(popup);
+map.closePopup(popup);
+map.closePopup();
+
+map.addControl(L.control.attribution({position: 'bottomright'}));
+map.removeControl(L.control.attribution({ position: 'bottomright' }));
+
+L.control.layers({'Base': layer}).addTo(map);
+map.on('baseLayerChange', function(e: L.LeafletLayersControlEvent) {
+ alert(e.name);
+});
+
+map.latLngToLayerPoint(map.layerPointToLatLng(L.point(0, 0)));
+map.latLngToContainerPoint(map.containerPointToLatLng(L.point(0, 0)));
+map.containerPointToLayerPoint(L.point(0, 0));
+map.layerPointToContainerPoint(L.point(0, 0));
+
+map.project(map.unproject(L.point(10, 20)));
+map.project(map.unproject(L.point(10, 20), 12), 12);
+
+var mouseEvent: L.LeafletMouseEvent;
+map.mouseEventToContainerPoint(mouseEvent);
+map.mouseEventToLayerPoint(mouseEvent);
+map.mouseEventToLatLng(mouseEvent);
+
+map.getContainer().classList.add('roger');
+map.getPanes().mapPane.classList.add('roger');
+map.getPanes().markerPane.classList.add('roger');
+map.getPanes().objectsPane.classList.add('roger');
+map.getPanes().overlayPane.classList.add('roger');
+map.getPanes().popupPane.classList.add('roger');
+map.getPanes().shadowPane.classList.add('roger');
+map.getPanes().tilePane.classList.add('roger');
+
+map.whenReady((m: L.Map) => {
+ m.zoomOut();
+});
+
+map.on('click', () => {
+ map.zoomOut();
+});
+
+map.off('dblclick', L.Util.falseFn);
+
+map.once('contextmenu', (e: L.LeafletMouseEvent) => {
+ map.openPopup('contextmenu', e.latlng);
+});
+
+var marker = L.marker(L.latLng(42, 51), {
+ icon: L.icon({
+ iconUrl: 'roger.png',
+ iconRetinaUrl: 'roger-retina.png',
+ iconSize: L.point(40, 40),
+ iconAnchor: L.point(20, 0),
+ shadowUrl: 'roger-shadow.png',
+ shadowRetinaUrl: 'roger-shadow-retina.png',
+ shadowSize: L.point(44, 44),
+ shadowAnchor: L.point(22, 0),
+ popupAnchor: L.point(0, 0),
+ className: 'roger-icon'
+ }),
+ clickable: true,
+ draggable: false,
+ keyboard: true,
+ title: 'this is an icon',
+ alt: '',
+ zIndexOffset: 0,
+ opacity: 1.0,
+ riseOnHover: false,
+ riseOffset: 250
+});
+
+marker.addTo(map);
+
+marker.on('click', (e: L.LeafletMouseEvent) => {
+ map.setView(e.latlng);
+});
+
+marker.once('mouseover', () => {
+ marker.openPopup();
+})
+
+marker.setLatLng(marker.getLatLng());
+
+marker.setIcon(L.icon({}));
+
+marker.setZIndexOffset(30);
+marker.setOpacity(0.8);
+
+marker.bindPopup(popup);
+marker.unbindPopup();
+marker.bindPopup('hello', {
+ closeOnClick: true
+});
+
+marker.openPopup();
+marker.closePopup();
+marker.togglePopup();
+marker.togglePopup();
+marker.setPopupContent('hello 3')
+marker.getPopup().setContent('hello 2');
+marker.update();
+
+marker.toGeoJSON();
+
+marker.dragging.enable();
+
+popup = L.popup({
+ maxWidth: 300,
+ minWidth: 50,
+ maxHeight: null,
+ autoPan: true,
+ keepInView: false,
+ closeButton: true,
+ offset: L.point(0, 6),
+ autoPanPaddingTopLeft: null,
+ autoPanPaddingBottomRight: L.point(20, 20),
+ autoPanPadding: L.point(5, 5),
+ zoomAnimation: true,
+ closeOnClick: null,
+ className: 'roger'
+});
+
+popup.setLatLng(L.latLng(12, 54)).setContent('this is nice popup').openOn(map);
+
+popup.update();
+
+var tileLayer = L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png?{foo}', {
+ minZoom: 0,
+ maxZoom: 18,
+ maxNativeZoom: 17,
+ tileSize: 256,
+ subdomains: ['a','b','c'],
+ errorTileUrl: '',
+ attribution: '',
+ tms: false,
+ continuousWorld: false,
+ noWrap: false,
+ zoomOffset: 0,
+ zoomReverse: false,
+ opacity: 1.0,
+ zIndex: null,
+ unloadInvisibleTiles: false,
+ updateWhenIdle: false,
+ detectRetina: true,
+ reuseTiles: true,
+ bounds: null
+});
+
+tileLayer.on('loading', L.Util.falseFn)
+ .off('loading', L.Util.falseFn)
+ .once('tileload', L.Util.falseFn);
+
+tileLayer.addTo(map);
+
+tileLayer.bringToBack()
+ .bringToFront()
+ .setOpacity(0.7)
+ .setZIndex(9)
+ .redraw()
+ .setUrl('http://perdu.com')
+ .getContainer();
+
+namespace CustomControl {
+ export interface Options {
+ title: string;
+ position?: string;
+ }
+}
+interface CustomControl extends L.Control {
+ getTitle(): string;
+ setTitle(title: string): CustomControl;
+}
+var CustomControl: { new(options: CustomControl.Options): CustomControl };
+CustomControl = L.Control.extend({
+ initialize: function(options: CustomControl.Options) {
+ L.Control.prototype.initialize.call(this, {
+ position: options.position || 'bottomleft',
+ });
+ this.title = options.title;
+ },
+ getTitle: function() {
+ return this.title;
+ },
+ setTitle: function(title: string) {
+ this.title = title;
+ },
+});
+
+// Different latLng and latLngBounds expressions
+var latLngLiteral = [10, 20];
+var latLngObjectLiteral = { lat: 10, lng: 10 };
+var boundsLiteral = [[10, 20], [20, 20]];
+var boundLiteralOfLatLngObjects = [latLngObjectLiteral, latLngObjectLiteral];
+
+var circle: L.Circle = L.circle(latLngLiteral, 4);
+circle = new L.Circle(latLngLiteral, 4);
+circle.setLatLng(latLngLiteral);
+
+circle = L.circle(latLngObjectLiteral, 4);
+circle = new L.Circle(latLngObjectLiteral, 4);
+circle.setLatLng(latLngObjectLiteral);
+
+var circleMarker: L.CircleMarker = L.circleMarker(latLngLiteral);
+circleMarker = new L.CircleMarker(latLngLiteral);
+circleMarker.setLatLng(latLngLiteral);
+
+circleMarker = L.circleMarker(latLngObjectLiteral);
+circleMarker = new L.CircleMarker(latLngObjectLiteral);
+circleMarker.setLatLng(latLngObjectLiteral);
+
+var latLng: L.LatLng = L.latLng(latLngLiteral);
+latLng = new L.LatLng(latLngLiteral);
+latLng.distanceTo(latLngLiteral);
+latLng.equals(latLngLiteral);
+
+latLng = L.latLng(latLngObjectLiteral);
+latLng = new L.LatLng(latLngObjectLiteral);
+latLng.distanceTo(latLngObjectLiteral);
+latLng.equals(latLngObjectLiteral);
+
+var bounds: L.LatLngBounds = L.latLngBounds(boundsLiteral);
+bounds = L.latLngBounds(boundLiteralOfLatLngObjects);
+bounds = new L.LatLngBounds(boundsLiteral);
+bounds = new L.LatLngBounds(boundLiteralOfLatLngObjects);
+bounds = new L.LatLngBounds(latLngLiteral, latLngLiteral);
+
+bounds.extend(latLngLiteral);
+bounds.extend(latLngObjectLiteral);
+bounds.extend(boundsLiteral);
+bounds.extend(boundLiteralOfLatLngObjects);
+
+bounds.contains(latLngLiteral);
+bounds.contains(boundLiteralOfLatLngObjects);
+bounds.contains(boundsLiteral);
+
+bounds.intersects(boundsLiteral);
+bounds.intersects(boundLiteralOfLatLngObjects);
+
+bounds.equals(boundsLiteral);
+bounds.equals(boundLiteralOfLatLngObjects);
+
+map.setView(latLngLiteral);
+map.setView(latLngObjectLiteral);
+map.setZoomAround(latLngLiteral, 15);
+map.setZoomAround(latLngObjectLiteral, 15);
+map.panTo(latLngLiteral);
+map.panTo(latLngObjectLiteral);
+map.openPopup('test', latLngLiteral);
+map.openPopup('test', latLngObjectLiteral);
+map.latLngToLayerPoint(latLngLiteral);
+map.latLngToLayerPoint(latLngObjectLiteral);
+map.latLngToContainerPoint(latLngLiteral);
+map.latLngToContainerPoint(latLngObjectLiteral);
+map.project(latLngLiteral);
+map.project(latLngObjectLiteral);
+
+marker.setLatLng(latLngLiteral);
+marker.setLatLng(latLngObjectLiteral);
+
+var polygon: L.Polygon = L.polygon(boundsLiteral);
+polygon = L.polygon(boundLiteralOfLatLngObjects);
+polygon = new L.Polygon(boundsLiteral);
+polygon = new L.Polygon(boundLiteralOfLatLngObjects);
+
+var polyline: L.Polyline = L.polyline(boundsLiteral);
+polyline = L.polyline(boundLiteralOfLatLngObjects);
+polyline = new L.Polyline(boundsLiteral);
+polyline = new L.Polyline(boundLiteralOfLatLngObjects);
+polyline.setLatLngs(boundsLiteral);
+polyline.setLatLngs(boundLiteralOfLatLngObjects);
+polyline.addLatLng(latLngLiteral);
+polyline.addLatLng(latLngObjectLiteral);
+
+var popup: L.Popup = L.popup();
+popup.setLatLng(latLngLiteral);
+popup.setLatLng(latLngObjectLiteral);
+
+var zoomCtrl = L.control.zoom({
+ position: "topleft",
+ zoomInText: '+',
+ zoomOutText: '-'
+});
diff --git a/leaflet/leaflet-0.7.d.ts b/leaflet/leaflet-0.7.d.ts
new file mode 100644
index 0000000000..0c4bca15a6
--- /dev/null
+++ b/leaflet/leaflet-0.7.d.ts
@@ -0,0 +1,4382 @@
+// Type definitions for Leaflet.js 0.7.x
+// Project: https://github.com/Leaflet/Leaflet
+// Definitions by: Vladimir Zotov
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+///
+
+declare namespace L {
+ type LatLngExpression = LatLng | number[] | ({ lat: number; lng: number })
+ type LatLngBoundsExpression = LatLngBounds | LatLngExpression[];
+ type PositionString = 'topleft' | 'topright' | 'bottomleft' | 'bottomright';
+}
+
+declare namespace L {
+
+ export interface AttributionOptions {
+
+ /**
+ * The position of the control (one of the map corners). See control positions.
+ * Default value: 'bottomright'.
+ */
+ position?: PositionString;
+
+ /**
+ * The HTML text shown before the attributions. Pass false to disable.
+ * Default value: 'Powered by Leaflet'.
+ */
+ prefix?: string;
+
+ }
+}
+
+declare namespace L {
+
+ /**
+ * Creates a Bounds object from two coordinates (usually top-left and bottom-right
+ * corners).
+ */
+ export function bounds(topLeft: Point, bottomRight: Point): Bounds;
+
+ /**
+ * Creates a Bounds object defined by the points it contains.
+ */
+ export function bounds(points: Point[]): Bounds;
+
+
+ export interface BoundsStatic {
+ /**
+ * Creates a Bounds object from two coordinates (usually top-left and bottom-right
+ * corners).
+ */
+ new(topLeft: Point, bottomRight: Point): Bounds;
+
+ /**
+ * Creates a Bounds object defined by the points it contains.
+ */
+ new(points: Point[]): Bounds;
+ }
+ export var Bounds: BoundsStatic;
+
+ export interface Bounds {
+ /**
+ * Extends the bounds to contain the given point.
+ */
+ extend(point: Point): void;
+
+ /**
+ * Returns the center point of the bounds.
+ */
+ getCenter(): Point;
+
+ /**
+ * Returns true if the rectangle contains the given one.
+ */
+ contains(otherBounds: Bounds): boolean;
+
+ /**
+ * Returns true if the rectangle contains the given point.
+ */
+ contains(point: Point): boolean;
+
+ /**
+ * Returns true if the rectangle intersects the given bounds.
+ */
+ intersects(otherBounds: Bounds): boolean;
+
+ /**
+ * Returns true if the bounds are properly initialized.
+ */
+ isValid(): boolean;
+
+ /**
+ * Returns the size of the given bounds.
+ */
+ getSize(): Point;
+
+ /**
+ * The top left corner of the rectangle.
+ */
+ min: Point;
+
+ /**
+ * The bottom right corner of the rectangle.
+ */
+ max: Point;
+ }
+}
+
+declare namespace L {
+
+ namespace Browser {
+
+ /**
+ * true for all Internet Explorer versions.
+ */
+ export var ie: boolean;
+
+ /**
+ * true for Internet Explorer 6.
+ */
+ export var ie6: boolean;
+
+ /**
+ * true for Internet Explorer 6.
+ */
+ export var ie7: boolean;
+
+ /**
+ * true for webkit-based browsers like Chrome and Safari (including mobile
+ * versions).
+ */
+ export var webkit: boolean;
+
+ /**
+ * true for webkit-based browsers that support CSS 3D transformations.
+ */
+ export var webkit3d: boolean;
+
+ /**
+ * true for Android mobile browser.
+ */
+ export var android: boolean;
+
+ /**
+ * true for old Android stock browsers (2 and 3).
+ */
+ export var android23: boolean;
+
+ /**
+ * true for modern mobile browsers (including iOS Safari and different Android
+ * browsers).
+ */
+ export var mobile: boolean;
+
+ /**
+ * true for mobile webkit-based browsers.
+ */
+ export var mobileWebkit: boolean;
+
+ /**
+ * true for mobile Opera.
+ */
+ export var mobileOpera: boolean;
+
+ /**
+ * true for all browsers on touch devices.
+ */
+ export var touch: boolean;
+
+ /**
+ * true for browsers with Microsoft touch model (e.g. IE10).
+ */
+ export var msTouch: boolean;
+
+ /**
+ * true for devices with Retina screens.
+ */
+ export var retina: boolean;
+
+ }
+}
+
+
+declare namespace L {
+
+ /**
+ * Instantiates a circle object given a geographical point, a radius in meters
+ * and optionally an options object.
+ */
+ function circle(latlng: LatLngExpression, radius: number, options?: PathOptions): Circle;
+
+ export interface CircleStatic extends ClassStatic {
+ /**
+ * Instantiates a circle object given a geographical point, a radius in meters
+ * and optionally an options object.
+ */
+ new(latlng: LatLngExpression, radius: number, options?: PathOptions): Circle;
+ }
+ export var Circle: CircleStatic;
+
+ export interface Circle extends Path {
+ /**
+ * Returns the current geographical position of the circle.
+ */
+ getLatLng(): LatLng;
+
+ /**
+ * Returns the current radius of a circle. Units are in meters.
+ */
+ getRadius(): number;
+
+ /**
+ * Sets the position of a circle to a new location.
+ */
+ setLatLng(latlng: LatLngExpression): Circle;
+
+ /**
+ * Sets the radius of a circle. Units are in meters.
+ */
+ setRadius(radius: number): Circle;
+
+ /**
+ * Returns a GeoJSON representation of the circle (GeoJSON Point Feature).
+ */
+ toGeoJSON(): GeoJSON.Feature;
+
+ }
+}
+
+declare namespace L {
+
+ /**
+ * Instantiates a circle marker given a geographical point and optionally
+ * an options object. The default radius is 10 and can be altered by passing a
+ * "radius" member in the path options object.
+ */
+ function circleMarker(latlng: LatLngExpression, options?: PathOptions): CircleMarker;
+
+
+ export interface CircleMarkerStatic extends ClassStatic {
+ /**
+ * Instantiates a circle marker given a geographical point and optionally
+ * an options object. The default radius is 10 and can be altered by passing a
+ * "radius" member in the path options object.
+ */
+ new(latlng: LatLngExpression, options?: PathOptions): CircleMarker;
+ }
+ export var CircleMarker: CircleMarkerStatic;
+
+ export interface CircleMarker extends Circle {
+ /**
+ * Sets the position of a circle marker to a new location.
+ */
+ setLatLng(latlng: LatLngExpression): CircleMarker;
+
+ /**
+ * Sets the radius of a circle marker. Units are in pixels.
+ */
+ setRadius(radius: number): CircleMarker;
+ }
+}
+
+declare namespace L {
+ export interface ClassExtendOptions {
+ /**
+ * Your class's constructor function, meaning that it gets called when you do 'new MyClass(...)'.
+ */
+ initialize?: Function;
+
+ /**
+ * options is a special property that unlike other objects that you pass
+ * to extend will be merged with the parent one instead of overriding it
+ * completely, which makes managing configuration of objects and default
+ * values convenient.
+ */
+ options?: any;
+
+ /**
+ * includes is a special class property that merges all specified objects
+ * into the class (such objects are called mixins). A good example of this
+ * is L.Mixin.Events that event-related methods like on, off and fire
+ * to the class.
+ */
+ includes?: any;
+
+ /**
+ * statics is just a convenience property that injects specified object
+ * properties as the static properties of the class, useful for defining
+ * constants.
+ */
+ static?: any;
+
+ [prop: string]: any;
+ }
+
+ export interface ClassStatic {
+ /**
+ * You use L.Class.extend to define new classes, but you can use the
+ * same method on any class to inherit from it.
+ */
+ extend(options: ClassExtendOptions): any;
+ extend(options: ClassExtendOptions): { new(options?: Options): NewClass };
+
+ /**
+ * You can also use the following shortcut when you just need to make
+ * one additional method call.
+ */
+ addInitHook(methodName: string, ...args: any[]): void;
+ }
+
+
+ /**
+ * L.Class powers the OOP facilities of Leaflet and is used to create
+ * almost all of the Leaflet classes documented.
+ */
+ namespace Class {
+ /**
+ * You use L.Class.extend to define new classes, but you can use the
+ * same method on any class to inherit from it.
+ */
+ function extend(options: ClassExtendOptions): any;
+ }
+
+}
+
+declare namespace L {
+ export interface ControlStatic extends ClassStatic {
+ /**
+ * Creates a control with the given options.
+ */
+ new(options?: ControlOptions): Control;
+
+ Zoom: Control.ZoomStatic;
+ Attribution: Control.AttributionStatic;
+ Layers: Control.LayersStatic;
+ Scale: Control.ScaleStatic;
+ }
+ export var Control: ControlStatic;
+
+ export interface Control extends IControl {
+ /**
+ * Sets the position of the control. See control positions.
+ */
+ setPosition(position: PositionString): Control;
+
+ /**
+ * Returns the current position of the control.
+ */
+ getPosition(): PositionString;
+
+ /**
+ * Adds the control to the map.
+ */
+ addTo(map: Map): Control;
+
+ /**
+ * Removes the control from the map.
+ */
+ removeFrom(map: Map): Control;
+
+ /**
+ * Returns the HTML container of the control.
+ */
+ getContainer(): HTMLElement;
+
+ // IControl members
+
+ /**
+ * Should contain code that creates all the neccessary DOM elements for the
+ * control, adds listeners on relevant map events, and returns the element
+ * containing the control. Called on map.addControl(control) or control.addTo(map).
+ */
+ onAdd(map: Map): HTMLElement;
+
+ /**
+ * Optional, should contain all clean up code (e.g. removes control's event
+ * listeners). Called on map.removeControl(control) or control.removeFrom(map).
+ * The control's DOM container is removed automatically.
+ */
+ onRemove(map: Map): void;
+ }
+
+ namespace Control {
+ export interface ZoomStatic extends ClassStatic {
+ /**
+ * Creates a zoom control.
+ */
+ new (options?: ZoomOptions): Zoom;
+ }
+
+ export interface Zoom extends L.Control {
+ }
+
+ export interface ZoomOptions {
+ /**
+ * The position of the control (one of the map corners).
+ * Can be 'topleft', 'topright', 'bottomleft', or 'bottomright'.
+ *
+ * Default value: 'topright'.
+ */
+ position?: PositionString;
+
+ /**
+ * The text set on the zoom in button.
+ *
+ * Default value: '+'
+ */
+ zoomInText?: string;
+
+ /**
+ * The text set on the zoom out button.
+ *
+ * Default value: '-'
+ */
+ zoomOutText?: string;
+
+ /**
+ * The title set on the zoom in button.
+ *
+ * Default value: 'Zoom in'
+ */
+ zoomInTitle?: string;
+
+ /**
+ * The title set on the zoom out button.
+ *
+ * Default value: 'Zoom out'
+ */
+ zoomOutTitle?: string;
+ }
+
+ export interface AttributionStatic extends ClassStatic {
+ /**
+ * Creates an attribution control.
+ */
+ new(options?: AttributionOptions): Attribution;
+ }
+
+ export interface Attribution extends L.Control {
+ /**
+ * Sets the text before the attributions.
+ */
+ setPrefix(prefix: string): Attribution;
+
+ /**
+ * Adds an attribution text (e.g. 'Vector data © CloudMade').
+ */
+ addAttribution(text: string): Attribution;
+
+ /**
+ * Removes an attribution text.
+ */
+ removeAttribution(text: string): Attribution;
+
+ }
+
+ export interface LayersStatic extends ClassStatic {
+ /**
+ * Creates an attribution control with the given layers. Base layers will be
+ * switched with radio buttons, while overlays will be switched with checkboxes.
+ */
+ new(baseLayers?: any, overlays?: any, options?: LayersOptions): Layers;
+ }
+
+ export interface Layers extends L.Control, IEventPowered {
+ /**
+ * Adds a base layer (radio button entry) with the given name to the control.
+ */
+ addBaseLayer(layer: ILayer, name: string): Layers;
+
+ /**
+ * Adds an overlay (checkbox entry) with the given name to the control.
+ */
+ addOverlay(layer: ILayer, name: string): Layers;
+
+ /**
+ * Remove the given layer from the control.
+ */
+ removeLayer(layer: ILayer): Layers;
+
+ ////////////////
+ ////////////////
+ addEventListener(type: string, fn: (e: LeafletEvent) => void, context?: any): Layers;
+ addOneTimeEventListener(type: string, fn: (e: LeafletEvent) => void, context?: any): Layers;
+ removeEventListener(type: string, fn?: (e: LeafletEvent) => void, context?: any): Layers;
+ hasEventListeners(type: string): boolean;
+ fireEvent(type: string, data?: any): Layers;
+ on(type: string, fn: (e: LeafletEvent) => void, context?: any): Layers;
+ once(type: string, fn: (e: LeafletEvent) => void, context?: any): Layers;
+ off(type: string, fn?: (e: LeafletEvent) => void, context?: any): Layers;
+ fire(type: string, data?: any): Layers;
+ addEventListener(eventMap: any, context?: any): Layers;
+ removeEventListener(eventMap?: any, context?: any): Layers;
+ clearAllEventListeners(): Layers;
+ on(eventMap: any, context?: any): Layers;
+ off(eventMap?: any, context?: any): Layers;
+ }
+
+ export interface ScaleStatic extends ClassStatic {
+ /**
+ * Creates an scale control with the given options.
+ */
+ new(options?: ScaleOptions): Scale;
+ }
+
+ export interface Scale extends L.Control {
+ }
+ }
+
+ export interface control {
+ /**
+ * Creates a control with the given options.
+ */
+ (options?: ControlOptions): Control;
+ }
+
+ export namespace control {
+
+ /**
+ * Creates a zoom control.
+ */
+ export function zoom(options?: Control.ZoomOptions): L.Control.Zoom;
+
+ /**
+ * Creates an attribution control.
+ */
+ export function attribution(options?: AttributionOptions): L.Control.Attribution;
+
+ /**
+ * Creates an attribution control with the given layers. Base layers will be
+ * switched with radio buttons, while overlays will be switched with checkboxes.
+ */
+ export function layers(baseLayers?: any, overlays?: any, options?: LayersOptions): L.Control.Layers;
+
+ /**
+ * Creates an scale control with the given options.
+ */
+ export function scale(options?: ScaleOptions): L.Control.Scale;
+ }
+}
+
+declare namespace L {
+
+ export interface ControlOptions {
+
+ /**
+ * The initial position of the control (one of the map corners). See control
+ * positions.
+ * Default value: 'topright'.
+ */
+ position?: PositionString;
+
+ }
+}
+
+declare namespace L {
+
+ namespace CRS {
+
+ /**
+ * The most common CRS for online maps, used by almost all free and commercial
+ * tile providers. Uses Spherical Mercator projection. Set in by default in
+ * Map's crs option.
+ */
+ export var EPSG3857: ICRS;
+
+ /**
+ * A common CRS among GIS enthusiasts. Uses simple Equirectangular projection.
+ */
+ export var EPSG4326: ICRS;
+
+ /**
+ * Rarely used by some commercial tile providers. Uses Elliptical Mercator
+ * projection.
+ */
+ export var EPSG3395: ICRS;
+
+ /**
+ * A simple CRS that maps longitude and latitude into x and y directly. May be
+ * used for maps of flat surfaces (e.g. game maps). Note that the y axis should
+ * still be inverted (going from bottom to top).
+ */
+ export var Simple: ICRS;
+
+ }
+}
+
+declare namespace L {
+
+ /**
+ * Creates a div icon instance with the given options.
+ */
+ function divIcon(options: DivIconOptions): DivIcon;
+
+ export interface DivIconStatic extends ClassStatic {
+ /**
+ * Creates a div icon instance with the given options.
+ */
+ new(options: DivIconOptions): DivIcon;
+ }
+ export var DivIcon: DivIconStatic;
+
+ export interface DivIcon extends Icon {
+ }
+}
+
+declare namespace L {
+
+ export interface DivIconOptions {
+
+ /**
+ * Size of the icon in pixels. Can be also set through CSS.
+ */
+ iconSize?: Point|[number, number];
+
+ /**
+ * The coordinates of the "tip" of the icon (relative to its top left corner).
+ * The icon will be aligned so that this point is at the marker's geographical
+ * location. Centered by default if size is specified, also can be set in CSS
+ * with negative margins.
+ */
+ iconAnchor?: Point|[number, number];
+
+ /**
+ * A custom class name to assign to the icon.
+ *
+ * Default value: 'leaflet-div-icon'.
+ */
+ className?: string;
+
+ /**
+ * A custom HTML code to put inside the div element.
+ *
+ * Default value: ''.
+ */
+ html?: string;
+
+ /**
+ * The coordinates of the point from which popups will "open", relative to the
+ * icon anchor.
+ */
+ popupAnchor?: Point|[number, number];
+
+ }
+}
+
+declare namespace L {
+
+ export interface DomEvent {
+
+ /**
+ * Adds a listener fn to the element's DOM event of the specified type. this keyword
+ * inside the listener will point to context, or to the element if not specified.
+ */
+ addListener(el: HTMLElement, type: string, fn: (e: Event) => void, context?: any): DomEvent;
+ on(el: HTMLElement, type: string, fn: (e: Event) => void, context?: any): DomEvent;
+
+ /**
+ * Removes an event listener from the element.
+ */
+ removeListener(el: HTMLElement, type: string, fn: (e: Event) => void, context?: any): DomEvent;
+ off(el: HTMLElement, type: string, fn: (e: Event) => void, context?: any): DomEvent;
+
+ /**
+ * Stop the given event from propagation to parent elements. Used inside the
+ * listener functions:
+ * L.DomEvent.addListener(div, 'click', function
+ * (e) {
+ * L.DomEvent.stopPropagation(e);
+ * });
+ */
+ stopPropagation(e: Event): DomEvent;
+
+ /**
+ * Prevents the default action of the event from happening (such as following
+ * a link in the href of the a element, or doing a POST request with page reload
+ * when form is submitted). Use it inside listener functions.
+ */
+ preventDefault(e: Event): DomEvent;
+
+ /**
+ * Does stopPropagation and preventDefault at the same time.
+ */
+ stop(e: Event): DomEvent;
+
+ /**
+ * Adds stopPropagation to the element's 'click', 'doubleclick', 'mousedown'
+ * and 'touchstart' events.
+ */
+ disableClickPropagation(el: HTMLElement): DomEvent;
+
+ /**
+ * Gets normalized mouse position from a DOM event relative to the container
+ * or to the whole page if not specified.
+ */
+ getMousePosition(e: Event, container?: HTMLElement): Point;
+
+ /**
+ * Gets normalized wheel delta from a mousewheel DOM event.
+ */
+ getWheelDelta(e: Event): number;
+
+ }
+
+ export var DomEvent: DomEvent;
+}
+
+declare namespace L {
+
+ namespace DomUtil {
+
+ /**
+ * Returns an element with the given id if a string was passed, or just returns
+ * the element if it was passed directly.
+ */
+ export function get(id: string): HTMLElement;
+
+ /**
+ * Returns the value for a certain style attribute on an element, including
+ * computed values or values set through CSS.
+ */
+ export function getStyle(el: HTMLElement, style: string): string;
+
+ /**
+ * Returns the offset to the viewport for the requested element.
+ */
+ export function getViewportOffset(el: HTMLElement): Point;
+
+ /**
+ * Creates an element with tagName, sets the className, and optionally appends
+ * it to container element.
+ */
+ export function create(tagName: string, className: string, container?: HTMLElement): HTMLElement;
+
+ /**
+ * Makes sure text cannot be selected, for example during dragging.
+ */
+ export function disableTextSelection(): void;
+
+ /**
+ * Makes text selection possible again.
+ */
+ export function enableTextSelection(): void;
+
+ /**
+ * Returns true if the element class attribute contains name.
+ */
+ export function hasClass(el: HTMLElement, name: string): boolean;
+
+ /**
+ * Adds name to the element's class attribute.
+ */
+ export function addClass(el: HTMLElement, name: string): void;
+
+ /**
+ * Removes name from the element's class attribute.
+ */
+ export function removeClass(el: HTMLElement, name: string): void;
+
+ /**
+ * Set the opacity of an element (including old IE support). Value must be from
+ * 0 to 1.
+ */
+ export function setOpacity(el: HTMLElement, value: number): void;
+
+ /**
+ * Goes through the array of style names and returns the first name that is a valid
+ * style name for an element. If no such name is found, it returns false. Useful
+ * for vendor-prefixed styles like transform.
+ */
+ export function testProp(props: string[]): any;
+
+ /**
+ * Returns a CSS transform string to move an element by the offset provided in
+ * the given point. Uses 3D translate on WebKit for hardware-accelerated transforms
+ * and 2D on other browsers.
+ */
+ export function getTranslateString(point: Point): string;
+
+ /**
+ * Returns a CSS transform string to scale an element (with the given scale origin).
+ */
+ export function getScaleString(scale: number, origin: Point): string;
+
+ /**
+ * Sets the position of an element to coordinates specified by point, using
+ * CSS translate or top/left positioning depending on the browser (used by
+ * Leaflet internally to position its layers). Forces top/left positioning
+ * if disable3D is true.
+ */
+ export function setPosition(el: HTMLElement, point: Point, disable3D?: boolean): void;
+
+ /**
+ * Returns the coordinates of an element previously positioned with setPosition.
+ */
+ export function getPosition(el: HTMLElement): Point;
+
+ /**
+ * Vendor-prefixed transition style name (e.g. 'webkitTransition' for WebKit).
+ */
+ export var TRANSITION: string;
+
+ /**
+ * Vendor-prefixed transform style name.
+ */
+ export var TRANSFORM: string;
+
+ }
+}
+
+declare namespace L {
+ export interface DraggableStatic extends ClassStatic {
+ /**
+ * Creates a Draggable object for moving the given element when you start dragging
+ * the dragHandle element (equals the element itself by default).
+ */
+ new(element: HTMLElement, dragHandle?: HTMLElement): Draggable;
+ }
+ export var Draggable: DraggableStatic;
+
+
+ export interface Draggable extends IEventPowered {
+ /**
+ * Enables the dragging ability.
+ */
+ enable(): void;
+
+ /**
+ * Disables the dragging ability.
+ */
+ disable(): void;
+
+ ////////////////
+ ////////////////
+ addEventListener(type: string, fn: (e: LeafletEvent) => void, context?: any): Draggable;
+ addOneTimeEventListener(type: string, fn: (e: LeafletEvent) => void, context?: any): Draggable;
+ removeEventListener(type: string, fn?: (e: LeafletEvent) => void, context?: any): Draggable;
+ hasEventListeners(type: string): boolean;
+ fireEvent(type: string, data?: any): Draggable;
+ on(type: string, fn: (e: LeafletEvent) => void, context?: any): Draggable;
+ once(type: string, fn: (e: LeafletEvent) => void, context?: any): Draggable;
+ off(type: string, fn?: (e: LeafletEvent) => void, context?: any): Draggable;
+ fire(type: string, data?: any): Draggable;
+ addEventListener(eventMap: any, context?: any): Draggable;
+ removeEventListener(eventMap?: any, context?: any): Draggable;
+ clearAllEventListeners(): Draggable;
+ on(eventMap: any, context?: any): Draggable;
+ off(eventMap?: any, context?: any): Draggable;
+ }
+}
+
+
+
+declare namespace L {
+
+ /**
+ * Create a layer group, optionally given an initial set of layers.
+ */
+ function featureGroup(layers?: T[]): FeatureGroup;
+
+
+ export interface FeatureGroupStatic extends ClassStatic {
+ /**
+ * Create a layer group, optionally given an initial set of layers.
+ */
+ new(layers?: T[]): FeatureGroup;
+ }
+ export var FeatureGroup: FeatureGroupStatic;
+
+ export interface FeatureGroup extends LayerGroup, ILayer, IEventPowered> {
+ /**
+ * Binds a popup with a particular HTML content to a click on any layer from the
+ * group that has a bindPopup method.
+ */
+ bindPopup(htmlContent: string, options?: PopupOptions): FeatureGroup;
+
+ /**
+ * Returns the LatLngBounds of the Feature Group (created from bounds and coordinates
+ * of its children).
+ */
+ getBounds(): LatLngBounds;
+
+ /**
+ * Sets the given path options to each layer of the group that has a setStyle method.
+ */
+ setStyle(style: PathOptions): FeatureGroup;
+
+ /**
+ * Brings the layer group to the top of all other layers.
+ */
+ bringToFront(): FeatureGroup;
+
+ /**
+ * Brings the layer group to the bottom of all other layers.
+ */
+ bringToBack(): FeatureGroup;
+
+ ////////////
+ ////////////
+ /**
+ * Should contain code that creates DOM elements for the overlay, adds them
+ * to map panes where they should belong and puts listeners on relevant map events.
+ * Called on map.addLayer(layer).
+ */
+ onAdd(map: Map): void;
+
+ /**
+ * Should contain all clean up code that removes the overlay's elements from
+ * the DOM and removes listeners previously added in onAdd. Called on map.removeLayer(layer).
+ */
+ onRemove(map: Map): void;
+
+ ////////////////
+ ////////////////
+ addEventListener(type: string, fn: (e: LeafletEvent) => void, context?: any): FeatureGroup;
+ addOneTimeEventListener(type: string, fn: (e: LeafletEvent) => void, context?: any): FeatureGroup;
+ removeEventListener(type: string, fn?: (e: LeafletEvent) => void, context?: any): FeatureGroup;
+ hasEventListeners(type: string): boolean;
+ fireEvent(type: string, data?: any): FeatureGroup;
+ on(type: string, fn: (e: LeafletEvent) => void, context?: any): FeatureGroup;
+ once(type: string, fn: (e: LeafletEvent) => void, context?: any): FeatureGroup;
+ off(type: string, fn?: (e: LeafletEvent) => void, context?: any): FeatureGroup;
+ fire(type: string, data?: any): FeatureGroup;
+ addEventListener(eventMap: any, context?: any): FeatureGroup;
+ removeEventListener(eventMap?: any, context?: any): FeatureGroup;
+ clearAllEventListeners(): FeatureGroup;
+ on(eventMap: any, context?: any): FeatureGroup;
+ off(eventMap?: any, context?: any): FeatureGroup;
+ }
+}
+
+declare namespace L {
+
+ /**
+ * Creates a GeoJSON layer. Optionally accepts an object in GeoJSON format
+ * to display on the map (you can alternatively add it later with addData method)
+ * and an options object.
+ */
+ function geoJson(geojson?: any, options?: GeoJSONOptions): GeoJSON;
+
+ export interface GeoJSONStatic extends ClassStatic {
+ /**
+ * Creates a GeoJSON layer. Optionally accepts an object in GeoJSON format
+ * to display on the map (you can alternatively add it later with addData method)
+ * and an options object.
+ */
+ new(geojson?: any, options?: GeoJSONOptions): GeoJSON;
+
+ /**
+ * Creates a layer from a given GeoJSON feature.
+ */
+ geometryToLayer(featureData: GeoJSON, pointToLayer?: (featureData: any, latlng: LatLng) => ILayer): ILayer;
+
+ /**
+ * Creates a LatLng object from an array of 2 numbers (latitude, longitude)
+ * used in GeoJSON for points. If reverse is set to true, the numbers will be interpreted
+ * as (longitude, latitude).
+ */
+ coordsToLatLng(coords: number[], reverse?: boolean): LatLng;
+
+ /**
+ * Creates a multidimensional array of LatLng objects from a GeoJSON coordinates
+ * array. levelsDeep specifies the nesting level (0 is for an array of points,
+ * 1 for an array of arrays of points, etc., 0 by default). If reverse is set to
+ * true, the numbers will be interpreted as (longitude, latitude).
+ */
+ coordsToLatLngs(coords: any[], levelsDeep?: number, reverse?: boolean): any[];
+ }
+ export var GeoJSON: GeoJSONStatic;
+
+ export interface GeoJSON extends FeatureGroup {
+ /**
+ * Adds a GeoJSON object to the layer.
+ */
+ addData(data: any): boolean;
+
+ /**
+ * Changes styles of GeoJSON vector layers with the given style function.
+ */
+ setStyle(style: (featureData: any) => any): GeoJSON;
+
+ /**
+ * Changes styles of GeoJSON vector layers with the given style options.
+ */
+ setStyle(style: PathOptions): GeoJSON;
+
+ /**
+ * Resets the the given vector layer's style to the original GeoJSON style,
+ * useful for resetting style after hover events.
+ */
+ resetStyle(layer: Path): GeoJSON;
+ }
+}
+
+declare namespace L {
+ export interface GeoJSONOptions {
+ /**
+ * Function that will be used for creating layers for GeoJSON points (if not
+ * specified, simple markers will be created).
+ */
+ pointToLayer?: (featureData: any, latlng: LatLng) => ILayer;
+
+ /**
+ * Function that will be used to get style options for vector layers created
+ * for GeoJSON features.
+ */
+ style?: (featureData: any) => any;
+
+ /**
+ * Function that will be called on each created feature layer. Useful for attaching
+ * events and popups to features.
+ */
+ onEachFeature?: (featureData: any, layer: ILayer) => void;
+
+ /**
+ * Function that will be used to decide whether to show a feature or not.
+ */
+ filter?: (featureData: any, layer: ILayer) => boolean;
+
+ /**
+ * Function that will be used for converting GeoJSON coordinates to LatLng points
+ * (if not specified, coords will be assumed to be WGS84 � standard[longitude, latitude]
+ * values in degrees).
+ */
+ coordsToLatLng?: (coords: any[]) => LatLng[];
+ }
+}
+
+
+
+
+declare namespace L {
+
+ /**
+ * Creates an icon instance with the given options.
+ */
+ function icon(options: IconOptions): Icon;
+
+ export interface IconStatic extends ClassStatic {
+ /**
+ * Creates an icon instance with the given options.
+ */
+ new(options: IconOptions): Icon;
+
+ Default: {
+ /**
+ * Creates a default icon instance with the given options.
+ */
+ new(options?: IconOptions): Icon.Default;
+
+ imagePath: string;
+ };
+ }
+ export var Icon: IconStatic;
+
+ export interface Icon {
+ }
+
+ namespace Icon {
+ /**
+ * L.Icon.Default extends L.Icon and is the blue icon Leaflet uses
+ * for markers by default.
+ */
+ export interface Default extends Icon {
+ }
+ }
+}
+
+declare namespace L {
+
+ export interface IconOptions {
+
+ /**
+ * (required) The URL to the icon image (absolute or relative to your script
+ * path).
+ */
+ iconUrl?: string;
+
+ /**
+ * The URL to a retina sized version of the icon image (absolute or relative to
+ * your script path). Used for Retina screen devices.
+ */
+ iconRetinaUrl?: string;
+
+ /**
+ * Size of the icon image in pixels.
+ */
+ iconSize?: Point|[number, number];
+
+ /**
+ * The coordinates of the "tip" of the icon (relative to its top left corner).
+ * The icon will be aligned so that this point is at the marker's geographical
+ * location. Centered by default if size is specified, also can be set in CSS
+ * with negative margins.
+ */
+ iconAnchor?: Point|[number, number];
+
+ /**
+ * The URL to the icon shadow image. If not specified, no shadow image will be
+ * created.
+ */
+ shadowUrl?: string;
+
+ /**
+ * The URL to the retina sized version of the icon shadow image. If not specified,
+ * no shadow image will be created. Used for Retina screen devices.
+ */
+ shadowRetinaUrl?: string;
+
+ /**
+ * Size of the shadow image in pixels.
+ */
+ shadowSize?: Point|[number, number];
+
+ /**
+ * The coordinates of the "tip" of the shadow (relative to its top left corner)
+ * (the same as iconAnchor if not specified).
+ */
+ shadowAnchor?: Point|[number, number];
+
+ /**
+ * The coordinates of the point from which popups will "open", relative to the
+ * icon anchor.
+ */
+ popupAnchor?: Point|[number, number];
+
+ /**
+ * A custom class name to assign to both icon and shadow images. Empty by default.
+ */
+ className?: string;
+ }
+}
+
+declare namespace L {
+
+ export interface IControl {
+
+ /**
+ * Should contain code that creates all the neccessary DOM elements for the
+ * control, adds listeners on relevant map events, and returns the element
+ * containing the control. Called on map.addControl(control) or control.addTo(map).
+ */
+ onAdd(map: Map): HTMLElement;
+
+ /**
+ * Optional, should contain all clean up code (e.g. removes control's event
+ * listeners). Called on map.removeControl(control) or control.removeFrom(map).
+ * The control's DOM container is removed automatically.
+ */
+ onRemove(map: Map): void;
+ }
+}
+
+declare namespace L {
+
+ export interface ICRS {
+
+ /**
+ * Projection that this CRS uses.
+ */
+ projection: IProjection;
+
+ /**
+ * Transformation that this CRS uses to turn projected coordinates into screen
+ * coordinates for a particular tile service.
+ */
+ transformation: Transformation;
+
+ /**
+ * Standard code name of the CRS passed into WMS services (e.g. 'EPSG:3857').
+ */
+ code: string;
+
+ /**
+ * Projects geographical coordinates on a given zoom into pixel coordinates.
+ */
+ latLngToPoint(latlng: LatLng, zoom: number): Point;
+
+ /**
+ * The inverse of latLngToPoint. Projects pixel coordinates on a given zoom
+ * into geographical coordinates.
+ */
+ pointToLatLng(point: Point, zoom: number): LatLng;
+
+ /**
+ * Projects geographical coordinates into coordinates in units accepted
+ * for this CRS (e.g. meters for EPSG:3857, for passing it to WMS services).
+ */
+ project(latlng: LatLng): Point;
+
+ /**
+ * Returns the scale used when transforming projected coordinates into pixel
+ * coordinates for a particular zoom. For example, it returns 256 * 2^zoom for
+ * Mercator-based CRS.
+ */
+ scale(zoom: number): number;
+
+ /**
+ * Returns the size of the world in pixels for a particular zoom.
+ */
+ getSize(zoom: number): Point;
+
+ }
+}
+
+declare namespace L {
+
+ export interface IEventPowered {
+
+ /**
+ * Adds a listener function (fn) to a particular event type of the object. You
+ * can optionally specify the context of the listener (object the this keyword
+ * will point to). You can also pass several space-separated types (e.g. 'click
+ * dblclick').
+ */
+ addEventListener(type: string, fn: (e: LeafletEvent) => void, context?: any): T;
+
+ /**
+ * The same as above except the listener will only get fired once and then removed.
+ */
+ addOneTimeEventListener(type: string, fn: (e: LeafletEvent) => void, context?: any): T;
+ /**
+ * Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
+ */
+ addEventListener(eventMap: any, context?: any): T;
+
+ /**
+ * Removes a previously added listener function. If no function is specified,
+ * it will remove all the listeners of that particular event from the object.
+ */
+ removeEventListener(type: string, fn?: (e: LeafletEvent) => void, context?: any): T;
+
+ /**
+ * Removes a set of type/listener pairs.
+ */
+ removeEventListener(eventMap?: any, context?: any): T;
+
+ /**
+ * Returns true if a particular event type has some listeners attached to it.
+ */
+ hasEventListeners(type: string): boolean;
+
+ /**
+ * Fires an event of the specified type. You can optionally provide an data object
+ * — the first argument of the listener function will contain its properties.
+ */
+ fireEvent(type: string, data?: any): T;
+
+ /**
+ * Removes all listeners to all events on the object.
+ */
+ clearAllEventListeners(): T;
+
+ /**
+ * Alias to addEventListener.
+ */
+ on(type: string, fn: (e: LeafletEvent) => void, context?: any): T;
+
+ /**
+ * Alias to addEventListener.
+ */
+ on(eventMap: any, context?: any): T;
+
+ /**
+ * Alias to addOneTimeEventListener.
+ */
+ once(type: string, fn: (e: LeafletEvent) => void, context?: any): T;
+
+ /**
+ * Alias to removeEventListener.
+ */
+ off(type: string, fn?: (e: LeafletEvent) => void, context?: any): T;
+
+ /**
+ * Alias to removeEventListener.
+ */
+ off(eventMap?: any, context?: any): T;
+
+ /**
+ * Alias to fireEvent.
+ */
+ fire(type: string, data?: any): T;
+ }
+}
+
+declare namespace L {
+
+ export interface IHandler {
+
+ /**
+ * Enables the handler.
+ */
+ enable(): void;
+
+ /**
+ * Disables the handler.
+ */
+ disable(): void;
+
+ /**
+ * Returns true if the handler is enabled.
+ */
+ enabled(): boolean;
+ }
+
+ export interface Handler {
+ initialize(map: Map): void;
+ }
+}
+
+declare namespace L {
+
+ export interface ILayer {
+
+ /**
+ * Should contain code that creates DOM elements for the overlay, adds them
+ * to map panes where they should belong and puts listeners on relevant map events.
+ * Called on map.addLayer(layer).
+ */
+ onAdd(map: Map): void;
+
+ /**
+ * Should contain all clean up code that removes the overlay's elements from
+ * the DOM and removes listeners previously added in onAdd. Called on map.removeLayer(layer).
+ */
+ onRemove(map: Map): void;
+ }
+}
+
+declare namespace L {
+ namespace Mixin {
+ export interface LeafletMixinEvents extends IEventPowered {
+ }
+
+ export var Events: LeafletMixinEvents;
+ }
+}
+
+declare namespace L {
+
+ /**
+ * Instantiates an image overlay object given the URL of the image and the geographical
+ * bounds it is tied to.
+ */
+ function imageOverlay(imageUrl: string, bounds: LatLngBounds, options?: ImageOverlayOptions): ImageOverlay;
+
+ export interface ImageOverlayStatic extends ClassStatic {
+ /**
+ * Instantiates an image overlay object given the URL of the image and the geographical
+ * bounds it is tied to.
+ */
+ new(imageUrl: string, bounds: LatLngBounds, options?: ImageOverlayOptions): ImageOverlay;
+ }
+ export var ImageOverlay: ImageOverlayStatic;
+
+ export interface ImageOverlay extends ILayer {
+ /**
+ * Adds the overlay to the map.
+ */
+ addTo(map: Map): ImageOverlay;
+
+ /**
+ * Sets the opacity of the overlay.
+ */
+ setOpacity(opacity: number): ImageOverlay;
+
+ /**
+ * Changes the URL of the image.
+ */
+ setUrl(imageUrl: string): ImageOverlay;
+
+ /**
+ * Brings the layer to the top of all overlays.
+ */
+ bringToFront(): ImageOverlay;
+
+ /**
+ * Brings the layer to the bottom of all overlays.
+ */
+ bringToBack(): ImageOverlay;
+
+ ////////////
+ ////////////
+ /**
+ * Should contain code that creates DOM elements for the overlay, adds them
+ * to map panes where they should belong and puts listeners on relevant map events.
+ * Called on map.addLayer(layer).
+ */
+ onAdd(map: Map): void;
+
+ /**
+ * Should contain all clean up code that removes the overlay's elements from
+ * the DOM and removes listeners previously added in onAdd. Called on map.removeLayer(layer).
+ */
+ onRemove(map: Map): void;
+ }
+}
+
+declare namespace L {
+
+ export interface ImageOverlayOptions {
+
+ /**
+ * The opacity of the image overlay.
+ */
+ opacity?: number;
+ }
+}
+
+declare namespace L {
+
+ export interface IProjection {
+
+ /**
+ * Projects geographical coordinates into a 2D point.
+ */
+ project(latlng: LatLng): Point;
+
+ /**
+ * The inverse of project. Projects a 2D point into geographical location.
+ */
+ unproject(point: Point): LatLng;
+ }
+}
+
+declare namespace L {
+
+ /**
+ * A constant that represents the Leaflet version in use.
+ */
+ export var version: string;
+
+ /**
+ * This method restores the L global variale to the original value it had
+ * before Leaflet inclusion, and returns the real Leaflet namespace.
+ */
+ export function noConflict(): typeof L;
+}
+
+declare namespace L {
+ /**
+ * Creates an object representing a geographical point with the given latitude
+ * and longitude.
+ */
+ function latLng(latitude: number, longitude: number): LatLng;
+
+ /**
+ * Creates an object representing a geographical point with the given latitude
+ * and longitude.
+ */
+ function latLng(coords: LatLngExpression): LatLng;
+
+ export interface LatLngStatic {
+ /**
+ * Creates an object representing a geographical point with the given latitude
+ * and longitude.
+ */
+ new(latitude: number, longitude: number): LatLng;
+
+ /**
+ * Creates an object representing a geographical point with the given latitude
+ * and longitude.
+ */
+ new(coords: LatLngExpression): LatLng;
+
+ /**
+ * A multiplier for converting degrees into radians.
+ *
+ * Value: Math.PI / 180.
+ */
+ DEG_TO_RAD: number;
+
+ /**
+ * A multiplier for converting radians into degrees.
+ *
+ * Value: 180 / Math.PI.
+ */
+ RAD_TO_DEG: number;
+
+ /**
+ * Max margin of error for the equality check.
+ *
+ * Value: 1.0E-9.
+ */
+ MAX_MARGIN: number;
+ }
+ export var LatLng: LatLngStatic;
+
+ export interface LatLng {
+ /**
+ * Returns the distance (in meters) to the given LatLng calculated using the
+ * Haversine formula. See description on wikipedia
+ */
+ distanceTo(otherLatlng: LatLngExpression): number;
+
+ /**
+ * Returns true if the given LatLng point is at the same position (within a small
+ * margin of error).
+ */
+ equals(otherLatlng: LatLngExpression): boolean;
+
+ /**
+ * Returns a string representation of the point (for debugging purposes).
+ */
+ toString(): string;
+
+ /**
+ * Returns a new LatLng object with the longitude wrapped around left and right
+ * boundaries (-180 to 180 by default).
+ */
+ wrap(left?: number, right?: number): LatLng;
+
+ /**
+ * Latitude in degrees.
+ */
+ lat: number;
+
+ /**
+ * Longitude in degrees.
+ */
+ lng: number;
+ }
+}
+
+declare namespace L {
+
+ /**
+ * Creates a LatLngBounds object by defining south-west and north-east corners
+ * of the rectangle.
+ */
+ function latLngBounds(southWest: LatLngExpression, northEast: LatLngExpression): LatLngBounds;
+
+ /**
+ * Creates a LatLngBounds object defined by the geographical points it contains.
+ * Very useful for zooming the map to fit a particular set of locations with fitBounds.
+ */
+ function latLngBounds(latlngs: LatLngBoundsExpression): LatLngBounds;
+
+ export interface LatLngBoundsStatic {
+ /**
+ * Creates a LatLngBounds object by defining south-west and north-east corners
+ * of the rectangle.
+ */
+ new(southWest: LatLngExpression, northEast: LatLngExpression): LatLngBounds;
+
+ /**
+ * Creates a LatLngBounds object defined by the geographical points it contains.
+ * Very useful for zooming the map to fit a particular set of locations with fitBounds.
+ */
+ new(latlngs: LatLngBoundsExpression): LatLngBounds;
+ }
+ export var LatLngBounds: LatLngBoundsStatic;
+
+ export interface LatLngBounds {
+ /**
+ * Extends the bounds to contain the given point.
+ */
+ extend(latlng: LatLngExpression): LatLngBounds;
+
+ /**
+ * Extends the bounds to contain the given bounds.
+ */
+ extend(latlng: LatLngBoundsExpression): LatLngBounds;
+
+ /**
+ * Returns the south-west point of the bounds.
+ */
+ getSouthWest(): LatLng;
+
+ /**
+ * Returns the north-east point of the bounds.
+ */
+ getNorthEast(): LatLng;
+
+ /**
+ * Returns the north-west point of the bounds.
+ */
+ getNorthWest(): LatLng;
+
+ /**
+ * Returns the south-east point of the bounds.
+ */
+ getSouthEast(): LatLng;
+
+ /**
+ * Returns the west longitude in degrees of the bounds.
+ */
+ getWest(): number;
+
+ /**
+ * Returns the east longitude in degrees of the bounds.
+ */
+ getEast(): number;
+
+ /**
+ * Returns the north latitude in degrees of the bounds.
+ */
+ getNorth(): number;
+
+ /**
+ * Returns the south latitude in degrees of the bounds.
+ */
+ getSouth(): number;
+
+ /**
+ * Returns the center point of the bounds.
+ */
+ getCenter(): LatLng;
+
+ /**
+ * Returns true if the rectangle contains the given one.
+ */
+ contains(otherBounds: LatLngBoundsExpression): boolean;
+
+ /**
+ * Returns true if the rectangle contains the given point.
+ */
+ contains(latlng: LatLngExpression): boolean;
+
+ /**
+ * Returns true if the rectangle intersects the given bounds.
+ */
+ intersects(otherBounds: LatLngBoundsExpression): boolean;
+
+ /**
+ * Returns true if the rectangle is equivalent (within a small margin of error)
+ * to the given bounds.
+ */
+ equals(otherBounds: LatLngBoundsExpression): boolean;
+
+ /**
+ * Returns a string with bounding box coordinates in a 'southwest_lng,southwest_lat,northeast_lng,northeast_lat'
+ * format. Useful for sending requests to web services that return geo data.
+ */
+ toBBoxString(): string;
+
+ /**
+ * Returns bigger bounds created by extending the current bounds by a given
+ * percentage in each direction.
+ */
+ pad(bufferRatio: number): LatLngBounds;
+
+ /**
+ * Returns true if the bounds are properly initialized.
+ */
+ isValid(): boolean;
+
+ }
+}
+
+declare namespace L {
+
+ /**
+ * Create a layer group, optionally given an initial set of layers.
+ */
+ function layerGroup(layers?: T[]): LayerGroup;
+
+
+ export interface LayerGroupStatic extends ClassStatic {
+ /**
+ * Create a layer group, optionally given an initial set of layers.
+ */
+ new(layers?: T[]): LayerGroup;
+ }
+ export var LayerGroup: LayerGroupStatic;
+
+ export interface LayerGroup extends ILayer {
+ /**
+ * Adds the group of layers to the map.
+ */
+ addTo(map: Map): LayerGroup;
+
+ /**
+ * Adds a given layer to the group.
+ */
+ addLayer(layer: T): LayerGroup;
+
+ /**
+ * Removes a given layer from the group.
+ */
+ removeLayer(layer: T): LayerGroup;
+
+ /**
+ * Removes a given layer of the given id from the group.
+ */
+ removeLayer(id: string): LayerGroup;
+
+ /**
+ * Returns true if the given layer is currently added to the group.
+ */
+ hasLayer(layer: T): boolean;
+
+ /**
+ * Returns the layer with the given id.
+ */
+ getLayer(id: string): T;
+
+ /**
+ * Returns an array of all the layers added to the group.
+ */
+ getLayers(): T[];
+
+ /**
+ * Removes all the layers from the group.
+ */
+ clearLayers(): LayerGroup;
+
+ /**
+ * Iterates over the layers of the group, optionally specifying context of
+ * the iterator function.
+ */
+ eachLayer(fn: (layer: T) => void, context?: any): LayerGroup;
+
+ /**
+ * Returns a GeoJSON representation of the layer group (GeoJSON FeatureCollection).
+ * Note: Descendent classes MultiPolygon & MultiPolyLine return `Feature`s, not `FeatureCollection`s
+ */
+ toGeoJSON(): GeoJSON.FeatureCollection|GeoJSON.Feature;
+
+ ////////////
+ ////////////
+ /**
+ * Should contain code that creates DOM elements for the overlay, adds them
+ * to map panes where they should belong and puts listeners on relevant map events.
+ * Called on map.addLayer(layer).
+ */
+ onAdd(map: Map): void;
+
+ /**
+ * Should contain all clean up code that removes the overlay's elements from
+ * the DOM and removes listeners previously added in onAdd. Called on map.removeLayer(layer).
+ */
+ onRemove(map: Map): void;
+ }
+}
+
+
+declare namespace L {
+
+ export interface LayersOptions {
+
+ /**
+ * The position of the control (one of the map corners). See control positions.
+ *
+ * Default value: 'topright'.
+ */
+ position?: PositionString;
+
+ /**
+ * If true, the control will be collapsed into an icon and expanded on mouse hover
+ * or touch.
+ *
+ * Default value: true.
+ */
+ collapsed?: boolean;
+
+ /**
+ * If true, the control will assign zIndexes in increasing order to all of its
+ * layers so that the order is preserved when switching them on/off.
+ *
+ * Default value: true.
+ */
+ autoZIndex?: boolean;
+
+ }
+}
+
+declare namespace L {
+
+ export interface LeafletErrorEvent extends LeafletEvent {
+
+ /**
+ * Error message.
+ */
+ message: string;
+
+ /**
+ * Error code (if applicable).
+ */
+ code: number;
+ }
+}
+
+declare namespace L {
+
+ export interface LeafletEvent {
+
+ /**
+ * The event type (e.g. 'click').
+ */
+ type: string;
+
+ /**
+ * The object that fired the event.
+ */
+ target: any;
+ }
+}
+
+declare namespace L {
+
+ export interface LeafletGeoJSONEvent extends LeafletEvent {
+
+ /**
+ * The layer for the GeoJSON feature that is being added to the map.
+ */
+ layer: ILayer;
+
+ /**
+ * GeoJSON properties of the feature.
+ */
+ properties: any;
+
+ /**
+ * GeoJSON geometry type of the feature.
+ */
+ geometryType: string;
+
+ /**
+ * GeoJSON ID of the feature (if present).
+ */
+ id: string;
+ }
+}
+
+declare namespace L {
+
+ export interface LeafletLayerEvent extends LeafletEvent {
+
+ /**
+ * The layer that was added or removed.
+ */
+ layer: ILayer;
+ }
+}
+
+declare namespace L {
+
+ export interface LeafletLayersControlEvent extends LeafletEvent {
+
+ /**
+ * The layer that was added or removed.
+ */
+ layer: ILayer;
+
+ /**
+ * The name of the layer that was added or removed.
+ */
+ name: string;
+ }
+}
+
+declare namespace L {
+
+ export interface LeafletLocationEvent extends LeafletEvent {
+
+ /**
+ * Detected geographical location of the user.
+ */
+ latlng: LatLng;
+
+ /**
+ * Geographical bounds of the area user is located in (with respect to the accuracy
+ * of location).
+ */
+ bounds: LatLngBounds;
+
+ /**
+ * Accuracy of location in meters.
+ */
+ accuracy: number;
+
+ /**
+ * Height of the position above the WGS84 ellipsoid in meters.
+ */
+ altitude: number;
+
+ /**
+ * Accuracy of altitude in meters.
+ */
+ altitudeAccuracy: number;
+
+ /**
+ * The direction of travel in degrees counting clockwise from true North.
+ */
+ heading: number;
+
+ /**
+ * Current velocity in meters per second.
+ */
+ speed: number;
+
+ /**
+ * The time when the position was acquired.
+ */
+ timestamp: number;
+
+ }
+}
+
+declare namespace L {
+
+ export interface LeafletMouseEvent extends LeafletEvent {
+
+ /**
+ * The geographical point where the mouse event occured.
+ */
+ latlng: LatLng;
+
+ /**
+ * Pixel coordinates of the point where the mouse event occured relative to
+ * the map layer.
+ */
+ layerPoint: Point;
+
+ /**
+ * Pixel coordinates of the point where the mouse event occured relative to
+ * the map сontainer.
+ */
+ containerPoint: Point;
+
+ /**
+ * The original DOM mouse event fired by the browser.
+ */
+ originalEvent: MouseEvent;
+ }
+}
+
+declare namespace L {
+
+ export interface LeafletPopupEvent extends LeafletEvent {
+
+ /**
+ * The popup that was opened or closed.
+ */
+ popup: Popup;
+ }
+}
+
+declare namespace L {
+
+ export interface LeafletDragEndEvent extends LeafletEvent {
+
+ /**
+ * The distance in pixels the draggable element was moved by.
+ */
+ distance: number;
+ }
+}
+
+declare namespace L {
+
+ export interface LeafletResizeEvent extends LeafletEvent {
+
+ /**
+ * The old size before resize event.
+ */
+ oldSize: Point;
+
+ /**
+ * The new size after the resize event.
+ */
+ newSize: Point;
+ }
+}
+
+declare namespace L {
+
+ export interface LeafletTileEvent extends LeafletEvent {
+
+ /**
+ * The tile element (image).
+ */
+ tile: HTMLElement;
+
+ /**
+ * The source URL of the tile.
+ */
+ url: string;
+ }
+}
+
+declare namespace L {
+
+ namespace LineUtil {
+
+ /**
+ * Dramatically reduces the number of points in a polyline while retaining
+ * its shape and returns a new array of simplified points. Used for a huge performance
+ * boost when processing/displaying Leaflet polylines for each zoom level
+ * and also reducing visual noise. tolerance affects the amount of simplification
+ * (lesser value means higher quality but slower and with more points). Also
+ * released as a separated micro-library Simplify.js.
+ */
+ export function simplify(points: Point[], tolerance: number): Point[];
+
+ /**
+ * Returns the distance between point p and segment p1 to p2.
+ */
+ export function pointToSegmentDistance(p: Point, p1: Point, p2: Point): number;
+
+ /**
+ * Returns the closest point from a point p on a segment p1 to p2.
+ */
+ export function closestPointOnSegment(p: Point, p1: Point, p2: Point): Point;
+
+ /**
+ * Clips the segment a to b by rectangular bounds. Used by Leaflet to only show
+ * polyline points that are on the screen or near, increasing performance. Returns
+ * either false or a length-2 array of clipped points.
+ */
+ export function clipSegment(a: Point, b: Point, bounds: Bounds): Point[] | boolean;
+
+ }
+}
+
+declare namespace L {
+
+ export interface LocateOptions {
+
+ /**
+ * If true, starts continous watching of location changes (instead of detecting
+ * it once) using W3C watchPosition method. You can later stop watching using
+ * map.stopLocate() method.
+ *
+ * Default value: false.
+ */
+ watch?: boolean;
+
+ /**
+ * If true, automatically sets the map view to the user location with respect
+ * to detection accuracy, or to world view if geolocation failed.
+ *
+ * Default value: false.
+ */
+ setView?: boolean;
+
+ /**
+ * The maximum zoom for automatic view setting when using `setView` option.
+ *
+ * Default value: Infinity.
+ */
+ maxZoom?: number;
+
+ /**
+ * Number of millisecond to wait for a response from geolocation before firing
+ * a locationerror event.
+ *
+ * Default value: 10000.
+ */
+ timeout?: number;
+
+ /**
+ * Maximum age of detected location. If less than this amount of milliseconds
+ * passed since last geolocation response, locate will return a cached location.
+ *
+ * Default value: 0.
+ */
+ maximumAge?: number;
+
+ /**
+ * Enables high accuracy, see description in the W3C spec.
+ *
+ * Default value: false.
+ */
+ enableHighAccuracy?: boolean;
+ }
+}
+
+declare namespace L {
+
+ /**
+ * Instantiates a map object given a div element and optionally an
+ * object literal with map options described below.
+ */
+ function map(id: HTMLElement, options?: Map.MapOptions): Map;
+
+ /**
+ * Instantiates a map object given a div element id and optionally an
+ * object literal with map options described below.
+ */
+ function map(id: string, options?: Map.MapOptions): Map;
+
+
+ export interface MapStatic extends ClassStatic {
+ /**
+ * Instantiates a map object given a div element and optionally an
+ * object literal with map options described below.
+ *
+ * @constructor
+ */
+ new(id: HTMLElement, options?: Map.MapOptions): Map;
+
+ /**
+ * Instantiates a map object given a div element id and optionally an
+ * object literal with map options described below.
+ *
+ * @constructor
+ */
+ new(id: string, options?: Map.MapOptions): Map;
+ }
+ export var Map: MapStatic;
+
+ export interface Map extends IEventPowered