balena-supervisor/typings/duration-js.d.ts
Cameron Diver 2a27b1d51f Move to resin-lint 3 and fix lint errors
This is a massive commit, but nothing related to runtime has actually
changed, only the lint errors have changed.

Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-05-26 18:54:09 +01:00

63 lines
1.8 KiB
TypeScript

// From: https://github.com/icholy/Duration.js/pull/15
// Once the above is merged, use the inbuilt module types
// tslint:disable
declare module 'duration-js' {
type DurationLike = Duration | string | number;
type DateLike = Date | number;
class Duration {
private _milliseconds: number;
constructor(value?: DurationLike);
static millisecond: Duration;
static second: Duration;
static minute: Duration;
static hour: Duration;
static day: Duration;
static week: Duration;
static milliseconds(milliseconds: number): Duration;
static seconds(seconds: number): Duration;
static minutes(minutes: number): Duration;
static hours(hours: number): Duration;
static days(days: number): Duration;
static weeks(weeks: number): Duration;
nanoseconds(): number;
microseconds(): number;
milliseconds(): number;
seconds(): number;
minutes(): number;
hours(): number;
days(): number;
weeks(): number;
toString(): string;
valueOf(): number;
isGreaterThan(duration: DurationLike): boolean;
isLessThan(duration: DurationLike): boolean;
isEqualTo(duration: DurationLike): boolean;
roundTo(duration: DurationLike): void;
after(date: DateLike): Date;
static since(date: DateLike): Duration;
static until(date: DateLike): Duration;
static between(a: DateLike, b: DateLike): Duration;
static parse(duration: string): Duration;
static fromMicroseconds(us: number): Duration;
static fromNanoseconds(ns: number): Duration;
static add(a: Duration, b: Duration): Duration;
static subtract(a: Duration, b: Duration): Duration;
static multiply(a: Duration, b: number): Duration;
static multiply(a: number, b: Duration): Duration;
static divide(a: Duration, b: Duration): number;
static abs(d: DurationLike): Duration;
}
export = Duration;
}