/** * @license * Copyright 2022-2026 Matter.js Authors * SPDX-License-Identifier: Apache-2.0 */ import { UnexpectedDataError } from "#MatterError.js"; import { Branded } from "#util/Type.js"; /** * A time interval. * * You can create an interval using a {@link TimeUnit} factory such as {@link Seconds}. * * Regardless of the input unit, intervals are stored as milliseconds. You can use {@link TimeUnit#of} to convert an * interval to the correct unit. * * Math operators always result in millisecond values and can thus be converted back to an interval using * {@link Millis}. For example, `Millisecs(Hours(1) + Minutes(30))` would produce a 90 minute {@link Duration}. */ export type Duration = Branded | 0; /** * Create an interval from a number or string. */ export declare function Duration(source: T): Duration; /** * Thrown when a textual duration cannot be parsed. */ export declare class DurationFormatError extends UnexpectedDataError { } export declare namespace Duration { /** * Determine the greater of two intervals. */ function max(a: Duration, b: Duration): Duration; /** * Determine the lesser of two intervals. */ function min(a: Duration, b: Duration): Duration; /** * Convert an interval to a compact human-readable string. */ function format(duration: T): T extends undefined ? string | undefined : string; /** * Parse a string into an interval. */ function parse(text: string): Duration; } //# sourceMappingURL=Duration.d.ts.map