import { FactoryProvider, InjectionToken } from '@angular/core'; import { GoogleMapsApiService } from '../../api/google-maps-api.service'; import { Native, NativeOf, Wrapper } from '../types/abstraction'; import { FactoryGeneratorConfig } from './common'; declare type WrapperFactory = (api: GoogleMapsApiService, native: NativeOf, ...deps: any[]) => TWrapper; /** * Defines the configuration for a function that generates a `FactoryProvider` for wrapper objects. * * @export * @interface WrapperFactoryGeneratorConfig * @extends {FactoryGeneratorConfig} */ export interface WrapperFactoryGeneratorConfig extends FactoryGeneratorConfig { /** * (Optional) The token to use when injecting the native object into the factory. Default is `NativeInstance`. * * @type {InjectionToken} */ nativeToken?: InjectionToken; } /** * Applies default values for undefined values in the config object. * * @export * @param {WrapperFactoryGeneratorConfig} config The optional config. * @returns {Required} The filled config. */ export declare function configWrapperFactoryProviderGeneratorDefaults(config: WrapperFactoryGeneratorConfig): Required; /** * Creates a factory provider for the a natve object injection token. * The factory runs the specified function and passes the `GoogleMapsApiService`, the native object to be wrapped and the specified dependencies to it. * * By default, the generator will create the factory provider for the `WrapperInstance` token, and inject `NativeInstance` as a dependency. * To change this behavior, specify the appropriate tokens in the config argument. * * Note: The factory will detect non-browser platforms and return `null` instead of calling the function. * * @export * @template TWrapper The type of wrapper generated by the factory. * @param {WrapperFactory} produceWrapper The function that will create the wrapper object. Receives the `GoogleMapsApiService`, the native object and the dependencies specified in `deps`. * @param {WrapperFactoryGeneratorConfig} [config={}] (Optional) A configuration object for the generator. * @returns {FactoryProvider} A `FactoryProvider` object for the specified token. */ export declare function createWrapperFactoryProvider(produceWrapper: WrapperFactory, config?: WrapperFactoryGeneratorConfig): FactoryProvider; export {};