forked from voximplant/react-native-foreground-service
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.d.ts
46 lines (46 loc) · 1.41 KB
/
index.d.ts
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
46
declare type Importance = 1 | 2 | 3 | 4 | 5;
declare type Priority = 0 | -1 | -2 | 1 | 2;
export declare enum NotificationType {
BACKGROUND = "BACKGROUND",
FOREGROUND = "FOREGROUND"
}
export interface IChannelConfig {
id: string;
name: string;
description: string;
enableVibration?: boolean;
importance?: Importance;
}
export interface INotificationConfig {
channelId?: string;
id: number;
title: string;
text: string;
icon: string;
priority?: Priority;
ongoing?: boolean;
notificationType?: NotificationType;
}
export interface IBackgroundConfig {
taskName?: string;
delay?: number;
channelId?: string;
id: number;
title: string;
text: string;
icon: string;
priority?: Priority;
ongoing?: boolean;
}
export interface ILTForegroundService {
createNotificationChannel(channelConfig: IChannelConfig): Promise<void>;
startService(notificationConfig: INotificationConfig): Promise<void>;
stopService(): Promise<void>;
updateService(notificationConfig: INotificationConfig): Promise<void>;
backgroundStartService(task: (taskData?: IBackgroundConfig) => Promise<void>, backgroundConfig: IBackgroundConfig): Promise<void>;
backgroundStopService(): Promise<void>;
getIsBackgroundRunning(): boolean;
getIsRunning(): boolean;
}
declare const LTForegroundService: ILTForegroundService;
export default LTForegroundService;