Index

core/abstraction/factories/natives.ts

configNativeFactoryProviderGeneratorDefaults
configNativeFactoryProviderGeneratorDefaults(config: NativeFactoryGeneratorConfig)

Applies default values for undefined values in the config object.

Parameters:
Name Type Optional Description
config NativeFactoryGeneratorConfig No

The optional config.

Returns: Required<NativeFactoryGeneratorConfig>

The filled config.

createNativeFactory
createNativeFactory(produceNative: NativeFactory)

Creates the factory that will be used in the provider created by createNativeFactoryProvider. See createNativeFactoryProvider for more details.

Parameters:
Name Type Optional Description
produceNative NativeFactory No

The function that will create the native object. Receives the dependencies specified in deps when configuring the generator.

createNativeFactoryProvider
createNativeFactoryProvider(produceNative: NativeFactory, config: NativeFactoryGeneratorConfig)

Creates a factory provider for the a natve object injection token. The factory runs the specified function and passes the specified dependencies to it. The function will be run outside Angular.

By default, the generator will create the factory provider for the NativeInstance token. To change this behavior, specify the appropriate token in the config argument.

Note: The factory will detect non-browser platforms and return null instead of calling the function.

Parameters:
Name Type Optional Default value Description
produceNative NativeFactory No

The function that will create the native object. Receives the dependencies specified in deps.

config NativeFactoryGeneratorConfig No {}

(Optional) A configuration object for the generator.

Returns: FactoryProvider

A FactoryProvider object for the specified token.

core/testing/helpers/factories/setup/natives/native-factory-provider-generator-test-setup.ts

configNativeProviderGeneratorTestDefaults
configNativeProviderGeneratorTestDefaults(config: NativeProviderGeneratorTestConfig)

Applies default values for unspecified properties of the config object. This also overrides the default value defined for ProviderGeneratorTestConfig.mockValue with a new MockNative object.

Parameters:
Name Type Optional Description
config NativeProviderGeneratorTestConfig No

The configuration to which to apply default values.

A full config object with default values for properties that were not specified.

setupNativeFactoryProviderGeneratorTest
setupNativeFactoryProviderGeneratorTest(createNativeFactoryProvider: FactoryProviderGenerator, config: NativeProviderGeneratorTestConfig)

Prepares the testing environment for a factory provider generator test. This will

  1. Apply default values to the specified config.
  2. Add the element from the config as a provider so it can be injected into native factories.
  3. Setup the testing environment using setupFactoryProviderGeneratorTest().
Parameters:
Name Type Optional Default value Description
createNativeFactoryProvider FactoryProviderGenerator No

The native factory provider generator which will be tested.

config NativeProviderGeneratorTestConfig No {}

(Optional) The configuration for the test. See NativeProviderGeneratorTestConfig for defaults.

core/testing/helpers/factories/setup/natives/native-factory-provider-test-setup.ts

configNativeProviderTestDefaults
configNativeProviderTestDefaults(config: NativeProviderTestConfig)

Applies default values for unspecified properties of the config object.

Parameters:
Name Type Optional Description
config NativeProviderTestConfig No

The configuration to which to apply default values.

A full config object with default values for properties that were not specified.

setupNativeFactoryProviderTest
setupNativeFactoryProviderTest(provider: FactoryProvider, config: NativeProviderTestConfig)

Prepares the testing environment for a native factory provider test. This will:

  1. Apply default values to the specified config.
  2. Add the element from the config to the providers (because native factories need it).
  3. Setup the testing environment for a factory provider test using setupFactoryProviderTest().
Parameters:
Name Type Optional Default value Description
provider FactoryProvider No

The factory provider which will be tested.

config NativeProviderTestConfig No {}

(Optional) The configuration for the test. See NativeProviderTestConfig for defaults.

core/testing/helpers/factories/setup/common/factory-provider-generator-test-setup.ts

configProviderGeneratorTestDefaults
configProviderGeneratorTestDefaults(config: ProviderGeneratorTestConfig)

Applies default values for unspecified properties of the config object.

Parameters:
Name Type Optional Description
config ProviderGeneratorTestConfig No

The configuration to which to apply default values.

A full config object with default values for properties that were not specified.

setupFactoryProviderGeneratorTest
setupFactoryProviderGeneratorTest(createProvider: FactoryProviderGenerator, config: ProviderGeneratorTestConfig)

