forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Microsoft.Maps.Search.d.ts
152 lines (131 loc) · 4.01 KB
/
Microsoft.Maps.Search.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
// Type definitions for Microsoft.Maps.Search 7.0
// Project: http://msdn.microsoft.com/en-us/library/hh868061.aspx
// Definitions by: Eric Todd <https://github.com/ericrtodd>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="Microsoft.Maps.d.ts"/>
declare namespace Microsoft.Maps.Search {
export interface Address {
addressLine: string;
adminDistrict: string;
countryRegion: string;
district: string;
formattedAddress: string;
locality: string;
postalCode: string;
postalTown:string;
}
export interface GeocodeLocation {
location: Location;
name: string;
precision:LocationPrecision;
}
export interface GeocodeRequestOptions {
bounds?: LocationRect;
callback?: (result: GeocodeResult, userData: any) => any;
count: number;
errorCallback?: (options: GeocodeRequestOptions) => any;
timeout?: number;
userData?: any;
where:string;
}
export interface GeocodeResult {
parsedAddress: Address;
parsedKeyword: string;
parsedSeparator: string;
results:Array<PlaceResult>;
}
export enum LocationPrecision {
interpolated,
rooftop,
}
export enum MatchCode {
none,
good,
ambiguous,
upHierarchy,
modified,
}
export enum MatchConfidence {
high,
medium,
low,
unknown,
}
export interface PlaceResult {
bestView: LocationRect;
location: GeocodeLocation;
locations: Array<GeocodeLocation>;
matchCode: MatchCode;
matchConfidence: MatchConfidence;
name:string;
}
export interface ReverseGeocodeRequestOptions {
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;
reverseGeocode(request: ReverseGeocodeRequestOptions): void;
search(request:SearchRequestOptions):void;
}
export interface SearchParseResult {
keyword: string;
location: GeocodeLocation;
matchConfidence:MatchConfidence;
}
export interface SearchRegion {
address: Address;
geocodeLocations: Array<GeocodeLocation>;
explicitLocation: GeocodeLocation;
mapBounds: LocationRect;
matchCode: MatchCode;
matchConfidence: MatchConfidence;
source:string;
}
export interface SearchRequestOptions {
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;
}
export interface SearchResponse {
alternateSearchRegions: Array<SearchRegion>;
hasMore: boolean;
parseResults: Array<SearchParseResult>;
responseSummary: SearchResponseSummary;
searchRegion: SearchRegion;
searchResults:Array<SearchResult>;
}
export interface SearchResponseSummary {
authResultCode: number;
copyright: string;
errorMessage: string;
statusCode: number;
traceId:number;
}
export interface SearchResult {
address: Address;
city: string;
country: string;
entityType: string;
hoursOfOperation: string;
id: number;
location: Location;
name: string;
phone: string;
postalCode: string;
reviewCount: number;
userRating: number;
website:string;
}
}