Skip to main content

Class: GenericNavDataBarFieldModelFactory

A generic implementation of a factory for navigation data bar field data models. For each data field type, a single-type model factory can be registered. Once registered, the single-type model factory is used to create data models for its assigned data field type.

Implements

Constructors

constructor

new GenericNavDataBarFieldModelFactory(gpsValidity): GenericNavDataBarFieldModelFactory

Creates an instance of aGenericNavDataBarFieldModelFactory.

Parameters

NameTypeDescription
gpsValiditySubscribable<NavDataFieldGpsValidity>The subscribable that provides the validity of the GPS data for the models.

Returns

GenericNavDataBarFieldModelFactory

Defined in

src/garminsdk/components/navdatabar/GenericNavDataBarFieldModelFactory.ts:19

Methods

create

create<T>(type): NavDataBarFieldTypeModelMap[T]

Creates a navigation data bar field data model for a given type of field.

Type parameters

NameType
Textends NavDataFieldType

Parameters

NameTypeDescription
typeTA data bar field type.

Returns

NavDataBarFieldTypeModelMap[T]

A navigation data bar field data model for the given field type.

Throws

Error if an unsupported field type is specified.

Implementation of

NavDataBarFieldModelFactory.create

Defined in

src/garminsdk/components/navdatabar/GenericNavDataBarFieldModelFactory.ts:45


deregister

deregister<T>(type): boolean

Deregisters a single-type model factory from this factory.

Type parameters

NameType
Textends NavDataFieldType

Parameters

NameTypeDescription
typeTThe data field type of the single-type model factory to deregister.

Returns

boolean

Whether a single-type model factory was deregistered.

Defined in

src/garminsdk/components/navdatabar/GenericNavDataBarFieldModelFactory.ts:35


register

register<T>(type, factory): void

Registers a single-type model factory with this factory.

Type parameters

NameType
Textends NavDataFieldType

Parameters

NameTypeDescription
typeTThe data field type of the single-type model factory to register.
factoryNavDataBarFieldTypeModelFactory<T>The single-type model factory to register.

Returns

void

Defined in

src/garminsdk/components/navdatabar/GenericNavDataBarFieldModelFactory.ts:26