From 66e0756065e19a70b9ffaf877cbaf378cec3b22e Mon Sep 17 00:00:00 2001 From: Eric Todd Date: Fri, 14 Aug 2015 11:06:14 -0700 Subject: [PATCH] Removed explicit event declarations (because handled by the Events class). Updated optionality of various interfaces. Corrected typo on LocationRect. --- bingmaps/Microsoft.Maps.AdvancedShapes.d.ts | 15 +-- bingmaps/Microsoft.Maps.Directions.d.ts | 25 ----- bingmaps/Microsoft.Maps.Search.d.ts | 44 ++++---- bingmaps/Microsoft.Maps.VenueMaps.d.ts | 33 +++--- bingmaps/Microsoft.Maps.d.ts | 109 +++++++------------- 5 files changed, 73 insertions(+), 153 deletions(-) diff --git a/bingmaps/Microsoft.Maps.AdvancedShapes.d.ts b/bingmaps/Microsoft.Maps.AdvancedShapes.d.ts index 94c49f0b5..c302d30c9 100644 --- a/bingmaps/Microsoft.Maps.AdvancedShapes.d.ts +++ b/bingmaps/Microsoft.Maps.AdvancedShapes.d.ts @@ -9,7 +9,7 @@ declare module Microsoft.Maps.AdvancedShapes { export class EntityCollection { - constructor(options: EntityCollectionOptions); + constructor(options?: EntityCollectionOptions); clear(): void; get(index: number): Entity; @@ -24,10 +24,6 @@ declare module Microsoft.Maps.AdvancedShapes { removeAt(index: number): Entity; setOptions(options: EntityCollectionOptions): void; toString(): string; - - entityAdded: (args: EntityChangeArgs) => any; - entityChanged: (args: EntityChangeArgs) => any; - entityRemoved: (args: EntityChangeArgs) => any; } export class Polygon implements Entity { @@ -43,15 +39,6 @@ declare module Microsoft.Maps.AdvancedShapes { setLocations(locations: Location[]): void; setOptions(options: PolylineOptions): void; toString(): string; - - click: (eventArgs: MouseEventArgs) => void; - dbclick: (eventArgs: MouseEventArgs) => void; - entitychanged: (entity: Entity) => void; - mousedown: (eventArgs: MouseEventArgs) => void; - mouseout: (eventArgs: MouseEventArgs) => void; - mouseover: (eventArgs: MouseEventArgs) => void; - mouseup: (eventArgs: MouseEventArgs) => void; - rightclick: (eventArgs: MouseEventArgs) => void; } } \ No newline at end of file diff --git a/bingmaps/Microsoft.Maps.Directions.d.ts b/bingmaps/Microsoft.Maps.Directions.d.ts index 670a04361..30065b84c 100644 --- a/bingmaps/Microsoft.Maps.Directions.d.ts +++ b/bingmaps/Microsoft.Maps.Directions.d.ts @@ -79,10 +79,6 @@ declare module Microsoft.Maps.Directions { isExactLocation(): boolean; isViapoint(): boolean; setOptions(options: WaypointOptions): void; - - changed: (args: WaypointEventArgs) => void; - geocoded: (args: WaypointEventArgs) => void; - reverseGeocoded: (args: WaypointEventArgs) => void; } export interface DirectionsRenderOptions { @@ -185,27 +181,6 @@ declare module Microsoft.Maps.Directions { setMapView(): void; setRenderOptions(options: DirectionsRenderOptions): void; setRequestOptions(options: DirectionsRequestOptions): void; - - afterRouteSelectorRender: (args: RouteSelectorRenderEventArgs) => void; - afterStepRender: (args: DirectionsStepRenderEventArgs) => void; - afterSummaryRender: (args: RouteSummaryRenderEventArgs) => void; - afterWaypointRender: (args: WaypointRenderEventArgs) => void; - beforeDisambiguationRender: (args: DisambiguationRenderEventArgs) => void; - beforeRouteSelectorRender: (args: RouteSelectorRenderEventArgs) => void; - beforeStepRender: (args: DirectionsStepRenderEventArgs) => void; - beforeSummaryRender: (args: RouteSummaryRenderEventArgs) => void; - beforeWaypointRender: (args: WaypointRenderEventArgs) => void; - directionsError: (args: DirectionsErrorEventArgs) => void; - directionsUpdated: (args: DirectionsEventArgs) => void; - dragDropCompleted: () => void; - itineraryStepClicked: (args: DirectionsStepEventArgs) => void; - mouseEnterRouteSelector: (args: RouteSelectorEventArgs) => void; - mouseEnterStep: (args: DirectionsStepEventArgs) => void; - mouseLeaveRouteSelector: (args: RouteSelectorEventArgs) => void; - mouseLeaveStep: (args: DirectionsStepEventArgs) => void; - routeSelectorClicked: (args: RouteSelectorEventArgs) => void; - waypointAdded: (args: WaypointEventArgs) => void; - waypointRemoved: (args: WaypointEventArgs) => void; } export interface DirectionsStepEventArgs { diff --git a/bingmaps/Microsoft.Maps.Search.d.ts b/bingmaps/Microsoft.Maps.Search.d.ts index 47169bb36..88572901b 100644 --- a/bingmaps/Microsoft.Maps.Search.d.ts +++ b/bingmaps/Microsoft.Maps.Search.d.ts @@ -6,7 +6,7 @@ /// declare module Microsoft.Maps.Search { - + export interface Address { addressLine: string; adminDistrict: string; @@ -25,12 +25,12 @@ declare module Microsoft.Maps.Search { } export interface GeocodeRequestOptions { - bounds: LocationRect; - callback: (result: GeocodeResult, userData: any) => any; + bounds?: LocationRect; + callback?: (result: GeocodeResult, userData: any) => any; count: number; - errorCallback: (options: GeocodeRequestOptions) => any; - timeout: number; - userData: any; + errorCallback?: (options: GeocodeRequestOptions) => any; + timeout?: number; + userData?: any; where:string; } @@ -71,15 +71,15 @@ declare module Microsoft.Maps.Search { } export interface ReverseGeocodeRequestOptions { - callback: (result: PlaceResult, userData: any) => any; - errorCallback: (options: ReverseGeocodeRequestOptions) => any; - location: Location; - timeout: number; - userData:any; + callback?: (result: PlaceResult, userData: any) => any; + errorCallback?: (options: ReverseGeocodeRequestOptions) => any; + location?: Location; + timeout?: number; + userData?:any; } export class SearchManager { - + constructor(map: Map); geocode(request: GeocodeRequestOptions): void; @@ -104,16 +104,16 @@ declare module Microsoft.Maps.Search { } export interface SearchRequestOptions { - callback:(result: SearchResponse, userData: any)=>any; + callback?:(result: SearchResponse, userData: any)=>any; count: number; - errorCallback:(options: SearchRequestOptions)=>any; - query: string; - startIndex: number; - timeout: number; - entityType: string; - userData: any; - what: string; - where:string; + errorCallback?:(options: SearchRequestOptions)=>any; + query?: string; + startIndex?: number; + timeout?: number; + entityType?: string; + userData?: any; + what?: string; + where?:string; } export interface SearchResponse { @@ -149,4 +149,4 @@ declare module Microsoft.Maps.Search { website:string; } - } \ No newline at end of file + } diff --git a/bingmaps/Microsoft.Maps.VenueMaps.d.ts b/bingmaps/Microsoft.Maps.VenueMaps.d.ts index bc87b2d28..f78f30da8 100644 --- a/bingmaps/Microsoft.Maps.VenueMaps.d.ts +++ b/bingmaps/Microsoft.Maps.VenueMaps.d.ts @@ -11,20 +11,23 @@ declare module Microsoft.Maps.VenueMaps { eventArgs: MouseEventArgs; } + export interface PrimitiveResponse { + eventArgs: Primitive; + } + export interface Directory { addToDOM(div: HTMLElement, sortOrder: DirectorySortOrder, to_group_or_not: DirectoryGrouping): void; createUIElements(): void; - handleMouseClick(response: MouseResponse): void; - handleMouseOut(response: MouseResponse): void; - handleMouseOver(response: MouseResponse): void; + handleMouseClick(e: (response: MouseResponse) => void): void; + handleMouseClick(e: (response: PrimitiveResponse) => void): void; + handleMouseOut(e: (response: MouseResponse) => void): void; + handleMouseOut(e: (response: PrimitiveResponse) => void): void; + handleMouseOver(e: (response: MouseResponse) => void): void; + handleMouseOver(e: (response: PrimitiveResponse) => void): void; isInDOM(): boolean; removeFromDOM(): void; setHeight(height: number): void; - - click: (eventArgs: MouseEventArgs) => any; - mouseOut: (eventArgs: MouseEventArgs) => any; - mouseOver: (eventArgs: MouseEventArgs) => any; } export enum DirectoryGrouping { @@ -67,10 +70,10 @@ declare module Microsoft.Maps.VenueMaps { } export interface NearbyVenueOptions { - callback: (maps: Array) => any; - location: Location; - map: Map; - radius: number; + callback?: (maps: Array) => any; + location?: Location; + map?: Map; + radius?: number; } export interface Polygon { @@ -116,12 +119,6 @@ declare module Microsoft.Maps.VenueMaps { hide(): void; setActiveFloor(floor: string): void; show(): void; - - click: (eventArgs: Primitive) => any; - close: () => any; - footprintclick: (eventArgs: Primitive) => any; - mouseout: (eventArgs: Primitive) => any; - mouseover: (eventArgs: Primitive) => any; } export interface VenueMapCreationOptions { @@ -138,4 +135,4 @@ declare module Microsoft.Maps.VenueMaps { getNearbyVenues(options: NearbyVenueOptions): void; } -} \ No newline at end of file +} diff --git a/bingmaps/Microsoft.Maps.d.ts b/bingmaps/Microsoft.Maps.d.ts index 238caa359..289d9d494 100644 --- a/bingmaps/Microsoft.Maps.d.ts +++ b/bingmaps/Microsoft.Maps.d.ts @@ -45,7 +45,7 @@ declare module Microsoft.Maps { getNorth(): number; getNorthwest(): Location; getSouth(): number; - getSouthEast(): Location; + getSoutheast(): Location; getWest(): number; intersects(rect: LocationRect): boolean; toString(): string; @@ -96,7 +96,8 @@ declare module Microsoft.Maps { export class Map { - constructor(containerElement: HTMLElement, options: MapOptions); + constructor(containerElement: HTMLElement, options?: MapOptions); + constructor(containerElement: HTMLElement, options?: ViewOptions); entities: EntityCollection; @@ -137,39 +138,25 @@ declare module Microsoft.Maps { setMapType(mapTypeId: MapTypeId): void; setOptions(options: MapOptions): void; setView(options: ViewOptions): void; - tryLocationToPixel(locations: Array, reference?: PixelReference): any; - tryPixelToLocation(points: Array, reference?: PixelReference): any; - - click: (eventArgs: MouseEventArgs) => void; - copyrightchanged: () => void; - dblclick: (eventArgs: MouseEventArgs) => void; - imagerychanged: () => void; - keydown: (eventArgs: KeyEventArgs) => void; - keypress: (eventArgs: KeyEventArgs) => void; - keyup: (eventArgs: KeyEventArgs) => void; - maptypechanged: () => void; - mousedown: (eventArgs: MouseEventArgs) => void; - mousemove: (eventArgs: MouseEventArgs) => void; - mouseout: (eventArgs: MouseEventArgs) => void; - mouseover: (eventArgs: MouseEventArgs) => void; - mouseup: (eventArgs: MouseEventArgs) => void; - mousewheel: (eventArgs: MouseEventArgs) => void; - rightlick: (eventArgs: MouseEventArgs) => void; - targetviewchanged: () => void; - tiledownloadcomplete: () => void; - viewchange: () => void; - viewchangeend: () => void; - viewchangestart: () => void; + tryLocationToPixel(locations: Location, reference?: PixelReference): Point; + tryLocationToPixel(locations: Array, reference?: PixelReference): Array; + tryPixelToLocation(points: Point, reference?: PixelReference): Location; + tryPixelToLocation(points: Array, reference?: PixelReference): Array; } export class MapMode { getDrawShapesInSingleLayer(): boolean; getShouldClipPolygons(): boolean; - setOptions(options: MapOptions): void; + setOptions(options: MapModeOptions): void; setViewChangeEndDelay(delay: number): void; } + export interface MapModeOptions { + shouldClipPolygons?: boolean; + drawShapesInSingleLayer?:boolean; + } + export interface MapOptions { backgroundColor?: Color; @@ -272,14 +259,14 @@ declare module Microsoft.Maps { } export interface EntityCollectionOptions { - bubble: boolean; - visible: boolean; - zIndex: number; + bubble?: boolean; + visible?: boolean; + zIndex?: number; } export class EntityCollection { - constructor(options: EntityCollectionOptions); + constructor(options?: EntityCollectionOptions); clear(): void; get(index: number): Entity; @@ -295,9 +282,6 @@ declare module Microsoft.Maps { setOptions(options: EntityCollectionOptions): void; toString(): string; - entityAdded: (args: EntityChangeArgs) => any; - entityChanged: (args: EntityChangeArgs) => any; - entityRemoved: (args: EntityChangeArgs) => any; } export class Infobox { @@ -325,11 +309,6 @@ declare module Microsoft.Maps { setLocation(location: Location): void; setOptions(options: InfoboxOptions): void; toString(): string; - - click: (eventArgs: MouseEventArgs) => void; - entitychanged: (entity: Entity) => void; - mouseenter: (eventArgs: MouseEventArgs) => void; - mouseleave: (eventArgs: MouseEventArgs) => void; } export interface Action { @@ -378,15 +357,11 @@ declare module Microsoft.Maps { setLocations(locations: Array): void; setOptions(options: PolylineOptions): void; toString(): string; + } - click: (eventArgs: MouseEventArgs) => void; - dblclick: (eventArgs: MouseEventArgs) => void; - entitychanged: (entity: Entity) => void; - mousedown: (eventArgs: MouseEventArgs) => void; - mouseout: (eventArgs: MouseEventArgs) => void; - mouseover: (eventArgs: MouseEventArgs) => void; - mouseup: (eventArgs: MouseEventArgs) => void; - rightclick: (eventArgs: MouseEventArgs) => void; + export class Position { + coords: Coordinates; + timestamp: string; } export interface PolylineOptions { @@ -409,20 +384,11 @@ declare module Microsoft.Maps { setLocations(locations: Location[]): void; setOptions(options: PolylineOptions): void; toString(): string; - - click: (eventArgs: MouseEventArgs) => void; - dbclick: (eventArgs: MouseEventArgs) => void; - entitychanged: (entity: Entity) => void; - mousedown: (eventArgs: MouseEventArgs) => void; - mouseout: (eventArgs: MouseEventArgs) => void; - mouseover: (eventArgs: MouseEventArgs) => void; - mouseup: (eventArgs: MouseEventArgs) => void; - rightclick: (eventArgs: MouseEventArgs) => void; } export interface PolygonOptions { fillColor?: Color; - infoBox?: Infobox; + infobox?: Infobox; strokeColor?: Color; strokeDashArray?: string; strokeThickness?: number; @@ -446,18 +412,6 @@ declare module Microsoft.Maps { setLocation(location: Location): void; setOptions(options: PushpinOptions): void; toString(): string; - - click: (eventArgs: MouseEventArgs) => void; - dblclick: (eventArgs: MouseEventArgs) => void; - drag: (object: Pushpin) => any; - dragend: (eventArgs: MouseEventArgs) => void; - dragstart: (eventArgs: MouseEventArgs) => void; - entitychanged: (object: { entity: Entity; }) => any; - mousedown: (eventArgs: MouseEventArgs) => void; - mouseout: (eventArgs: MouseEventArgs) => void; - mouseover: (eventArgs: MouseEventArgs) => void; - mouseup: (eventArgs: MouseEventArgs) => void; - rightclick: (eventArgs: MouseEventArgs) => void; } export enum EntityState { @@ -487,13 +441,11 @@ declare module Microsoft.Maps { constructor(options: TileLayerOptions); - getOpacty(): number; + getOpacity(): number; getTileSource(projection: string): TileSource; getZIndex(): number; setOptions(options: TileLayerOptions): void; toString(): string; - - tiledownloadcomplete: () => void; } export class TileSource { @@ -509,7 +461,7 @@ declare module Microsoft.Maps { export interface TileSourceOptions { height?: number; - uriConstructor: string; + uriConstructor: any; width?: number; } @@ -550,9 +502,18 @@ declare module Microsoft.Maps { removeAccuracyCircle(): void; } + export interface PositionOptionsErrorCallbackResult { + internalError: PositionError; + errorCode:number; +} + export interface PositionOptions { + enableHighAccuracy?: boolean; + errorCallback?:(result:PositionOptionsErrorCallbackResult)=>void; + } + export interface PositionCircleOptions { polygonOptions: PolygonOptions; - showOnMap: boolean; + showOnMap?: boolean; } export class PositionError { @@ -567,7 +528,7 @@ declare module Microsoft.Maps { homeRegion?: string; } - export function loadModule(moduleKey: string, options: ModuleOptions): void; + export function loadModule(moduleKey: string, options?: ModuleOptions): void; export function moduleLoaded(moduleKey: string): void; export function registerModule(moduleKey: string, scriptUrl: string, options?: ModuleOptions): void; }