forked from ocetnik/react-native-background-timer
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathindex.d.ts
More file actions
39 lines (31 loc) · 1.14 KB
/
index.d.ts
File metadata and controls
39 lines (31 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import { EmitterSubscription, TurboModule } from 'react-native';
declare module '@boterop/react-native-background-timer' {
export interface TimerCallback {
callback: () => void;
interval: boolean;
timeout: number;
}
export interface RNBackgroundTimerModule extends TurboModule {
start: (delay?: number) => void;
stop: () => void;
setTimeout: (id: number, timeout: number) => void;
clearTimeout?: (id: number) => void;
}
export interface BackgroundTimerInterface {
uniqueId: number;
callbacks: Record<number, TimerCallback>;
backgroundTimer?: number;
backgroundListener?: EmitterSubscription;
start: (delay?: number) => void;
stop: () => void;
runBackgroundTimer: (callback: () => void, delay: number) => void;
backgroundClockMethod: (callback: () => void, delay: number) => void;
stopBackgroundTimer: () => void;
setTimeout: (callback: () => void, timeout: number) => number;
clearTimeout: (timeoutId: number) => void;
setInterval: (callback: () => void, timeout: number) => number;
clearInterval: (intervalId: number) => void;
}
const BackgroundTimer: BackgroundTimerInterface;
export default BackgroundTimer;
}