/** * @license * Copyright 2022-2026 Matter.js Authors * SPDX-License-Identifier: Apache-2.0 */ import { Duration } from "./Duration.js"; /** * Details of a specific unit of time. */ export interface TimeUnit { (scale: number | bigint): Duration; (scale: undefined | number | bigint): undefined | Duration; /** * Long name of the unit. */ readonly kind: TimeUnit.Kind; /** * Abbreviated name of the unit. */ readonly abbrev: string; /** * An interval representing a single unit. */ readonly one: Duration; /** * Convert an interval to an integer of this unit. * * Produces an even integer result. Use {@link fractionalOf} to retain any fractional component. */ of(interval: T): T extends undefined ? number | undefined : number; /** * Convert an interval to this unit, retaining fractional component. */ fractionalOf(interval: T): T extends undefined ? number | undefined : number; /** * Compute the ceiling of an interval in this unit. */ ceil(duration: Duration): Duration; /** * Compute the floor of an interval in this unit. */ floor(duration: Duration): Duration; /** * Round an interval to this unit. */ round(duration: Duration): Duration; length: never; } export declare namespace TimeUnit { /** * Standard time units. */ type Kind = "microsecond" | "millisecond" | "second" | "minute" | "hour" | "day"; } /** * Implement a {@link TimeUnit}. */ export declare function TimeUnit(kind: TimeUnit.Kind, abbrev: string, one: number, props?: T): TimeUnit & T; /** * Create an interval in microseconds. */ export declare const Microseconds: TimeUnit; /** * Create an interval in milliseconds. */ export declare const Millis: TimeUnit; /** * Create an interval in seconds. */ export declare const Seconds: TimeUnit; /** * Create an interval in minutes. */ export declare const Minutes: TimeUnit; /** * Create an interval in hours. */ export declare const Hours: TimeUnit; /** * Create an interval in days. */ export declare const Days: TimeUnit; /** * A zero-length interval. */ export declare const Instant: Duration; /** * An infinite interval. */ export declare const Forever: Duration; //# sourceMappingURL=TimeUnit.d.ts.map