Prepares the testing environment for a factory provider generator test. This will:

  1. Apply default values to the specified config.
  2. Simulate the produceValue using a spy that returns the value in config.mockValue.
  3. Create the provider using the generator and the simulated produceValue function.
  4. Add SomeProvider as an additional provider passed to the produceValue function through its deps argument.
  5. Setup the testing environment using the setupFactoryProviderTest() function.
Parameters:
Name Type Optional Default value Description
createProvider FactoryProviderGenerator No

The factory provider generator which will be tested.

config ProviderGeneratorTestConfig No {}

(Optional) The configuration for the test. See ProviderGeneratorTestConfig for defaults.

core/testing/helpers/factories/setup/common/factory-provider-test-setup.ts

configTestDefaults
configTestDefaults(config: ProviderTestConfig)

Applies default values for unspecified properties of the config object.

Parameters:
Name Type Optional Description
config ProviderTestConfig No

The configuration to which to apply default values.

A full config object with default values for properties that were not specified.

setupFactoryProviderTest
setupFactoryProviderTest(testedProvider: FactoryProvider, config: ProviderTestConfig)

Prepares the testing environment for a factory provider test. This will:

  1. Apply default values to the specified config.
  2. Add the tested provider and a PLATFORM_ID provider, then configure a testing module using configureGoogleMapsTestingModule().
  3. Inject the provider to extract the value produced by the factory.
Parameters:
Name Type Optional Default value Description
testedProvider FactoryProvider No

The factory provider which will be tested.

config ProviderTestConfig No {}

(Optional) The configuration for the test. See ProviderTestConfig for defaults.

testing/helpers/setup.ts

configureGoogleMapsTestingModule
configureGoogleMapsTestingModule(options?: IGoogleMapsTestingModuleConfigOptions)

Configures a basic testing module with common definitions for Google Maps components and extracts useful tools and services. This should allow faster setup without the redundancy of declarations and extractions of services. After calling this function, the caller can simply deconstruct the tools and use them.

Parameters:
Name Type Optional Description
options IGoogleMapsTestingModuleConfigOptions Yes

(Optional) The options for the configuring the test module.

Example :
let { api, component } = createGoogleMapsTestingModule({ componentType: GoogleMapsComponent });
createGoogleMapsTestModuleMetadata
createGoogleMapsTestModuleMetadata()

Creates a TestModuleMetadata object that can be passed into TestBed.configureTestingModule() in order to imprort the GoogleMapsModule from the @bespunky/angular-google-maps/core package, which automatically provides NoOpGoogleMapsApiLoader as the GoogleMapsApiLoader token.

A TestBed-ready module configuration.

fakeTheRunXsideAngularMethod
fakeTheRunXsideAngularMethod(api: GoogleMapsApiService, methodName)

Creates a jest spy on the runOutsideAngular(), runInsideAngular(), runOutsideAngularWhenReady() or runInsideAngularWhenReady() method of the api which fakes its execution. The fake implementation skips actually running the code outside/outside of angular and proceeds with executing it directly.

Parameters:
Name Type Optional Description
api GoogleMapsApiService No

The api instance to spy on.

methodName No
Returns: jest.SpyInstance

A jest spy which can be used to count calls to api.runOutsideAngular().

async/testing/helpers/setup.ts

configureGoogleMapsTestingModule
configureGoogleMapsTestingModule(options?: IGoogleMapsTestingModuleConfigOptions)

Configures a basic testing module with common definitions for Google Maps components and extracts useful tools and services. This should allow faster setup without the redundancy of declarations and extractions of services. After calling this function, the caller can simply deconstruct the tools and use them.

Parameters:
Name Type Optional Description
options IGoogleMapsTestingModuleConfigOptions Yes

(Optional) The options for the configuring the test module.

Example :
let { api, component } = createGoogleMapsTestingModule({ componentType: GoogleMapsComponent });
createGoogleMapsTestModuleMetadata
createGoogleMapsTestModuleMetadata(config?: GoogleMapsConfig)

Creates a TestModuleMetadeta object that can be passed into TestBed.configureTestingModule() in order to import the GoogleMapsModule from the @bespunky/angular-google-maps/async package, and allow DI without actually downloading the API from google. This changes the default GoogleMapsApiLoader provider to the NoOpGoogleMapsApiLoader.

Parameters:
Name Type Optional Description
config GoogleMapsConfig Yes

