Skip to main content

Class: NumberUnitDisplay<F>

A component which displays a number with units.

Type parameters

NameType
Fextends string

Hierarchy

Constructors

constructor

new NumberUnitDisplay<F>(props): NumberUnitDisplay<F>

Creates an instance of a DisplayComponent.

Type parameters

NameType
Fextends string

Parameters

NameTypeDescription
propsNumberUnitDisplayProps<F>The propertis of the component.

Returns

NumberUnitDisplay<F>

Inherited from

AbstractNumberUnitDisplay<F, NumberUnitDisplayProps<F>>.constructor

Defined in

src/sdk/components/FSComponent.ts:73

Properties

context

Optional context: [] = undefined

The context on this component, if any.

Inherited from

AbstractNumberUnitDisplay.context

Defined in

src/sdk/components/FSComponent.ts:64


contextType

Optional Readonly contextType: readonly [] = undefined

The type of context for this component, if any.

Inherited from

AbstractNumberUnitDisplay.contextType

Defined in

src/sdk/components/FSComponent.ts:67


displayUnit

Protected Readonly displayUnit: Subscribable<null | Unit<F>>

A subscribable which provides the unit type in which to display the value.

Inherited from

AbstractNumberUnitDisplay.displayUnit

Defined in

src/sdk/components/common/AbstractNumberUnitDisplay.tsx:31


props

props: NumberUnitDisplayProps<F> & ComponentProps

The properties of the component.

Inherited from

AbstractNumberUnitDisplay.props

Defined in

src/sdk/components/FSComponent.ts:61


value

Protected Readonly value: Subscribable<NumberUnitInterface<F, Unit<F>>>

A subscribable which provides the value to display.

Inherited from

AbstractNumberUnitDisplay.value

Defined in

src/sdk/components/common/AbstractNumberUnitDisplay.tsx:26

Methods

destroy

destroy(): void

Returns

void

Inherit Doc

Inherited from

AbstractNumberUnitDisplay.destroy

Defined in

src/sdk/components/common/AbstractNumberUnitDisplay.tsx:57


getContext

getContext(context): never

Gets a context data subscription from the context collection.

Parameters

NameTypeDescription
contextneverThe context to get the subscription for.

Returns

never

The requested context.

Throws

An error if no data for the specified context type could be found.

Inherited from

AbstractNumberUnitDisplay.getContext

Defined in

src/sdk/components/FSComponent.ts:106


onAfterRender

onAfterRender(): void

Returns

void

Inherit Doc

Inherited from

AbstractNumberUnitDisplay.onAfterRender

Defined in

src/sdk/components/common/AbstractNumberUnitDisplay.tsx:39


onBeforeRender

onBeforeRender(): void

A callback that is called before the component is rendered.

Returns

void

Inherited from

AbstractNumberUnitDisplay.onBeforeRender

Defined in

src/sdk/components/FSComponent.ts:80


onDisplayUnitChanged

onDisplayUnitChanged(displayUnit): void

Parameters

NameType
displayUnitnull | Unit<F>

Returns

void

Inherit Doc

Overrides

AbstractNumberUnitDisplay.onDisplayUnitChanged

Defined in

src/garminsdk/components/common/NumberUnitDisplay.tsx:70


onValueChanged

onValueChanged(value): void

Parameters

NameType
valueNumberUnitInterface<F, Unit<F>>

Returns

void

Inherit Doc

Overrides

AbstractNumberUnitDisplay.onValueChanged

Defined in

src/garminsdk/components/common/NumberUnitDisplay.tsx:65


render

render(): VNode

Returns

VNode

Inherit Doc

Overrides

AbstractNumberUnitDisplay.render

Defined in

src/garminsdk/components/common/NumberUnitDisplay.tsx:119


DEFAULT_UNIT_FORMATTER

DEFAULT_UNIT_FORMATTER(out, unit): void

A function which formats units to default text for NumberUnitDisplay.

Parameters

NameTypeDescription
out[string, string]The 2-tuple to which to write the formatted text, as [bigText, smallText].
unitUnit<any>The unit to format.

Returns

void

Defined in

src/garminsdk/components/common/NumberUnitDisplay.tsx:44