diff --git a/backbone/backbone.d.ts b/backbone/backbone.d.ts index aa8488beac..c957be929b 100644 --- a/backbone/backbone.d.ts +++ b/backbone/backbone.d.ts @@ -271,7 +271,7 @@ declare module Backbone { navigate(fragment: string, options?: any); started: boolean; - _updateHash(location: Location, fragment: string, replace: bool); + _updateHash(location: Location, fragment: string, replace: boolean); } interface ViewOptions { diff --git a/fullCalendar/fullCalendar-tests.ts b/fullCalendar/fullCalendar-tests.ts index a85dd1d6e9..6c60f3ddb3 100644 --- a/fullCalendar/fullCalendar-tests.ts +++ b/fullCalendar/fullCalendar-tests.ts @@ -87,7 +87,7 @@ $('#calendar').fullCalendar({ } }); -var view: FullCalendar.View = $('#calendar').fullCalendar('getView'); +var view = $('#calendar').fullCalendar('getView'); alert("The view's title is " + view.title); $(document).ready(function () { @@ -407,7 +407,7 @@ $('#my-today-button').click(function () { $('#calendar').fullCalendar('gotoDate', 1, 0, 1); $('#my-button').click(function () { - var d: Date = $('#calendar').fullCalendar('getDate'); + var d = $('#calendar').fullCalendar('getDate'); alert("The current date of the calendar is " + d); }); diff --git a/fullCalendar/fullCalendar.d.ts b/fullCalendar/fullCalendar.d.ts index d11c68e046..b26920dc21 100644 --- a/fullCalendar/fullCalendar.d.ts +++ b/fullCalendar/fullCalendar.d.ts @@ -180,7 +180,33 @@ declare module FullCalendar { interface JQuery { fullCalendar(options: FullCalendar.Options): JQuery; - fullCalendar(method: string, ...args: Array): JQuery; + fullCalendar(method: string, arg1: any, arg2: any, arg3: any): void; + fullCalendar(method: 'option', option: string, value?: any): void; + fullCalendar(method: 'render'): void; + fullCalendar(method: 'destroy'): void; + fullCalendar(method: 'prev'): void; + fullCalendar(method: 'next'): void; + fullCalendar(method: 'prevYear'): void; + fullCalendar(method: 'nextYear'): void; + fullCalendar(method: 'today'): void; + fullCalendar(method: 'getView'): FullCalendar.View; + fullCalendar(method: 'changeView', viewName: string): void; + fullCalendar(method: 'gotoDate', year: number, month?: number, date?: number): void; + fullCalendar(method: 'gotoDate', date: Date): void; + fullCalendar(method: 'incrementDate', year: number, month?: number, date?: number): void; + fullCalendar(method: 'getDate'): Date; + fullCalendar(method: 'select', startDate: Date, endDate: Date, allDay: boolean): void; + fullCalendar(method: 'unselect'): void; + fullCalendar(method: 'updateEvent', event: FullCalendar.EventObject): void; + fullCalendar(method: 'clientEvents', idOrfilter?: any): Array; + fullCalendar(method: 'clientEvents', idOrfilter?: (e: FullCalendar.EventObject) => boolean): Array; + fullCalendar(method: 'removeEvents', idOrfilter?: any): void; + fullCalendar(method: 'removeEvents', idOrfilter?: (e: FullCalendar.EventObject) => boolean): void; + fullCalendar(method: 'refreshEvents'): void; + fullCalendar(method: 'addEventSource', source: any): void; + fullCalendar(method: 'removeEventSource', source: any): void; + fullCalendar(method: 'renderEvent', event: FullCalendar.EventObject, stick?: boolean): void; + fullCalendar(method: 'rerenderEvents'): void; } interface JQueryStatic { diff --git a/hammerjs/hammerjs.d.ts b/hammerjs/hammerjs.d.ts index f933058cee..38a77e5a51 100644 --- a/hammerjs/hammerjs.d.ts +++ b/hammerjs/hammerjs.d.ts @@ -7,24 +7,24 @@ /// interface HammerOptions { - prevent_default?: bool; - css_hacks?: bool; - swipe?: bool; + prevent_default?: boolean; + css_hacks?: boolean; + swipe?: boolean; swipe_time?: number; swipe_min_distance?: number; - drag?: bool; - drag_vertical?: bool; - drag_horizontal?: bool; + drag?: boolean; + drag_vertical?: boolean; + drag_horizontal?: boolean; drag_min_distance?: number; - transform?: bool; + transform?: boolean; scale_treshold?: number; rotation_treshold?: number; - tap?: bool; - tap_double?: bool; + tap?: boolean; + tap_double?: boolean; tap_max_interval?: number; tap_max_distance?: number; tap_double_distance?: number; - hold?: bool; + hold?: boolean; hold_timeout?: number; } @@ -70,4 +70,4 @@ declare class Hammer { interface JQuery { hammer(options?: HammerOptions): JQuery; -} \ No newline at end of file +} diff --git a/handlebars/handlebars.d.ts b/handlebars/handlebars.d.ts index aa5e72086d..f6b0c55652 100644 --- a/handlebars/handlebars.d.ts +++ b/handlebars/handlebars.d.ts @@ -5,7 +5,7 @@ interface HandlebarsStatic { - registerHelper(name: string, fn: Function, inverse?: bool): void; + registerHelper(name: string, fn: Function, inverse?: boolean): void; registerPartial(name: string, str): void; K(); createFrame(object); @@ -20,4 +20,4 @@ interface HandlebarsStatic { compile(environment, options?, context?, asObject?); } -declare var Handlebars: HandlebarsStatic; \ No newline at end of file +declare var Handlebars: HandlebarsStatic; diff --git a/jqueryui/jqueryui.d.ts b/jqueryui/jqueryui.d.ts index ba6bf05fd0..ecc52a0f15 100644 --- a/jqueryui/jqueryui.d.ts +++ b/jqueryui/jqueryui.d.ts @@ -782,6 +782,11 @@ interface JQuery { accordion(): JQuery; accordion(methodName: string): JQuery; + accordion(methodName: 'destroy'): void; + accordion(methodName: 'disable'): void; + accordion(methodName: 'enable'): void; + accordion(methodName: 'refresh'): void; + accordion(methodName: 'widget'): JQuery; accordion(options: JQueryUI.AccordionOptions): JQuery; accordion(optionLiteral: string, optionName: string): any; accordion(optionLiteral: string, options: JQueryUI.AccordionOptions): any; @@ -789,6 +794,12 @@ interface JQuery { autocomplete(): JQuery; autocomplete(methodName: string): JQuery; + autocomplete(methodName: 'close'): void; + autocomplete(methodName: 'destroy'): void; + autocomplete(methodName: 'disable'): void; + autocomplete(methodName: 'enable'): void; + autocomplete(methodName: 'search', value?: string): void; + autocomplete(methodName: 'widget'): JQuery; autocomplete(options: JQueryUI.AutocompleteOptions): JQuery; autocomplete(optionLiteral: string, optionName: string): any; autocomplete(optionLiteral: string, options: JQueryUI.AutocompleteOptions): any; @@ -796,6 +807,11 @@ interface JQuery { button(): JQuery; button(methodName: string): JQuery; + button(methodName: 'destroy'): void; + button(methodName: 'disable'): void; + button(methodName: 'enable'): void; + button(methodName: 'refresh'): void; + button(methodName: 'widget'): JQuery; button(options: JQueryUI.ButtonOptions): JQuery; button(optionLiteral: string, optionName: string): any; button(optionLiteral: string, options: JQueryUI.ButtonOptions): any; @@ -803,6 +819,11 @@ interface JQuery { buttonset(): JQuery; buttonset(methodName: string): JQuery; + buttonset(methodName: 'destroy'): void; + buttonset(methodName: 'disable'): void; + buttonset(methodName: 'enable'): void; + buttonset(methodName: 'refresh'): void; + buttonset(methodName: 'widget'): JQuery; buttonset(options: JQueryUI.ButtonOptions): JQuery; buttonset(optionLiteral: string, optionName: string): any; buttonset(optionLiteral: string, options: JQueryUI.ButtonOptions): any; @@ -810,6 +831,17 @@ interface JQuery { datepicker(): JQuery; datepicker(methodName: string): JQuery; + datepicker(methodName: 'destroy'): void; + datepicker(methodName: 'dialog', date?: Date, onSelect?: () => void , pos?: any): void; + datepicker(methodName: 'dialog', date?: string, onSelect?: () => void , pos?: any): void; + datepicker(methodName: 'getDate'): Date; + datepicker(methodName: 'hide'): void; + datepicker(methodName: 'isDisabled'): boolean; + datepicker(methodName: 'refresh'): void; + datepicker(methodName: 'setDate', date: Date): void; + datepicker(methodName: 'setDate', date: string): void; + datepicker(methodName: 'show'): void; + datepicker(methodName: 'widget'): JQuery; datepicker(options: JQueryUI.DatepickerOptions): JQuery; datepicker(optionLiteral: string, optionName: string): any; datepicker(optionLiteral: string, options: JQueryUI.DatepickerOptions): any; @@ -817,6 +849,12 @@ interface JQuery { dialog(): JQuery; dialog(methodName: string): JQuery; + dialog(methodName: 'close'): void; + dialog(methodName: 'destroy'): void; + dialog(methodName: 'isOpen'): boolean; + dialog(methodName: 'moveToTop'): void; + dialog(methodName: 'open'): void; + dialog(methodName: 'widget'): JQuery; dialog(options: JQueryUI.DialogOptions): JQuery; dialog(optionLiteral: string, optionName: string): any; dialog(optionLiteral: string, options: JQueryUI.DialogOptions): any; @@ -824,6 +862,10 @@ interface JQuery { draggable(): JQuery; draggable(methodName: string): JQuery; + draggable(methodName: 'destroy'): void; + draggable(methodName: 'disable'): void; + draggable(methodName: 'enable'): void; + draggable(methodName: 'widget'): JQuery; draggable(options: JQueryUI.DraggableOptions): JQuery; draggable(optionLiteral: string, optionName: string): any; draggable(optionLiteral: string, options: JQueryUI.DraggableOptions): any; @@ -831,6 +873,10 @@ interface JQuery { droppable(): JQuery; droppable(methodName: string): JQuery; + droppable(methodName: 'destroy'): void; + droppable(methodName: 'disable'): void; + droppable(methodName: 'enable'): void; + droppable(methodName: 'widget'): JQuery; droppable(options: JQueryUI.DroppableOptions): JQuery; droppable(optionLiteral: string, optionName: string): any; droppable(optionLiteral: string, options: JQueryUI.DraggableOptions): any; @@ -838,6 +884,23 @@ interface JQuery { menu(): JQuery; menu(methodName: string): JQuery; + menu(methodName: 'blur'): void; + menu(methodName: 'collapse', event?: JQueryEventObject): void; + menu(methodName: 'collapseAll', event?: JQueryEventObject, all?: boolean): void; + menu(methodName: 'destroy'): void; + menu(methodName: 'disable'): void; + menu(methodName: 'enable'): void; + menu(methodName: string, event: JQueryEventObject, item: JQuery): void; + menu(methodName: 'focus', event: JQueryEventObject, item: JQuery): void; + menu(methodName: 'isFirstItem'): boolean; + menu(methodName: 'isLastItem'): boolean; + menu(methodName: 'next', event?: JQueryEventObject): void; + menu(methodName: 'nextPage', event?: JQueryEventObject): void; + menu(methodName: 'previous', event?: JQueryEventObject): void; + menu(methodName: 'previousPage', event?: JQueryEventObject): void; + menu(methodName: 'refresh'): void; + menu(methodName: 'select', event?: JQueryEventObject): void; + menu(methodName: 'widget'): JQuery; menu(options: JQueryUI.MenuOptions): JQuery; menu(optionLiteral: string, optionName: string): any; menu(optionLiteral: string, options: JQueryUI.MenuOptions): any; @@ -845,6 +908,15 @@ interface JQuery { progressbar(): JQuery; progressbar(methodName: string): JQuery; + progressbar(methodName: 'destroy'): void; + progressbar(methodName: 'disable'): void; + progressbar(methodName: 'enable'): void; + progressbar(methodName: 'refresh'): void; + progressbar(methodName: 'value'): number; + progressbar(methodName: 'value'): boolean; + progressbar(methodName: 'value', value: number): void; + progressbar(methodName: 'value', value: boolean): void; + progressbar(methodName: 'widget'): JQuery; progressbar(options: JQueryUI.ProgressbarOptions): JQuery; progressbar(optionLiteral: string, optionName: string): any; progressbar(optionLiteral: string, options: JQueryUI.ProgressbarOptions): any; @@ -852,6 +924,10 @@ interface JQuery { resizable(): JQuery; resizable(methodName: string): JQuery; + resizable(methodName: 'destroy'): void; + resizable(methodName: 'disable'): void; + resizable(methodName: 'enable'): void; + resizable(methodName: 'widget'): JQuery; resizable(options: JQueryUI.ResizableOptions): JQuery; resizable(optionLiteral: string, optionName: string): any; resizable(optionLiteral: string, options: JQueryUI.ResizableOptions): any; @@ -859,6 +935,10 @@ interface JQuery { selectable(): JQuery; selectable(methodName: string): JQuery; + selectable(methodName: 'destroy'): void; + selectable(methodName: 'disable'): void; + selectable(methodName: 'enable'): void; + selectable(methodName: 'widget'): JQuery; selectable(options: JQueryUI.SelectableOptions): JQuery; selectable(optionLiteral: string, optionName: string): any; selectable(optionLiteral: string, options: JQueryUI.SelectableOptions): any; @@ -866,6 +946,18 @@ interface JQuery { slider(): JQuery; slider(methodName: string): JQuery; + slider(methodName: 'destroy'): void; + slider(methodName: 'disable'): void; + slider(methodName: 'enable'): void; + slider(methodName: 'refresh'): void; + slider(methodName: 'value'): number; + slider(methodName: 'value', value: number): void; + slider(methodName: 'values'): Array; + slider(methodName: 'values', index: number): number; + slider(methodName: string, index: number, value: number): void; + slider(methodName: 'values', index: number, value: number): void; + slider(methodName: 'values', values: Array): void; + slider(methodName: 'widget'): JQuery; slider(options: JQueryUI.SliderOptions): JQuery; slider(optionLiteral: string, optionName: string): any; slider(optionLiteral: string, options: JQueryUI.SliderOptions): any; @@ -873,6 +965,10 @@ interface JQuery { sortable(): JQuery; sortable(methodName: string): JQuery; + sortable(methodName: 'destroy'): void; + sortable(methodName: 'disable'): void; + sortable(methodName: 'enable'): void; + sortable(methodName: 'widget'): JQuery; sortable(options: JQueryUI.SortableOptions): JQuery; sortable(optionLiteral: string, optionName: string): any; sortable(optionLiteral: string, options: JQueryUI.SortableOptions): any; @@ -880,6 +976,16 @@ interface JQuery { spinner(): JQuery; spinner(methodName: string): JQuery; + spinner(methodName: 'destroy'): void; + spinner(methodName: 'disable'): void; + spinner(methodName: 'enable'): void; + spinner(methodName: 'pageDown', pages?: number): void; + spinner(methodName: 'pageUp', pages?: number): void; + spinner(methodName: 'stepDown', steps?: number): void; + spinner(methodName: 'stepUp', steps?: number): void; + spinner(methodName: 'value'): number; + spinner(methodName: 'value', value: number): void; + spinner(methodName: 'widget'): JQuery; spinner(options: JQueryUI.SpinnerOptions): JQuery; spinner(optionLiteral: string, optionName: string): any; spinner(optionLiteral: string, options: JQueryUI.SpinnerOptions): any; @@ -887,6 +993,12 @@ interface JQuery { tabs(): JQuery; tabs(methodName: string): JQuery; + tabs(methodName: 'destroy'): void; + tabs(methodName: 'disable'): void; + tabs(methodName: 'enable'): void; + tabs(methodName: 'load', index: number): void; + tabs(methodName: 'refresh'): void; + tabs(methodName: 'widget'): JQuery; tabs(options: JQueryUI.TabsOptions): JQuery; tabs(optionLiteral: string, optionName: string): any; tabs(optionLiteral: string, options: JQueryUI.TabsOptions): any; @@ -894,6 +1006,12 @@ interface JQuery { tooltip(): JQuery; tooltip(methodName: string): JQuery; + tooltip(methodName: 'destroy'): void; + tooltip(methodName: 'disable'): void; + tooltip(methodName: 'enable'): void; + tooltip(methodName: 'open'): void; + tooltip(methodName: 'close'): void; + tooltip(methodName: 'widget'): JQuery; tooltip(options: JQueryUI.TooltipOptions): JQuery; tooltip(optionLiteral: string, optionName: string): any; tooltip(optionLiteral: string, options: JQueryUI.TooltipOptions): any; diff --git a/leaflet/leaflet.d.ts b/leaflet/leaflet.d.ts index a2e3fb09fa..5d6825383c 100644 --- a/leaflet/leaflet.d.ts +++ b/leaflet/leaflet.d.ts @@ -9,27 +9,27 @@ declare module L { * Initial geographical center of the map. */ center?: LatLng; - + /** * Initial map zoom. */ zoom?: number; - + /** * Layers that will be added to the map initially. */ layers?: ILayer[]; - + /** * Minimum zoom level of the map. Overrides any minZoom set on map layers. */ minZoom?: number; - + /** * Maximum zoom level of the map. This overrides any maxZoom set on map layers. */ maxZoom?: number; - + /** * When this option is set, the map restricts the view to the given geographical * bounds, bouncing the user back when he tries to pan outside the view, and also @@ -37,125 +37,125 @@ declare module L { * on the map size). To set the restriction dynamically, use setMaxBounds method */ maxBounds?: LatLngBounds; - + /** * Coordinate Reference System to use. Don't change this if you're not sure * what it means. */ crs?: ICRS; - + /** * Whether the map be draggable with mouse/touch or not. */ - dragging?: bool; - + dragging?: boolean; + /** * Whether the map can be zoomed by touch-dragging with two fingers. */ - touchZoom?: bool; - + touchZoom?: boolean; + /** * Whether the map can be zoomed by using the mouse wheel. */ - scrollWheelZoom?: bool; - + scrollWheelZoom?: boolean; + /** * Whether the map can be zoomed in by double clicking on it. */ - doubleClickZoom?: bool; - + doubleClickZoom?: boolean; + /** * Whether the map can be zoomed to a rectangular area specified by dragging * the mouse while pressing shift. */ - boxZoom?: bool; - + boxZoom?: boolean; + /** * Whether the map automatically handles browser window resize to update itself. */ - trackResize?: bool; - + trackResize?: boolean; + /** * With this option enabled, the map tracks when you pan to another "copy" of * the world and seamlessly jumps to the original one so that all overlays like * markers and vector layers are still visible. */ - worldCopyJump?: bool; - + worldCopyJump?: boolean; + /** * Set it to false if you don't want popups to close when user clicks the map. */ - closePopupOnClick?: bool; - + closePopupOnClick?: boolean; + /** * Makes the map focusable and allows users to navigate the map with keyboard * arrows and +/- keys. */ - keyboard?: bool; - + keyboard?: boolean; + /** * Amount of pixels to pan when pressing an arrow key. */ keyboardPanOffset?: number; - + /** * Number of zoom levels to change when pressing + or - key. */ keyboardZoomOffset?: number; - + /** * If enabled, panning of the map will have an inertia effect where the map builds * momentum while dragging and continues moving in the same direction for some * time. Feels especially nice on touch devices. */ - inertia?: bool; - + inertia?: boolean; + /** * The rate with which the inertial movement slows down, in pixels/second2. */ inertiaDeceleration?: number; - + /** * Max speed of the inertial movement, in pixels/second. */ inertiaMaxSpeed?: number; - + /** * Amount of milliseconds that should pass between stopping the movement and * releasing the mouse or touch to prevent inertial movement. 32 for touch devices * and 14 for the rest by default. */ inertiaThreshold?: number; - + /** * Whether the zoom control is added to the map by default. */ - zoomControl?: bool; - + zoomControl?: boolean; + /** * Whether the attribution control is added to the map by default. */ - attributionControl?: bool; - + attributionControl?: boolean; + /** * Whether the tile fade animation is enabled. By default it's enabled in all * browsers that support CSS3 Transitions except Android. */ - fadeAnimation?: bool; - + fadeAnimation?: boolean; + /** * Whether the tile zoom animation is enabled. By default it's enabled in all * browsers that support CSS3 Transitions except Android. */ - zoomAnimation?: bool; - + zoomAnimation?: boolean; + /** * Whether markers animate their zoom with the zoom animation, if disabled * they will disappear for the length of the animation. By default it's enabled * in all browsers that support CSS3 Transitions except Android. */ - markerZoomAnimation?: bool; - + markerZoomAnimation?: boolean; + } export interface LocateOptions { @@ -164,36 +164,36 @@ declare module L { * it once) using W3C watchPosition method. You can later stop watching using * map.stopLocate() method. */ - watch?: bool; - + 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. */ - setView?: bool; - + setView?: boolean; + /** * The maximum zoom for automatic view setting when using `setView` option. */ maxZoom?: number; - + /** * Number of millisecond to wait for a response from geolocation before firing * a locationerror event. */ 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. */ maximumAge?: number; - + /** * Enables high accuracy, see description in the W3C spec. */ - enableHighAccuracy?: bool; - + enableHighAccuracy?: boolean; + } export interface MapPanes { @@ -201,37 +201,37 @@ declare module L { * Pane that contains all other map panes. */ mapPane: HTMLElement; - + /** * Pane for tile layers. */ tilePane: HTMLElement; - + /** * Pane that contains all the panes except tile pane. */ objectsPane: HTMLElement; - + /** * Pane for overlay shadows (e.g. marker shadows). */ shadowPane: HTMLElement; - + /** * Pane for overlays like polylines and polygons. */ overlayPane: HTMLElement; - + /** * Pane for marker icons. */ markerPane: HTMLElement; - + /** * Pane for popups. */ popupPane: HTMLElement; - + } export class Map implements IEventPowered { @@ -252,64 +252,64 @@ declare module L { * set to true, the map is reloaded even if it's eligible for pan or zoom animation * (false by default). */ - setView(center: LatLng, zoom: number, forceReset?: bool): Map; - + setView(center: LatLng, zoom: number, forceReset?: boolean): Map; + /** * Sets the zoom of the map. */ setZoom(zoom: number): Map; - + /** * Increases the zoom of the map by delta (1 by default). */ zoomIn(delta?: number): Map; - + /** * Decreases the zoom of the map by delta (1 by default). */ zoomOut(delta?: number): Map; - + /** * Sets a map view that contains the given geographical bounds with the maximum * zoom level possible. */ fitBounds(bounds: LatLngBounds): Map; - + /** * Sets a map view that mostly contains the whole world with the maximum zoom * level possible. */ fitWorld(): Map; - + /** * Pans the map to a given center. Makes an animated pan if new center is not more * than one screen away from the current one. */ panTo(latlng: LatLng): Map; - + /** * Pans the map to the closest view that would lie inside the given bounds (if * it's not already). */ panInsideBounds(bounds: LatLngBounds): Map; - + /** * Pans the map by a given number of pixels (animated). */ panBy(point: Point): Map; - + /** * Checks if the map container size changed and updates the map if so — call it * after you've changed the map size dynamically. If animate is true, map animates * the update. */ - invalidateSize(animate?: bool): Map; - + invalidateSize(animate?: boolean): Map; + /** * Restricts the map view to the given bounds (see map maxBounds option). */ setMaxBounds(bounds: LatLngBounds): Map; - + /** * Tries to locate the user using Geolocation API, firing locationfound event * with location data on success or locationerror event on failure, and optionally @@ -318,219 +318,219 @@ declare module L { * details. */ locate(options?: LocateOptions): Map; - + /** * Stops watching location previously initiated by map.locate({watch: true}). */ stopLocate(): Map; - + /** * Returns the geographical center of the map view. */ getCenter(): LatLng; - + /** * Returns the current zoom of the map view. */ getZoom(): number; - + /** * Returns the minimum zoom level of the map. */ getMinZoom(): number; - + /** * Returns the maximum zoom level of the map. */ getMaxZoom(): number; - + /** * Returns the LatLngBounds of the current map view. */ getBounds(): LatLngBounds; - + /** * Returns the maximum zoom level on which the given bounds fit to the map view * in its entirety. If inside (optional) is set to true, the method instead returns * the minimum zoom level on which the map view fits into the given bounds in its * entirety. */ - getBoundsZoom(bounds: LatLngBounds, inside?: bool): number; - + getBoundsZoom(bounds: LatLngBounds, inside?: boolean): number; + /** * Returns the current size of the map container. */ getSize(): Point; - + /** * Returns the bounds of the current map view in projected pixel coordinates * (sometimes useful in layer and overlay implementations). */ getPixelBounds(): Bounds; - + /** * Returns the projected pixel coordinates of the top left point of the map layer * (useful in custom layer and overlay implementations). */ getPixelOrigin(): Point; - + /** * Adds the given layer to the map. If optional insertAtTheBottom is set to true, * the layer is inserted under all others (useful when switching base tile layers). */ - addLayer(layer: ILayer, insertAtTheBottom?: bool): Map; - + addLayer(layer: ILayer, insertAtTheBottom?: boolean): Map; + /** * Removes the given layer from the map. */ removeLayer(layer: ILayer): Map; - + /** * Returns true if the given layer is currently added to the map. */ - hasLayer(layer: ILayer): bool; - + hasLayer(layer: ILayer): boolean; + /** * Opens the specified popup while closing the previously opened (to make sure * only one is opened at one time for usability). */ openPopup(popup: Popup): Map; - + /** * Closes the popup opened with openPopup. */ closePopup(): Map; - + /** * Adds the given control to the map. */ addControl(control: IControl): Map; - + /** * Removes the given control from the map. */ removeControl(control: IControl): Map; - + /** * Returns the map layer point that corresponds to the given geographical coordinates * (useful for placing overlays on the map). */ latLngToLayerPoint(latlng: LatLng): Point; - + /** * Returns the geographical coordinates of a given map layer point. */ layerPointToLatLng(point: Point): LatLng; - + /** * Converts the point relative to the map container to a point relative to the * map layer. */ containerPointToLayerPoint(point: Point): Point; - + /** * Converts the point relative to the map layer to a point relative to the map * container. */ layerPointToContainerPoint(point: Point): Point; - + /** * Returns the map container point that corresponds to the given geographical * coordinates. */ latLngToContainerPoint(latlng: LatLng): Point; - + /** * Returns the geographical coordinates of a given map container point. */ containerPointToLatLng(point: Point): LatLng; - + /** * Projects the given geographical coordinates to absolute pixel coordinates * for the given zoom level (current zoom level by default). */ project(latlng: LatLng, zoom?: number): Point; - + /** * Projects the given absolute pixel coordinates to geographical coordinates * for the given zoom level (current zoom level by default). */ unproject(point: Point, zoom?: number): LatLng; - + /** * Returns the pixel coordinates of a mouse click (relative to the top left corner * of the map) given its event object. */ mouseEventToContainerPoint(event: LeafletMouseEvent): Point; - + /** * Returns the pixel coordinates of a mouse click relative to the map layer given * its event object. */ mouseEventToLayerPoint(event: LeafletMouseEvent): Point; - + /** * Returns the geographical coordinates of the point the mouse clicked on given * the click's event object. */ mouseEventToLatLng(event: LeafletMouseEvent): LatLng; - + /** * Returns the container element of the map. */ getContainer(): HTMLElement; - + /** * Returns an object with different map panes (to render overlays in). */ getPanes(): MapPanes; - + /** * Runs the given callback when the map gets initialized with a place and zoom, * or immediately if it happened already, optionally passing a function context. */ whenReady(fn: Function, context?: any): Map; - + /** * Map dragging handler (by both mouse and touch). */ dragging: IHandler; - + /** * Touch zoom handler. */ touchZoom: IHandler; - + /** * Double click zoom handler. */ doubleClickZoom: IHandler; - + /** * Scroll wheel zoom handler. */ scrollWheelZoom: IHandler; - + /** * Box (shift-drag with mouse) zoom handler. */ boxZoom: IHandler; - + /** * Keyboard navigation handler. */ keyboard: IHandler; - + /** * Zoom control. */ zoomControl: Zoom; - + /** * Attribution control. */ attributionControl: Attribution; - + //////////// //// IEventPowered members //////////// @@ -539,7 +539,7 @@ declare module L { addEventListener(eventMap: any, context?: any): IEventPowered; removeEventListener(type: string, fn?: (e: LeafletEvent) => void, context?: any): IEventPowered; removeEventListener(eventMap: any, context?: any): IEventPowered; - hasEventListeners(type: string): bool; + hasEventListeners(type: string): boolean; fireEvent(type: string, data?: any): IEventPowered; on(type: string, fn: (e: LeafletEvent) => void, context?: any): IEventPowered; on(eventMap: any, context?: any): IEventPowered; @@ -554,45 +554,45 @@ declare module L { * on how to customize the marker icon. Set to new L.Icon.Default() by default. */ icon?: Icon; - + /** * If false, the marker will not emit mouse events and will act as a part of the * underlying map. */ - clickable?: bool; - + clickable?: boolean; + /** * Whether the marker is draggable with mouse/touch or not. */ - draggable?: bool; - + draggable?: boolean; + /** * Text for the browser tooltip that appear on marker hover (no tooltip by default). */ title?: string; - + /** * By default, marker images zIndex is set automatically based on its latitude. * You this option if you want to put the marker on top of all others (or below), * specifying a high value like 1000 (or high negative value, respectively). */ zIndexOffset?: number; - + /** * The opacity of the marker. */ opacity?: number; - + /** * If true, the marker will get on top of others when you hover the mouse over it. */ - riseOnHover?: bool; - + riseOnHover?: boolean; + /** * The z-index offset used for the riseOnHover feature. */ riseOffset?: number; - + } export class Marker implements ILayer, IEventPowered { @@ -601,59 +601,59 @@ declare module L { * an options object. */ constructor(latlng: LatLng, options?: MarkerOptions); - + /** * Adds the marker to the map. */ addTo(map: Map): Marker; - + /** * Returns the current geographical position of the marker. */ getLatLng(): LatLng; - + /** * Changes the marker position to the given point. */ setLatLng(latlng: LatLng): Marker; - + /** * Changes the marker icon. */ setIcon(icon: Icon): Marker; - + /** * Changes the zIndex offset of the marker. */ setZIndexOffset(offset: number): Marker; - + /** * Changes the opacity of the marker. */ setOpacity(opacity: number): Marker; - + /** * Updates the marker position, useful if coordinates of its latLng object * were changed directly. */ update(): Marker; - + /** * Binds a popup with a particular HTML content to a click on this marker. You * can also open the bound popup with the Marker openPopup method. */ bindPopup(htmlContent: string, options?: PopupOptions): Marker; - + /** * Unbinds the popup previously bound to the marker with bindPopup. */ unbindPopup(): Marker; - + /** * Opens the popup previously bound by the bindPopup method. */ openPopup(): Marker; - + /** * Closes the bound popup of the marker if it's opened. */ @@ -669,13 +669,13 @@ declare module L { * 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; - + //////////// //// IEventPowered members //////////// @@ -684,7 +684,7 @@ declare module L { addEventListener(eventMap: any, context?: any): IEventPowered; removeEventListener(type: string, fn?: (e: LeafletEvent) => void, context?: any): IEventPowered; removeEventListener(eventMap: any, context?: any): IEventPowered; - hasEventListeners(type: string): bool; + hasEventListeners(type: string): boolean; fireEvent(type: string, data?: any): IEventPowered; on(type: string, fn: (e: LeafletEvent) => void, context?: any): IEventPowered; on(eventMap: any, context?: any): IEventPowered; @@ -698,47 +698,47 @@ declare module L { * Max width of the popup. */ maxWidth?: number; - + /** * Min width of the popup. */ minWidth?: number; - + /** * If set, creates a scrollable container of the given height inside a popup * if its content exceeds it. */ maxHeight?: number; - + /** * Set it to false if you don't want the map to do panning animation to fit the opened * popup. */ - autoPan?: bool; - + autoPan?: boolean; + /** * Controls the presense of a close button in the popup. */ - closeButton?: bool; - + closeButton?: boolean; + /** * The offset of the popup position. Useful to control the anchor of the popup * when opening it on some overlays. */ offset?: Point; - + /** * The margin between the popup and the edges of the map view after autopanning * was performed. */ autoPanPadding?: Point; - + /** * Whether to animate the popup on zoom. Disable it if you have problems with * Flash content inside popups. */ - zoomAnimation?: bool; - + zoomAnimation?: boolean; + } export class Popup implements ILayer { @@ -748,22 +748,22 @@ declare module L { * popup with a reference to the source object to which it refers. */ constructor(options?: PopupOptions, source?: any); - + /** * Adds the popup to the map. */ addTo(map: Map): Popup; - + /** * Adds the popup to the map and closes the previous one. The same as map.openPopup(popup). */ openOn(map: Map): Popup; - + /** * Sets the geographical point where the popup will open. */ setLatLng(latlng: LatLng): Popup; - + /** * Sets the HTML content of the popup. */ @@ -779,13 +779,13 @@ declare module L { * 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; - + } export interface TileLayerOptions { @@ -793,92 +793,92 @@ declare module L { * Minimum zoom number. */ minZoom?: number; - + /** * Maximum zoom number. */ maxZoom?: number; - + /** * Tile size (width and height in pixels, assuming tiles are square). */ tileSize?: number; - + /** * Subdomains of the tile service. Can be passed in the form of one string (where * each letter is a subdomain name) or an array of strings. */ subdomains?: string; - + /** * URL to the tile image to show in place of the tile that failed to load. */ errorTileUrl?: string; - + /** * e.g. "© CloudMade" — the string used by the attribution control, describes * the layer data. */ attribution?: string; - + /** * If true, inverses Y axis numbering for tiles (turn this on for TMS services). */ - tms?: bool; - + tms?: boolean; + /** * If set to true, the tile coordinates won't be wrapped by world width (-180 * to 180 longitude) or clamped to lie within world height (-90 to 90). Use this * if you use Leaflet for maps that don't reflect the real world (e.g. game, indoor * or photo maps). */ - continuousWorld?: bool; - + continuousWorld?: boolean; + /** * If set to true, the tiles just won't load outside the world width (-180 to 180 * longitude) instead of repeating. */ - noWrap?: bool; - + noWrap?: boolean; + /** * The zoom number used in tile URLs will be offset with this value. */ zoomOffset?: number; - + /** * If set to true, the zoom number used in tile URLs will be reversed (maxZoom * - zoom instead of zoom) */ - zoomReverse?: bool; - + zoomReverse?: boolean; + /** * The opacity of the tile layer. */ opacity?: number; - + /** * The explicit zIndex of the tile layer. Not set by default. */ zIndex?: number; - + /** * If true, all the tiles that are not visible after panning are removed (for * better performance). true by default on mobile WebKit, otherwise false. */ - unloadInvisibleTiles?: bool; - + unloadInvisibleTiles?: boolean; + /** * If false, new tiles are loaded during panning, otherwise only after it (for * better performance). true by default on mobile WebKit, otherwise false. */ - updateWhenIdle?: bool; - + updateWhenIdle?: boolean; + /** * If true and user is on a retina display, it will request four tiles of half the * specified size and a bigger zoom level in place of one to utilize the high resolution. */ - detectRetina?: bool; - + detectRetina?: boolean; + /** * If true, all the tiles that are not visible after panning are placed in a reuse * queue from which they will be fetched when new tiles become visible (as opposed @@ -886,8 +886,8 @@ declare module L { * low and eliminate the need for reserving new memory whenever a new tile is * needed. */ - reuseTiles?: bool; - + reuseTiles?: boolean; + } export class TileLayer implements ILayer, IEventPowered { @@ -896,44 +896,44 @@ declare module L { * object. */ constructor(urlTemplate: string, options?: TileLayerOptions); - + /** * Adds the layer to the map. */ addTo(map: Map): TileLayer; - + /** * Brings the tile layer to the top of all tile layers. */ bringToFront(): TileLayer; - + /** * Brings the tile layer to the bottom of all tile layers. */ bringToBack(): TileLayer; - + /** * Changes the opacity of the tile layer. */ setOpacity(opacity: number): TileLayer; - + /** * Sets the zIndex of the tile layer. */ setZIndex(zIndex: number): TileLayer; - + /** * Causes the layer to clear all the tiles and request them again. */ redraw(): TileLayer; - + /** * Updates the layer's URL template and redraws it. */ setUrl(urlTemplate: string): TileLayer; static WMS: new () => WMS; - + static Canvas: new () => Canvas; //////////// @@ -946,13 +946,13 @@ declare module L { * 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; - + //////////// //// IEventPowered members //////////// @@ -961,7 +961,7 @@ declare module L { addEventListener(eventMap: any, context?: any): IEventPowered; removeEventListener(type: string, fn?: (e: LeafletEvent) => void, context?: any): IEventPowered; removeEventListener(eventMap: any, context?: any): IEventPowered; - hasEventListeners(type: string): bool; + hasEventListeners(type: string): boolean; fireEvent(type: string, data?: any): IEventPowered; on(type: string, fn: (e: LeafletEvent) => void, context?: any): IEventPowered; on(eventMap: any, context?: any): IEventPowered; @@ -975,27 +975,27 @@ declare module L { * (required) Comma-separated list of WMS layers to show. */ layers?: string; - + /** * Comma-separated list of WMS styles. */ styles?: string; - + /** * WMS image format (use 'image/png' for layers with transparency). */ format?: string; - + /** * If true, the WMS service will return images with transparency. */ - transparent?: bool; - + transparent?: boolean; + /** * Version of the WMS service to use. */ version?: string; - + } export class WMS { @@ -1004,13 +1004,13 @@ declare module L { * a WMS parameters/options object. */ constructor(baseUrl: string, options: WMSOptions); - + /** * Merges an object with the new parameters and re-requests tiles on the current * screen (unless noRedraw was set to true). */ - setParams(params: WMS, noRedraw?: bool): WMS; - + setParams(params: WMS, noRedraw?: boolean): WMS; + } export class Canvas { @@ -1018,20 +1018,20 @@ declare module L { * Instantiates a Canvas tile layer object given an options object (optionally). */ constructor(options?: TileLayerOptions); - + /** * You need to define this method after creating the instance to draw tiles; * canvas is the actual canvas tile on which you can draw, tilePoint represents * the tile numbers, and zoom is the current zoom. */ drawTile(canvas: HTMLCanvasElement, tilePoint: Point, zoom: number): Canvas; - + /** * Calling redraw will cause the drawTile method to be called for all tiles. * May be used for updating dynamic content drawn on the Canvas */ redraw(): Canvas; - + } export interface ImageOverlayOptions { @@ -1039,7 +1039,7 @@ declare module L { * The opacity of the image overlay. */ opacity?: number; - + } export class ImageOverlay implements ILayer { @@ -1048,22 +1048,22 @@ declare module L { * bounds it is tied to. */ constructor(imageUrl: string, bounds: LatLngBounds, options?: ImageOverlayOptions); - + /** * Adds the overlay to the map. */ addTo(map: Map): ImageOverlay; - + /** * Sets the opacity of the overlay. */ setOpacity(opacity: number): ImageOverlay; - + /** * Brings the layer to the top of all overlays. */ bringToFront(): ImageOverlay; - + /** * Brings the layer to the bottom of all overlays. */ @@ -1079,13 +1079,13 @@ declare module L { * 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; - + } export interface PathOptions { @@ -1093,51 +1093,51 @@ declare module L { * Whether to draw stroke along the path. Set it to false to disable borders on * polygons or circles. */ - stroke?: bool; - + stroke?: boolean; + /** * Stroke color. */ color?: string; - + /** * Stroke width in pixels. */ weight?: number; - + /** * Stroke opacity. */ opacity?: number; - + /** * Whether to fill the path with color. Set it to false to disable filling on polygons * or circles. */ - fill?: bool; - + fill?: boolean; + /** * Fill color. */ fillColor?: string; - + /** * Fill opacity. */ fillOpacity?: number; - + /** * A string that defines the stroke dash pattern. Doesn't work on canvas-powered * layers (e.g. Android 2). */ dashArray?: string; - + /** * If false, the vector will not emit mouse events and will act as a part of the * underlying map. */ - clickable?: bool; - + clickable?: boolean; + } export class Path implements ILayer, IEventPowered { @@ -1145,64 +1145,64 @@ declare module L { * Adds the layer to the map. */ addTo(map: Map): Path; - + /** * Binds a popup with a particular HTML content to a click on this path. */ bindPopup(htmlContent: string, options?: PopupOptions): Path; - + /** * Unbinds the popup previously bound to the path with bindPopup. */ unbindPopup(): Path; - + /** * Opens the popup previously bound by the bindPopup method in the given point, * or in one of the path's points if not specified. */ openPopup(latlng?: LatLng): Path; - + /** * Closes the path's bound popup if it is opened. */ closePopup(): Path; - + /** * Changes the appearance of a Path based on the options in the Path options object. */ setStyle(object: PathOptions): Path; - + /** * Returns the LatLngBounds of the path. */ getBounds(): LatLngBounds; - + /** * Brings the layer to the top of all path layers. */ bringToFront(): Path; - + /** * Brings the layer to the bottom of all path layers. */ bringToBack(): Path; - + /** * Redraws the layer. Sometimes useful after you changed the coordinates that * the path uses. */ redraw(): Path; - + /** * True if SVG is used for vector rendering (true for most modern browsers). */ - static SVG: bool; - + static SVG: boolean; + /** * True if VML is used for vector rendering (IE 6-8). */ - static VML: bool; - + static VML: boolean; + /** * True if Canvas is used for vector rendering (Android 2). You can also force * this by setting global variable L_PREFER_CANVAS to true before the Leaflet @@ -1210,8 +1210,8 @@ declare module L { * when rendering thousands of circle markers, but currently suffers from * a bug that causes removing such layers to be extremely slow. */ - static CANVAS: bool; - + static CANVAS: boolean; + /** * How much to extend the clip area around the map view (relative to its size, * e.g. 0.5 is half the screen in each direction). Smaller values mean that you @@ -1230,13 +1230,13 @@ declare module L { * 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; - + //////////// //// IEventPowered members //////////// @@ -1245,7 +1245,7 @@ declare module L { addEventListener(eventMap: any, context?: any): IEventPowered; removeEventListener(type: string, fn?: (e: LeafletEvent) => void, context?: any): IEventPowered; removeEventListener(eventMap: any, context?: any): IEventPowered; - hasEventListeners(type: string): bool; + hasEventListeners(type: string): boolean; fireEvent(type: string, data?: any): IEventPowered; on(type: string, fn: (e: LeafletEvent) => void, context?: any): IEventPowered; on(eventMap: any, context?: any): IEventPowered; @@ -1260,12 +1260,12 @@ declare module L { * and smoother look, and less means more accurate representation. */ smoothFactor?: number; - + /** * Disabled polyline clipping. */ - noClip?: bool; - + noClip?: boolean; + } export class Polyline extends Path { @@ -1274,34 +1274,34 @@ declare module L { * optionally an options object. */ constructor(latlngs: LatLng[], options?: PolylineOptions); - + /** * Adds a given point to the polyline. */ addLatLng(latlng: LatLng): Polyline; - + /** * Replaces all the points in the polyline with the given array of geographical * points. */ setLatLngs(latlngs: LatLng[]): Polyline; - + /** * Returns an array of the points in the path. */ getLatLngs(): LatLng[]; - + /** * Allows adding, removing or replacing points in the polyline. Syntax is the * same as in Array#splice. Returns the array of removed points (if any). */ spliceLatLngs(index: number, pointsToRemove: number, ...latlngs: LatLng[]): LatLng[]; - + /** * Returns the LatLngBounds of the polyline. */ getBounds(): LatLngBounds; - + } export class MultiPolyline extends FeatureGroup { @@ -1310,7 +1310,7 @@ declare module L { * points (one for each individual polyline) and optionally an options object. */ constructor(latlngs: LatLng[][], options?: PolylineOptions); - + } export class Polygon extends Polyline { @@ -1322,7 +1322,7 @@ declare module L { * the holes inside. */ constructor(latlngs: LatLng[], options?: PolylineOptions); - + } export class MultiPolygon extends FeatureGroup { @@ -1332,7 +1332,7 @@ declare module L { * as for MultiPolyline). */ constructor(latlngs: LatLng[][], options?: PolylineOptions); - + } export class Rectangle extends Polygon { @@ -1341,12 +1341,12 @@ declare module L { * optionally an options object. */ constructor(bounds: LatLngBounds, options?: PathOptions); - + /** * Redraws the rectangle with the passed bounds. */ setBounds(bounds: LatLngBounds): Rectangle; - + } export class Circle extends Path { @@ -1355,27 +1355,27 @@ declare module L { * and optionally an options object. */ constructor(latlng: LatLng, radius: number, options?: PathOptions); - + /** * 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: LatLng): Circle; - + /** * Sets the radius of a circle. Units are in meters. */ setRadius(radius: number): Circle; - + } export class CircleMarker extends Circle { @@ -1385,17 +1385,17 @@ declare module L { * "radius" member in the path options object. */ constructor(latlng: LatLng, options?: PathOptions); - + /** * Sets the position of a circle marker to a new location. */ setLatLng(latlng: LatLng): CircleMarker; - + /** * Sets the radius of a circle marker. Units are in pixels. */ setRadius(radius: number): CircleMarker; - + } export class LayerGroup implements ILayer { @@ -1403,27 +1403,27 @@ declare module L { * Create a layer group, optionally given an initial set of layers. */ constructor(layers?: ILayer[]); - + /** * Adds the group of layers to the map. */ addTo(map: Map): LayerGroup; - + /** * Adds a given layer to the group. */ addLayer(layer: ILayer): LayerGroup; - + /** * Removes a given layer from the group. */ removeLayer(layer: ILayer): LayerGroup; - + /** * Removes all the layers from the group. */ clearLayers(): LayerGroup; - + /** * Iterates over the layers of the group, optionally specifying context of * the iterator function. @@ -1440,13 +1440,13 @@ declare module L { * 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; - + } export class FeatureGroup implements ILayer, IEventPowered { @@ -1454,29 +1454,29 @@ declare module L { * Create a layer group, optionally given an initial set of layers. */ constructor(layers?: ILayer[]); - + /** * 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. */ @@ -1492,13 +1492,13 @@ declare module L { * 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; - + //////////// //// IEventPowered members //////////// @@ -1507,7 +1507,7 @@ declare module L { addEventListener(eventMap: any, context?: any): IEventPowered; removeEventListener(type: string, fn?: (e: LeafletEvent) => void, context?: any): IEventPowered; removeEventListener(eventMap: any, context?: any): IEventPowered; - hasEventListeners(type: string): bool; + hasEventListeners(type: string): boolean; fireEvent(type: string, data?: any): IEventPowered; on(type: string, fn: (e: LeafletEvent) => void, context?: any): IEventPowered; on(eventMap: any, context?: any): IEventPowered; @@ -1522,24 +1522,24 @@ declare module L { * 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) => bool; - + } export class GeoJSON extends FeatureGroup { @@ -1549,12 +1549,12 @@ declare module L { * and an options object. */ constructor(geojson?: any, options?: GeoJSONOptions); - + /** - * Adds a GeoJSON object to the layer. + * Adds a GeoJSON object to the layer. */ - addData(data: any): bool; - + addData(data: any): boolean; + /** * NOTE: A fake signature to allow an overriding overload. */ @@ -1564,33 +1564,33 @@ declare module L { * Changes styles of GeoJSON vector layers with the given style function. */ setStyle(style: (featureData: any) => any): 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; - + /** * Creates a layer from a given GeoJSON feature. */ static 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). */ - static coordsToLatlng(coords: Array, reverse?: bool): LatLng; - + static coordsToLatlng(coords: Array, 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). */ - static coordsToLatlngs(coords: Array, levelsDeep?: number, reverse?: bool): Array; - + static coordsToLatlngs(coords: Array, levelsDeep?: number, reverse?: boolean): Array; + } export class LatLng { @@ -1599,40 +1599,40 @@ declare module L { * and longitude. */ constructor(latitude: number, longitude: number); - + /** * Returns the distance (in meters) to the given LatLng calculated using the * Haversine formula. See description on wikipedia */ distanceTo(otherLatlng: LatLng): number; - + /** * Returns true if the given LatLng point is at the same position (within a small * margin of error). */ - equals(otherLatlng: LatLng): bool; - + equals(otherLatlng: LatLng): 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; - + } export class LatLngBounds { @@ -1641,12 +1641,12 @@ declare module L { * of the rectangle. */ constructor(southWest: LatLng, northEast: LatLng); - + /** * Extends the bounds to contain the given point or bounds. */ extend(latlng: LatLng): LatLngBounds; - + /** * Extends the bounds to contain the given point or bounds. */ @@ -1656,65 +1656,65 @@ declare module L { * 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 center point of the bounds. */ getCenter(): LatLng; - + /** * Returns true if the rectangle contains the given one. */ - contains(otherBounds: LatLngBounds): bool; - + contains(otherBounds: LatLngBounds): boolean; + /** * Returns true if the rectangle contains the given point. */ - contains(latlng: LatLng): bool; - + contains(latlng: LatLng): boolean; + /** * Returns true if the rectangle intersects the given bounds. */ - intersects(otherBounds: LatLngBounds): bool; - + intersects(otherBounds: LatLngBounds): boolean; + /** * Returns true if the rectangle is equivalent (within a small margin of error) * to the given bounds. */ - equals(otherBounds: LatLngBounds): bool; - + equals(otherBounds: LatLngBounds): 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(): bool; - + isValid(): boolean; + } export class Point { @@ -1722,64 +1722,64 @@ declare module L { * Creates a Point object with the given x and y coordinates. If optional round * is set to true, rounds the x and y values. */ - constructor(x: number, y: number, round?: bool); - + constructor(x: number, y: number, round?: boolean); + /** * Returns the result of addition of the current and the given points. */ add(otherPoint: Point): Point; - + /** * Returns the result of subtraction of the given point from the current. */ subtract(otherPoint: Point): Point; - + /** * Returns the result of multiplication of the current point by the given number. */ multiplyBy(number: number): Point; - + /** * Returns the result of division of the current point by the given number. If * optional round is set to true, returns a rounded result. */ - divideBy(number: number, round?: bool): Point; - + divideBy(number: number, round?: boolean): Point; + /** * Returns the distance between the current and the given points. */ distanceTo(otherPoint: Point): number; - + /** * Returns a copy of the current point. */ clone(): Point; - + /** * Returns a copy of the current point with rounded coordinates. */ round(): Point; - + /** * Returns true if the given point has the same coordinates. */ - equals(otherPoint: Point): bool; - + equals(otherPoint: Point): boolean; + /** * Returns a string representation of the point for debugging purposes. */ toString(): string; - + /** * The x coordinate. */ x: number; - + /** * The y coordinate. */ y: number; - + } export class Bounds { @@ -1788,52 +1788,52 @@ declare module L { * corners). */ constructor(topLeft: Point, bottomRight: Point); - + /** * 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): bool; - + contains(otherBounds: Bounds): boolean; + /** * Returns true if the rectangle contains the given point. */ - contains(point: Point): bool; - + contains(point: Point): boolean; + /** * Returns true if the rectangle intersects the given bounds. */ - intersects(otherBounds: Bounds): bool; - + intersects(otherBounds: Bounds): boolean; + /** * Returns true if the bounds are properly initialized. */ - isValid(): bool; - + 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; - + } export interface IconOptions { @@ -1842,18 +1842,18 @@ declare module L { * 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; - + /** * 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 @@ -1861,41 +1861,41 @@ declare module L { * with negative margins. */ iconAnchor?: Point; - + /** * 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; - + /** * The coordinates of the "tip" of the shadow (relative to its top left corner) * (the same as iconAnchor if not specified). */ shadowAnchor?: Point; - + /** * The coordinates of the point from which popups will "open", relative to the * icon anchor. */ popupAnchor?: Point; - + /** * A custom class name to assign to both icon and shadow images. Empty by default. */ className?: string; - + } export class Icon { @@ -1903,7 +1903,7 @@ declare module L { * Creates an icon instance with the given options. */ constructor(options: IconOptions); - + } export interface DivIconOptions { @@ -1911,7 +1911,7 @@ declare module L { * Size of the icon in pixels. Can be also set through CSS. */ iconSize?: Point; - + /** * 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 @@ -1919,17 +1919,17 @@ declare module L { * with negative margins. */ iconAnchor?: Point; - + /** * A custom class name to assign to the icon. 'leaflet-div-icon' by default. */ className?: string; - + /** * A custom HTML code to put inside the div element, empty by default. */ html?: string; - + } export class DivIcon extends Icon{ @@ -1937,7 +1937,7 @@ declare module L { * Creates a div icon instance with the given options. */ constructor(options: DivIconOptions); - + } export interface ControlOptions { @@ -1946,7 +1946,7 @@ declare module L { * positions. */ position: string; - + } export class Control implements IControl { @@ -1954,33 +1954,33 @@ declare module L { * Creates a control with the given options. */ constructor(options?: ControlOptions); - + /** * Sets the position of the control. See control positions. */ setPosition(position: string): Control; - + /** * Returns the current position of the control. */ getPosition(): string; - + /** * Adds the control to the map. */ addTo(map: Map): Control; - + /** * Removes the control from the map. */ removeFrom(map: Map): Control; static Zoom: new () => Zoom; - + static Attribution: new () => Attribution; - + static Layers: new () => Layers; - + static Scale: new () => Scale; //////////// @@ -1993,14 +1993,14 @@ declare module L { * 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; - + } export interface ZoomOptions { @@ -2008,7 +2008,7 @@ declare module L { * The position of the control (one of the map corners). See control positions. */ position?: string; - + } export class Zoom extends Control { @@ -2016,7 +2016,7 @@ declare module L { * Creates a zoom control. */ constructor(options?: ZoomOptions); - + } export interface AttributionOptions { @@ -2024,12 +2024,12 @@ declare module L { * The position of the control (one of the map corners). See control positions. */ position?: string; - + /** * The HTML text shown before the attributions. Pass false to disable. */ prefix?: string; - + } export class Attribution extends Control { @@ -2037,22 +2037,22 @@ declare module L { * Creates an attribution control. */ constructor(options?: AttributionOptions); - + /** * 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 LayersOptions { @@ -2060,19 +2060,19 @@ declare module L { * The position of the control (one of the map corners). See control positions. */ position?: string; - + /** * If true, the control will be collapsed into an icon and expanded on mouse hover * or touch. */ - collapsed?: bool; - + 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. */ - autoZIndex?: bool; - + autoZIndex?: boolean; + } export class Layers extends Control implements IEventPowered { @@ -2081,22 +2081,22 @@ declare module L { * switched with radio buttons, while overlays will be switched with checkboxes. */ constructor(baseLayers?: any, overlays?: any, options?: LayersOptions); - + /** * 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; - + //////////// //// IEventPowered members //////////// @@ -2105,7 +2105,7 @@ declare module L { addEventListener(eventMap: any, context?: any): IEventPowered; removeEventListener(type: string, fn?: (e: LeafletEvent) => void, context?: any): IEventPowered; removeEventListener(eventMap: any, context?: any): IEventPowered; - hasEventListeners(type: string): bool; + hasEventListeners(type: string): boolean; fireEvent(type: string, data?: any): IEventPowered; on(type: string, fn: (e: LeafletEvent) => void, context?: any): IEventPowered; on(eventMap: any, context?: any): IEventPowered; @@ -2119,29 +2119,29 @@ declare module L { * The position of the control (one of the map corners). See control positions. */ position?: string; - + /** * Maximum width of the control in pixels. The width is set dynamically to show * round values (e.g. 100, 200, 500). */ maxWidth?: number; - + /** * Whether to show the metric scale line (m/km). */ - metric?: bool; - + metric?: boolean; + /** * Whether to show the imperial scale line (mi/ft). */ - imperial?: bool; - + imperial?: boolean; + /** * If true, the control is updated on moveend, otherwise it's always up-to-date * (updated on move). */ - updateWhenIdle?: bool; - + updateWhenIdle?: boolean; + } export class Scale extends Control { @@ -2149,7 +2149,7 @@ declare module L { * Creates an scale control with the given options. */ constructor(options?: ScaleOptions); - + } export interface IEventPowered { @@ -2160,34 +2160,34 @@ declare module L { * dblclick'). */ addEventListener(type: string, fn: (e: LeafletEvent) => void, context?: any): IEventPowered; - + /** * Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove} */ addEventListener(eventMap: any, context?: any): IEventPowered; - + /** * 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): IEventPowered; - + /** * Removes a set of type/listener pairs. */ removeEventListener(eventMap: any, context?: any): IEventPowered; - + /** * Returns true if a particular event type has some listeners attached to it. */ - hasEventListeners(type: string): bool; - + 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): IEventPowered; - + /** * Alias to addEventListener. */ @@ -2207,12 +2207,12 @@ declare module L { * Alias to removeEventListener. */ off(eventMap: any, context?: any): IEventPowered; - + /** * Alias to fireEvent. */ fire(type: string, data?: any): IEventPowered; - + } export interface LeafletEvent { @@ -2220,12 +2220,12 @@ declare module L { * The event type (e.g. 'click'). */ type: string; - + /** * The object that fired the event. */ target: any; - + } export interface LeafletMouseEvent { @@ -2233,24 +2233,24 @@ declare module L { * 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; - + } export interface LeafletLocationEvent { @@ -2258,18 +2258,18 @@ declare module L { * 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; - + } export interface LeafletErrorEvent { @@ -2277,12 +2277,12 @@ declare module L { * Error message. */ message: string; - + /** * Error code (if applicable). */ code: number; - + } export interface LeafletLayerEvent { @@ -2290,7 +2290,7 @@ declare module L { * The layer that was added or removed. */ layer: ILayer; - + } export interface LeafletTileEvent { @@ -2298,12 +2298,12 @@ declare module L { * The tile element (image). */ tile: HTMLElement; - + /** * The source URL of the tile. */ url: string; - + } export interface LeafletGeoJSONEvent { @@ -2311,22 +2311,22 @@ declare module L { * 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; - + } export interface LeafletPopupEvent { @@ -2334,7 +2334,7 @@ declare module L { * The popup that was opened or closed. */ popup: Popup; - + } export class Class { @@ -2344,70 +2344,70 @@ declare module L { /** * true for all Internet Explorer versions. */ - static ie: bool; - + static ie: boolean; + /** * true for Internet Explorer 6. */ - static ie6: bool; - + static ie6: boolean; + /** * true for Internet Explorer 6. */ - static ie7: bool; - + static ie7: boolean; + /** * true for webkit-based browsers like Chrome and Safari (including mobile * versions). */ - static webkit: bool; - + static webkit: boolean; + /** * true for webkit-based browsers that support CSS 3D transformations. */ - static webkit3d: bool; - + static webkit3d: boolean; + /** * true for Android mobile browser. */ - static android: bool; - + static android: boolean; + /** * true for old Android stock browsers (2 and 3). */ - static android23: bool; - + static android23: boolean; + /** * true for modern mobile browsers (including iOS Safari and different Android * browsers). */ - static mobile: bool; - + static mobile: boolean; + /** * true for mobile webkit-based browsers. */ - static mobileWebkit: bool; - + static mobileWebkit: boolean; + /** * true for mobile Opera. */ - static mobileOpera: bool; - + static mobileOpera: boolean; + /** * true for all browsers on touch devices. */ - static touch: bool; - + static touch: boolean; + /** * true for browsers with Microsoft touch model (e.g. IE10). */ - static msTouch: bool; - + static msTouch: boolean; + /** * true for devices with Retina screens. */ - static retina: bool; - + static retina: boolean; + } export class Util { @@ -2416,18 +2416,18 @@ declare module L { * and returns the latter. Has an L.extend shortcut. */ static extend(dest: any, ...sources: any[]): any; - + /** * Returns a function which executes function fn with the given scope obj (so * that this keyword refers to obj inside the function code). Has an L.bind shortcut. */ static bind(fn: Function, obj: any): Function; - + /** * Applies a unique key to the object and returns that key. Has an L.stamp shortcut. */ static stamp(obj: any): string; - + /** * Returns a wrapper around the function fn that makes sure it's called not more * often than a certain time interval time, but as fast as possible otherwise @@ -2436,53 +2436,53 @@ declare module L { * be called. */ static limitExecByInterval(fn: Function, time: number, context?: any): Function; - + /** * Returns a function which always returns false. */ static falseFn(): () => bool; - + /** * Returns the number num rounded to digits decimals. */ static formatNum(num: number, digits: number): number; - + /** * Trims and splits the string on whitespace and returns the array of parts. */ static splitWords(str: string): string[]; - + /** * Merges the given properties to the options of the obj object, returning the * resulting options. See Class options. Has an L.setOptions shortcut. */ static setOptions(obj: any, options: any): any; - + /** * Converts an object into a parameter URL string, e.g. {a: "foo", b: "bar"} * translates to '?a=foo&b=bar'. */ static getParamString(obj: any): string; - + /** * Simple templating facility, creates a string by applying the values of the * data object of a form {a: 'foo', b: 'bar', …} to a template string of the form * 'Hello {a}, {b}' — in this example you will get 'Hello foo, bar'. */ static template(str: string, data: any): string; - + /** * Returns true if the given object is an array. */ - static isArray(obj: any): bool; - + static isArray(obj: any): boolean; + /** * Data URI string containing a base64-encoded empty GIF image. Used as a hack * to free memory from unused images on WebKit-powered mobile devices (by setting * image src to this string). */ static emptyImageUrl: string; - + } export class Transformation { @@ -2490,19 +2490,19 @@ declare module L { * Creates a transformation object with the given coefficients. */ constructor(a: number, b: number, c: number, d: number); - + /** * Returns a transformed point, optionally multiplied by the given scale. * Only accepts real L.Point instances, not arrays. */ transform(point: Point, scale?: number): Point; - + /** * Returns the reverse transformation of the given point, optionally divided * by the given scale. Only accepts real L.Point instances, not arrays. */ untransform(point: Point, scale?: number): Point; - + } export class LineUtil { @@ -2515,24 +2515,24 @@ declare module L { * released as a separated micro-library Simplify.js. */ static simplify(points: Point[], tolerance: number): Point[]; - + /** * Returns the distance between point p and segment p1 to p2. */ static pointToSegmentDistance(p: Point, p1: Point, p2: Point): number; - + /** * Returns the closest point from a point p on a segment p1 to p2. */ static closestPointOnSegment(p: Point, p1: Point, p2: Point): number; - + /** * Clips the segment a to b by rectangular bounds (modifying the segment points * directly!). Used by Leaflet to only show polyline points that are on the screen * or near, increasing performance. */ static clipSegment(a: Point, b: Point, bounds: Bounds): void; - + } export class PolyUtil { @@ -2543,7 +2543,7 @@ declare module L { * for clipping than polyline, so there's a seperate method for it. */ static clipPolygon(points: Point[], bounds: Bounds): Point[]; - + } export class DomEvent { @@ -2552,12 +2552,12 @@ declare module L { * inside the listener will point to context, or to the element if not specified. */ static addListener(el: HTMLElement, type: string, fn: (e: Event) => void, context?: any): DomEvent; - + /** * Removes an event listener from the element. */ static removeListener(el: HTMLElement, type: string, fn: (e: Event) => void): DomEvent; - + /** * Stop the given event from propagation to parent elements. Used inside the * listener functions: @@ -2567,36 +2567,36 @@ declare module L { * }); */ static 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. */ static preventDefault(e: Event): DomEvent; - + /** * Does stopPropagation and preventDefault at the same time. */ static stop(e: Event): DomEvent; - + /** * Adds stopPropagation to the element's 'click', 'doubleclick', 'mousedown' * and 'touchstart' events. */ static disableClickPropagation(el: HTMLElement): DomEvent; - + /** * Gets normalized mouse position from a DOM event relative to the container * or to the whole page if not specified. */ static getMousePosition(e: Event, container?: HTMLElement): Point; - + /** * Gets normalized wheel delta from a mousewheel DOM event. */ static getWheelDelta(e: Event): number; - + } export class DomUtil { @@ -2605,97 +2605,97 @@ declare module L { * the element if it was passed directly. */ static get(id: string): HTMLElement; - + /** * Returns the value for a certain style attribute on an element, including * computed values or values set through CSS. */ static getStyle(el: HTMLElement, style: string): string; - + /** * Returns the offset to the viewport for the requested element. */ static getViewportOffset(el: HTMLElement): Point; - + /** * Creates an element with tagName, sets the className, and optionally appends * it to container element. */ static create(tagName: string, className: string, container?: HTMLElement): HTMLElement; - + /** * Makes sure text cannot be selected, for example during dragging. */ static disableTextSelection(): void; - + /** * Makes text selection possible again. */ static enableTextSelection(): void; - + /** * Returns true if the element class attribute contains name. */ - static hasClass(el: HTMLElement, name: string): bool; - + static hasClass(el: HTMLElement, name: string): boolean; + /** * Adds name to the element's class attribute. */ static addClass(el: HTMLElement, name: string): void; - + /** * Removes name from the element's class attribute. */ static removeClass(el: HTMLElement, name: string): void; - + /** * Set the opacity of an element (including old IE support). Value must be from * 0 to 1. */ static 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. */ static testProp(props: String[]): string; - + /** * 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. */ static getTranslateString(point: Point): string; - + /** * Returns a CSS transform string to scale an element (with the given scale origin). */ static 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. */ - static setPosition(el: HTMLElement, point: Point, disable3D?: bool): void; - + static setPosition(el: HTMLElement, point: Point, disable3D?: boolean): void; + /** * Returns the coordinates of an element previously positioned with setPosition. */ static getPosition(el: HTMLElement): Point; - + /** * Vendor-prefixed transition style name (e.g. 'webkitTransition' for WebKit). */ static TRANSITION: string; - + /** * Vendor-prefixed transform style name. */ static TRANSFORM: string; - + } export class PosAnimation implements IEventPowered { @@ -2703,14 +2703,14 @@ declare module L { * Creates a PosAnimation object. */ constructor(); - + /** * Run an animation of a given element to a new position, optionally setting * duration in seconds (0.25 by default) and easing linearity factor (3rd argument * of the cubic bezier curve, 0.5 by default) */ run(element: HTMLElement, newPos: Point, duration?: number, easeLinearity?: number): PosAnimation; - + //////////// //// IEventPowered members //////////// @@ -2719,7 +2719,7 @@ declare module L { addEventListener(eventMap: any, context?: any): IEventPowered; removeEventListener(type: string, fn?: (e: LeafletEvent) => void, context?: any): IEventPowered; removeEventListener(eventMap: any, context?: any): IEventPowered; - hasEventListeners(type: string): bool; + hasEventListeners(type: string): boolean; fireEvent(type: string, data?: any): IEventPowered; on(type: string, fn: (e: LeafletEvent) => void, context?: any): IEventPowered; on(eventMap: any, context?: any): IEventPowered; @@ -2734,17 +2734,17 @@ declare module L { * the dragHandle element (equals the element itself by default). */ constructor(element: HTMLElement, dragHandle?: HTMLElement); - + /** * Enables the dragging ability. */ enable(): void; - + /** * Disables the dragging ability. */ disable(): void; - + //////////// //// IEventPowered members //////////// @@ -2753,7 +2753,7 @@ declare module L { addEventListener(eventMap: any, context?: any): IEventPowered; removeEventListener(type: string, fn?: (e: LeafletEvent) => void, context?: any): IEventPowered; removeEventListener(eventMap: any, context?: any): IEventPowered; - hasEventListeners(type: string): bool; + hasEventListeners(type: string): boolean; fireEvent(type: string, data?: any): IEventPowered; on(type: string, fn: (e: LeafletEvent) => void, context?: any): IEventPowered; on(eventMap: any, context?: any): IEventPowered; @@ -2767,17 +2767,17 @@ declare module L { * Enables the handler. */ enable(): void; - + /** * Disables the handler. */ disable(): void; - + /** * Returns true if the handler is enabled. */ - enabled(): bool; - + enabled(): boolean; + } export interface ILayer { @@ -2787,13 +2787,13 @@ declare module L { * 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; - + } export interface IControl { @@ -2803,14 +2803,14 @@ declare module L { * 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; - + } export class Projection { @@ -2820,14 +2820,14 @@ declare module L { * is a sphere. Used by the EPSG:3857 CRS. */ static SphericalMercator: IProjection; - + /** * Elliptical Mercator projection — more complex than Spherical Mercator. * Takes into account that Earth is a geoid, not a perfect sphere. Used by the * EPSG:3395 CRS. */ static Mercator: IProjection; - + /** * Equirectangular, or Plate Carree projection — the most simple projection, * mostly used by GIS enthusiasts. Directly maps x as longitude, and y as latitude. @@ -2835,7 +2835,7 @@ declare module L { * CRS. */ static LonLat: IProjection; - + } export interface IProjection { @@ -2843,12 +2843,12 @@ declare module L { * 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; - + } export class CRS { @@ -2858,25 +2858,25 @@ declare module L { * Map's crs option. */ static EPSG3857: ICRS; - + /** * A common CRS among GIS enthusiasts. Uses simple Equirectangular projection. */ static EPSG4326: ICRS; - + /** * Rarely used by some commercial tile providers. Uses Elliptical Mercator * projection. */ static 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). */ static Simple: ICRS; - + } export interface ICRS { @@ -2884,50 +2884,50 @@ declare module L { * 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; - + } /** - * This method restores the L global variale to the original value it had + * This method restores the L global variale to the original value it had * before Leaflet inclusion, and returns the real Leaflet namespace. */ export var noConflict: () => L; - + /** * A constant that represents the Leaflet version in use. */ @@ -2935,19 +2935,19 @@ declare module L { } /** - * Forces Leaflet to use the Canvas back-end (if available) for vector layers - * instead of SVG. This can increase performance considerably in some cases + * Forces Leaflet to use the Canvas back-end (if available) for vector layers + * instead of SVG. This can increase performance considerably in some cases * (e.g. many thousands of circle markers on the map). */ -declare var L_PREFER_CANVAS: bool; +declare var L_PREFER_CANVAS: boolean; /** * Forces Leaflet to not use touch events even if it detects them. */ -declare var L_NO_TOUCH: bool; +declare var L_NO_TOUCH: boolean; /** - * Forces Leaflet to not use hardware-accelerated CSS 3D transforms for positioning + * Forces Leaflet to not use hardware-accelerated CSS 3D transforms for positioning * (which may cause glitches in some rare environments) even if they're supported. */ -declare var L_DISABLE_3D: bool; +declare var L_DISABLE_3D: boolean; diff --git a/mousetrap/mousetrap.d.ts b/mousetrap/mousetrap.d.ts index 814efb3ddf..d2ae42aa6d 100644 --- a/mousetrap/mousetrap.d.ts +++ b/mousetrap/mousetrap.d.ts @@ -4,11 +4,11 @@ // Definitions: https://github.com/borisyankov/DefinitelyTyped interface ExtendedKeyboardEvent extends KeyboardEvent { - returnValue: bool; // IE returnValue + returnValue: boolean; // IE returnValue } interface MousetrapStatic { - stopCallback: (e: ExtendedKeyboardEvent, element: Element, combo: string) => bool; + stopCallback: (e: ExtendedKeyboardEvent, element: Element, combo: string) => boolean; bind(keys: string, callback: (e: ExtendedKeyboardEvent, combo: string) => any, action?: string): void; bind(keyArray: string[], callback: (e: ExtendedKeyboardEvent, combo: string) => any, action?: string): void; diff --git a/rx.js/rx.js.aggregates.d.ts b/rx.js/rx.js.aggregates.d.ts index 92ab499894..16426a96e4 100644 --- a/rx.js/rx.js.aggregates.d.ts +++ b/rx.js/rx.js.aggregates.d.ts @@ -1,16 +1,19 @@ +/// + // Type definitions for RxJS "Aggregates" // Project: http://rx.codeplex.com/ // Definitions by: Carl de Billy // Definitions: https://github.com/borisyankov/DefinitelyTyped -/// - declare module Rx { - export module Observable { - function all(predicate?: (any) => bool): IObservable; - function min(predicate?: (any) => bool): IObservable; - function max(predicate?: (any) => bool): IObservable; - function count(predicate?: (any) => bool): IObservable; - function sum(keySelector?: (any) => any): IObservable; + interface IObservable { + all(predicate?: (value: T) => bool): IObservable; + min(comparer?: (value1: T, value2: T) => number): IObservable; + max(comparer?: (value1: T, value2: T) => number): IObservable; + count(predicate?: (item: T) => bool): IObservable; + sum(keySelector?: (item: T) => number): IObservable; + isEmpty(predicate?: (value: T) => bool): IObservable; + contains(value: T, comparer?: (value1: T, value2: T) => bool): IObservable; + average(keySelector?: (item: T) => number): IObservable; } } \ No newline at end of file diff --git a/rx.js/rx.js.d.ts b/rx.js/rx.js.d.ts index 481603a7c7..1cce070dcb 100644 --- a/rx.js/rx.js.d.ts +++ b/rx.js/rx.js.d.ts @@ -5,462 +5,458 @@ declare module Rx { - export module Internals { - function inherits(child: Function, parent: Function): Function; - function addProperties(obj: Object, ...sourcces: Object[]): void; - function addRef(xs: IObservable, r: { getDisposable(): _IDisposable; }): IObservable; - } + export module Internals { + function inherits(child: Function, parent: Function): Function; + function addProperties(obj: Object, ...sourcces: Object[]): void; + function addRef(xs: IObservable, r: { getDisposable(): _IDisposable; }): IObservable; + } - //Collections - interface IIndexedItem { - id: number; - value: IScheduledItem; + //Collections + interface IIndexedItem { + id: number; + value: IScheduledItem; - compareTo(other: IIndexedItem): number; - } + compareTo(other: IIndexedItem): number; + } - // Priority Queue for Scheduling - interface IPriorityQueue { - items: IIndexedItem[]; - length: number; + // Priority Queue for Scheduling + interface IPriorityQueue { + items: IIndexedItem[]; + length: number; - isHigherPriority(left: number, right: number): bool; - percolate(index: number): void; - heapify(index: number): void; - peek(): IIndexedItem; - removeAt(index: number): void; - dequeue(): IIndexedItem; - enqueue(item: IIndexedItem): void; - remove(item: IIndexedItem): bool; - } + isHigherPriority(left: number, right: number): bool; + percolate(index: number): void; + heapify(index: number): void; + peek(): IIndexedItem; + removeAt(index: number): void; + dequeue(): IIndexedItem; + enqueue(item: IIndexedItem): void; + remove(item: IIndexedItem): bool; + } - interface _IDisposable { - dispose(): void; - } + interface _IDisposable { + dispose(): void; + } - interface ICompositeDisposable { - disposables: _IDisposable[]; - isDisposed: bool; - length: number; + export class CompositeDisposable { + constructor (...disposables: _IDisposable[]); - dispose(): void; - add(item: _IDisposable): void; - remove(item: _IDisposable): bool; - clear(): void; - contains(item: _IDisposable): bool; - toArray(): _IDisposable[]; - } - export interface CompositeDisposable { - (...disposables: _IDisposable[]): ICompositeDisposable; - } + disposables: _IDisposable[]; + isDisposed: bool; + length: number; - // Main disposable class - interface IDisposable { - isDisposed: bool; - action: () =>void; + dispose(): void; + add(item: _IDisposable): void; + remove(item: _IDisposable): bool; + clear(): void; + contains(item: _IDisposable): bool; + toArray(): _IDisposable[]; + } - dispose(): void; - } - export interface Disposable { - (action: () =>void ): IDisposable; + // Main disposable class + interface IDisposable { + isDisposed: bool; + action: () =>void; - create(action: () =>void ): _IDisposable; - empty: _IDisposable; - } + dispose(): void; + } + export interface Disposable { + (action: () =>void ): IDisposable; - // Single assignment - interface ISingleAssignmentDisposable { - isDisposed: bool; - current: _IDisposable; + create(action: () =>void ): _IDisposable; + empty: _IDisposable; + } - dispose(): void; - disposable(value?: _IDisposable): _IDisposable; - getDisposable(): _IDisposable; - setDisposable(value: _IDisposable): void; - } - export interface SingleAssignmentDisposable { - (): ISingleAssignmentDisposable; - } + // Single assignment + interface ISingleAssignmentDisposable { + isDisposed: bool; + current: _IDisposable; - // Multiple assignment disposable - interface ISerialDisposable { - isDisposed: bool; - current: _IDisposable; + dispose(): void; + disposable(value?: _IDisposable): _IDisposable; + getDisposable(): _IDisposable; + setDisposable(value: _IDisposable): void; + } + export interface SingleAssignmentDisposable { + (): ISingleAssignmentDisposable; + } - dispose(): void; - getDisposable(): _IDisposable; - setDisposable(value: _IDisposable): void; - disposable(value?: _IDisposable): _IDisposable; - } - export interface SerialDisposable { - (): ISerialDisposable; - } + // Multiple assignment disposable + export class SerialDisposable { + isDisposed: bool; + current: _IDisposable; - interface IRefCountDisposable { - underlyingDisposable: _IDisposable; - isDisposed: bool; - isPrimaryDisposed: bool; - count: number; + dispose(): void; + getDisposable(): _IDisposable; + setDisposable(value: _IDisposable): void; + disposable(value?: _IDisposable): _IDisposable; + } - dispose(): void; - getDisposable(): _IDisposable; - } - export interface RefCountDisposable { - (disposable: _IDisposable): IRefCountDisposable; - } + export class RefCountDisposable { + constructor(disposable: _IDisposable); - interface IScheduledItem { - scheduler: IScheduler; - state: any; - action: (scheduler: IScheduler, state) => _IDisposable; - dueTime: number; - comparer: (x: number, y: number) =>number; - disposable: ISingleAssignmentDisposable; + underlyingDisposable: _IDisposable; + isDisposed: bool; + isPrimaryDisposed: bool; + count: number; - invoke(): void; - compareTo(other: IScheduledItem): number; - isCancelled(): bool; - invokeCore(): _IDisposable; - } + dispose(): void; + getDisposable(): _IDisposable; + } - interface IScheduler { - _schedule: (state: any, action: (scheduler: IScheduler, state: any) =>_IDisposable) => _IDisposable; - _scheduleRelative: (state: any, dueTime: number, action: (scheduler: IScheduler, state: any) =>_IDisposable) =>_IDisposable; - _scheduleAbsolute: (state: any, dueTime: number, action: (scheduler: IScheduler, state: any) =>_IDisposable) =>_IDisposable; + interface IScheduledItem { + scheduler: IScheduler; + state: any; + action: (scheduler: IScheduler, state) => _IDisposable; + dueTime: number; + comparer: (x: number, y: number) =>number; + disposable: ISingleAssignmentDisposable; - now(): number; - scheduleWithState(state: any, action: (scheduler: IScheduler, state: any) =>_IDisposable): _IDisposable; - scheduleWithAbsoluteAndState(state: any, dueTime: number, action: (scheduler: IScheduler, state: any) =>_IDisposable): _IDisposable; - scheduleWithRelativeAndState(state: any, dueTime: number, action: (scheduler: IScheduler, state: any) =>_IDisposable): _IDisposable; + invoke(): void; + compareTo(other: IScheduledItem): number; + isCancelled(): bool; + invokeCore(): _IDisposable; + } - catchException(handler: (exception: any) =>bool): ICatchScheduler; - schedulePeriodic(period: number, action: () =>void ): _IDisposable; - schedulePeriodicWithState(state: any, period: number, action: (state: any) =>any): _IDisposable;//returns {Disposable|SingleAssignmentDisposable} - schedule(action: () =>void ): _IDisposable; - scheduleWithRelative(dueTime: number, action: () =>void ): _IDisposable; - scheduleWithAbsolute(dueTime: number, action: () =>void ): _IDisposable; - scheduleRecursive(action: (action: () =>void ) =>void ): _IDisposable; - scheduleRecursiveWithState(state: any, action: (state: any, action: (state: any) =>void ) =>void ): _IDisposable; - scheduleRecursiveWithRelative(dueTime: number, action: (action: (dueTime: number) =>void ) =>void ): _IDisposable; - scheduleRecursiveWithRelativeAndState(state: any, dueTime: number, action: (state: any, action: (state: any, dueTime: number) =>void ) =>void ): _IDisposable; - scheduleRecursiveWithAbsolute(dueTime: number, action: (action: (dueTime: number) =>void ) =>void ): _IDisposable; - scheduleRecursiveWithAbsoluteAndState(state: any, dueTime: number, action: (state: any, action: (state: any, dueTime: number) =>void ) =>void ): _IDisposable; - } - export interface Scheduler { - (now: () =>number, - schedule: (state: any, action: (scheduler: IScheduler, state: any) =>_IDisposable) => _IDisposable, - scheduleRelative: (state: any, dueTime: number, action: (scheduler: IScheduler, state: any) =>_IDisposable) =>_IDisposable, - scheduleAbsolute: (state: any, dueTime: number, action: (scheduler: IScheduler, state: any) =>_IDisposable) =>_IDisposable - ): IScheduler; + interface IScheduler { + _schedule: (state: any, action: (scheduler: IScheduler, state: any) =>_IDisposable) => _IDisposable; + _scheduleRelative: (state: any, dueTime: number, action: (scheduler: IScheduler, state: any) =>_IDisposable) =>_IDisposable; + _scheduleAbsolute: (state: any, dueTime: number, action: (scheduler: IScheduler, state: any) =>_IDisposable) =>_IDisposable; - now(): number; - normalize(timeSpan: number): number; + now(): number; + scheduleWithState(state: any, action: (scheduler: IScheduler, state: any) =>_IDisposable): _IDisposable; + scheduleWithAbsoluteAndState(state: any, dueTime: number, action: (scheduler: IScheduler, state: any) =>_IDisposable): _IDisposable; + scheduleWithRelativeAndState(state: any, dueTime: number, action: (scheduler: IScheduler, state: any) =>_IDisposable): _IDisposable; - immediate: IScheduler; - currentThread: ICurrentScheduler;//IScheduler; - timeout: IScheduler; - } + catchException(handler: (exception: any) =>bool): ICatchScheduler; + schedulePeriodic(period: number, action: () =>void ): _IDisposable; + schedulePeriodicWithState(state: any, period: number, action: (state: any) =>any): _IDisposable;//returns {Disposable|SingleAssignmentDisposable} + schedule(action: () =>void ): _IDisposable; + scheduleWithRelative(dueTime: number, action: () =>void ): _IDisposable; + scheduleWithAbsolute(dueTime: number, action: () =>void ): _IDisposable; + scheduleRecursive(action: (action: () =>void ) =>void ): _IDisposable; + scheduleRecursiveWithState(state: any, action: (state: any, action: (state: any) =>void ) =>void ): _IDisposable; + scheduleRecursiveWithRelative(dueTime: number, action: (action: (dueTime: number) =>void ) =>void ): _IDisposable; + scheduleRecursiveWithRelativeAndState(state: any, dueTime: number, action: (state: any, action: (state: any, dueTime: number) =>void ) =>void ): _IDisposable; + scheduleRecursiveWithAbsolute(dueTime: number, action: (action: (dueTime: number) =>void ) =>void ): _IDisposable; + scheduleRecursiveWithAbsoluteAndState(state: any, dueTime: number, action: (state: any, action: (state: any, dueTime: number) =>void ) =>void ): _IDisposable; + } + export interface Scheduler { + (now: () =>number, + schedule: (state: any, action: (scheduler: IScheduler, state: any) =>_IDisposable) => _IDisposable, + scheduleRelative: (state: any, dueTime: number, action: (scheduler: IScheduler, state: any) =>_IDisposable) =>_IDisposable, + scheduleAbsolute: (state: any, dueTime: number, action: (scheduler: IScheduler, state: any) =>_IDisposable) =>_IDisposable + ): IScheduler; - // Current Thread IScheduler - interface ICurrentScheduler extends IScheduler { - scheduleRequired(): bool; - ensureTrampoline(action: () =>_IDisposable): _IDisposable; - } + now(): number; + normalize(timeSpan: number): number; - // Virtual IScheduler - interface IVirtualTimeScheduler extends IScheduler { - toRelative(duetime): number; - toDateTimeOffset(duetime: number): number; + immediate: IScheduler; + currentThread: ICurrentScheduler;//IScheduler; + timeout: IScheduler; + } - clock: number; - comparer: (x: number, y: number) =>number; - isEnabled: bool; - queue: IPriorityQueue; - scheduleRelativeWithState(state: any, dueTime: number, action: (scheduler: IScheduler, state: any) =>_IDisposable): _IDisposable; - scheduleRelative(dueTime: number, action: () =>void ): _IDisposable; - start(): _IDisposable; - stop(): void; - advanceTo(time: number); - advanceBy(time: number); - sleep(time: number); - getNext(): IScheduledItem; - scheduleAbsolute(dueTime: number, action: () =>void ); - scheduleAbsoluteWithState(state: any, dueTime: number, action: (scheduler: IScheduler, state: any) =>_IDisposable): _IDisposable; - } - //export module VirtualTimeScheduler { - // //absract - // function new (initialClock: number, comparer: (x: number, y: number) =>number): IVirtualTimeScheduler; - //} + // Current Thread IScheduler + interface ICurrentScheduler extends IScheduler { + scheduleRequired(): bool; + ensureTrampoline(action: () =>_IDisposable): _IDisposable; + } + + // Virtual IScheduler + interface IVirtualTimeScheduler extends IScheduler { + toRelative(duetime): number; + toDateTimeOffset(duetime: number): number; + + clock: number; + comparer: (x: number, y: number) =>number; + isEnabled: bool; + queue: IPriorityQueue; + scheduleRelativeWithState(state: any, dueTime: number, action: (scheduler: IScheduler, state: any) =>_IDisposable): _IDisposable; + scheduleRelative(dueTime: number, action: () =>void ): _IDisposable; + start(): _IDisposable; + stop(): void; + advanceTo(time: number); + advanceBy(time: number); + sleep(time: number); + getNext(): IScheduledItem; + scheduleAbsolute(dueTime: number, action: () =>void ); + scheduleAbsoluteWithState(state: any, dueTime: number, action: (scheduler: IScheduler, state: any) =>_IDisposable): _IDisposable; + } + //export module VirtualTimeScheduler { + // //absract + // function new (initialClock: number, comparer: (x: number, y: number) =>number): IVirtualTimeScheduler; + //} - // CatchScheduler - interface ICatchScheduler extends IScheduler { } + // CatchScheduler + interface ICatchScheduler extends IScheduler { } - // Notifications - interface INotification { - accept(observer: IObserver): void; - accept(onNext: (value: any) =>void , onError?: (exception: any) =>void , onCompleted?: () =>void ): void; - toObservable(scheduler?: IScheduler): IObservable; - hasValue: bool; - equals(other: INotification): bool; - kind: string; - value?: any; - exception?: any; - } - export interface Notification { - //abstract - //function new (): INotification; + // Notifications + interface INotification { + accept(observer: IObserver): void; + accept(onNext: (value: T) =>void , onError?: (exception: any) =>void , onCompleted?: () =>void ): void; + toObservable(scheduler?: IScheduler): IObservable; + hasValue: bool; + equals(other: INotification): bool; + kind: string; + value?: T; + exception?: any; + } + export interface Notification { + //abstract + //function new (): INotification; - createOnNext(value: any): INotification;//ON - createOnError(exception): INotification;//OE - createOnCompleted(): INotification;//OC - } + createOnNext(value: T): INotification;//ON + createOnError(exception): INotification;//OE + createOnCompleted(): INotification;//OC + } - export module Internals { - // Enumerator - interface IEnumerator { - moveNext(): bool; - getCurrent(): any; - dispose(): void; - } - export interface Enumerator { - (moveNext: () =>bool, getCurrent: () => any, dispose: () =>void ): IEnumerator; + var Notification: Notification; - create(moveNext: () =>bool, getCurrent: () =>any, dispose?: () =>void ): IEnumerator; - } + export module Internals { + // Enumerator + interface IEnumerator { + moveNext(): bool; + getCurrent(): T; + dispose(): void; + } + export interface Enumerator { + (moveNext: () =>bool, getCurrent: () => T, dispose: () =>void ): IEnumerator; - // Enumerable - interface IEnumerable { - getEnumerator(): IEnumerator; + create(moveNext: () =>bool, getCurrent: () => T, dispose?: () =>void ): IEnumerator; + } - concat(): IObservable; - catchException(): IObservable; - } - export interface Enumerable { - (getEnumerator: () =>IEnumerator): IEnumerable; + // Enumerable + interface IEnumerable { + getEnumerator(): IEnumerator; - repeat(value: any, repeatCount?: number): IEnumerable; - forEach(source: any[], selector?: (element: any, index: number) =>any): IEnumerable; - forEach(source: { length: number;[index: number]: any; }, selector?: (element: any, index: number) =>any): IEnumerable; - } - } + concat(): IObservable; + catchException(): IObservable; + } + export interface Enumerable { + (getEnumerator: () =>IEnumerator): IEnumerable; - // Observer - interface IObserver { - onNext(value: any): void; - onError(exception: any): void; - onCompleted(): void; + repeat(value: T, repeatCount?: number): IEnumerable; + forEach(source: T[], selector?: (element: T, index: number) => T2): IEnumerable; + forEach(source: { length: number; [index: number]: T; }, selector?: (element: T, index: number) => T2): IEnumerable; + } + } - toNotifier(): (notification: INotification) =>void; - asObserver(): IObserver; - checked(): ICheckedObserver; - } - export module Observer { - //abstract - //function new (): IObserver; + // Observer + interface IObserver { + onNext(value: T): void; + onError(exception: any): void; + onCompleted(): void; - function create(onNext: (value: any) =>void , onError?: (exception: any) =>void , onCompleted?: () =>void ): IObserver; - function fromNotifier(handler: (notification: INotification) =>void ): IObserver; - } + toNotifier(): (notification: INotification) =>void; + asObserver(): IObserver; + checked(): ICheckedObserver; + } + export module Observer { + //abstract + //function new (): IObserver; - export module Internals { - // Abstract Observer - interface IAbstractObserver extends IObserver { - isStopped: bool; + function create(onNext: (value: T) =>void , onError?: (exception: any) =>void , onCompleted?: () =>void ): IObserver; + function fromNotifier(handler: (notification: INotification) =>void ): IObserver; + } - dispose(): void; - next(value: any): void; - error(exception: any): void; - completed(): void; - fail(): bool; - } - //export module AbstractObserver { - // //abstract - // function new (): IAbstractObserver; - //} - } + export module Internals { + // Abstract Observer + interface IAbstractObserver extends IObserver { + isStopped: bool; - interface IAnonymousObserver extends Internals.IAbstractObserver { - _onNext: (value: any) =>void; - _onError: (exception: any) =>void; - _onCompleted: () =>void; - } - export interface AnonymousObserver { - (onNext: (value: any) =>void , onError: (exception: any) =>void , onCompleted: () =>void ): IAnonymousObserver; - } + dispose(): void; + next(value: T): void; + error(exception: any): void; + completed(): void; + fail(): bool; + } + //export module AbstractObserver { + // //abstract + // function new (): IAbstractObserver; + //} + } - interface ICheckedObserver extends IObserver { - _observer: IObserver; - _state: number; // 0 - idle, 1 - busy, 2 - done - checkAccess(): void; - } + export class AnonymousObserver { + constructor(onNext: (value: T) => void , onError: (exception: any) => void , onCompleted: () => void); + } - export module Internals { - interface IScheduledObserver extends IAbstractObserver { - scheduler: IScheduler; - observer: IObserver; - isAcquired: bool; - hasFaulted: bool; - //queue: { (value: any): void; (exception: any): void; (): void; }[]; - disposable: ISerialDisposable; + interface ICheckedObserver extends IObserver { + _observer: IObserver; + _state: number; // 0 - idle, 1 - busy, 2 - done + checkAccess(): void; + } - ensureActive(): void; - } - export interface ScheduledObserver { - (scheduler: IScheduler, observer: IObserver): IScheduledObserver; - } - } + export module Internals { + interface IScheduledObserver extends IAbstractObserver { + scheduler: IScheduler; + observer: IObserver; + isAcquired: bool; + hasFaulted: bool; + //queue: { (value: any): void; (exception: any): void; (): void; }[]; + disposable: SerialDisposable; + ensureActive(): void; + } + export interface ScheduledObserver { + (scheduler: IScheduler, observer: IObserver): IScheduledObserver; + } + } - interface IObservable { - _subscribe: (observer: IObserver) =>_IDisposable; + interface IObservable { + _subscribe: (observer: IObserver) =>_IDisposable; - subscribe(observer: IObserver): _IDisposable; + subscribe(observer: IObserver): _IDisposable; - finalValue(): IObservable; - subscribe(onNext?: (value: any) =>void , onError?: (exception: any) =>void , onCompleted?: () =>void ): _IDisposable; - toArray(): IObservable; + finalValue(): IObservable; + subscribe(onNext?: (value: T) =>void , onError?: (exception: any) =>void , onCompleted?: () =>void ): _IDisposable; + toArray(): IObservable; - observeOn(scheduler: IScheduler): IObservable; - subscribeOn(scheduler: IScheduler): IObservable; - amb(rightSource: IObservable): IObservable; - catchException(handler: (exception: any) =>IObservable): IObservable; - catchException(second: IObservable): IObservable; - combineLatest(second: IObservable, resultSelector: (v1: any, v2: any) =>any): IObservable; - combineLatest(second: IObservable, third: IObservable, resultSelector: (v1: any, v2: any, v3: any) =>any): IObservable; - combineLatest(second: IObservable, third: IObservable, fourth: IObservable, resultSelector: (v1: any, v2: any, v3: any, v4: any) =>any): IObservable; - combineLatest(second: IObservable, third: IObservable, fourth: IObservable, fifth, IObservable, resultSelector: (v1: any, v2: any, v3: any, v4: any, v5: any) =>any): IObservable; - combineLatest(...soucesAndResultSelector: any[]): IObservable; - concat(...sources: IObservable[]): IObservable; - concat(sources: IObservable[]): IObservable; - concatIObservable(): IObservable; - merge(maxConcurrent: number): IObservable; - merge(other: IObservable): IObservable; - mergeIObservable(): IObservable; - onErrorResumeNext(second: IObservable): IObservable; - skipUntil(other: IObservable): IObservable; - switchLatest(): IObservable; - takeUntil(other: IObservable): IObservable; - zip(second: IObservable, resultSelector: (v1: any, v2: any) =>any): IObservable; - zip(second: IObservable, third: IObservable, resultSelector: (v1: any, v2: any, v3: any) =>any): IObservable; - zip(second: IObservable, third: IObservable, fourth: IObservable, resultSelector: (v1: any, v2: any, v3: any, v4: any) =>any): IObservable; - zip(second: IObservable, third: IObservable, fourth: IObservable, fifth, IObservable, resultSelector: (v1: any, v2: any, v3: any, v4: any, v5: any) =>any): IObservable; - zip(...soucesAndResultSelector: any[]): IObservable; - zip(second: any[], resultSelector: (left: any, right: any) =>any): IObservable; - asIObservable(): IObservable; - bufferWithCount(count: number, skip?: number): IObservable; - dematerialize(): IObservable; - distinctUntilChanged(keySelector?: (value: any) =>any, comparer?: (x: any, y: any) =>bool): IObservable; - doAction(observer: IObserver): IObservable; - doAction(onNext: (value: any) => void , onError?: (exception: any) =>void , onCompleted?: () =>void ): IObservable; - finallyAction(action: () =>void ): IObservable; - ignoreElements(): IObservable; - materialize(): IObservable; - repeat(repeatCount?: number): IObservable; - retry(retryCount?: number): IObservable; - scan(seed: any, accumulator: (acc: any, value: any) =>any): IObservable; - scan(accumulator: (acc: any, value: any) =>any): IObservable; - skipLast(count: number): IObservable; - startWith(...values: any[]): IObservable; - startWith(scheduler: IScheduler, ...values: any[]): IObservable; - takeLast(count: number, scheduler?: IScheduler): IObservable; - takeLastBuffer(count: number): IObservable; - windowWithCount(count: number, skip?: number): IObservable; - defaultIfEmpty(defaultValue?: any): IObservable; - distinct(keySelector?: (value: any) =>any, keySerializer?: (key: any) =>string): IObservable; - groupBy(keySelector: (value: any) =>any, elementSelector?: (value: any) =>any, keySerializer?: (key: any) =>string): IGroupedObservable; - groupByUntil(keySelector: (value: any) =>any, elementSelector: (value: any) =>any, durationSelector: (gloup: IGroupedObservable) =>IObservable, keySerializer?: (key: any) =>string): IGroupedObservable; - select(selector: (value: any, index: number) =>any): IObservable; - selectMany(selector: (value: any) =>IObservable, resultSelector?: (x: any, y: any) =>any): IObservable; - selectMany(other: IObservable): IObservable; - skip(count: number): IObservable; - skipWhile(predicate: (value: any, index?: number) =>bool): IObservable; - take(count: number, scheduler?: IScheduler): IObservable; - takeWhile(predicate: (value: any, index?: number) =>bool): IObservable; - where(predicate: (value: any, index?: number) => bool): IObservable; + observeOn(scheduler: IScheduler): IObservable; + subscribeOn(scheduler: IScheduler): IObservable; + amb(rightSource: IObservable): IObservable; + catchException(handler: (exception: any) =>IObservable): IObservable; + catchException(second: IObservable): IObservable; + combineLatest(second: IObservable, resultSelector: (v1: T, v2: T2) =>TResult): IObservable; + combineLatest(second: IObservable, third: IObservable, resultSelector: (v1: T, v2: T2, v3: T3) =>TResult): IObservable; + combineLatest(second: IObservable, third: IObservable, fourth: IObservable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) =>TResult): IObservable; + combineLatest(second: IObservable, third: IObservable, fourth: IObservable, fifth: IObservable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5) =>TResult): IObservable; + combineLatest(...soucesAndResultSelector: any[]): IObservable; + concat(...sources: IObservable[]): IObservable; + concat(sources: IObservable[]): IObservable; + //concatIObservable(): IObservable; + merge(maxConcurrent: number): IObservable; + merge(other: IObservable): IObservable; + //mergeIObservable(): IObservable; + onErrorResumeNext(second: IObservable): IObservable; + skipUntil(other: IObservable): IObservable; + switchLatest(): IObservable; + takeUntil(other: IObservable): IObservable; + zip(second: IObservable, resultSelector: (v1: T, v2: T2) =>TResult): IObservable; + zip(second: IObservable, third: IObservable, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): IObservable; + zip(second: IObservable, third: IObservable, fourth: IObservable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): IObservable; + zip(second: IObservable, third: IObservable, fourth: IObservable, fifth: IObservable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5) => TResult): IObservable; + zip(...soucesAndResultSelector: any[]): IObservable; + zip(second: any[], resultSelector: (left: T, right: any) => TResult): IObservable; + asIObservable(): IObservable; + bufferWithCount(count: number, skip?: number): IObservable; + dematerialize(): IObservable; + distinctUntilChanged(keySelector?: (value: T) => TValue, comparer?: (x: TValue, y: TValue) =>bool): IObservable; + doAction(observer: IObserver): IObservable; + doAction(onNext: (value: T) => void , onError?: (exception: any) =>void , onCompleted?: () =>void ): IObservable; + finallyAction(action: () =>void): IObservable; + ignoreElements(): IObservable; + materialize(): IObservable>; // IObservable> not supported by TypeScript 0.9.0 !! + repeat(repeatCount?: number): IObservable; + retry(retryCount?: number): IObservable; + scan(seed: TAcc, accumulator: (acc: TAcc, value: T) => TAcc): IObservable; + scan(accumulator: (acc: TAcc, value: T) => TAcc): IObservable; + skipLast(count: number): IObservable; + startWith(...values: T[]): IObservable; + startWith(scheduler: IScheduler, ...values: T[]): IObservable; + takeLast(count: number, scheduler?: IScheduler): IObservable; + takeLastBuffer(count: number): IObservable; + windowWithCount(count: number, skip?: number): IObservable; + defaultIfEmpty(defaultValue?: any): IObservable; + distinct(keySelector?: (value: T) => TKey, keySerializer?: (key: TKey) =>string): IObservable; + groupBy(keySelector: (value: T) => TKey, elementSelector?: (value: T) => TElement, keySerializer?: (key: TKey) => string): IGroupedObservable; + groupByUntil(keySelector: (value: T) => TKey, elementSelector: (value: T) => TElement, durationSelector: (group: IGroupedObservable) => IObservable, keySerializer?: (key: TKey) => string): IGroupedObservable; + select(selector: (value: T, index: number) =>T2): IObservable; + selectMany(selector: (value: T) =>IObservable, resultSelector?: (x: any, y: any) =>any): IObservable; + selectMany(other: IObservable): IObservable; + skip(count: number): IObservable; + skipWhile(predicate: (value: T, index?: number) =>bool): IObservable; + take(count: number, scheduler?: IScheduler): IObservable; + takeWhile(predicate: (value: T, index?: number) =>bool): IObservable; + where(predicate: (value: T, index?: number) => bool): IObservable; - // time - delay(dueTime: number, scheduler?: IScheduler): IObservable; - throttle(dueTime: number, scheduler?: IScheduler): IObservable; - windowWithTime(dueTime: number, timeShiftOrScheduler?: any, scheduler?: IScheduler): IObservable; - timeInterval(scheduler: IScheduler): IObservable; - sample(interval: number, scheduler?: IScheduler): IObservable; - sample(sampler: IObservable, scheduler?: IScheduler): IObservable; - timeout(dueTime: number, other?: IObservable, scheduler?: IScheduler): IObservable; - delaySubscription(dueTime: number, scheduler?: IScheduler): IObservable; - } - export interface Observable { - (subscribe: (observer: IObserver) =>_IDisposable): IObservable; + // time + delay(dueTime: number, scheduler?: IScheduler): IObservable; + throttle(dueTime: number, scheduler?: IScheduler): IObservable; + windowWithTime(dueTime: number, timeShiftOrScheduler?: any, scheduler?: IScheduler): IObservable; + timeInterval(scheduler: IScheduler): IObservable; + sample(interval: number, scheduler?: IScheduler): IObservable; + sample(sampler: IObservable, scheduler?: IScheduler): IObservable; + timeout(dueTime: number, other?: IObservable, scheduler?: IScheduler): IObservable; + delaySubscription(dueTime: number, scheduler?: IScheduler): IObservable; + } - start(func: () =>any, scheduler?: IScheduler, context?: any): IObservable; - toAsync(func: Function, scheduler?: IScheduler, context?: any): (...arguments: any[]) => IObservable; - create(subscribe: (Observer) =>() =>void ): IObservable; - createWithDisposable(subscribe: (Observer) =>_IDisposable): IObservable; - defer(observableFactory: () =>IObservable): IObservable; - empty(scheduler?: IScheduler): IObservable; - fromArray(array: any[], scheduler?: IScheduler): IObservable; - fromArray(array: { length: number;[index: number]: any; }, scheduler?: IScheduler): IObservable; - generate(initialState: any, condition: (state: any) =>bool, iterate: (state: any) =>any, resultSelector: (state: any) =>any, scheduler?: IScheduler): IObservable; - never(): IObservable; - range(start: number, count: number, scheduler?: IScheduler): IObservable; - repeat(value: any, repeatCount?: number, scheduler?: IScheduler): IObservable; - returnValue(value: any, scheduler?: IScheduler): IObservable; - throwException(exception: any, scheduler?: IScheduler): IObservable; - using(resourceFactory: () =>any, observableFactory: (resource: any) =>IObservable): IObservable; - amb(...sources: IObservable[]): IObservable; - catchException(sources: IObservable[]): IObservable; - catchException(...sources: IObservable[]): IObservable; - concat(...sources: IObservable[]): IObservable; - concat(sources: IObservable[]): IObservable; - merge(...sources: IObservable[]): IObservable; - merge(sources: IObservable[]): IObservable; - merge(scheduler: IScheduler, ...sources: IObservable[]): IObservable; - merge(scheduler: IScheduler, sources: IObservable[]): IObservable; - onErrorResumeNext(...sources: IObservable[]): IObservable; - onErrorResumeNext(sources: IObservable[]): IObservable; - } + interface Observable { + (subscribe: (observer: IObserver) =>_IDisposable): IObservable; - export module Internals { - interface IAnonymousObservable extends IObservable { } - export interface AnonymousObservable { - (subscribe: (observer: IObserver) =>_IDisposable): IAnonymousObservable; - } - } + start(func: () =>T, scheduler?: IScheduler, context?: any): IObservable; + toAsync(func: Function, scheduler?: IScheduler, context?: any): (...arguments: any[]) => IObservable; + create(subscribe: (observer: IObserver) => void ): IObservable; + create(subscribe: (observer: IObserver) => () => void ): IObservable; + createWithDisposable(subscribe: (observer: IObserver) =>_IDisposable): IObservable; + defer(observableFactory: () =>IObservable): IObservable; + empty(scheduler?: IScheduler): IObservable; + fromArray(array: T[], scheduler?: IScheduler): IObservable; + fromArray(array: { length: number;[index: number]: T; }, scheduler?: IScheduler): IObservable; + generate(initialState: TState, condition: (state: TState) => bool, iterate: (state: TState) => TState, resultSelector: (state: TState) => TResult, scheduler?: IScheduler): IObservable; + never(): IObservable; + range(start: number, count: number, scheduler?: IScheduler): IObservable; + repeat(value: T, repeatCount?: number, scheduler?: IScheduler): IObservable; + returnValue(value: T, scheduler?: IScheduler): IObservable; + throwException(exception: any, scheduler?: IScheduler): IObservable; + using(resourceFactory: () => TResource, observableFactory: (resource: TResource) => IObservable): IObservable; + amb(...sources: IObservable[]): IObservable; + catchException(sources: IObservable[]): IObservable; + catchException(...sources: IObservable[]): IObservable; + concat(...sources: IObservable[]): IObservable; + concat(sources: IObservable[]): IObservable; + merge(...sources: IObservable[]): IObservable; + merge(sources: IObservable[]): IObservable; + merge(scheduler: IScheduler, ...sources: IObservable[]): IObservable; + merge(scheduler: IScheduler, sources: IObservable[]): IObservable; + onErrorResumeNext(...sources: IObservable[]): IObservable; + onErrorResumeNext(sources: IObservable[]): IObservable; + } - interface IGroupedObservable extends IObservable { - key: any; - underlyingObservable: IObservable; - } + var Observable: Observable; - interface ISubject extends IObservable, IObserver { - isDisposed: bool; - isStopped: bool; - observers: IObserver[]; + export module Internals { + interface IAnonymousObservable extends IObservable { } + export interface AnonymousObservable { + (subscribe: (observer: IObserver) =>_IDisposable): IAnonymousObservable; + } + } - dispose(): void; - } - export interface Subject { - (): ISubject; + interface IGroupedObservable extends IObservable { + key: TKey; + underlyingObservable: IObservable; + } - create(observer: IObserver, observable: IObservable): ISubject; - } + interface ISubject extends IObservable, IObserver { + isDisposed: bool; + isStopped: bool; + //observers: IObserver[]; - interface IAsyncSubject extends IObservable, IObserver { - isDisposed: bool; - value: any; - hasValue: bool; - observers: IObserver[]; - exception: any; + dispose(): void; + } - dispose(): void; - } - export interface AsyncSubject { - (): IAsyncSubject; - } + export interface Subject { + (): ISubject; - interface IAnonymousSubject extends IObservable { - onNext(value: any): void; - onError(exception: any): void; - onCompleted(): void; - } + create(observer?: IObserver, observable?: IObservable): ISubject; + } + + interface IAsyncSubject extends IObservable, IObserver { + isDisposed: bool; + value: T; + hasValue: bool; + observers: IObserver[]; + exception: any; + + dispose(): void; + } + export interface AsyncSubject { + (): IAsyncSubject; + } + + interface IAnonymousSubject extends IObservable { + onNext(value: T): void; + onError(exception: any): void; + onCompleted(): void; + } } \ No newline at end of file diff --git a/rx.js/rx.js.html.d.ts b/rx.js/rx.js.html.d.ts index 4a9eb833f2..e1dcf69dd5 100644 --- a/rx.js/rx.js.html.d.ts +++ b/rx.js/rx.js.html.d.ts @@ -1,8 +1,8 @@ -/// +/// declare module Rx { - export module Observable { - function fromEvent(element: HTMLElement, eventName: string) : IObservable; - function fromEvent(document: HTMLDocument, eventName: string): IObservable; + interface Observable { + fromEvent(element: HTMLElement, eventName: string): IObservable; + fromEvent(document: HTMLDocument, eventName: string): IObservable; } } \ No newline at end of file diff --git a/rx.js/rx.js.jquery.d.ts b/rx.js/rx.js.jquery.d.ts index 7f87a37da8..361040390b 100644 --- a/rx.js/rx.js.jquery.d.ts +++ b/rx.js/rx.js.jquery.d.ts @@ -1,46 +1,90 @@ -/// +/// /// +declare module JQueryResults { + + export interface eventBase{ + bubbles: bool; + cancelable: bool; + type: string; + preventDefault(): void; + isDefaultPrevented(): bool; + stopPropagation(): void; + isPropagationStopped(): bool; + data: any; + originalEvent: any; + eventPhase: number; + } + + export interface keyEvent extends eventBase { + key: number; + keyCode: number; + altKey: bool; + ctrlKey: bool; + shiftKey: bool; + char: string; + metaKey: bool; + } + + export interface uiEvent extends eventBase{ + target: any; + currentTarget: any; + } + + export interface mouseEvent extends keyEvent{ + clientX: number; + clientY: number; + screenX: number; + screenY: number; + offsetX: number; + offsetY: number; + pageX: number; + pageY: number; + which: number; + } +} + + interface JQueryStatic { - ajaxAsObservable(settings: JQueryAjaxSettings): Rx.IObservable; - getAsObservable(url: string, data: any, dataType: string): Rx.IObservable; - getJSONAsObservable(url: string, data: any): Rx.IObservable; - getScriptAsObservable(url: string, data: any): Rx.IObservable; - postAsObservable(url: string, data: any, dataType: string): Rx.IObservable; + ajaxAsObservable(settings: JQueryAjaxSettings): Rx.IObservable; + getAsObservable(url: string, data: any, dataType: string): Rx.IObservable; + getJSONAsObservable(url: string, data: any): Rx.IObservable; + getScriptAsObservable(url: string, data: any): Rx.IObservable; + postAsObservable(url: string, data: any, dataType: string): Rx.IObservable; } interface JQuery { - changeAsObservable(eventData?: any): Rx.IObservable; - clickAsObservable(eventData?: any): Rx.IObservable; - dblclickAsObservable(eventData?: any): Rx.IObservable; - focusAsObservable(eventData?: any): Rx.IObservable; - focusinAsObservable(eventData?: any): Rx.IObservable; - focusoutAsObservable(eventData?: any): Rx.IObservable; - keydownAsObservable(eventData?: any): Rx.IObservable; - keyupAsObservable(eventData?: any): Rx.IObservable; - loadAsObservable(eventData?: any): Rx.IObservable; - mousedownAsObservable(eventData?: any): Rx.IObservable; - mouseenterAsObservable(eventData?: any): Rx.IObservable; - mouseleaveAsObservable(eventData?: any): Rx.IObservable; - mousemoveAsObservable(eventData?: any): Rx.IObservable; - mouseoutAsObservable(eventData?: any): Rx.IObservable; - mouseoverAsObservable(eventData?: any): Rx.IObservable; - mouseupAsObservable(eventData?: any): Rx.IObservable; - resizeAsObservable(eventData?: any): Rx.IObservable; - scrollAsObservable(eventData?: any): Rx.IObservable; - selectAsObservable(eventData?: any): Rx.IObservable; - submitAsObservable(eventData?: any): Rx.IObservable; - unloadAsObservable(eventData?: any): Rx.IObservable; - readyAsObservable(): Rx.IObservable; - hideAsObservable(duration: number): Rx.IObservable; - showAsObservable(duration: number): Rx.IObservable; - animateAsObservable(properties: any, duration: number, easing?: string): Rx.IObservable; - fadeInAsObservable(duration: number, easing?: string): Rx.IObservable; - fadeToAsObservable(duration: number, opacity: number, easing?: string): Rx.IObservable; - fadeOutAsObservable(duration: number, easing?: string): Rx.IObservable; - fadeToggleAsObservable(duration: number, easing?: string): Rx.IObservable; - slideDownAsObservable(duration: number): Rx.IObservable; - slideUpAsObservable(duration: number): Rx.IObservable; - slideToggleAsObservable(duration: number): Rx.IObservable; - toggleAsObservable(duration: number): Rx.IObservable; + changeAsObservable(eventData?: any): Rx.IObservable; + clickAsObservable(eventData?: any): Rx.IObservable; + dblclickAsObservable(eventData?: any): Rx.IObservable; + focusAsObservable(eventData?: any): Rx.IObservable; + focusinAsObservable(eventData?: any): Rx.IObservable; + focusoutAsObservable(eventData?: any): Rx.IObservable; + keydownAsObservable(eventData?: any): Rx.IObservable; + keyupAsObservable(eventData?: any): Rx.IObservable; + loadAsObservable(eventData?: any): Rx.IObservable; + mousedownAsObservable(eventData?: any): Rx.IObservable; + mouseenterAsObservable(eventData?: any): Rx.IObservable; + mouseleaveAsObservable(eventData?: any): Rx.IObservable; + mousemoveAsObservable(eventData?: any): Rx.IObservable; + mouseoutAsObservable(eventData?: any): Rx.IObservable; + mouseoverAsObservable(eventData?: any): Rx.IObservable; + mouseupAsObservable(eventData?: any): Rx.IObservable; + resizeAsObservable(eventData?: any): Rx.IObservable; + scrollAsObservable(eventData?: any): Rx.IObservable; + selectAsObservable(eventData?: any): Rx.IObservable; + submitAsObservable(eventData?: any): Rx.IObservable; + unloadAsObservable(eventData?: any): Rx.IObservable; + hideAsObservable(duration: number): Rx.IObservable; + showAsObservable(duration: number): Rx.IObservable; + readyAsObservable(): Rx.IObservable; + animateAsObservable(properties: any, duration: number, easing?: string): Rx.IObservable; + fadeInAsObservable(duration: number, easing?: string): Rx.IObservable; + fadeToAsObservable(duration: number, opacity: number, easing?: string): Rx.IObservable; + fadeOutAsObservable(duration: number, easing?: string): Rx.IObservable; + fadeToggleAsObservable(duration: number, easing?: string): Rx.IObservable; + slideDownAsObservable(duration: number): Rx.IObservable; + slideUpAsObservable(duration: number): Rx.IObservable; + slideToggleAsObservable(duration: number): Rx.IObservable; + toggleAsObservable(duration: number): Rx.IObservable; } \ No newline at end of file diff --git a/rx.js/rx.js.time.d.ts b/rx.js/rx.js.time.d.ts index f1bd2a5846..fc12992558 100644 --- a/rx.js/rx.js.time.d.ts +++ b/rx.js/rx.js.time.d.ts @@ -1,10 +1,13 @@ /// declare module Rx { - export module Observable { - function ifThen(condition: () => bool, thenSource: IObservable): IObservable; - function ifThen(condition: () => bool, thenSource: IObservable, elseSource: IObservable): IObservable; - function ifThen(condition: () => bool, thenSource: IObservable, scheduler: IScheduler): IObservable; - function interval(period: number, scheduler?: IScheduler): IObservable; + interface IObservable { + ifThen(condition: () => bool, thenSource: IObservable): IObservable; + ifThen(condition: () => bool, thenSource: IObservable, elseSource: IObservable): IObservable; + ifThen(condition: () => bool, thenSource: IObservable, scheduler: IScheduler): IObservable; + } + interface Observable { + interval(period: number, scheduler?: IScheduler): IObservable; + interval(dutTime: number, period: number, scheduler?: IScheduler): IObservable; } } \ No newline at end of file diff --git a/zeroclipboard/zeroclipboard.d.ts b/zeroclipboard/zeroclipboard.d.ts index 86713503e3..c059d47eb6 100644 --- a/zeroclipboard/zeroclipboard.d.ts +++ b/zeroclipboard/zeroclipboard.d.ts @@ -10,7 +10,7 @@ declare class ZeroClipboard { setText(newText: string); setTitle(newTitle: string); setSize(width: number, height: number); - setHandCursor(enabled: bool); + setHandCursor(enabled: boolean); version: string; moviePath: string; trustedDomains: any; @@ -18,7 +18,7 @@ declare class ZeroClipboard { hoverClass: string; activeClass: string; resetBridge(); - ready: bool; + ready: boolean; reposition(); on(eventName, func); addEventListener(eventName: string, func); @@ -29,7 +29,7 @@ declare class ZeroClipboard { unglue(elements: any); static setDefaults(options: ZeroClipboardOptions); static destroy(); - static detectFlashSupport(): bool; + static detectFlashSupport(): boolean; static dispatch(eventName: string, func); }