(Optional) The module configuration to use when creating the module. Default is defaultTestApiConfig

A TestBed-ready module configuration.

core/abstraction/factories/wrappers.ts

configWrapperFactoryProviderGeneratorDefaults
configWrapperFactoryProviderGeneratorDefaults(config: WrapperFactoryGeneratorConfig)

Applies default values for undefined values in the config object.

Parameters:
Name Type Optional Description
config WrapperFactoryGeneratorConfig No

The optional config.

Returns: Required<WrapperFactoryGeneratorConfig>

The filled config.

createWrapperFactory
createWrapperFactory(produceWrapper: WrapperFactory)

Creates the factory that will be used in the provider created by createWrapperFactoryProvider. See createWrapperFactoryProvider for more details.

Parameters:
Name Type Optional Description
produceWrapper WrapperFactory No

The function that will create the wrapper object. Receives the GoogleMapsApiService, the native object and the dependencies specified in deps when configuring the generator.

createWrapperFactoryProvider
createWrapperFactoryProvider(produceWrapper: WrapperFactory, config: WrapperFactoryGeneratorConfig)

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.

Parameters:
Name Type Optional Default value Description
produceWrapper WrapperFactory No

The function that will create the wrapper object. Receives the GoogleMapsApiService, the native object and the dependencies specified in deps.

config WrapperFactoryGeneratorConfig No {}

(Optional) A configuration object for the generator.

Returns: FactoryProvider

A FactoryProvider object for the specified token.

core/testing/helpers/factories/setup/wrappers/wrapper-factory-provider-generator-test-setup.ts

configWrapperProviderGeneratorTestDefaults
configWrapperProviderGeneratorTestDefaults(config: WrapperProviderGeneratorTestConfig)

Applies default values for unspecified properties of the config object. This also overrides the default value defined for ProviderGeneratorTestConfig.mockValue with a new MockWrapper object.

Parameters:
Name Type Optional Description
config WrapperProviderGeneratorTestConfig No

The configuration to which to apply default values.

A full config object with default values for properties that were not specified.

setupWrapperFactoryProviderGeneratorTest
setupWrapperFactoryProviderGeneratorTest(createWrapperFactoryProvider: FactoryProviderGenerator, config: WrapperProviderGeneratorTestConfig)

Prepares the testing environment for a factory provider generator test. This will

  1. Apply default values to the specified config.
  2. Add a provider for the NativeInstance token using the native element wrapped in the wrapper from the config so it can be injected into native factories.
  3. Setup the testing environment using setupFactoryProviderGeneratorTest().
Parameters:
Name Type Optional Default value Description
createWrapperFactoryProvider FactoryProviderGenerator No

The wrapper factory provider generator which will be tested.

config WrapperProviderGeneratorTestConfig No {}

(Optional) The configuration for the test. See WrapperProviderGeneratorTestConfig for defaults.

core/testing/helpers/factories/setup/wrappers/wrapper-factory-provider-test-setup.ts

configWrapperProviderTestDefaults
configWrapperProviderTestDefaults(config: WrapperProviderTestConfig)

Applies default values for unspecified properties of the config object.

Parameters:
Name Type Optional Description
config WrapperProviderTestConfig No

The configuration to which to apply default values.

A full config object with default values for properties that were not specified.

setupWrapperFactoryProviderTest
setupWrapperFactoryProviderTest(provider: FactoryProvider, config: WrapperProviderTestConfig)

Prepares the testing environment for a wrapper factory provider test. This will:

  1. Apply default values to the specified config.
  2. Add the native object from the config as a provider to NativeInstance (because wrapper factories need it).
  3. Setup the testing environment for a factory provider test using setupFactoryProviderTest().
Parameters:
Name Type Optional Default value Description
provider FactoryProvider No

The factory provider which will be tested.

config WrapperProviderTestConfig No {}

(Optional) The configuration for the test. See WrapperProviderTestConfig for defaults.

core/testing/helpers/lifecycle-components.ts

createLifecycleTestingHostComponentTemplate
createLifecycleTestingHostComponentTemplate(testedComponentTemplate: string, mapDirectives: string)

Wraps the template of a tested component with a map element template.

Parameters:
Name Type Optional Default value Description
testedComponentTemplate string No

The template to include inside of the map element.

mapDirectives string No ''

(Optional) Any directives or attributes to add to the map element.

