1414 * limitations under the License.
1515 */
1616/// <reference types="google.maps" />
17- /**
18- * @ignore
19- */
20- declare global {
21- interface Window {
22- __googleMapsCallback : ( e : Event ) => void ;
23- }
24- }
2517export declare const DEFAULT_ID = "__googleMapsScriptId" ;
26- export declare type Libraries = ( "drawing" | "geometry" | "localContext" | "marker" | "places" | "visualization" ) [ ] ;
18+ export type Library = "core" | "maps" | "places" | "geocoding" | "routes" | "marker" | "geometry" | "elevation" | "streetView" | "journeySharing" | "drawing" | "visualization" ;
19+ export type Libraries = Library [ ] ;
2720/**
2821 * The Google Maps JavaScript API
2922 * [documentation](https://developers.google.com/maps/documentation/javascript/tutorial)
@@ -248,7 +241,6 @@ export declare class Loader {
248241 * See [[LoaderOptions.authReferrerPolicy]]
249242 */
250243 readonly authReferrerPolicy : "origin" ;
251- private CALLBACK ;
252244 private callbacks ;
253245 private done ;
254246 private loading ;
@@ -271,21 +263,40 @@ export declare class Loader {
271263 * CreateUrl returns the Google Maps JavaScript API script url given the [[LoaderOptions]].
272264 *
273265 * @ignore
266+ * @deprecated
274267 */
275268 createUrl ( ) : string ;
276269 deleteScript ( ) : void ;
277270 /**
278271 * Load the Google Maps JavaScript API script and return a Promise.
272+ * @deprecated , use importLibrary() instead.
279273 */
280274 load ( ) : Promise < typeof google > ;
281275 /**
282276 * Load the Google Maps JavaScript API script and return a Promise.
283277 *
284278 * @ignore
279+ * @deprecated , use importLibrary() instead.
285280 */
286281 loadPromise ( ) : Promise < typeof google > ;
282+ /**
283+ * See https://developers.google.com/maps/documentation/javascript/reference/top-level#google.maps.importLibrary
284+ */
285+ importLibrary ( name : "core" ) : Promise < google . maps . CoreLibrary > ;
286+ importLibrary ( name : "maps" ) : Promise < google . maps . MapsLibrary > ;
287+ importLibrary ( name : "places" ) : Promise < google . maps . PlacesLibrary > ;
288+ importLibrary ( name : "geocoding" ) : Promise < google . maps . GeocodingLibrary > ;
289+ importLibrary ( name : "routes" ) : Promise < google . maps . RoutesLibrary > ;
290+ importLibrary ( name : "marker" ) : Promise < google . maps . MarkerLibrary > ;
291+ importLibrary ( name : "geometry" ) : Promise < google . maps . GeometryLibrary > ;
292+ importLibrary ( name : "elevation" ) : Promise < google . maps . ElevationLibrary > ;
293+ importLibrary ( name : "streetView" ) : Promise < google . maps . StreetViewLibrary > ;
294+ importLibrary ( name : "journeySharing" ) : Promise < google . maps . JourneySharingLibrary > ;
295+ importLibrary ( name : "drawing" ) : Promise < google . maps . DrawingLibrary > ;
296+ importLibrary ( name : "visualization" ) : Promise < google . maps . VisualizationLibrary > ;
287297 /**
288298 * Load the Google Maps JavaScript API script with a callback.
299+ * @deprecated , use importLibrary() instead.
289300 */
290301 loadCallback ( fn : ( e : ErrorEvent ) => void ) : void ;
291302 /**
@@ -298,7 +309,6 @@ export declare class Loader {
298309 private reset ;
299310 private resetIfRetryingFailed ;
300311 private loadErrorCallback ;
301- private setCallback ;
302312 private callback ;
303313 private execute ;
304314}
0 commit comments