@oslokommune/punkt-elements
Version:
Komponentbiblioteket til Punkt, et designsystem laget av Oslo Origo
20 lines (19 loc) • 803 B
TypeScript
/**
* Shared timepicker option generation utilities.
* Used by both Elements and React implementations.
* Only framework-agnostic functions belong here.
*/
/**
* Converts a step value in seconds to a step value in minutes.
* Defaults to 1 if step is null/undefined/zero.
*/
export declare const getMinuteStep: (stepSeconds?: number | null) => number;
/**
* Returns an array of valid hour values (0–23) based on min/max constraints.
* min and max should be HH:MM strings; invalid/missing values fall back to 0 and 23.
*/
export declare const getHourOptions: (min?: string | number | null, max?: string | number | null) => number[];
/**
* Returns an array of valid minute values based on step constraints.
*/
export declare const getMinuteOptions: (stepSeconds?: number | null) => number[];