Returns: string

A string containing the component template wrapped inside a map tempalte.

core/utils/proxy-utils.ts

createNativeProxy
createNativeProxy(wrapper: TWrapper)

Creates a proxy object trapping calls to the native object held by the wrapper. Calls are delegated according to delegation rules and definitions. See @NativeObjectWrapper() decorator for default behavior.

Parameters:
Name Type Optional Description
wrapper TWrapper No

The wrapper which will be used to proxy calls to the native object.

delegateNativeFunction
delegateNativeFunction(wrapper: Wrapper, functionName: string, wrappingDef: WrapperFunctionDefinition, wrapperName: string)

Determines how the native function should be executed and returns a function that implements it accordingly. If a wrapping definition is provided for the function, it will be wrapped accordingly. Otherwise:

  • getXXX() functions will be returned as-is.
  • setXXX() functions will be wrapped with a function executing outside angular.
  • Anything else will be considered as an excluded function and will throw an error.

Note: This is defined here and not as a private method of the extending class to avoid exposing it to the object's user.

Parameters:
Name Type Optional Description
wrapper Wrapper No

The wrapper holding the native object.

functionName string No

The name of the function to delegate.

wrappingDef WrapperFunctionDefinition No

The wrapping definition for the function.

wrapperName string No

The name of the wrapper class.

Returns: Function

A function that will execute the native function by its wrapping definition or by the defined default behaviour.

delegateOutside
delegateOutside(exec: Function, wrapper: Wrapper)

Wraps the specified function in a function that will execute it outside angular.

Parameters:
Name Type Optional Description
exec Function No

The function which actually implements the work to execute.

wrapper Wrapper No

The wrapper to bind the function to.

Returns: Function

A wrapping function that will execute the specified function outside angular.

delegateWrapperMethod
delegateWrapperMethod(wrapper: Wrapper, methodName: string, outside: boolean)

Determines how the wrapper method should be executed and returns a function that implements it accordingly. If the method should be executed outside angular, it will be wrapped and returned. Otherwise, the method itself will be returned.

Note: This is defined here and not as a private method of the extending class to avoid exposing it to the object's user.

Parameters:
Name Type Optional Description
wrapper Wrapper No

The wrapper object holding the method to execute.

methodName string No

The name of the method to delegate.

outside boolean No

true if the method should be executed outside angular; otherwise false.

Returns: Function

A function that will execute the wrapper method by its wrapping definition.

extractWrapperMetadata
extractWrapperMetadata(wrapper: Wrapper)

Extracts decorators metadata from a wrapper object.

Parameters:
Name Type Optional Description
wrapper Wrapper No

The wrapper object to extract metadata from.

Returns: WrapperMetadata

The metadata defined for that type of wrapper.

isGetter
isGetter(property: string)

Checks whether the given property name matches a getter method name pattern of get<SomeProperty>. *

Parameters:
Name Type Optional Description
property string No

The name of the property to evaluate.

Returns: boolean

true if the property name matches the getter pattern; otherwise false.

isSetter
isSetter(property: string)

Checks whether the given property name matches a setter method name pattern of set<SomeProperty>. *

Parameters:
Name Type Optional Description
property string No

The name of the property to evaluate.

Returns: boolean

true if the property name matches the setter pattern; otherwise false.

throwExcludedError
throwExcludedError(wrapperTypeName: string, property: string)

Throws the error for method execution attemps of excluded properties on a proxy object with an explanatory message.

Parameters:
Name Type Optional Description
wrapperTypeName string No

The name of the wrapper class which was being accessed.

property string No

The name of the excluded property which was being accessed.

Returns: void

core/testing/helpers/geometry-expectations.ts

expectBounds
expectBounds(makeBounds, northEast: Coord, southWest: Coord)

Produces a bounds object using the specified funcion and compares it to the specified corner coords.

Parameters:
Name Type Optional Description
makeBounds No

A function which produces a native bounds object.

northEast Coord No

The expected north-east corner of the produced bounds.

southWest Coord No

The expected south-west corner of the produced bounds.

Returns: void
expectCoord
expectCoord(makeCoord, expected: Coord)

Produces a coord using the specified function and compares it to the expected coord.

Parameters:
Name Type Optional Description
makeCoord No

A function which produces a coord.

expected Coord No

The coord expected to be produced by the makeCoord() function.

