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
Name | Type | Description |
---|---|---|
gpsValidity | Subscribable <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
Name | Type |
---|---|
T | extends NavDataFieldType |
Parameters
Name | Type | Description |
---|---|---|
type | T | A 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
Name | Type |
---|---|
T | extends NavDataFieldType |
Parameters
Name | Type | Description |
---|---|---|
type | T | The 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
Name | Type |
---|---|
T | extends NavDataFieldType |
Parameters
Name | Type | Description |
---|---|---|
type | T | The data field type of the single-type model factory to register. |
factory | NavDataBarFieldTypeModelFactory <T > | The single-type model factory to register. |
Returns
void
Defined in
src/garminsdk/components/navdatabar/GenericNavDataBarFieldModelFactory.ts:26