DefinitelyTyped/types/react-native-background-timer/index.d.ts

35 lines
1.1 KiB
TypeScript
Raw Permalink Normal View History

// Type definitions for react-native-background-timer 2.0
// Project: https://github.com/ocetnik/react-native-background-timer#readme
// Definitions by: Tjark Smalla <https://github.com/chillkroeteTTS>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/*~ You can declare types that are available via importing the module */
export type IntervalId = number;
export type TimeoutId = number;
/*~ You can declare properties of the module using const, let, or var */
declare class BackgroundTimer {
constructor();
2018-06-21 15:44:39 +00:00
start(delay?: number): any;
stop(): void;
2018-06-21 15:44:39 +00:00
runBackgroundTimer(callback: () => void, delay: number): void;
2018-06-21 15:44:39 +00:00
backgroundClockMethod(callback: () => void, delay: number): void;
stopBackgroundTimer(): void;
2018-06-21 15:44:39 +00:00
setTimeout(callback: () => void, timeout: number): TimeoutId;
clearTimeout(timeoutId: TimeoutId): void;
2018-06-21 15:44:39 +00:00
setInterval(callback: () => void, timeout: number): IntervalId;
clearInterval(intervalId: IntervalId): void;
}
declare const _BackgroundTimer: BackgroundTimer;
2018-06-21 15:44:39 +00:00
export default _BackgroundTimer;