/*! Copyright (c) 2018 Siemens AG. Licensed under the MIT License. */ /** * Returns a string in ISO 8601 format including timezone offset information. * @param date a Date object * @param includeMillis whether to include milliseconds in the string (defaults to false) */ export declare function toLocalIsoString(date: Date, includeMillis?: boolean): string; /** * Returns a string in ISO 8601 format for a duration. * @param duration a duration given in milliseconds */ export declare function toDurationIsoString(duration: number): string; /** * Defines a time interval using the number of milliseconds since the epoc in UTC * instead of ISO 8601 standard time intervals. This is used for consistency within * the system. * * An interval can have four formats: * - start and end timestamps * - start timestamp and duration * - duration and end timestamp * - duration only * * The ISO 8601 standard string can be created using the function `toLocalTimeIntervalIsoString` * in the `@coaty/core` module. */ export interface TimeInterval { /** * Start timestamp of the interval. * Value represents the number of milliseconds since the epoc in UTC. * (see Date.getTime(), Date.now()) * * This can be either used with end timestamp or a duration but not both. */ start?: number; /** * End timestamp of the interval. * Value represents the number of milliseconds since the epoc in UTC. * (see Date.getTime(), Date.now()) * * This can be either used with start timestamp or a duration but not both. */ end?: number; /** * Duration of the interval. Value represents the number of milliseconds. * * This can be either used with start or end timestamp but not both. */ duration?: number; } export declare function isTimeInterval(obj: any): boolean; /** * Returns whether the given time interval object is valid. */ export declare function isValidTimeInterval(interval: TimeInterval): boolean; /** * Returns a string in ISO 8601 format for a time interval including timezone offset information. * @param interval a TimeInterval object * @param includeMillis whether to include milliseconds in the string (defaults to false) */ export declare function toLocalIntervalIsoString(interval: TimeInterval, includeMillis?: boolean): string;