@instawork/design-system
Version:
The design system for Instawork's web apps
25 lines (24 loc) • 1.15 kB
TypeScript
import { Duration } from 'luxon';
export interface TimeRangeDurationInfo {
readonly crossesMidnight: boolean;
readonly offsetChange: number;
}
/**
* Data structure used by {@link TimeRangeComponent} to represent the current duration value, as well as the diff as
* compared to the original duration value of the time inputs.
*/
export declare class TimeRangeDurationState {
readonly current: Duration;
readonly original: Duration;
readonly diff: Duration;
readonly info: TimeRangeDurationInfo;
/**
*
* @param current - The current duration value based on the current values of start and end inputs
* @param original - The original duration based on the original values of the start and end inputs
* @param diff - The difference between the current and original durations
* @param crossesMidnight - Whether the time range crosses midnight (into the next day)
* @param offsetChange - The change in time zone offset, if any (e.g. due to entering or leaving DST)
*/
constructor(current: Duration, original: Duration, diff: Duration, crossesMidnight?: boolean, offsetChange?: number);
}