about summary refs log tree commit diff
path: root/modules/expo-background-notification-handler/src/ExpoBackgroundNotificationHandler.types.ts
diff options
context:
space:
mode:
Diffstat (limited to 'modules/expo-background-notification-handler/src/ExpoBackgroundNotificationHandler.types.ts')
-rw-r--r--modules/expo-background-notification-handler/src/ExpoBackgroundNotificationHandler.types.ts40
1 files changed, 40 insertions, 0 deletions
diff --git a/modules/expo-background-notification-handler/src/ExpoBackgroundNotificationHandler.types.ts b/modules/expo-background-notification-handler/src/ExpoBackgroundNotificationHandler.types.ts
new file mode 100644
index 000000000..5fbd302da
--- /dev/null
+++ b/modules/expo-background-notification-handler/src/ExpoBackgroundNotificationHandler.types.ts
@@ -0,0 +1,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
+}