-
Notifications
You must be signed in to change notification settings - Fork 134
Open
Description
Hi,
The Formatter type is defined as follows:
export type Formatter = (
value: number,
unit: Unit,
suffix: Suffix,
epochMilliseconds: number,
nextFormatter: Formatter,
now: () => number,
) => React.ReactNodeNote how the nextFormatter and now parameters are required arguments to Formatter and nextFormatter is declared as a Formatter.
According to the docs and the code, nextFormatter actually takes all the options as optional and will use the prior values if none is provided (or undefined). So the type should be something like:
export type NextFormatter = (
value?: number,
unit?: Unit,
suffix?: Suffix,
epochMilliseconds?: number,
nextFormatter?: Formatter,
now?: () => number,
) => React.ReactNode;
export type Formatter = (
value: number,
unit: Unit,
suffix: Suffix,
epochMilliseconds: number,
nextFormatter: NextFormatter,
now: () => number,
) => React.ReactNode;
Metadata
Metadata
Assignees
Labels
No labels