Returns: void
expectPath
expectPath(makePath, expected: CoordPath)

Produces a path using the specified function and compares it to the expected path.

Parameters:
Name Type Optional Description
makePath No

A function which produces a path.

expected CoordPath No

The path expected to be produced by the makePath() function.

Returns: void

directions/testing/helpers/directions-expectations.ts

expectPlace
expectPlace(place: DirectionsPlace, expected: DirectionsPlace)
Parameters:
Name Type Optional
place DirectionsPlace No
expected DirectionsPlace No

testing/helpers/expectations.ts

expectPositionEquals
expectPositionEquals(position1: Coord, position2: Coord, geometry?: GeometryTransformService)

Shortcuts expecting a literal position match with a native LatLng object. Uses toBeCloseTo() with 6 digits precision.

Parameters:
Name Type Optional Description
position1 Coord No

The first coordinate to compare.

position2 Coord No

The second coordinate to compare.

geometry GeometryTransformService Yes

core/decorators/hook.decorator.ts

Hook
Hook(nativeName?: string)

Marks a component @Output() member that will serve as an emitter of a native event. Use in components/directive which inherit from GoogleMapsComponentBase to allow users of the component to handle native events in angular.

Parameters:
Name Type Optional Description
nativeName string Yes

(Optional) The name of the native event. If not provided, the name of the component member will be used.

Example :
<code> @Hook @Output() public click: EventEmitter&lt;IGoogleMapsEventData&gt;;</code>

overlays/abstraction/type-guards/feature-options-type-guard.ts

isGoogleMapsFeatureOptions
isGoogleMapsFeatureOptions(feature: any)

(Type Guard) Determines if the given value is a native feature options object.

Parameters:
Name Type Optional Description
feature any No

The value to test.

Returns: google.maps.Data.FeatureOptions

true if the value is a native feature options object; otherwise false.

core/abstraction/type-guards/mouse-event-type-guard.ts

isGoogleMapsMouseEvent
isGoogleMapsMouseEvent(event: any)

Checks whether the given value is a native map mouse event object.

Parameters:
Name Type Optional Description
event any No

The value to test.

Returns: google.maps.MapMouseEvent

true if the object is a native map mouse event; otherwise false.

core/testing/helpers/factories/specs/native-factory-provider-spec-production.ts

itShouldBeAFactoryProviderForNative
itShouldBeAFactoryProviderForNative(provider, expectedToken)
Parameters:
Name Optional
provider No
expectedToken No
produceBrowserNativeFactoryProviderSpecs
produceBrowserNativeFactoryProviderSpecs(provider, producedNative, runOutsideAngular, expectedToken, expectedNativeType: Type)

Produces specs for native factory providers for browser platforms. See implementation for included tests.

Parameters:
Name Type Optional Description
provider No

A function that returns the tested provider.

producedNative No

A function that returns the value produced by the provider.

runOutsideAngular No

A function that returns the runOutsideAngular spy.

expectedToken No
expectedNativeType Type No

The type of native object expected to be produced by the factory.

produceNativeFactoryProviderSpecs
produceNativeFactoryProviderSpecs(setup, provider, producedNative, runOutsideAngular, expectedToken, expectedNativeType: Type, additionalSpecs?: AdditionalNativeFactoryProviderSpecs)

Produces specs for native factory providers for both browser and non-browser platforms.

Parameters:
Name Type Optional Description
setup No

The function that will setup the testing environment.

provider No

A function that returns the tested provider.

producedNative No

A function that returns the value produced by the factory.

runOutsideAngular No

A function that returns the runOutsideAngular spy.

expectedToken No
expectedNativeType Type No

The type of native object expected to be produced by the factory.

additionalSpecs AdditionalNativeFactoryProviderSpecs Yes

(Optional) Additional specs that should be run after the automated specs provided by produceBrowserNativeFactoryProviderSpecs() and produceNonBrowserNativeFactoryProviderSpecs().

produceNonBrowserNativeFactoryProviderSpecs
produceNonBrowserNativeFactoryProviderSpecs(provider, producedNative, expectedToken)

Produces specs for native factory providers for non-browser platforms. See implementation for included tests.

Parameters:
Name Optional Description
provider No

A function that returns the tested provider.

producedNative No

A function that returns the value produced by the provider.

expectedToken No

core/testing/helpers/factories/specs/wrapper-factory-provider-spec-production.ts

