-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.d.ts
More file actions
45 lines (39 loc) · 1.05 KB
/
index.d.ts
File metadata and controls
45 lines (39 loc) · 1.05 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
40
41
42
43
44
45
declare module '@rn-native-utils/workmanager' {
export enum SchedulerTypes {
periodic = 'PERIODIC',
oneTime = 'ONE_TIME',
}
export enum WorkerPolicy {
KEEP = 'KEEP',
REPLACE = 'REPLACE',
UPDATE = 'UPDATE',
}
export enum TimeUnits {
HOUR = 'HOUR',
DAY = 'DAY',
SECOND = 'SECOND',
MINUTES = 'MINUTES',
}
export interface BackgroundSchedulerParams {
taskKey: string;
type: SchedulerTypes;
maxRetryAttempts?: number;
retryDelay?: number;
taskTimeout?: number;
allowedInForeground?: boolean;
syncInterval?: number;
syncIntervalType?: TimeUnits;
syncFlexTime?: number;
syncFlexTimeType?: TimeUnits;
workerPolicy?: WorkerPolicy;
extras?: Record<string, unknown>;
}
export function schedule(
params: BackgroundSchedulerParams,
callback: (
data: string | Record<string, unknown> | boolean
) => Promise<void>
): Promise<boolean>;
export function cancel(taskKey: string): Promise<boolean>;
export function disableAppIgnoringBatteryOptimization(): boolean;
}