/// import { Observable } from 'rxjs'; import { GoogleMapsApiService, GoogleMapsNativeObjectWrapper } from '@bespunky/angular-google-maps/core'; import { DirectionsRequestConfig } from '../abstraction/types/directions-request-config.type'; import { DirectionsPlace } from '../abstraction/types/directions.type'; import { DirectionsTransformService } from './transform/directions-transform.service'; import { NativeDirectionsService } from './google-maps-directions-service-factory.provider'; export declare type DirectionsCallback = (result: google.maps.DirectionsResult, status: google.maps.DirectionsStatus) => void; /** * Integrates the `google.maps.DirectionsService` into the framework and provides tools for directions. * The service can be used directly, however the `GoogleMapsDirectionsDirective` allows integrating it and rendering it * directly on an existing map. * * @see [original notes of the native service](https://developers.google.com/maps/documentation/javascript/directions) * * Note: This service is intended to be injected once, at root level. Therefore the native object provider should also be * provided at root level. `GoogleMapsDirectionsModule` should be imported `forRoot()` to provide the native factory. * * @export * @class GoogleMapsDirectionsService */ export declare class GoogleMapsDirectionsService extends GoogleMapsNativeObjectWrapper { private transform; constructor(transform: DirectionsTransformService, api: GoogleMapsApiService, native: NativeDirectionsService); /** * Finds the directions from the first place to the last place, through all the places in between. If no travel mode was provided * `google.maps.TravelMode.DRIVING` will be used. * * If the native service returned an `'OK'` status, the observable will emit the results. Otherwise, the observable will * error with the status code received in the response. * @See original docs about [result status](https://developers.google.com/maps/documentation/javascript/directions#DirectionsStatus). * * @param {DirectionsPlace[]} places The array of places to pass through. The first item will be considered as origin, the last one as destination, * and all of which are in between will be considered waypoints. At least 2 items must be provided. * @param {Exclude} [options] (Optional) Any additional route options. * @returns {Observable} The directions for the specified places. */ through(places: DirectionsPlace[], options?: Exclude): Observable; /** * Finds the directions from the specified origin to the specified destination. If no travel mode was provided * `google.maps.TravelMode.DRIVING` will be used. * * If the native service returned an `'OK'` status, the observable will emit the results. Otherwise, the observable will * error with the status code received in the response. * @See original docs about [result status](https://developers.google.com/maps/documentation/javascript/directions#DirectionsStatus). * * @param {DirectionsPlace} from The origin for the route. * @param {DirectionsPlace} to The destination of the route. * @param {DirectionsRequestConfig} [options] (Optional) Any additional route options. * @returns {Observable} The directions for the specified points. */ route(from: DirectionsPlace, to: DirectionsPlace, options?: DirectionsRequestConfig): Observable; /** * Creates a feed that emits a new directions result for each change in places or route configuration. * * @param {Observable} places The feed that emits the places to route through. * @param {Observable>} config The feed that emits the routing configuration. * @returns {Observable} A feed that emits a new directions result for each change in places or route configuration. */ throughFeed(places: Observable, config: Observable>): Observable; /** * Creates a feed that emits a new directions result for each change origin, destination or route configuration. * * @param {Observable} from The feed that emits the origin to route from. * @param {Observable} to The feed that emits the destination to route to. * @param {Observable} config The feed that emits the routing configuration. * @returns {Observable} A feed that emits a new directions result for each change origin, destination or route configuration. */ routeFeed(from: Observable, to: Observable, config: Observable): Observable; /** * Creates a feed that emits a new directions result for each change in places or route configuration. * * @private * @param {Observable} placesFeed The feed that emits the places to route through. * @param {Observable} configFeed The feed that emits the routing configuration. * @returns {Observable} A feed that emits a new directions result for each change in places or route configuration. */ private feedFor; /** * Creates an observable that, when subscribed to, launches a directions request safely (i.e. when api is ready). * * @private * @param {google.maps.DirectionsRequest} request The directions request to send. * @returns {Observable} An observable that emits the results for the specified directions request. */ private requestRoute; /** * Applies default values for mandatory options which were not provided and executes the directions request * through the native `google.maps.DirectionsService`. * * @private * @param {google.maps.DirectionsRequest} request The request to execute. * @param {DirectionsCallback} handleDirectionsResult The callback to execute once directions result have returned. */ private nativeRequestRoute; }