-
Notifications
You must be signed in to change notification settings - Fork 1
/
definitions.d.ts
69 lines (57 loc) · 2.47 KB
/
definitions.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import { PushNotificationsPlugin } from '@capacitor/core';
import {
LocalNotificationsPlugin,
PushNotification,
PushNotificationActionPerformed,
PushNotificationToken
} from '@capacitor/core/dist/esm/core-plugin-definitions';
import { PluginListenerHandle } from '@capacitor/core/dist/esm/definitions';
declare module '@capacitor/core' {
interface PluginRegistry {
NotificationExtension: NotificationExtension;
}
}
export interface LocalNotificationExtension extends LocalNotificationsPlugin {}
export interface NotificationExtension extends PushNotificationsPlugin {
/**
* @deprecated Use getToken() instead.
*/
addListener(eventName: 'registration', listenerFunc: (token: PushNotificationToken) => void): PluginListenerHandle;
addListener(eventName: 'registrationError', listenerFunc: (error: any) => void): PluginListenerHandle;
addListener(eventName: 'pushNotificationReceived', listenerFunc: (notification: PushNotification) => void): PluginListenerHandle;
addListener(eventName: 'pushNotificationActionPerformed', listenerFunc: (notification: PushNotificationActionPerformed) => void): PluginListenerHandle;
/**
* Get FCM token from client with promise.
* Use this method to get token rather than waiting 'registration' event listener
* to control the procedure of initializing application.
*/
getToken(): Promise<{ value: string }>
/**
* Save the range of time to SQLite to filtering push notification when it is received.
* Push notification won't shown when current time is out of range.
* Time format should be a 24 hour clock like HH:mm, in user's timezone.
* @param options
*/
addTimeFilter(options: { startFrom: string, endAt: string }): Promise<void>
/**
* Remove time filter which added with addTimeFilter method.
*/
removeTimeFilter(): Promise<void>
/**
* Save the key - boolean field to SQLite to filtering push notification when it is received.
* Push notification won't shown when any of the value from matched keys exists with 'false' value.
* Can detailed filter with saved value.
* @param options
*/
addFilters(options: { filters: string[] }): Promise<void>
/**
* Find all rows that have key matched with filters and make value to 'true'
* to not ignore push notification.
* @param options
*/
removeFilters(options: { filters: string[] }): Promise<void>
/**
* Get all filters which contains time filter
*/
getFilters(): Promise<{ value: Array<{ [props: string]: string }> }>
}