itShouldBeAFactoryProviderForWrapperToken
itShouldBeAFactoryProviderForWrapperToken(provider, expectedToken)
Parameters:
Name Optional
provider No
expectedToken No
produceBrowserWrapperFactoryProviderSpecs
produceBrowserWrapperFactoryProviderSpecs(provider, producedWrapper, expectedToken, expectedWrapperType: Type, expectedNative: any)

Produces specs for wrapper factory providers for browser platforms. See implementation for included tests.

Parameters:
Name Type Optional Description
provider No

A function that returns the tested provider.

producedWrapper No

A function that returns the value produced by the provider.

expectedToken No
expectedWrapperType Type No

The type of wrapper object expected to be produced by the factory.

expectedNative any No

The native object expected to be wrapped in the produced wrapper object.

produceNonBrowserWrapperFactoryProviderSpecs
produceNonBrowserWrapperFactoryProviderSpecs(provider, producedWrapper, expectedToken)

Produces specs for wrapper factory providers for non-browser platforms. See implementation for included tests.

Parameters:
Name Optional Description
provider No

A function that returns the tested provider.

producedWrapper No

A function that returns the value produced by the provider.

expectedToken No
produceWrapperFactoryProviderSpecs
produceWrapperFactoryProviderSpecs(setup, provider, producedWrapper, expectedToken, expectedWrapperType: Type, expectedNative: any, additionalSpecs?: AdditionalWrapperFactoryProviderSpecs)

Produces specs for wrapper factory providers for both browser and non-browser platforms.

Parameters:
Name Type Optional Description
setup No

The function that will setup the testing environment.

provider No

A function that returns the tested provider.

producedWrapper No

A function that returns the value produced by the provider.

expectedToken No
expectedWrapperType Type No

The type of wrapper object expected to be produced by the factory.

expectedNative any No

The native object expected to be wrapped in the produced wrapper object.

additionalSpecs AdditionalWrapperFactoryProviderSpecs Yes

(Optional) Additional specs that should be run after the automated specs provided by produceBrowserWrapperFactoryProviderSpecs() and produceNonBrowserWrapperFactoryProviderSpecs().

core/decorators/native-object-wrapper.decorator.ts

NativeObjectWrapper
NativeObjectWrapper(definition: WrapperDefinition)

Defines how method calls should be delegated to the native object. All classes implementing IGoogleMapsNativeObjectWrapper (directly or indirectly) should be decorated with @NativeObjectWrapper.

