about summary refs log tree commit diff
path: root/modules/expo-background-notification-handler/src/ExpoBackgroundNotificationHandler.types.ts
blob: 5fbd302da92794ac4135adca283decb729792729 (plain) (blame)
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
export type ExpoBackgroundNotificationHandlerModule = {
  getAllPrefsAsync: () => Promise<BackgroundNotificationHandlerPreferences>
  getBoolAsync: (forKey: string) => Promise<boolean>
  getStringAsync: (forKey: string) => Promise<string>
  getStringArrayAsync: (forKey: string) => Promise<string[]>
  setBoolAsync: (
    forKey: keyof BackgroundNotificationHandlerPreferences,
    value: boolean,
  ) => Promise<void>
  setStringAsync: (
    forKey: keyof BackgroundNotificationHandlerPreferences,
    value: string,
  ) => Promise<void>
  setStringArrayAsync: (
    forKey: keyof BackgroundNotificationHandlerPreferences,
    value: string[],
  ) => Promise<void>
  addToStringArrayAsync: (
    forKey: keyof BackgroundNotificationHandlerPreferences,
    value: string,
  ) => Promise<void>
  removeFromStringArrayAsync: (
    forKey: keyof BackgroundNotificationHandlerPreferences,
    value: string,
  ) => Promise<void>
  addManyToStringArrayAsync: (
    forKey: keyof BackgroundNotificationHandlerPreferences,
    value: string[],
  ) => Promise<void>
  removeManyFromStringArrayAsync: (
    forKey: keyof BackgroundNotificationHandlerPreferences,
    value: string[],
  ) => Promise<void>
}

// TODO there are more preferences in the native code, however they have not been added here yet.
// Don't add them until the native logic also handles the notifications for those preference types.
export type BackgroundNotificationHandlerPreferences = {
  playSoundChat: boolean
}