DefinitelyTyped/types/long-timeout/index.d.ts
Matthias Kunnen c7a768fca6
🤖 Merge PR #46642 feat(long-timeout): new type definition by @MatthiasKunnen
* feat(long-timeout): new type definition

* fix(long-timeout): remove export as namespace

long-timeout does not have a UMD wrapper.
2020-08-12 19:38:28 -04:00

29 lines
796 B
TypeScript

// Type definitions for long-timeout 0.1
// Project: https://github.com/tellnes/long-timeout
// Definitions by: Matthias Kunnen <https://github.com/MatthiasKunnen>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export type Listener = (...args: any[]) => void;
export class Timeout {
after: number;
close: () => void;
listener: Listener;
ref: () => void;
start: () => void;
unref: () => void;
unreffed: boolean;
constructor(listener: Listener, ms: number);
}
export type Interval = Timeout;
export function clearInterval(timer: Interval): void;
export function clearTimeout(timer: Timeout): void;
export function setInterval(listener: Listener, ms: number): Interval;
export function setTimeout(listener: Listener, ms: number): Timeout;