There are 3 pieces to the puzzle:

  1. Intercepting access to methods that don't exist on the wrapper and redirecting them to the native object.
  2. Providing Intellisense for for wrapping methods without providing their implementation (as it will be automated by #1).
  3. Delegating component input changes to the wrapper's methods.

See WrappedNativeFunctions for implementing #2.
See GoogleMapsComponentApiService for implementing #3.

Default behaviour:

  • getXXX() and setXXX() calls are automatically delegated to the native object.
  • setXXX() methods are automatically delegated outside angular.
  • Anything else will be excluded and will throw an error if it doesn't already have an implementation on the wrapper.

Custom behaviour:

  • Use the definition param to override and control what gets delegated and how it will be wrapped.
  • Decorate manually implemented wrapper methods which should run outside angular with @OutsideAngular.
Parameters:
Name Type Optional Default value Description
definition WrapperDefinition No {}

(Optional) Additional wrapping definitions for native functions.

core/decorators/outside-angular.decorator.ts

OutsideAngular
OutsideAngular(target: Object, methodName: string, descriptor: PropertyDescriptor)

Wraps the method with a call to api.runOutsideAngular(). Methods decorated with this are expected to have access to a GoogleMapsApiService instance via this.api.

This should be used inside classes marked with @NativeObjectWrapper. In general, methods that change the map, its configuration, or cause it to redraw, should be marked with @OutsideAngular. This will prevent unnecessary change detection runs as native Google Maps code is not associated with Angular.

Parameters:
Name Type Optional
target Object No
methodName string No
descriptor PropertyDescriptor No

core/testing/helpers/geometry-spec-production.ts

produceBoundsLikeSpecs
produceBoundsLikeSpecs(expectation: string, test, exclude?)

Produces a spec for each supported BoundsLike geometry type and runs the test against the geometry.

Parameters:
Name Type Optional Description
expectation string No

Format is should <expectation> for a <type name>.

test No

The test to perform on the bounds like element.

exclude Yes

(Optional) Type names of bounds like object to exclude from the specs. Example: ['literal coord', 'LatLng coord'].

Returns: void
produceCoordSpecs
produceCoordSpecs(expectation: string, test)

Produces a spec for each supported coord type and runs the test against the coord.

Parameters:
Name Type Optional Description
expectation string No

Format is should <expectation> for a <geometry type>.

test No

The test to perform on the coord.

Returns: void
produceDataGeometrySpecs
produceDataGeometrySpecs(expectation: string, test)

Produces a spec for each supported data layer geometry type and runs the test against the geometry.

Parameters:
Name Type Optional Description
expectation string No

Format is should <expectation> for a <geometry type>.

test No

The test to perform on the geometry.

Returns: void
produceFlexibleDummiesSpecs
produceFlexibleDummiesSpecs(flexibles: FlexibleDummies, flexibleType: string, expectation: string, test, exclude)
Parameters:
Name Type Optional Default value
flexibles FlexibleDummies No
flexibleType string No
expectation string No
test No
exclude No []
Returns: void
produceIBoundsSpecs
produceIBoundsSpecs(expectation: string, test)

Produces a spec for each supported IBounds implementing types and runs the test against the implementers.

Parameters:
Name Type Optional Description
expectation string No

Format is should <expectation> for a <geometry type>.

test No

The test to perform on the IBounds implementer.

Returns: void
produceMultiPathSpecs
produceMultiPathSpecs(expectation: string, test)

Produces a spec for each supported multi path type and runs the test against the path.

Parameters:
Name Type Optional Description
expectation string No

Format is should <expectation> for a <geometry type>.

test No

The test to perform on the path.

Returns: void
produceNativeBoundsSpecs
produceNativeBoundsSpecs(expectation: string, test)

Produces a spec for each supported native bounds types and runs the test against the bounds.

Parameters:
Name Type Optional Description
expectation string No

Format is should <expectation> for a <geometry type>.

test No

The test to perform on the bounds object.

Returns: void
producePathSpecs
producePathSpecs(expectation: string, test)

Produces a spec for each supported path type (single and multi paths) and runs the test against the path.

Parameters:
Name Type Optional Description
expectation string No

Format is should <expectation> for a <geometry type>.

test No

The test to perform on the path.

Returns: void
produceSinglePathSpecs
produceSinglePathSpecs(expectation: string, test)

Produces a spec for each supported single path type and runs the test against the path.

Parameters:
Name Type Optional Description
expectation string No

Format is should <expectation> for a <geometry type>.

test No

The test to perform on the path.

Returns: void

directions/testing/helpers/directions-spec-production.ts

produceFlexiblePlaceSpecs
produceFlexiblePlaceSpecs(expectation: string, test)

Produces a spec for the additional types supported by the library as places and runs the test against each place.

Parameters:
Name Type Optional Description
expectation string No

Format is should <expectation> for a <place type>.

test No

The test to perform on the place.

Returns: void
produceFlexibleWaypointSpecs
produceFlexibleWaypointSpecs(expectation: string, test)

Produces a spec for the additional waypoint types supported by the library and runs the test against each waypoint.

Parameters:
Name Type Optional Description
expectation string No

Format is should <expectation> for a <wayoint type>.

test No

The test to perform on the waypoint.

Returns: void
produceNativePlaceSpecs
produceNativePlaceSpecs(expectation: string, test)

Produces a spec for each native place type and runs the test against the place.

Parameters:
Name Type Optional Description
expectation string No

Format is should <expectation> for a <place type>.

test No

The test to perform on the place.

Returns: void
produceNativeWaypointSpecs
produceNativeWaypointSpecs(expectation: string, test)

Produces a spec for each native waypoint type and runs the test against the waypoint.

Parameters:
Name Type Optional Description
expectation string No

Format is should <expectation> for a <wayoint type>.

test No

The test to perform on the waypoint.

Returns: void
producePlaceSpecs
producePlaceSpecs(expectation: string, test)

Produces a spec for each supported place type and runs the test against the place.

Parameters:
Name Type Optional Description
expectation string No

Format is should <expectation> for a <place type>.

test No

The test to perform on the place.

Returns: void
produceWaypointSpecs
produceWaypointSpecs(expectation: string, test)

Produces a spec for each supported waypoint type and runs the test against the waypoint.

Parameters:
Name Type Optional Description
expectation string No

Format is should <expectation> for a <wayoint type>.

test No

The test to perform on the waypoint.

Returns: void

overlays/testing/helpers/factories/setup/overlay-wrapper-factory-provider-test-setup.ts

setupOverlayWrapperFactoryProviderTest
setupOverlayWrapperFactoryProviderTest(factoryProvider: FactoryProvider, config?: WrapperProviderTestConfig)

Configures a testing module for overlay wrapper factories. Used with itShouldCreateWrapper().

Parameters:
Name Type Optional Description
factoryProvider FactoryProvider No

The wrapper factory provider to add to the testing module.

config WrapperProviderTestConfig Yes

core/testing/helpers/factories/native-factory-provider-test-production.ts

testNativeFactoryProvider
testNativeFactoryProvider(testConfig: Omit)

Performs setup and spec production for native factory providers using the default setupNativeFactoryProviderTest() as a setup function.

How: Creates a testing section with the provider name using describe(), sets up the testing environment using the default setup function and produces native factory provider specs using the produceNativeFactoryProviderSpecs() function.

Parameters:
Name Type Optional Description
testConfig Omit No

The configuration for the test.

testNativeFactoryProviderCore
testNativeFactoryProviderCore(__namedParameters: {providerName: NativeFactoryProviderTest, provider, setup, expectedToken, expectedNativeType, providers, element, additionalSpecs})

Performs setup and spec production for native factory providers.

How: Creates a testing section with the provider name using describe(), sets up the testing environment using the provided setup function and produces native factory provider specs using the produceNativeFactoryProviderSpecs() function.

Parameters:
Name Type Optional
providerName NativeFactoryProviderTest No
provider No
setup No
expectedToken No
expectedNativeType No
providers No
element No
additionalSpecs No

overlays/testing/helpers/factories/overlay-native-factory-provider-test-production.ts

testOverlayNativeFactoryProvider
testOverlayNativeFactoryProvider(testConfig: Omit)

Performs setup and spec production for native overlay factory providers using the default setupNativeFactoryProviderTest() as a setup function.

How: Creates a testing section with the provider name using describe(), sets up the testing environment using the default setup function and produces native factory provider specs using the produceNativeFactoryProviderSpecs() function.

Parameters:
Name Type Optional Description
testConfig Omit No

The configuration for the test.

overlays/testing/helpers/factories/overlay-wrapper-factory-provider-test-production.ts

testOverlayWrapperFactoryProvider
testOverlayWrapperFactoryProvider(testConfig: Omit)

Performs setup and spec production for an overlay wrapper factory providers using the default setupOverlayWrapperFactoryProviderTest() as a setup function. Also adds a MockNativeDrawableOverlay as the native injected into the wrapper.

How: Creates a testing section with the provider name using describe(), sets up the testing environment using the default setup function and produces native factory provider specs using the produceWrapperFactoryProviderSpecs() function.

Parameters:
Name Type Optional Description
testConfig Omit No

The configuration for the test.

core/testing/mocks/mock-component.ts

TestWrapperFactory
TestWrapperFactory()

core/testing/helpers/factories/wrapper-factory-provider-test-production.ts

testWrapperFactoryProvider
testWrapperFactoryProvider(testConfig: Omit)

Performs setup and spec production for wrapper factory providers using the default setupWrapperFactoryProviderTest() as a setup function.

How: Creates a testing section with the provider name using describe(), sets up the testing environment using the default setup function and produces wrapper factory provider specs using the produceWrapperFactoryProviderSpecs() function.

Parameters:
Name Type Optional Description
testConfig Omit No

The configuration for the test.

testWrapperFactoryProviderCore
testWrapperFactoryProviderCore(__namedParameters: {providerName: WrapperFactoryProviderTest, provider, setup, expectedToken, expectedWrapperType, mockNative, providers, additionalSpecs})

Performs setup and spec production for wrapper factory providers.

How: Creates a testing section with the provider name using describe(), sets up the testing environment using the provided setup function and produces native factory provider specs using the produceWrapperFactoryProviderSpecs() function.

Parameters:
Name Type Optional
providerName WrapperFactoryProviderTest No
provider No
setup No
expectedToken No
expectedWrapperType No
mockNative No
providers No
additionalSpecs No

results matching ""

    No results matching ""