diff --git a/README.md b/README.md
index ab2080714b..0a7131bd99 100644
--- a/README.md
+++ b/README.md
@@ -52,7 +52,7 @@ DefinitelyTyped only works because of contributions by users like you!
Before you share your improvement with the world, use it yourself.
-#### Test editing an exiting package
+#### Test editing an existing package
To add new features you can use [module augmentation](http://www.typescriptlang.org/docs/handbook/declaration-merging.html).
You can also directly edit the types in `node_modules/@types/foo/index.d.ts`, or copy them from there and follow the steps below.
@@ -100,7 +100,7 @@ If it doesn't, you can do so yourself in the comment associated with the PR.
#### Create a new package
-If you are the library author, or can make a pull request to the library, [bundle](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html) types instead of publishing to DefinitelyTyped.
+If you are the library author, or can make a pull request to the library, [bundle types](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html) instead of publishing to DefinitelyTyped.
If you are adding typings for an NPM package, create a directory with the same name.
If the package you are adding typings for is not on NPM, make sure the name you choose for it does not conflict with the name of a package on NPM.
@@ -192,7 +192,7 @@ Changes to the `master` branch are also manually merged into the `types-2.0` bra
#### I'm writing a definition that depends on another definition. Should I use `` or an import?
If the module you're referencing is an external module (uses `export`), use an import.
-If the module you're referenceing is an ambient module (uses `declare module`, or just declares globals), use ``.
+If the module you're referencing is an ambient module (uses `declare module`, or just declares globals), use ``.
#### What do I do about older versions of typings?
diff --git a/angular-bootstrap-calendar/index.d.ts b/angular-bootstrap-calendar/index.d.ts
index 5c6b4f1fec..a451ee9b03 100644
--- a/angular-bootstrap-calendar/index.d.ts
+++ b/angular-bootstrap-calendar/index.d.ts
@@ -7,7 +7,35 @@ import * as moment from 'moment';
import * as angular from 'angular';
declare module 'angular' {
- export namespace bootstrap.calendar {
+ export namespace bootstrap.calendar {
+ interface IEventAction {
+ /**
+ * The label of the action
+ */
+ label: string;
+ /**
+ * CSS class to be added to the action element
+ */
+ cssClass?: string;
+ /**
+ * The action that occurs when it's clicked
+ * @param args - the IEvent whose action was clicked
+ */
+ onClick: (args: any) => void;
+ }
+
+ interface IEventColor {
+ /**
+ * The primary color of the event, should be darker than secondary
+ */
+ primary: string;
+
+ /**
+ * The secondary color of the event, should be lighter than primary
+ */
+ secondary: string;
+ }
+
interface IEvent {
/**
* The title of the event
@@ -16,7 +44,7 @@ declare module 'angular' {
/**
* The type of the event (determines its color). Can be important, warning, info, inverse, success or special
*/
- type: string;
+ type?: string;
/**
* A javascript date object for when the event starts
*/
@@ -25,6 +53,14 @@ declare module 'angular' {
* Optional - a javascript date object for when the event ends
*/
endsAt?: Date;
+ /**
+ * Color of the Event
+ */
+ color?: IEventColor;
+ /**
+ * Actions of the Event
+ */
+ actions?: Array;
/**
* If edit-event-html is set and this field is explicitly set to false then dont make it editable.
*/
@@ -53,6 +89,10 @@ declare module 'angular' {
* A CSS class (or more, just separate with spaces) that will be added to the event when it is displayed on each view. Useful for marking an event as selected / active etc
*/
cssClass?: string;
+ /**
+ * If set the event will display as all-day event
+ */
+ allDay?: boolean;
}
interface ICalendarConfig {
@@ -134,7 +174,7 @@ declare module 'angular' {
}
interface IOnViewChangeClick {
- (calendarDate: Date, calendarNextView: string): void;
+ (calendarDate: Date, calendarNextView: string): boolean;
}
}
}
diff --git a/angular-resource/index.d.ts b/angular-resource/index.d.ts
index e8726cc089..afde3cad14 100644
--- a/angular-resource/index.d.ts
+++ b/angular-resource/index.d.ts
@@ -162,6 +162,8 @@ declare module 'angular' {
* Really just a regular Array object with $promise and $resolve attached to it
*/
interface IResourceArray extends Array> {
+ $cancelRequest(): void;
+
/** the promise of the original server interaction that created this collection. **/
$promise: angular.IPromise>;
$resolved: boolean;
diff --git a/angular-ui-router/index.d.ts b/angular-ui-router/index.d.ts
index 4bbd94d641..035dc93430 100644
--- a/angular-ui-router/index.d.ts
+++ b/angular-ui-router/index.d.ts
@@ -110,7 +110,7 @@ declare module 'angular' {
interface IUrlMatcher {
concat(pattern: string): IUrlMatcher;
- exec(path: string, searchParams: {}): {};
+ exec(path: string, search?: any, hash?: string, options?: any): {};
parameters(): string[];
format(values: {}): string;
}
diff --git a/auth0-js/index.d.ts b/auth0-js/index.d.ts
index 7e49961475..8026ccfc4f 100644
--- a/auth0-js/index.d.ts
+++ b/auth0-js/index.d.ts
@@ -84,7 +84,7 @@ interface Auth0Identity {
interface Auth0DecodedHash {
access_token: string;
- id_token: string;
+ idToken: string;
profile: Auth0UserProfile;
state: any;
}
diff --git a/bluebird-retry/index.d.ts b/bluebird-retry/index.d.ts
index 2881d2065c..22c7b1c95e 100644
--- a/bluebird-retry/index.d.ts
+++ b/bluebird-retry/index.d.ts
@@ -16,6 +16,7 @@ declare namespace retry {
max_interval?: number;
timeout?: number;
max_tries?: number;
+ predicate?: any;
}
}
diff --git a/gapi/index.d.ts b/gapi/index.d.ts
index 6d7e18a12e..54806755e8 100644
--- a/gapi/index.d.ts
+++ b/gapi/index.d.ts
@@ -127,27 +127,7 @@ declare namespace gapi.auth {
}
declare namespace gapi.client {
- /**
- * Loads the client library interface to a particular API. If a callback is not provided, a promise is returned.
- * @param name The name of the API to load.
- * @param version The version of the API to load.
- * @return promise The promise that get's resolved after the request is finished.
- */
- export function load(name: string, version: string): Promise
-
- /**
- * Loads the client library interface to a particular API. The new API interface will be in the form gapi.client.api.collection.method.
- * @param name The name of the API to load.
- * @param version The version of the API to load
- * @param callback the function that is called once the API interface is loaded
- * @param url optional, the url of your app - if using Google's APIs, don't set it
- */
- export function load(name: string, version: string, callback: () => any, url?: string): void;
- /**
- * Creates a HTTP request for making RESTful requests.
- * An object encapsulating the various arguments for this method.
- */
- export function request(args: {
+ interface RequestOptions {
/**
* The URL to handle the request
*/
@@ -172,7 +152,29 @@ declare namespace gapi.client {
* If supplied, the request is executed immediately and no gapi.client.HttpRequest object is returned
*/
callback?: () => any;
- }): HttpRequest;
+ }
+
+ /**
+ * Loads the client library interface to a particular API. If a callback is not provided, a promise is returned.
+ * @param name The name of the API to load.
+ * @param version The version of the API to load.
+ * @return promise The promise that get's resolved after the request is finished.
+ */
+ export function load(name: string, version: string): Promise
+
+ /**
+ * Loads the client library interface to a particular API. The new API interface will be in the form gapi.client.api.collection.method.
+ * @param name The name of the API to load.
+ * @param version The version of the API to load
+ * @param callback the function that is called once the API interface is loaded
+ * @param url optional, the url of your app - if using Google's APIs, don't set it
+ */
+ export function load(name: string, version: string, callback: () => any, url?: string): void;
+ /**
+ * Creates a HTTP request for making RESTful requests.
+ * An object encapsulating the various arguments for this method.
+ */
+ export function request(args: RequestOptions): HttpRequest;
/**
* Creates an RPC Request directly. The method name and version identify the method to be executed and the RPC params are provided upon RPC creation.
* @param method The method to be executed.
diff --git a/google-drive-realtime-api/index.d.ts b/google-drive-realtime-api/index.d.ts
index 025ce08a86..6cfd9b1cc1 100644
--- a/google-drive-realtime-api/index.d.ts
+++ b/google-drive-realtime-api/index.d.ts
@@ -16,8 +16,9 @@
// gapi is a global var introduced by https://apis.google.com/js/api.js
declare namespace gapi.drive.realtime {
+ export type CollaborativeObjectType = 'EditableString' | 'Map' | 'List'
- type GoogEventHandler = ((evt:ObjectChangedEvent) => void) | ((e:Event) => void) | EventListener;
+ export type GoogEventHandler = ((evt:ObjectChangedEvent) => void) | ((e:Event) => void) | EventListener;
// Complete
// https://developers.google.com/google-apps/realtime/reference/gapi.drive.realtime.Collaborator
@@ -65,7 +66,7 @@ declare namespace gapi.drive.realtime {
// see gapi.drive.realtime.CollaborrativeType for possible values; for custom collaborative objects, this value is
// application-defined.
// Addition: the possible values for standard objects are EditableString, List, and Map.
- type:string;
+ type:CollaborativeObjectType;
// Adds an event listener to the event target. The same handler can only be added once per the type.
// Even if you add the same handler multiple times using the same type then it will only be called once
@@ -107,9 +108,9 @@ declare namespace gapi.drive.realtime {
// Complete
// https://developers.google.com/google-apps/realtime/reference/gapi.drive.realtime.CollaborativeMap
export class CollaborativeMap extends CollaborativeObject {
- size:string;
+ size:number;
- static type:string; // equals "Map"
+ static type:'Map';
// Removes all entries.
clear():void;
@@ -154,7 +155,7 @@ declare namespace gapi.drive.realtime {
// The text of this collaborative string. Reading from this property is equivalent to calling getText(). Writing to this property is equivalent to calling setText().
text:string;
- static type:string; // equals "EditableString"
+ static type:'EditableString';
// Appends a string to the end of this one.
append(text:string):void;
@@ -186,7 +187,7 @@ declare namespace gapi.drive.realtime {
// The length of a list cannot be extended in this way.
length:number;
- static type:string; // equals "List"
+ static type:"List";
// Returns a copy of the contents of this collaborative list as an array.
// Changes to the returned object will not affect the original collaborative list.
@@ -344,9 +345,68 @@ declare namespace gapi.drive.realtime {
undo():void;
}
+ export type EventType = 'object_changed' | 'values_set' | 'values_added' | 'values_removed' | 'value_changed' |
+ 'text_inserted' | 'text_deleted' | 'collaborator_joined' | 'collaborator_left' | 'reference_shifted' |
+ 'document_save_state_changed' | 'undo_redo_state_changed' | 'attribute_changed';
+ export const EventType:{
+ // A collaborative object has changed. This event wraps a specific event, and bubbles to ancestors.
+ // Defaults to object_changed.
+ OBJECT_CHANGED:'object_changed'
+
+ // Values in a list are changed in place.
+ // Defaults to values_set.
+ VALUES_SET:'values_set',
+
+ // New values have been added to the list.
+ // values_added
+ VALUES_ADDED:'values_added'
+
+ // Values have been removed from the list.
+ // values_removed
+ VALUES_REMOVED:'values_removed'
+
+ // A map or custom object value has changed. Note this could be a new value or deleted value.
+ // value_changed
+ VALUE_CHANGED:'value_changed'
+
+ // Text has been inserted into a string.
+ // text_inserted
+ TEXT_INSERTED:'text_inserted'
+
+ // Text has been removed from a string.
+ // text_deleted
+ TEXT_DELETED:'text_deleted'
+
+ // A new collaborator joined the document. Listen on the gapi.drive.realtime.Document for these changes.
+ // collaborator_joined
+ COLLABORATOR_JOINED:'collaborator_joined'
+
+ // A collaborator left the document. Listen on the gapi.drive.realtime.Document for these changes.
+ // collaborator_left
+ COLLABORATOR_LEFT:'collaborator_left'
+
+ // An index reference changed.
+ // reference_shifted
+ REFERENCE_SHIFTED:'reference_shifted'
+
+ // The document save state changed. Listen on the gapi.drive.realtime.Document for these changes.
+ // document_save_state_changed
+ DOCUMENT_SAVE_STATE_CHANGED:'document_save_state_changed'
+
+ // The model canUndo/canRedo state changed. Listen on the gapi.drive.realtime.Model for these changes.
+ // undo_redo_state_changed
+ UNDO_REDO_STATE_CHANGED:'undo_redo_state_changed'
+
+ // A metadata attribute of the document changed. This is fired on changes to:
+ // gapi.drive.realtime.Attribute.IS_READ_ONLY
+ // Listen on the gapi.drive.realtime.Document for these changes.
+ // attribute_changed
+ ATTRIBUTE_CHANGED:'attribute_changed'
+ }
+
// Complete
// https://developers.google.com/google-apps/realtime/reference/gapi.drive.realtime.BaseModelEvent
- interface BaseModelEvent {
+ export interface BaseModelEvent {
// Whether this event bubbles.
bubbles : boolean;
@@ -373,7 +433,7 @@ declare namespace gapi.drive.realtime {
target : CollaborativeObject;
// The type of the event.
- type : string;
+ type : EventType;
// The user id of the user that initiated this event.
userId : string;
@@ -399,6 +459,7 @@ declare namespace gapi.drive.realtime {
Array of string
The list of names from the hierarchy of compound operations that initiated the event.
Value must not be null.
+
isLocal
boolean
True if the event originated in the local session.
@@ -417,7 +478,7 @@ declare namespace gapi.drive.realtime {
// Complete
// https://developers.google.com/google-apps/realtime/reference/gapi.drive.realtime.ObjectChangedEvent
- interface ObjectChangedEvent extends BaseModelEvent {
+ export interface ObjectChangedEvent extends BaseModelEvent {
// parameters as in BaseModelEvent above except for addition of:
// events:
// Array of gapi.drive.realtime.BaseModelEvent
@@ -435,7 +496,7 @@ declare namespace gapi.drive.realtime {
new (target:CollaborativeObject, sessionId:string, userId:string, compoundOperationNames:string[],
isLocal:boolean, isUndo:boolean, isRedo:boolean, index:number,
values:V[], movedFromList:CollaborativeList, movedFromIndex:number):ValuesAddedEvent;
-
+
// The index of the first added value
index:number;
@@ -523,7 +584,7 @@ declare namespace gapi.drive.realtime {
"missing_property" | "not_found" | "forbidden" | "server_error" | "client_error" |
"token_refresh_required" | "invalid_element_type" | "no_write_permission" |
"fatal_network_error" | "unexpected_element";
- export var ErrorType : {
+ export const ErrorType : {
// Another user created the document's initial state after
// gapi.drive.realtime.load was called but before the local
// creation was saved.
@@ -627,12 +688,12 @@ declare namespace gapi.drive.realtime {
opt_initializerFn? : (m:Model) => void,
opt_errorFn? : (e:gapi.drive.realtime.Error) => void
) : Document;
-
+
/* Loads an existing file by id.
https://developers.google.com/google-apps/realtime/reference/gapi.drive.realtime#.load
-
+
@Param fileId {string} Id of the file to load.
-
+
@Param onLoaded {function(non-null gapi.drive.realtime.Document)}
A callback that will be called when the realtime document is ready. The created or opened realtime document
object will be passed to this function.
@@ -649,8 +710,22 @@ declare namespace gapi.drive.realtime {
fileId:string,
onLoaded? : (d:Document) => void,
opt_initializerFn? : (m:Model) => void,
- opt_errorFn? : (e:gapi.drive.realtime.Error) => void
+ opt_errorFn? : (e:Error) => void
):void;
+
+ export function loadAppDataDocument(
+ onLoaded:(x:Document) => void,
+ opt_initializerFn?:(x:Model) => void,
+ opt_errorFn?:(e:Error) => void
+ ):void
+
+ // Loads an in-memory document from a json string.
+ // This document does not talk to the server and will only exist in memory for as long as the browser session exists.
+ export function loadFromJson(
+ json:string,
+ opt_errorFn?:(e:Error) => void
+ ):Document
+
}
@@ -674,29 +749,21 @@ declare namespace gapi.drive.realtime.databinding {
}
-declare namespace gapi.drive.realtime.EventType {
- export var TEXT_INSERTED: string
- export var TEXT_DELETED: string
- export var OBJECT_CHANGED: string
- // List
- export var VALUES_ADDED:string;
- export var VALUES_REMOVED:string;
- export var VALUES_SET:string;
-}
-
-
// rtclient is a global var introduced by realtime-client-utils.js
declare namespace rtclient {
// INCOMPLETE
export interface RealtimeLoader {
start():void;
load():void;
+ handleErrors(e:gapi.drive.realtime.Error):void;
}
interface RealtimeLoaderFactory {
new (options:LoaderOptions) : RealtimeLoader;
}
// ***********************************
+ // NOTE THIS IS OUT OF DATE. realtime-client-utils.js has been rewritten, with the new version "Realtime Utils 1.0.0".
+ // Will add typings for the new version later.
// The remainder of this file types some (not all) things in realtime-client-utils.js, found here:
// https://developers.google.com/google-apps/realtime/realtime-quickstart
// and
diff --git a/hellosign-embedded/index.d.ts b/hellosign-embedded/index.d.ts
index 45b70774ff..c1b0a7fd02 100644
--- a/hellosign-embedded/index.d.ts
+++ b/hellosign-embedded/index.d.ts
@@ -3,10 +3,66 @@
// Definitions by: Brian Surowiec
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module HelloSign {
- interface MessageEvent {
- event: string;
+ interface SignedMessageEvent {
+ event: 'signature_request_signed';
+ signature_id: string;
}
+ interface DeclinedMessageEvent {
+ event: 'signature_request_declined';
+ signature_id: string;
+ }
+
+ interface CanceledMessageEvent {
+ event: 'signature_request_canceled';
+ }
+
+ interface SentMessageEvent {
+ event: 'signature_request_sent';
+ signature_request_id: string;
+ signature_request_info: {
+ title: string;
+ message: string;
+ signatures: Array<{
+ signature_id: string;
+ signer_email_address: string;
+ signer_name: string;
+ order: number;
+ status_code: string;
+ signed_at: number;
+ last_viewed_at: number;
+ last_reminded_at: number;
+ has_pin: boolean;
+ }>;
+ cc_email_addresses: Array;
+ };
+ }
+
+ interface TemplateCreatedMessageEvent {
+ event: 'template_created';
+ template_id: string;
+ template_info: {
+ title: string;
+ message: string;
+ signer_roles: Array<{
+ name: string;
+ order: number;
+ }>;
+ cc_roles: Array<{
+ name: string;
+ }>;
+ };
+ }
+
+ interface ErrorMessageEvent {
+ event: 'error';
+ description: string;
+ }
+
+ type MessageEvent = SignedMessageEvent | DeclinedMessageEvent |
+ CanceledMessageEvent | SentMessageEvent | TemplateCreatedMessageEvent |
+ ErrorMessageEvent;
+
interface ClientCultures {
/**
* English (United States)
@@ -169,6 +225,20 @@ declare module HelloSign {
*/
EVENT_CANCELED: string;
+ /**
+ * The user sent a signature request
+ *
+ * @default signature_request_sent
+ */
+ EVENT_SENT: string;
+
+ /**
+ * The template was created or edited
+ *
+ * @default template_created
+ */
+ EVENT_TEMPLATE_CREATED: string;
+
/**
* An error occurred in the iFrame
*
diff --git a/jquery.contextmenu/index.d.ts b/jquery.contextmenu/index.d.ts
index 5748c76edc..64db123173 100644
--- a/jquery.contextmenu/index.d.ts
+++ b/jquery.contextmenu/index.d.ts
@@ -25,7 +25,8 @@ interface JQueryContextMenuOptions {
hide?: () => void;
};
callback?: (key: any, options: any) => any;
- items: any;
+ items?: any;
+ build?: (triggerElement: JQuery, e: Event) => any;
reposition?: boolean;
className?: string;
itemClickEvent?: string;
diff --git a/jstree/index.d.ts b/jstree/index.d.ts
index 7b924bfd2d..377f34fbc4 100644
--- a/jstree/index.d.ts
+++ b/jstree/index.d.ts
@@ -1,8 +1,8 @@
-// Type definitions for jsTree v3.3.2
+// Type definitions for jsTree v3.3.3
// Project: http://www.jstree.com/
// Definitions by: Adam Pluciński
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-// 1 commit bb0473ae8cfc205585b6404ef86f650df2f6996e 2016-08-15
+// 1 commit 26e99ad5ec27c1a594ed57974cb16e0987482fd5 2016-11-19
///
@@ -374,6 +374,12 @@ interface JSTreeStaticDefaultsCoreThemes {
*/
icons?: boolean;
+ /**
+ * a boolean indicating if node ellipsis should be shown - this only works with a fixed with on the container
+ * @name $.jstree.defaults.core.themes.ellipsis
+ */
+ ellipsis?: boolean;
+
/**
* a boolean indicating if the tree background is striped
* @name $.jstree.defaults.core.themes.stripes
@@ -429,7 +435,7 @@ interface JSTreeStaticDefaultsCheckbox {
* @name $.jstree.defaults.checkbox.cascade
* @plugin checkbox
*/
- cascade: boolean;
+ cascade: string;
/**
* This setting controls if checkbox are bound to the general tree selection
@@ -737,6 +743,11 @@ interface JSTree extends JQuery {
*/
teardown: () => void;
+ /**
+ * Create prototype node
+ */
+ _create_prototype_node: () => HTMLElement;
+
/**
* bind all events. Used internally.
* @private
@@ -1567,6 +1578,24 @@ interface JSTree extends JQuery {
*/
toggle_icons: () => void;
+ /**
+ * show the node ellipsis
+ * @name show_icons()
+ */
+ show_ellipsis: () => void;
+
+ /**
+ * hide the node ellipsis
+ * @name hide_ellipsis()
+ */
+ hide_ellipsis: () => void;
+
+ /**
+ * toggle the node ellipsis
+ * @name toggle_icons()
+ */
+ toggle_ellipsis: () => void;
+
/**
* set the node icon for a node
* @name set_icon(obj, icon)
diff --git a/jstree/jstree-tests.ts b/jstree/jstree-tests.ts
index e82115c645..bd35406c71 100644
--- a/jstree/jstree-tests.ts
+++ b/jstree/jstree-tests.ts
@@ -114,3 +114,15 @@ tree.get_path('nodeId');
tree.get_path('nodeId', '/');
tree.get_path('nodeId', '/', true);
+
+
+var coreThemes: JSTreeStaticDefaultsCoreThemes = {
+ ellipsis:true
+};
+
+// tree with new theme elipsis
+var treeWithNewCoreProperties = $('#treeWithNewEllipsisProperties').jstree({
+ core: {
+ themes: coreThemes
+ }
+});
diff --git a/mapbox-gl/index.d.ts b/mapbox-gl/index.d.ts
index f8fb9d9b60..a0ba241d99 100644
--- a/mapbox-gl/index.d.ts
+++ b/mapbox-gl/index.d.ts
@@ -1,4 +1,4 @@
-// Type definitions for Mapbox GL JS v0.26.0
+// Type definitions for Mapbox GL JS v0.27.0
// Project: https://github.com/mapbox/mapbox-gl-js
// Definitions by: Dominik Bruderer
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -16,7 +16,9 @@ declare namespace mapboxgl {
export class Map extends Evented {
constructor(options?: MapboxOptions);
- addControl(control: Control): this;
+ addControl(control: Control, position?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left'): this;
+
+ removeControl(control: Control): this;
addClass(klass: string, options?: mapboxgl.StyleOptions): this;
@@ -36,8 +38,12 @@ declare namespace mapboxgl {
setMinZoom(minZoom?: number): this;
+ getMinZoom(): number;
+
setMaxZoom(maxZoom?: number): this;
+ getMaxZoom(): number;
+
project(lnglat: mapboxgl.LngLat | number[]): mapboxgl.Point;
unproject(point: mapboxgl.Point | number[]): mapboxgl.LngLat;
@@ -328,44 +334,34 @@ declare namespace mapboxgl {
* Control
*/
export class Control extends Evented {
- addTo(map: mapboxgl.Map): this;
-
- remove(): this;
- }
-
- /**
- * ControlOptions
- */
- export interface ControlOptions {
- position?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left';
}
/**
* Navigation
*/
export class NavigationControl extends Control {
- constructor(options?: mapboxgl.ControlOptions);
+ constructor();
}
/**
* Geolocate
*/
export class GeolocateControl extends Control {
- constructor(options?: mapboxgl.ControlOptions);
+ constructor();
}
/**
* Attribution
*/
export class AttributionControl extends Control {
- constructor(options?: mapboxgl.ControlOptions);
+ constructor();
}
/**
* Scale
*/
export class ScaleControl extends Control {
- constructor(options?: {position?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left', maxWidth?: number, unit?: string})
+ constructor(options?: {maxWidth?: number, unit?: string})
}
/**
@@ -409,6 +405,7 @@ declare namespace mapboxgl {
metadata?: any;
name?: string;
pitch?: number;
+ light?: Light;
sources?: any;
sprite?: string;
transition?: Transition;
@@ -421,6 +418,13 @@ declare namespace mapboxgl {
duration?: number;
}
+ export interface Light {
+ "anchor"?: "map" | "viewport";
+ "position"?: number[];
+ "color"?: string;
+ "intensity"?: number;
+ }
+
export interface Source {
type: "vector" | "raster" | "geojson" | "image" | "video";
}
@@ -799,8 +803,8 @@ declare namespace mapboxgl {
interactive?: boolean;
filter?: any[];
- layout?: BackgroundLayout | FillLayout | LineLayout | SymbolLayout | RasterLayout | CircleLayout;
- paint?: BackgroundPaint | FillPaint | LinePaint | SymbolPaint | RasterPaint | CirclePaint;
+ layout?: BackgroundLayout | FillLayout | FillExtrusionLayout | LineLayout | SymbolLayout | RasterLayout | CircleLayout;
+ paint?: BackgroundPaint | FillPaint | FillExtrusionPaint | LinePaint | SymbolPaint | RasterPaint | CirclePaint;
}
export interface StyleFunction {
@@ -831,8 +835,18 @@ declare namespace mapboxgl {
"fill-translate"?: number[];
"fill-translate-anchor"?: "map" | "viewport";
"fill-pattern"?: "string";
- "fill-extrude-height"?: number;
- "fill-extrude-base"?: number;
+ }
+
+ export interface FillExtrusionLayout {
+ visibility?: "visible" | "none";
+ }
+ export interface FillExtrusionPaint {
+ "fill-extrusion-opacity"?: number;
+ "fill-extrusion-color"?: string | StyleFunction;
+ "fill-extrusion-translate"?: number[];
+ "fill-extrusion-translate-anchor"?: "map" | "viewport";
+ "fill-extrusion-height"?: number | StyleFunction;
+ "fill-extrusion-base"?: number;
}
export interface LineLayout {
diff --git a/mapbox-gl/mapbox-gl-0.26.0.d.ts b/mapbox-gl/mapbox-gl-0.26.0.d.ts
new file mode 100644
index 0000000000..ddb6344cbd
--- /dev/null
+++ b/mapbox-gl/mapbox-gl-0.26.0.d.ts
@@ -0,0 +1,948 @@
+// Type definitions for Mapbox GL JS v0.26.0
+// Project: https://github.com/mapbox/mapbox-gl-js
+// Definitions by: Dominik Bruderer
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+///
+
+declare namespace mapboxgl {
+ let accessToken: string;
+ let version: string;
+ export function supported(options?: {failIfMajorPerformanceCaveat?: boolean}): boolean;
+
+ /**
+ * Map
+ */
+ export class Map extends Evented {
+ constructor(options?: MapboxOptions);
+
+ addControl(control: Control): this;
+
+ addClass(klass: string, options?: mapboxgl.StyleOptions): this;
+
+ removeClass(klass: string, options?: mapboxgl.StyleOptions): this;
+
+ setClasses(klasses: string[], options?: mapboxgl.StyleOptions): this;
+
+ hasClass(klass: string): boolean;
+
+ getClasses(): string[];
+
+ resize(): this;
+
+ getBounds(): mapboxgl.LngLatBounds;
+
+ setMaxBounds(lnglatbounds?: mapboxgl.LngLatBounds | number[][]): this;
+
+ setMinZoom(minZoom?: number): this;
+
+ setMaxZoom(maxZoom?: number): this;
+
+ project(lnglat: mapboxgl.LngLat | number[]): mapboxgl.Point;
+
+ unproject(point: mapboxgl.Point | number[]): mapboxgl.LngLat;
+
+ queryRenderedFeatures(pointOrBox?: mapboxgl.Point|number[]|mapboxgl.Point[]|number[][], parameters?: {layers?: string[], filter?: any[]}): GeoJSON.Feature[];
+
+ querySourceFeatures(sourceID: string, parameters: {sourceLayer?: string, filter?: any[]}): GeoJSON.Feature[];
+
+ setStyle(style: mapboxgl.Style | string): this;
+
+ getStyle(): mapboxgl.Style;
+
+ addSource(id: string, source: VectorSource | RasterSource | GeoJSONSource | ImageSource | VideoSource | GeoJSONSourceRaw): this;
+
+ removeSource(id: string): this;
+
+ getSource(id: string): VectorSource | RasterSource | GeoJSONSource | ImageSource | VideoSource;
+
+ addLayer(layer: mapboxgl.Layer, before?: string): this;
+
+ removeLayer(id: string): this;
+
+ getLayer(id: string): mapboxgl.Layer;
+
+ setFilter(layer: string, filter: any[]): this;
+
+ setLayerZoomRange(layerId: string, minzoom: number, maxzoom: number): this;
+
+ getFilter(layer: string): any[];
+
+ setPaintProperty(layer: string, name: string, value: any, klass?: string): this;
+
+ getPaintProperty(layer: string, name: string, klass?: string): any;
+
+ setLayoutProperty(layer: string, name: string, value: any): this;
+
+ getLayoutProperty(layer: string, name: string, klass?: string): any;
+
+ getContainer(): HTMLElement;
+
+ getCanvasContainer(): HTMLElement;
+
+ getCanvas(): HTMLCanvasElement;
+
+ loaded(): boolean;
+
+ remove(): void;
+
+ onError(): void;
+
+ showTileBoundaries: boolean;
+
+ showCollisionBoxes: boolean;
+
+ repaint: boolean;
+
+ getCenter(): mapboxgl.LngLat;
+
+ setCenter(center: LngLat|number[], eventData?: mapboxgl.EventData): this;
+
+ panBy(offset: number[], options?: mapboxgl.AnimationOptions, eventData?: mapboxgl.EventData): this;
+
+ panTo(lnglat: mapboxgl.LngLat, options?: mapboxgl.AnimationOptions, eventdata?: mapboxgl.EventData): this;
+
+ getZoom(): number;
+
+ setZoom(zoom: number, eventData?: mapboxgl.EventData): this;
+
+ zoomTo(zoom: number, options?: mapboxgl.AnimationOptions, eventData?: mapboxgl.EventData): this;
+
+ zoomIn(options?: mapboxgl.AnimationOptions, eventData?: mapboxgl.EventData): this;
+
+ zoomOut(options?: mapboxgl.AnimationOptions, eventData?: mapboxgl.EventData): this;
+
+ getBearing(): number;
+
+ setBearing(bearing: number, eventData?: mapboxgl.EventData): this;
+
+ rotateTo(bearing: number, options?: mapboxgl.AnimationOptions, eventData?: EventData): this;
+
+ resetNorth(options?: mapboxgl.AnimationOptions, eventData?: mapboxgl.EventData): this;
+
+ snapToNorth(options?: mapboxgl.AnimationOptions, eventData?: mapboxgl.EventData): this;
+
+ getPitch(): number;
+
+ setPitch(pitch: number, eventData?: EventData): this;
+
+ fitBounds(bounds: mapboxgl.LngLatBounds | number[][], options?: { linear?: boolean, easing?: Function, padding?: number, offset?: Point|number[],maxZoom?: number }): this;
+
+ jumpTo(options: mapboxgl.CameraOptions, eventData?: mapboxgl.EventData): this;
+
+ easeTo(options: mapboxgl.CameraOptions | mapboxgl.AnimationOptions, eventData?: mapboxgl.EventData): this;
+
+ flyTo(options: mapboxgl.FlyToOptions, eventData?: mapboxgl.EventData): this;
+
+ stop(): this;
+
+ scrollZoom: ScrollZoomHandler;
+
+ boxZoom: BoxZoomHandler;
+
+ dragRotate: DragRotateHandler;
+
+ dragPan: DragPanHandler;
+
+ keyboard: KeyboardHandler;
+
+ doublClickZoom: DoubleClickZoomHandler;
+
+ touchZoomRotate: TouchZoomRotateHandler;
+ }
+
+ export interface MapboxOptions {
+ /** If true, an attribution control will be added to the map. */
+ attributionControl?: boolean;
+
+ bearing?: number;
+
+ /** Snap to north threshold in degrees. */
+ bearingSnap?: number;
+
+ /** If true, enable the "box zoom" interaction (see BoxZoomHandler) */
+ boxZoom?: boolean;
+
+ /** initial map center */
+ center?: mapboxgl.LngLat | number[];
+
+ /** Style class names with which to initialize the map */
+ classes?: string[];
+
+ /** ID of the container element */
+ container?: string | Element;
+
+ /** If true, enable the "drag to pan" interaction (see DragPanHandler). */
+ dragPan?: boolean;
+
+ /** If true, enable the "drag to rotate" interaction (see DragRotateHandler). */
+ dragRotate?: boolean;
+
+ /** If true, enable the "double click to zoom" interaction (see DoubleClickZoomHandler). */
+ doubleClickZoom?: boolean;
+
+ /** If true, the map will track and update the page URL according to map position */
+ hash?: boolean;
+
+ /** If true, map creation will fail if the implementation determines that the performance of the created WebGL context would be dramatically lower than expected. */
+ failIfMayorPerformanceCaveat?: boolean;
+
+ /** If false, no mouse, touch, or keyboard listeners are attached to the map, so it will not respond to input */
+ interactive?: boolean;
+
+ /** If true, enable keyboard shortcuts (see KeyboardHandler). */
+ keyboard?: boolean;
+
+ /** If set, the map is constrained to the given bounds. */
+ maxBounds?: mapboxgl.LngLatBounds | number[][];
+
+ /** Maximum zoom of the map */
+ maxZoom?: number;
+
+ /** Minimum zoom of the map */
+ minZoom?: number;
+
+ /** If true, The maps canvas can be exported to a PNG using map.getCanvas().toDataURL();. This is false by default as a performance optimization. */
+ preserveDrawingBuffer?: boolean;
+
+ pitch?: number;
+
+ /** If true, enable the "scroll to zoom" interaction */
+ scrollZoom?: boolean;
+
+ /** stylesheet location */
+ style?: mapboxgl.Style | string;
+
+ /** If true, the map will automatically resize when the browser window resizes */
+ trackResize?: boolean;
+
+ /** If true, enable the "pinch to rotate and zoom" interaction (see TouchZoomRotateHandler). */
+ touchZoomRotate?: boolean;
+
+ /** Initial zoom level */
+ zoom?: number;
+ }
+
+ /**
+ * BoxZoomHandler
+ */
+ export class BoxZoomHandler {
+ constructor(map: mapboxgl.Map);
+
+ isEnabled(): boolean;
+
+ isActive(): boolean;
+
+ enable(): void;
+
+ disable(): void;
+ }
+
+ /**
+ * ScrollZoomHandler
+ */
+ export class ScrollZoomHandler {
+ constructor(map: mapboxgl.Map);
+
+ isEnabled(): boolean;
+
+ enable(): void;
+
+ disable(): void;
+ }
+
+ /**
+ * DragPenHandler
+ */
+ export class DragPanHandler {
+ constructor(map: mapboxgl.Map);
+
+ isEnabled(): boolean;
+
+ isActive(): boolean;
+
+ enable(): void;
+
+ disable(): void;
+ }
+
+ /**
+ * DragRotateHandler
+ */
+ export class DragRotateHandler {
+ constructor(map: mapboxgl.Map, options?: {bearingSnap?: number, pitchWithRotate?: boolean});
+
+ isEnabled(): boolean;
+
+ isActive(): boolean;
+
+ enable(): void;
+
+ disable(): void;
+ }
+
+ /**
+ * KeyboardHandler
+ */
+ export class KeyboardHandler {
+ constructor(map: mapboxgl.Map);
+
+ isEnabled(): boolean;
+
+ enable(): void;
+
+ disable(): void;
+ }
+
+ /**
+ * DoubleClickZoomHandler
+ */
+ export class DoubleClickZoomHandler {
+ constructor(map: mapboxgl.Map);
+
+ isEnabled(): boolean;
+
+ enable(): void;
+
+ disable(): void;
+ }
+
+ /**
+ * TouchZoomRotateHandler
+ */
+ export class TouchZoomRotateHandler {
+ constructor(map: mapboxgl.Map);
+
+ isEnabled(): boolean;
+
+ enable(): void;
+
+ disable(): void;
+
+ disableRotation(): void;
+
+ enableRotation(): void;
+ }
+
+ /**
+ * Control
+ */
+ export class Control extends Evented {
+ addTo(map: mapboxgl.Map): this;
+
+ remove(): this;
+ }
+
+ /**
+ * ControlOptions
+ */
+ export interface ControlOptions {
+ position?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left';
+ }
+
+ /**
+ * Navigation
+ */
+ export class NavigationControl extends Control {
+ constructor(options?: mapboxgl.ControlOptions);
+ }
+
+ /**
+ * Geolocate
+ */
+ export class GeolocateControl extends Control {
+ constructor(options?: mapboxgl.ControlOptions);
+ }
+
+ /**
+ * Attribution
+ */
+ export class AttributionControl extends Control {
+ constructor(options?: mapboxgl.ControlOptions);
+ }
+
+ /**
+ * Scale
+ */
+ export class ScaleControl extends Control {
+ constructor(options?: {position?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left', maxWidth?: number, unit?: string})
+ }
+
+ /**
+ * Popup
+ */
+ export class Popup extends Evented {
+ constructor(options?: mapboxgl.PopupOptions);
+
+ addTo(map: mapboxgl.Map): this;
+
+ isOpen(): boolean;
+
+ remove(): this;
+
+ getLngLat(): mapboxgl.LngLat;
+
+ setLngLat(lnglat: mapboxgl.LngLat | number[]): this;
+
+ setText(text: string): this;
+
+ setHTML(html: string): this;
+
+ setDOMContent(htmlNode: Node): this;
+ }
+
+ export interface PopupOptions {
+ closeButton?: boolean;
+
+ closeOnClick?: boolean;
+
+ anchor?: 'top' | 'bottom' | 'left' | 'right' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
+
+ offset?: number | Point | number[] | { [key:string]: Point | number[];};
+ }
+
+ export interface Style {
+ bearing?: number;
+ center?: number[];
+ glyphs?: string;
+ layers?: Layer[];
+ metadata?: any;
+ name?: string;
+ pitch?: number;
+ sources?: any;
+ sprite?: string;
+ transition?: Transition;
+ version: number;
+ zoom?: number;
+ }
+
+ export interface Transition {
+ delay?: number;
+ duration?: number;
+ }
+
+ export interface Source {
+ type: "vector" | "raster" | "geojson" | "image" | "video";
+ }
+
+ /**
+ * GeoJSONSource
+ */
+
+ export interface GeoJSONSourceRaw extends Source, GeoJSONSourceOptions {
+ type: "geojson";
+ }
+
+ export class GeoJSONSource implements GeoJSONSourceRaw {
+ type: "geojson";
+
+ constructor(options?: mapboxgl.GeoJSONSourceOptions);
+
+ setData(data: GeoJSON.Feature | GeoJSON.FeatureCollection | String): this;
+ }
+
+ export interface GeoJSONSourceOptions {
+ data?: GeoJSON.Feature | GeoJSON.FeatureCollection | string;
+
+ maxzoom?: number;
+
+ buffer?: number;
+
+ tolerance?: number;
+
+ cluster?: number | boolean;
+
+ clusterRadius?: number;
+
+ clusterMaxZoom?: number;
+ }
+
+ /**
+ * VideoSource
+ */
+ export class VideoSource implements Source, VideoSourceOptions {
+ type: "video";
+
+ constructor(options?: mapboxgl.VideoSourceOptions);
+
+ getVideo(): HTMLVideoElement;
+
+ setCoordinates(coordinates: number[][]): this;
+ }
+
+ export interface VideoSourceOptions {
+ urls?: string[];
+
+ coordinates?: number[][];
+ }
+
+ /**
+ * ImageSource
+ */
+ export class ImageSource implements Source, ImageSourceOptions {
+ type: "image";
+
+ constructor(options?: mapboxgl.ImageSourceOptions);
+
+ setCoordinates(coordinates: number[][]): this;
+ }
+
+ export interface ImageSourceOptions {
+ url?: string;
+
+ coordinates?: number[][];
+ }
+
+ interface VectorSource extends Source {
+ type: "vector";
+ url?: string;
+ tiles?: string[];
+ minzoom?: number;
+ maxzoom?: number;
+ }
+
+ interface RasterSource extends Source {
+ type: "raster";
+ url: string;
+ tiles?: string[];
+ minzoom?: number;
+ maxzoom?: number;
+ tileSize?: number;
+ }
+
+ /**
+ * LngLat
+ */
+ export class LngLat {
+ lng: number;
+ lat: number;
+
+ constructor(lng: number, lat: number);
+
+ /** Return a new LngLat object whose longitude is wrapped to the range (-180, 180). */
+ wrap(): mapboxgl.LngLat;
+
+ /** Return a LngLat as an array */
+ toArray(): number[];
+
+ /** Return a LngLat as a string */
+ toString(): string;
+
+ static convert(input: number[]|mapboxgl.LngLat): mapboxgl.LngLat;
+ }
+
+ /**
+ * LngLatBounds
+ */
+ export class LngLatBounds {
+ sw: LngLat | number[];
+ ne: LngLat | number[];
+ constructor(sw?: LngLat, ne?: LngLat);
+
+ /** Extend the bounds to include a given LngLat or LngLatBounds. */
+ extend(obj: mapboxgl.LngLat | mapboxgl.LngLatBounds): this;
+
+ /** Get the point equidistant from this box's corners */
+ getCenter(): mapboxgl.LngLat;
+
+ /** Get southwest corner */
+ getSouthWest(): mapboxgl.LngLat;
+
+ /** Get northeast corner */
+ getNorthEast(): mapboxgl.LngLat;
+
+ /** Get northwest corner */
+ getNorthWest(): mapboxgl.LngLat;
+
+ /** Get southeast corner */
+ getSouthEast(): mapboxgl.LngLat;
+
+ /** Get west edge longitude */
+ getWest(): number;
+
+ /** Get south edge latitude */
+ getSouth(): number;
+
+ /** Get east edge longitude */
+ getEast(): number;
+
+ /** Get north edge latitude */
+ getNorth(): number;
+
+ /** Returns a LngLatBounds as an array */
+ toArray(): number[][];
+
+ /** Return a LngLatBounds as a string */
+ toString(): string;
+
+ /** Convert an array to a LngLatBounds object, or return an existing LngLatBounds object unchanged. */
+ static convert(input: mapboxgl.LngLatBounds | number[] | number[][]): mapboxgl.LngLatBounds;
+ }
+
+ /**
+ * Point
+ */
+ // Todo: Pull out class to seperate definition for Module "point-geometry"
+ export class Point {
+ constructor(options?: Object);
+
+ clone(): Point;
+
+ add(p: number): Point;
+
+ sub(p: number): Point;
+
+ mult(k: number): Point;
+
+ div(k: number): Point;
+
+ rotate(a: number): Point;
+
+ matMult(m: number): Point;
+
+ unit(): Point;
+
+ perp(): Point;
+
+ round(): Point;
+
+ mag(): number;
+
+ equals(): boolean;
+
+ dist(): number;
+
+ distSqr(): number;
+
+ angle(): number;
+
+ angleTo(): number;
+
+ angleWidth(): number;
+
+ angleWidthSep(): number;
+ }
+
+ export class Marker {
+ constructor(element?: HTMLElement, options?: { offset?: Point | number[] });
+
+ addTo(map: Map): this;
+
+ remove(): this;
+
+ getLngLat(): LngLat;
+
+ setLngLat(lngLat: LngLat | number[]): this;
+
+ setPopup(popup?: Popup): this;
+
+ getPopup(): Popup;
+
+ togglePopup(): this;
+ }
+
+ /**
+ * Evented
+ */
+ export class Evented {
+ on(type: string, listener: Function): this;
+
+ off(type?: string | any, listener?: Function): this;
+
+ once(type: string, listener: Function): this;
+
+ fire(type: string, data?: mapboxgl.EventData | Object): this;
+
+ listens(type: string): boolean;
+ }
+
+ /**
+ * StyleOptions
+ */
+ export interface StyleOptions {
+ transition?: boolean;
+ }
+
+ /**
+ * EventData
+ */
+ export class EventData {
+ type: string;
+ target: Map;
+ originalEvent: Event;
+ point: mapboxgl.Point;
+ lngLat: mapboxgl.LngLat;
+ }
+
+ export class MapMouseEvent {
+ type: string;
+ target: Map;
+ originalEvent: MouseEvent;
+ point: mapboxgl.Point;
+ lngLat: mapboxgl.LngLat;
+ }
+
+ export class MapTouchEvent {
+ type: string;
+ target: Map;
+ originalEvent: TouchEvent;
+ point: mapboxgl.Point;
+ lngLat: mapboxgl.LngLat;
+ points: Point[];
+ lngLats: LngLat[];
+ }
+
+ export class MapBoxZoomEvent {
+ originalEvent: MouseEvent;
+ boxZoomBounds: LngLatBounds;
+ }
+
+ export class MapDataEvent {
+ type: string;
+ dataType: "source" | "style" | "tile";
+ }
+
+ /**
+ * AnimationOptions
+ */
+ export interface AnimationOptions {
+ /** Number in milliseconds */
+ duration?: number;
+ easing?: Function;
+ /** point, origin of movement relative to map center */
+ offset?: Point | number[];
+ /** When set to false, no animation happens */
+ animate?: boolean;
+ }
+
+ /**
+ * CameraOptions
+ */
+ export interface CameraOptions {
+ /** Map center */
+ center?: mapboxgl.LngLat | number[];
+ /** Map zoom level */
+ zoom?: number;
+ /** Map rotation bearing in degrees counter-clockwise from north */
+ bearing?: number;
+ /** Map angle in degrees at which the camera is looking at the ground */
+ pitch?: number;
+ /** If zooming, the zoom center (defaults to map center) */
+ around?: mapboxgl.LngLat | number[];
+ }
+
+ /**
+ * FlyToOptions
+ */
+ export interface FlyToOptions extends AnimationOptions, CameraOptions {
+ curve?: number;
+ minZoom?: number;
+ speed?: number;
+ screenSpeed?: number;
+ easing?: Function;
+ }
+
+ /**
+ * MapEvent
+ */
+ export interface MapEvent {
+ resize?: void;
+ webglcontextlost?: {originalEvent: WebGLContextEvent};
+ webglcontextrestored?: {originalEvent: WebGLContextEvent};
+ remove?: void;
+ dataloading?: {data: mapboxgl.MapDataEvent};
+ data?: {data: mapboxgl.MapDataEvent};
+ render?: void;
+ contextmenu?: {data: mapboxgl.MapMouseEvent};
+ dblclick?: {data: mapboxgl.MapMouseEvent};
+ click?: {data: mapboxgl.MapMouseEvent};
+ touchcancel?: {data: mapboxgl.MapTouchEvent};
+ touchmove?: {data: mapboxgl.MapTouchEvent};
+ touchend?: {data: mapboxgl.MapTouchEvent};
+ touchstart?: {data: mapboxgl.MapTouchEvent};
+ mousemove?: {data: mapboxgl.MapMouseEvent};
+ mouseup?: {data: mapboxgl.MapMouseEvent};
+ mousedown?: {data: mapboxgl.MapMouseEvent};
+ moveend?: {data: mapboxgl.MapMouseEvent | mapboxgl.MapTouchEvent};
+ move?: {data: mapboxgl.MapMouseEvent | mapboxgl.MapTouchEvent};
+ movestart?: {data: mapboxgl.MapMouseEvent | mapboxgl.MapTouchEvent};
+ mouseout?:{data: mapboxgl.MapMouseEvent};
+ load?: void;
+ zoomend?: {data: mapboxgl.MapMouseEvent | mapboxgl.MapTouchEvent};
+ zoom?: {data: mapboxgl.MapMouseEvent | mapboxgl.MapTouchEvent};
+ zoomstart?: {data: mapboxgl.MapMouseEvent | mapboxgl.MapTouchEvent};
+ boxzoomcancel?: {data: mapboxgl.MapBoxZoomEvent};
+ boxzoomstart?: {data: mapboxgl.MapBoxZoomEvent};
+ boxzoomend?: {data: mapboxgl.MapBoxZoomEvent};
+ rotate?: {data: mapboxgl.MapMouseEvent | mapboxgl.MapTouchEvent};
+ rotatestart?: {data: mapboxgl.MapMouseEvent | mapboxgl.MapTouchEvent};
+ rotateend?: {data: mapboxgl.MapMouseEvent | mapboxgl.MapTouchEvent};
+ drag?: {data: mapboxgl.MapMouseEvent | mapboxgl.MapTouchEvent};
+ dragend?: {data: mapboxgl.MapMouseEvent | mapboxgl.MapTouchEvent};
+ pitch?: {data: mapboxgl.EventData};
+ }
+
+ export interface Layer {
+ id: string;
+ type?: "fill" | "line" | "symbol" | "circle" | "raster" | "background" | string; //TODO: Ideally we wouldn't accept string here, just these specific strings
+
+ metadata?: any;
+ ref?: string;
+
+ source?: string;
+
+ "source-layer"?: string;
+
+ minzoom?: number;
+ maxzoom?: number;
+
+ interactive?: boolean;
+
+ filter?: any[];
+ layout?: BackgroundLayout | FillLayout | LineLayout | SymbolLayout | RasterLayout | CircleLayout;
+ paint?: BackgroundPaint | FillPaint | LinePaint | SymbolPaint | RasterPaint | CirclePaint;
+ }
+
+ export interface StyleFunction {
+ stops: any[][];
+ property?: string;
+ base?: number;
+ type?: "identity" | "exponential" | "interval" | "categorical";
+ "colorSpace"?: "rgb" | "lab" | "interval";
+ }
+
+ export interface BackgroundLayout {
+ visibility?: "visible" | "none";
+ }
+ export interface BackgroundPaint {
+ "background-color"?: string;
+ "background-pattern"?: string;
+ "background-opacity"?: number;
+ }
+
+ export interface FillLayout {
+ visibility?: "visible" | "none";
+ }
+ export interface FillPaint {
+ "fill-antialias"?: boolean;
+ "fill-opacity"?: number | StyleFunction;
+ "fill-color"?: string | StyleFunction;
+ "fill-outline-color": string | StyleFunction;
+ "fill-translate"?: number[];
+ "fill-translate-anchor"?: "map" | "viewport";
+ "fill-pattern"?: "string";
+ "fill-extrude-height"?: number;
+ "fill-extrude-base"?: number;
+ }
+
+ export interface LineLayout {
+ visibility?: "visible" | "none";
+
+ "line-cap"?: "butt" | "round" | "square";
+ "line-join"?: "bevel" | "round" | "miter";
+ "line-miter-limit"?: number;
+ "line-round-limit"?: number;
+ }
+ export interface LinePaint {
+ "line-opacity"?: number;
+ "line-color"?: string| StyleFunction;
+ "line-translate"?: number[];
+ "line-translate-anchor"?: "map" | "viewport";
+ "line-width"?: number;
+ "line-gap-width"?: number;
+ "line-offset"?: number;
+ "line-blur"?: number;
+ "line-dasharray"?: number[];
+ "line-dasharray-transition"?: Transition;
+ "line-pattern"?: string;
+ }
+
+ export interface SymbolLayout {
+ visibility?: "visible" | "none";
+
+ "symbol-placement"?: "point" | "line";
+ "symbol-spacing"?: number;
+ "symbol-avoid-edges"?: boolean;
+ "icon-allow-overlap"?: boolean;
+ "icon-ignore-placement"?: boolean;
+ "icon-optional"?: boolean;
+ "icon-rotation-alignment"?: "map" | "viewport" | "auto";
+ "icon-size"?: number;
+ "icon-text-fit"?: "none" | "both" | "width" | "height";
+ "icon-text-fit-padding"?: number[];
+ "icon-image"?: string;
+ "icon-rotate"?: number | StyleFunction;
+ "icon-padding"?: number;
+ "icon-keep-upright"?: boolean;
+ "icon-offset"?: number[];
+ "text-pitch-alignment"?: "map" | "viewport" | "auto";
+ "text-rotation-alignment"?: "map" | "viewport" | "auto";
+ "text-field"?: string;
+ "text-font"?: string | string[];
+ "text-size"?: number;
+ "text-max-width"?: number;
+ "text-line-height"?: number;
+ "text-letter-spacing"?: number;
+ "text-justify"?: "left" | "center" | "right";
+ "text-anchor"?: "center" | "left" | "right" | "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right";
+ "text-max-angle"?: number;
+ "text-rotate"?: number;
+ "text-padding"?: number;
+ "text-keep-upright"?: boolean;
+ "text-transform"?: "none" | "uppercase" | "lowercase";
+ "text-offset"?: number[];
+ "text-allow-overlap"?: boolean;
+ "text-ignore-placement"?: boolean;
+ "text-optional"?: boolean;
+
+ }
+ export interface SymbolPaint {
+ "icon-opacity"?: number;
+ "icon-color"?: string;
+ "icon-halo-color"?: string;
+ "icon-halo-width"?: number;
+ "icon-halo-blur"?: number;
+ "icon-translate"?: number[];
+ "icon-translate-anchor"?: "map" | "viewport";
+ "text-opacity"?: number;
+ "text-color"?: "string";
+ "text-halo-color"?: "string";
+ "text-halo-width"?: number;
+ "text-halo-blur"?: number;
+ "text-translate"?: number[];
+ "text-translate-anchor"?: "map" | "viewport";
+ }
+
+ export interface RasterLayout {
+ visibility?: "visible" | "none";
+ }
+
+ export interface RasterPaint {
+ "raster-opacity"?: number;
+ "raster-hue-rotate"?: number;
+ "raster-brightness-min"?: number;
+ "raster-brightness-max"?: number;
+ "raster-saturation"?: number;
+ "raster-contrast"?: number;
+ "raster-fade-duration"?: number;
+ }
+
+ export interface CircleLayout {
+ visibility?: "visible" | "none";
+ }
+
+ export interface CirclePaint {
+ "circle-radius"?: number | StyleFunction;
+ "circle-radius-transition"?: Transition;
+ "circle-color"?: number | StyleFunction;
+ "circle-blur"?: number | StyleFunction;
+ "circle-opacity"?: number | StyleFunction;
+ "circle-translate"?: number[];
+ "circle-translate-anchor"?: "map" | "viewport";
+ "circle-pitch-scale"?: "map" | "viewport";
+ }
+}
+
+declare module 'mapbox-gl' {
+ export = mapboxgl;
+}
diff --git a/openlayers/index.d.ts b/openlayers/index.d.ts
index 25fabc2107..a48e26071b 100644
--- a/openlayers/index.d.ts
+++ b/openlayers/index.d.ts
@@ -59,7 +59,7 @@ declare module ol {
}
- /**
+ /**
* Error object thrown when an assertion failed. This is an ECMA-262 Error,
* extended with a `code` property.
* @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error}
@@ -67,7 +67,7 @@ declare module ol {
* @extends {Error}
* @implements {oli.AssertionError}
* @param {number} code Error code.
- */
+ */
class AssertionError extends Error {
/**
* Error object thrown when an assertion failed. This is an ECMA-262 Error,
@@ -146,21 +146,21 @@ declare module ol {
}
- /**
+ /**
* @classdesc
* An expanded version of standard JS Array, adding convenience methods for
* manipulation. Add and remove changes to the Collection trigger a Collection
* event. Note that this does not cover changes to the objects _within_ the
* Collection; they trigger events on the appropriate object, not on the
* Collection as a whole.
- *
+ *
* @constructor
* @extends {ol.Object}
* @fires ol.Collection.Event
* @param {!Array.=} opt_array Array.
* @template T
* @api stable
- */
+ */
class Collection extends ol.Object {
/**
* @classdesc
@@ -318,7 +318,7 @@ declare module ol {
*/
element: any;
- }
+ }
}
/**
@@ -330,21 +330,21 @@ declare module ol {
* @namespace ol.color
*/
module color {
- /**
+ /**
* Return the color as an array. This function maintains a cache of calculated
* arrays which means the result should not be modified.
* @param {ol.Color|string} color Color.
* @return {ol.Color} Color.
* @api
- */
+ */
function asArray(color: (ol.Color | string)): ol.Color;
- /**
+ /**
* Return the color as an rgba string.
* @param {ol.Color|string} color Color.
* @return {string} Rgba string.
* @api
- */
+ */
function asString(color: (ol.Color | string)): string;
}
@@ -364,9 +364,9 @@ declare module ol {
}
- /**
+ /**
* @namespace ol.control
- */
+ */
module control {
/**
* @classdesc
@@ -381,7 +381,7 @@ declare module ol {
* @api stable
*/
class Attribution extends ol.control.Control {
- /**
+ /**
* @classdesc
* Control to show all the attributions associated with the layer sources
* in the map. This control is one of the default controls included in maps.
@@ -392,46 +392,46 @@ declare module ol {
* @extends {ol.control.Control}
* @param {olx.control.AttributionOptions=} opt_options Attribution options.
* @api stable
- */
+ */
constructor(opt_options?: olx.control.AttributionOptions);
- /**
+ /**
* Update the attribution element.
* @param {ol.MapEvent} mapEvent Map event.
* @this {ol.control.Attribution}
* @api
- */
+ */
static render(mapEvent: ol.MapEvent): void;
- /**
+ /**
* Return `true` if the attribution is collapsible, `false` otherwise.
* @return {boolean} True if the widget is collapsible.
* @api stable
- */
+ */
getCollapsible(): boolean;
- /**
+ /**
* Set whether the attribution should be collapsible.
* @param {boolean} collapsible True if the widget is collapsible.
* @api stable
- */
+ */
setCollapsible(collapsible: boolean): void;
- /**
+ /**
* Collapse or expand the attribution according to the passed parameter. Will
* not do anything if the attribution isn't collapsible or if the current
* collapsed state is already the one requested.
* @param {boolean} collapsed True if the widget is collapsed.
* @api stable
- */
+ */
setCollapsed(collapsed: boolean): void;
- /**
+ /**
* Return `true` when the attribution is currently collapsed or `false`
* otherwise.
* @return {boolean} True if the widget is collapsed.
* @api stable
- */
+ */
getCollapsed(): boolean;
}
@@ -494,14 +494,14 @@ declare module ol {
* @implements {oli.control.Control}
* @param {olx.control.ControlOptions} options Control options.
* @api stable
- */
+ */
constructor(options: olx.control.ControlOptions);
- /**
+ /**
* Get the map associated with this control.
* @return {ol.Map} Map.
* @api stable
- */
+ */
getMap(): ol.Map;
/**
@@ -524,7 +524,7 @@ declare module ol {
*/
setTarget(target: (Element | string)): void;
- }
+ }
/**
* @classdesc
@@ -544,7 +544,7 @@ declare module ol {
* @api stable
*/
class FullScreen extends ol.control.Control {
- /**
+ /**
* @classdesc
* Provides a button that when clicked fills up the full screen with the map.
* The full screen source element is by default the element containing the map viewport unless
@@ -554,13 +554,13 @@ declare module ol {
* When in full screen mode, a close button is shown to exit full screen mode.
* The [Fullscreen API](http://www.w3.org/TR/fullscreen/) is used to
* toggle the map in full screen mode.
- *
+ *
*
* @constructor
* @extends {ol.control.Control}
* @param {olx.control.FullScreenOptions=} opt_options Options.
* @api stable
- */
+ */
constructor(opt_options?: olx.control.FullScreenOptions);
}
@@ -605,52 +605,52 @@ declare module ol {
* @param {olx.control.MousePositionOptions=} opt_options Mouse position
* options.
* @api stable
- */
+ */
constructor(opt_options?: olx.control.MousePositionOptions);
- /**
+ /**
* Update the mouseposition element.
* @param {ol.MapEvent} mapEvent Map event.
* @this {ol.control.MousePosition}
* @api
- */
+ */
static render(mapEvent: ol.MapEvent): void;
- /**
+ /**
* Return the coordinate format type used to render the current position or
* undefined.
* @return {ol.CoordinateFormatType|undefined} The format to render the current
* position in.
* @observable
* @api stable
- */
+ */
getCoordinateFormat(): (ol.CoordinateFormatType);
- /**
+ /**
* Return the projection that is used to report the mouse position.
* @return {ol.proj.Projection|undefined} The projection to report mouse
* position in.
* @observable
* @api stable
- */
+ */
getProjection(): (ol.proj.Projection);
- /**
+ /**
* Set the coordinate format type used to render the current position.
* @param {ol.CoordinateFormatType} format The format to render the current
* position in.
* @observable
* @api stable
- */
+ */
setCoordinateFormat(format: ol.CoordinateFormatType): void;
- /**
+ /**
* Set the projection that is used to report the mouse position.
* @param {ol.proj.Projection} projection The projection to report mouse
* position in.
* @observable
* @api stable
- */
+ */
setProjection(projection: ol.proj.Projection): void;
}
@@ -662,16 +662,16 @@ declare module ol {
* @extends {ol.control.Control}
* @param {olx.control.OverviewMapOptions=} opt_options OverviewMap options.
* @api
- */
+ */
class OverviewMap extends ol.control.Control {
- /**
+ /**
* Create a new control with a map acting as an overview map for an other
* defined map.
* @constructor
* @extends {ol.control.Control}
* @param {olx.control.OverviewMapOptions=} opt_options OverviewMap options.
* @api
- */
+ */
constructor(opt_options?: olx.control.OverviewMapOptions);
/**
@@ -721,7 +721,7 @@ declare module ol {
}
- /**
+ /**
* @classdesc
* A button control to reset rotation to 0.
* To style this control use css selector `.ol-rotate`. A `.ol-hidden` css
@@ -731,7 +731,7 @@ declare module ol {
* @extends {ol.control.Control}
* @param {olx.control.RotateOptions=} opt_options Rotate options.
* @api stable
- */
+ */
class Rotate extends ol.control.Control {
/**
* @classdesc
@@ -756,7 +756,7 @@ declare module ol {
}
- /**
+ /**
* @classdesc
* A control displaying rough y-axis distances, calculated for the center of the
* viewport. For conformal projections (e.g. EPSG:3857, the default view
@@ -826,11 +826,11 @@ declare module ol {
* Units for the scale line. Supported values are `'degrees'`, `'imperial'`,
* `'nautical'`, `'metric'`, `'us'`.
* @enum {string}
- */
+ */
type Units = string;
}
- /**
+ /**
* @classdesc
* A control with 2 buttons, one for zoom in and one for zoom out.
* This control is one of the default controls of a map. To style this control
@@ -840,7 +840,7 @@ declare module ol {
* @extends {ol.control.Control}
* @param {olx.control.ZoomOptions=} opt_options Zoom options.
* @api stable
- */
+ */
class Zoom extends ol.control.Control {
/**
* @classdesc
@@ -857,7 +857,7 @@ declare module ol {
}
- /**
+ /**
* @classdesc
* A slider type of control for zooming.
*
@@ -869,7 +869,7 @@ declare module ol {
* @extends {ol.control.Control}
* @param {olx.control.ZoomSliderOptions=} opt_options Zoom slider options.
* @api stable
- */
+ */
class ZoomSlider extends ol.control.Control {
/**
* @classdesc
@@ -896,7 +896,7 @@ declare module ol {
}
- /**
+ /**
* @classdesc
* A button control which, when pressed, changes the map view to a specific
* extent. To style this control use the css selector `.ol-zoom-extent`.
@@ -905,7 +905,7 @@ declare module ol {
* @extends {ol.control.Control}
* @param {olx.control.ZoomToExtentOptions=} opt_options Options.
* @api stable
- */
+ */
class ZoomToExtent extends ol.control.Control {
/**
* @classdesc
@@ -921,13 +921,13 @@ declare module ol {
}
- }
+ }
- /**
+ /**
* @namespace ol.coordinate
- */
+ */
module coordinate {
- /**
+ /**
* Add `delta` to `coordinate`. `coordinate` is modified in place and returned
* by the function.
*
@@ -941,10 +941,10 @@ declare module ol {
* @param {ol.Coordinate} delta Delta.
* @return {ol.Coordinate} The input coordinate adjusted by the given delta.
* @api stable
- */
+ */
function add(coordinate: ol.Coordinate, delta: ol.Coordinate): ol.Coordinate;
- /**
+ /**
* Returns a {@link ol.CoordinateFormatType} function that can be used to format
* a {ol.Coordinate} to a string.
*
@@ -966,10 +966,10 @@ declare module ol {
* after the decimal point. Default is `0`.
* @return {ol.CoordinateFormatType} Coordinate format.
* @api stable
- */
+ */
function createStringXY(opt_fractionDigits?: number): ol.CoordinateFormatType;
- /**
+ /**
* Transforms the given {@link ol.Coordinate} to a string using the given string
* template. The strings `{x}` and `{y}` in the template will be replaced with
* the first and second coordinate values respectively.
@@ -995,10 +995,10 @@ declare module ol {
* after the decimal point. Default is `0`.
* @return {string} Formatted coordinate.
* @api stable
- */
+ */
function format(coordinate: (ol.Coordinate), template: string, opt_fractionDigits?: number): string;
- /**
+ /**
* Rotate `coordinate` by `angle`. `coordinate` is modified in place and
* returned by the function.
*
@@ -1013,10 +1013,10 @@ declare module ol {
* @param {number} angle Angle in radian.
* @return {ol.Coordinate} Coordinate.
* @api stable
- */
+ */
function rotate(coordinate: ol.Coordinate, angle: number): ol.Coordinate;
- /**
+ /**
* Format a geographic coordinate with the hemisphere, degrees, minutes, and
* seconds.
*
@@ -1037,10 +1037,10 @@ declare module ol {
* after the decimal point. Default is `0`.
* @return {string} Hemisphere, degrees, minutes and seconds.
* @api stable
- */
+ */
function toStringHDMS(coordinate?: ol.Coordinate, opt_fractionDigits?: number): string;
- /**
+ /**
* Format a coordinate as a comma delimited string.
*
* Example without specifying fractional digits:
@@ -1060,12 +1060,12 @@ declare module ol {
* after the decimal point. Default is `0`.
* @return {string} XY.
* @api stable
- */
+ */
function toStringXY(coordinate?: ol.Coordinate, opt_fractionDigits?: number): string;
}
- /**
+ /**
* @classdesc
* The ol.DeviceOrientation class provides access to information from
* DeviceOrientation events. See the [HTML 5 DeviceOrientation Specification](
@@ -1119,9 +1119,9 @@ declare module ol {
* @extends {ol.Object}
* @param {olx.DeviceOrientationOptions=} opt_options Options.
* @api
- */
+ */
class DeviceOrientation extends ol.Object {
- /**
+ /**
* @classdesc
* The ol.DeviceOrientation class provides access to information from
* DeviceOrientation events. See the [HTML 5 DeviceOrientation Specification](
@@ -1175,127 +1175,127 @@ declare module ol {
* @extends {ol.Object}
* @param {olx.DeviceOrientationOptions=} opt_options Options.
* @api
- */
+ */
constructor(opt_options?: olx.DeviceOrientationOptions);
- /**
+ /**
* Rotation around the device z-axis (in radians).
* @return {number|undefined} The euler angle in radians of the device from the
* standard Z axis.
* @observable
* @api
- */
+ */
getAlpha(): (number);
- /**
+ /**
* Rotation around the device x-axis (in radians).
* @return {number|undefined} The euler angle in radians of the device from the
* planar X axis.
* @observable
* @api
- */
+ */
getBeta(): (number);
- /**
+ /**
* Rotation around the device y-axis (in radians).
* @return {number|undefined} The euler angle in radians of the device from the
* planar Y axis.
* @observable
* @api
- */
+ */
getGamma(): (number);
- /**
+ /**
* The heading of the device relative to north (in radians).
* @return {number|undefined} The heading of the device relative to north, in
* radians, normalizing for different browser behavior.
* @observable
* @api
- */
+ */
getHeading(): (number);
- /**
+ /**
* Determine if orientation is being tracked.
* @return {boolean} Changes in device orientation are being tracked.
* @observable
* @api
- */
+ */
getTracking(): boolean;
- /**
+ /**
* Enable or disable tracking of device orientation events.
* @param {boolean} tracking The status of tracking changes to alpha, beta and
* gamma. If true, changes are tracked and reported immediately.
* @observable
* @api
- */
+ */
setTracking(tracking: boolean): void;
}
- /**
+ /**
* Objects that need to clean up after themselves.
* @constructor
- */
+ */
class Disposable {
- /**
+ /**
* Objects that need to clean up after themselves.
* @constructor
- */
+ */
constructor();
- }
+ }
- /**
+ /**
* Easing functions for {@link ol.animation}.
* @namespace ol.easing
- */
+ */
module easing {
- /**
+ /**
* Start slow and speed up.
* @param {number} t Input between 0 and 1.
* @return {number} Output between 0 and 1.
* @api
- */
+ */
function easeIn(t: number): number;
- /**
+ /**
* Start fast and slow down.
* @param {number} t Input between 0 and 1.
* @return {number} Output between 0 and 1.
* @api
- */
+ */
function easeOut(t: number): number;
- /**
+ /**
* Start slow, speed up, and then slow down again.
* @param {number} t Input between 0 and 1.
* @return {number} Output between 0 and 1.
* @api
- */
+ */
function inAndOut(t: number): number;
- /**
+ /**
* Maintain a constant speed over time.
* @param {number} t Input between 0 and 1.
* @return {number} Output between 0 and 1.
* @api
- */
+ */
function linear(t: number): number;
- /**
+ /**
* Start slow, speed up, and at the very end slow down again. This has the
* same general behavior as {@link ol.easing.inAndOut}, but the final slowdown
* is delayed.
* @param {number} t Input between 0 and 1.
* @return {number} Output between 0 and 1.
* @api
- */
+ */
function upAndDown(t: number): number;
- }
+ }
- /**
+ /**
* Applications do not normally create event instances. They register (and
* unregister) event listener functions, which, when called by the library as
* the result of an event being dispatched, are passed event instances as their
@@ -1308,11 +1308,11 @@ declare module ol {
* properties; see the specific event class page for details.
*
* @namespace ol.events
- */
+ */
module events {
- /**
+ /**
* @namespace ol.events.condition
- */
+ */
module condition {
/**
* Return `true` if only the alt-key is pressed, `false` otherwise (e.g. when
@@ -1454,7 +1454,7 @@ declare module ol {
}
- /**
+ /**
* @classdesc
* Stripped down implementation of the W3C DOM Level 2 Event interface.
* @see {@link https://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-interface}
@@ -1467,7 +1467,7 @@ declare module ol {
* @constructor
* @implements {oli.events.Event}
* @param {string} type Type.
- */
+ */
class Event {
/**
* @classdesc
@@ -1515,7 +1515,7 @@ declare module ol {
}
- /**
+ /**
* @classdesc
* A simplified implementation of the W3C DOM Level 2 EventTarget interface.
* @see {@link https://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113/events.html#Events-EventTarget}
@@ -1532,7 +1532,7 @@ declare module ol {
*
* @constructor
* @extends {ol.Disposable}
- */
+ */
class EventTarget extends ol.Disposable {
/**
* @classdesc
@@ -1558,40 +1558,40 @@ declare module ol {
}
- /**
+ /**
* @namespace ol.extent
- */
+ */
module extent {
- /**
+ /**
* Build an extent that includes all given coordinates.
*
* @param {Array.} coordinates Coordinates.
* @return {ol.Extent} Bounding extent.
* @api stable
- */
+ */
function boundingExtent(coordinates: ol.Coordinate[]): ol.Extent;
- /**
+ /**
* Return extent increased by the provided value.
* @param {ol.Extent} extent Extent.
* @param {number} value The amount by which the extent should be buffered.
* @param {ol.Extent=} opt_extent Extent.
* @return {ol.Extent} Extent.
* @api stable
- */
+ */
function buffer(extent: ol.Extent, value: number, opt_extent?: ol.Extent): ol.Extent;
- /**
+ /**
* Check if the passed coordinate is contained or on the edge of the extent.
*
* @param {ol.Extent} extent Extent.
* @param {ol.Coordinate} coordinate Coordinate.
* @return {boolean} The coordinate is contained in the extent.
* @api stable
- */
+ */
function containsCoordinate(extent: ol.Extent, coordinate: ol.Coordinate): boolean;
- /**
+ /**
* Check if one extent contains another.
*
* An extent is deemed contained if it lies completely within the other extent,
@@ -1602,10 +1602,10 @@ declare module ol {
* @return {boolean} The second extent is contained by or on the edge of the
* first.
* @api stable
- */
+ */
function containsExtent(extent1: ol.Extent, extent2: ol.Extent): boolean;
- /**
+ /**
* Check if the passed coordinate is contained or on the edge of the extent.
*
* @param {ol.Extent} extent Extent.
@@ -1613,126 +1613,126 @@ declare module ol {
* @param {number} y Y coordinate.
* @return {boolean} The x, y values are contained in the extent.
* @api stable
- */
+ */
function containsXY(extent: ol.Extent, x: number, y: number): boolean;
- /**
+ /**
* Create an empty extent.
* @return {ol.Extent} Empty extent.
* @api stable
- */
+ */
function createEmpty(): ol.Extent;
- /**
+ /**
* Determine if two extents are equivalent.
* @param {ol.Extent} extent1 Extent 1.
* @param {ol.Extent} extent2 Extent 2.
* @return {boolean} The two extents are equivalent.
* @api stable
- */
+ */
function equals(extent1: ol.Extent, extent2: ol.Extent): boolean;
- /**
+ /**
* Modify an extent to include another extent.
* @param {ol.Extent} extent1 The extent to be modified.
* @param {ol.Extent} extent2 The extent that will be included in the first.
* @return {ol.Extent} A reference to the first (extended) extent.
* @api stable
- */
+ */
function extend(extent1: ol.Extent, extent2: ol.Extent): ol.Extent;
- /**
+ /**
* Get the bottom left coordinate of an extent.
* @param {ol.Extent} extent Extent.
* @return {ol.Coordinate} Bottom left coordinate.
* @api stable
- */
+ */
function getBottomLeft(extent: ol.Extent): ol.Coordinate;
- /**
+ /**
* Get the bottom right coordinate of an extent.
* @param {ol.Extent} extent Extent.
* @return {ol.Coordinate} Bottom right coordinate.
* @api stable
- */
+ */
function getBottomRight(extent: ol.Extent): ol.Coordinate;
- /**
+ /**
* Get the center coordinate of an extent.
* @param {ol.Extent} extent Extent.
* @return {ol.Coordinate} Center.
* @api stable
- */
+ */
function getCenter(extent: ol.Extent): ol.Coordinate;
- /**
+ /**
* Get the height of an extent.
* @param {ol.Extent} extent Extent.
* @return {number} Height.
* @api stable
- */
+ */
function getHeight(extent: ol.Extent): number;
- /**
+ /**
* Get the intersection of two extents.
* @param {ol.Extent} extent1 Extent 1.
* @param {ol.Extent} extent2 Extent 2.
* @param {ol.Extent=} opt_extent Optional extent to populate with intersection.
* @return {ol.Extent} Intersecting extent.
* @api stable
- */
+ */
function getIntersection(extent1: ol.Extent, extent2: ol.Extent, opt_extent?: ol.Extent): ol.Extent;
- /**
+ /**
* Get the size (width, height) of an extent.
* @param {ol.Extent} extent The extent.
* @return {ol.Size} The extent size.
* @api stable
- */
+ */
function getSize(extent: ol.Extent): ol.Size;
- /**
+ /**
* Get the top left coordinate of an extent.
* @param {ol.Extent} extent Extent.
* @return {ol.Coordinate} Top left coordinate.
* @api stable
- */
+ */
function getTopLeft(extent: ol.Extent): ol.Coordinate;
- /**
+ /**
* Get the top right coordinate of an extent.
* @param {ol.Extent} extent Extent.
* @return {ol.Coordinate} Top right coordinate.
* @api stable
- */
+ */
function getTopRight(extent: ol.Extent): ol.Coordinate;
- /**
+ /**
* Get the width of an extent.
* @param {ol.Extent} extent Extent.
* @return {number} Width.
* @api stable
- */
+ */
function getWidth(extent: ol.Extent): number;
- /**
+ /**
* Determine if one extent intersects another.
* @param {ol.Extent} extent1 Extent 1.
* @param {ol.Extent} extent2 Extent.
* @return {boolean} The two extents intersect.
* @api stable
- */
+ */
function intersects(extent1: ol.Extent, extent2: ol.Extent): boolean;
- /**
+ /**
* Determine if an extent is empty.
* @param {ol.Extent} extent Extent.
* @return {boolean} Is empty.
* @api stable
- */
+ */
function isEmpty(extent: ol.Extent): boolean;
- /**
+ /**
* Apply a transform function to the extent.
* @param {ol.Extent} extent Extent.
* @param {ol.TransformFunction} transformFn Transform function. Called with
@@ -1740,12 +1740,12 @@ declare module ol {
* @param {ol.Extent=} opt_extent Destination extent.
* @return {ol.Extent} Extent.
* @api stable
- */
+ */
function applyTransform(extent: ol.Extent, transformFn: ol.TransformFunction, opt_extent?: ol.Extent): ol.Extent;
}
- /**
+ /**
* @classdesc
* A vector object for geographic features with a geometry and other
* attribute properties, similar to the features in vector file formats like
@@ -1789,9 +1789,9 @@ declare module ol {
* containing properties. If you pass an object literal, you may
* include a Geometry associated with a `geometry` key.
* @api stable
- */
+ */
class Feature extends ol.Object {
- /**
+ /**
* @classdesc
* A vector object for geographic features with a geometry and other
* attribute properties, similar to the features in vector file formats like
@@ -1835,74 +1835,74 @@ declare module ol {
* containing properties. If you pass an object literal, you may
* include a Geometry associated with a `geometry` key.
* @api stable
- */
+ */
constructor(opt_geometryOrProperties?: (ol.geom.Geometry | { [k: string]: any }));
- /**
+ /**
* Clone this feature. If the original feature has a geometry it
* is also cloned. The feature id is not set in the clone.
* @return {ol.Feature} The clone.
* @api stable
- */
+ */
clone(): ol.Feature;
- /**
+ /**
* Get the feature's default geometry. A feature may have any number of named
* geometries. The "default" geometry (the one that is rendered by default) is
* set when calling {@link ol.Feature#setGeometry}.
* @return {ol.geom.Geometry|undefined} The default geometry for the feature.
* @api stable
* @observable
- */
+ */
getGeometry(): (ol.geom.Geometry);
- /**
+ /**
* Get the feature identifier. This is a stable identifier for the feature and
* is either set when reading data from a remote source or set explicitly by
* calling {@link ol.Feature#setId}.
* @return {number|string|undefined} Id.
* @api stable
* @observable
- */
+ */
getId(): (number | string);
- /**
+ /**
* Get the name of the feature's default geometry. By default, the default
* geometry is named `geometry`.
* @return {string} Get the property name associated with the default geometry
* for this feature.
* @api stable
- */
+ */
getGeometryName(): string;
- /**
+ /**
* Get the feature's style. This return for this method depends on what was
* provided to the {@link ol.Feature#setStyle} method.
* @return {ol.style.Style|Array.|
* ol.FeatureStyleFunction} The feature style.
* @api stable
* @observable
- */
+ */
getStyle(): (ol.style.Style | ol.style.Style[] | ol.FeatureStyleFunction);
- /**
+ /**
* Get the feature's style function.
* @return {ol.FeatureStyleFunction|undefined} Return a function
* representing the current style of this feature.
* @api stable
- */
+ */
getStyleFunction(): (ol.FeatureStyleFunction);
- /**
+ /**
* Set the default geometry for the feature. This will update the property
* with the name returned by {@link ol.Feature#getGeometryName}.
* @param {ol.geom.Geometry|undefined} geometry The new geometry.
* @api stable
* @observable
- */
+ */
setGeometry(geometry: (ol.geom.Geometry)): void;
- /**
+ /**
* Set the style for the feature. This can be a single style object, an array
* of styles, or a function that takes a resolution and returns an array of
* styles. If it is `null` the feature has no style (a `null` style).
@@ -1910,10 +1910,10 @@ declare module ol {
* ol.FeatureStyleFunction} style Style for this feature.
* @api stable
* @observable
- */
+ */
setStyle(style: (ol.style.Style | ol.style.Style[] | ol.FeatureStyleFunction)): void;
- /**
+ /**
* Set the feature id. The feature id is considered stable and may be used when
* requesting features or comparing identifiers returned from a remote source.
* The feature id can be used with the {@link ol.source.Vector#getFeatureById}
@@ -1921,24 +1921,24 @@ declare module ol {
* @param {number|string|undefined} id The feature id.
* @api stable
* @observable
- */
+ */
setId(id: (number | string)): void;
- /**
+ /**
* Set the property name to be used when getting the feature's default geometry.
* When calling {@link ol.Feature#getGeometry}, the value of the property with
* this name will be returned.
* @param {string} name The property name of the default geometry.
* @api stable
- */
+ */
setGeometryName(name: string): void;
}
- /**
+ /**
* Loading mechanisms for vector data.
* @namespace ol.featureloader
- */
+ */
module featureloader {
/**
* Create an XHR feature loader for a `url` and `format`. The feature loader
@@ -1951,7 +1951,7 @@ declare module ol {
*/
function tile(url: (string | ol.FeatureUrlFunction), format: ol.format.Feature): ol.FeatureLoader;
- /**
+ /**
* Create an XHR feature loader for a `url` and `format`. The feature loader
* loads features (with XHR), parses the features, and adds them to the
* vector source.
@@ -1959,17 +1959,17 @@ declare module ol {
* @param {ol.format.Feature} format Feature format.
* @return {ol.FeatureLoader} The feature loader.
* @api
- */
+ */
function xhr(url: (string | ol.FeatureUrlFunction), format: ol.format.Feature): ol.FeatureLoader;
}
- /**
+ /**
* @namespace ol.format
- */
+ */
module format {
- /**
+ /**
* @classdesc
* Feature format for reading and writing data in the EsriJSON format.
*
@@ -1977,7 +1977,7 @@ declare module ol {
* @extends {ol.format.JSONFeature}
* @param {olx.format.EsriJSONOptions=} opt_options Options.
* @api
- */
+ */
class EsriJSON extends ol.format.JSONFeature {
/**
* @classdesc
@@ -2098,7 +2098,7 @@ declare module ol {
*/
writeFeaturesObject(features: ol.Feature[], opt_options?: olx.format.WriteOptions): GlobalObject;
- }
+ }
type EsriJSONGeometry = JSON;
@@ -2129,14 +2129,14 @@ declare module ol {
*/
constructor();
- }
+ }
type GeoJSONFeature = JSON;
type GeoJSONFeatureCollection = JSON;
type GeoJSONGeometry = JSON;
type GeoJSONGeometryCollection = JSON;
- /**
+ /**
* @classdesc
* Feature format for reading and writing data in the GeoJSON format.
*
@@ -2144,7 +2144,7 @@ declare module ol {
* @extends {ol.format.JSONFeature}
* @param {olx.format.GeoJSONOptions=} opt_options Options.
* @api stable
- */
+ */
class GeoJSON extends ol.format.JSONFeature {
/**
* @classdesc
@@ -2267,7 +2267,7 @@ declare module ol {
}
- /**
+ /**
* @classdesc
* Feature format for reading and writing data in the GML format
* version 3.1.1.
@@ -2278,7 +2278,7 @@ declare module ol {
* Optional configuration object.
* @extends {ol.format.GMLBase}
* @api stable
- */
+ */
class GML extends ol.format.GMLBase {
/**
* @classdesc
@@ -2318,7 +2318,7 @@ declare module ol {
}
- /**
+ /**
* @classdesc
* Feature format for reading and writing data in the GML format,
* version 2.1.2.
@@ -2327,7 +2327,7 @@ declare module ol {
* @param {olx.format.GMLOptions=} opt_options Optional configuration object.
* @extends {ol.format.GMLBase}
* @api
- */
+ */
class GML2 extends ol.format.GMLBase {
/**
* @classdesc
@@ -2343,7 +2343,7 @@ declare module ol {
}
- /**
+ /**
* @classdesc
* Feature format for reading and writing data in the GML format
* version 3.1.1.
@@ -2354,7 +2354,7 @@ declare module ol {
* Optional configuration object.
* @extends {ol.format.GMLBase}
* @api
- */
+ */
class GML3 extends ol.format.GMLBase {
/**
* @classdesc
@@ -2403,7 +2403,7 @@ declare module ol {
}
- /**
+ /**
* @classdesc
* Abstract base class; normally only used for creating subclasses and not
* instantiated in apps.
@@ -2416,7 +2416,7 @@ declare module ol {
* @param {olx.format.GMLOptions=} opt_options
* Optional configuration object.
* @extends {ol.format.XMLFeature}
- */
+ */
class GMLBase extends ol.format.XMLFeature {
/**
* @classdesc
@@ -2447,7 +2447,7 @@ declare module ol {
}
- /**
+ /**
* @classdesc
* Feature format for reading and writing data in the GPX format.
*
@@ -2455,7 +2455,7 @@ declare module ol {
* @extends {ol.format.XMLFeature}
* @param {olx.format.GPXOptions=} opt_options Options.
* @api stable
- */
+ */
class GPX extends ol.format.XMLFeature {
/**
* @classdesc
@@ -2529,15 +2529,15 @@ declare module ol {
*/
writeFeaturesNode(features: ol.Feature[], opt_options?: olx.format.WriteOptions): Node;
- }
+ }
- /**
+ /**
* IGC altitude/z. One of 'barometric', 'gps', 'none'.
* @enum {string}
- */
+ */
type IGCZ = string;
- /**
+ /**
* @classdesc
* Feature format for `*.igc` flight recording files.
*
@@ -2545,7 +2545,7 @@ declare module ol {
* @extends {ol.format.TextFeature}
* @param {olx.format.IGCOptions=} opt_options Options.
* @api
- */
+ */
class IGC extends ol.format.TextFeature {
/**
* @classdesc
@@ -2566,7 +2566,7 @@ declare module ol {
* @param {olx.format.ReadOptions=} opt_options Read options.
* @return {ol.Feature} Feature.
* @api
- */
+ */
readFeature(source: (Document | Node | GlobalObject | string), opt_options?: olx.format.ReadOptions): ol.Feature;
/**
@@ -2593,7 +2593,7 @@ declare module ol {
}
- /**
+ /**
* @classdesc
* Abstract base class; normally only used for creating subclasses and not
* instantiated in apps.
@@ -2601,22 +2601,22 @@ declare module ol {
*
* @constructor
* @extends {ol.format.Feature}
- */
+ */
class JSONFeature extends ol.format.Feature {
- /**
+ /**
* @classdesc
* Abstract base class; normally only used for creating subclasses and not
* instantiated in apps.
* Base class for JSON feature formats.
*
- * @constructor
+ * @constructor
* @extends {ol.format.Feature}
- */
+ */
constructor();
- }
+ }
- /**
+ /**
* @classdesc
* Feature format for reading and writing data in the KML format.
*
@@ -2627,23 +2627,23 @@ declare module ol {
* @extends {ol.format.XMLFeature}
* @param {olx.format.KMLOptions=} opt_options Options.
* @api stable
- */
+ */
class KML extends ol.format.XMLFeature {
- /**
+ /**
* @classdesc
* Feature format for reading and writing data in the KML format.
*
* Note that the KML format uses the URL() constructor. Older browsers such as IE
* which do not support this will need a URL polyfill to be loaded before use.
*
- * @constructor
+ * @constructor
* @extends {ol.format.XMLFeature}
* @param {olx.format.KMLOptions=} opt_options Options.
* @api stable
- */
+ */
constructor(opt_options?: olx.format.KMLOptions);
- /**
+ /**
* Read the first feature from a KML source. MultiGeometries are converted into
* GeometryCollections if they are a mix of geometry types, and into MultiPoint/
* MultiLineString/MultiPolygon if they are all of the same type.
@@ -2653,10 +2653,10 @@ declare module ol {
* @param {olx.format.ReadOptions=} opt_options Read options.
* @return {ol.Feature} Feature.
* @api stable
- */
+ */
readFeature(source: (Document | Node | GlobalObject | string), opt_options?: olx.format.ReadOptions): ol.Feature;
- /**
+ /**
* Read all features from a KML source. MultiGeometries are converted into
* GeometryCollections if they are a mix of geometry types, and into MultiPoint/
* MultiLineString/MultiPolygon if they are all of the same type.
@@ -2666,38 +2666,38 @@ declare module ol {
* @param {olx.format.ReadOptions=} opt_options Read options.
* @return {Array.} Features.
* @api stable
- */
+ */
readFeatures(source: (Document | Node | GlobalObject | string), opt_options?: olx.format.ReadOptions): ol.Feature[];
- /**
+ /**
* Read the name of the KML.
*
* @param {Document|Node|string} source Souce.
* @return {string|undefined} Name.
* @api stable
- */
+ */
readName(source: (Document | Node | string)): (string);
- /**
+ /**
* Read the network links of the KML.
*
* @param {Document|Node|string} source Source.
* @return {Array.