From db83a97011a19882cf73ebb41a0e52a7cfad5ecf Mon Sep 17 00:00:00 2001 From: Akshay Date: Wed, 21 Aug 2024 13:50:00 +0530 Subject: [PATCH] Added NotificationResponse Type --- .../plugins/we-cap-inbox/index.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/@awesome-cordova-plugins/plugins/we-cap-inbox/index.ts b/src/@awesome-cordova-plugins/plugins/we-cap-inbox/index.ts index 71a404e9b..c69488459 100644 --- a/src/@awesome-cordova-plugins/plugins/we-cap-inbox/index.ts +++ b/src/@awesome-cordova-plugins/plugins/we-cap-inbox/index.ts @@ -20,17 +20,15 @@ import { Plugin, Cordova, AwesomeCordovaNativePlugin } from '@awesome-cordova-pl * ``` */ - @Plugin({ pluginName: 'WECapInbox', plugin: 'we-notificationinbox-cordova', // npm package name, example: cordova-plugin-camera pluginRef: 'WENotificationInboxPlugin', // the variable reference to call the plugin, repo: 'https://github.com/WebEngage/we-ionic-notification-inbox', - platforms: ['Android', 'iOS'] // Array of platforms supported, example: ['Android', 'iOS'] + platforms: ['Android', 'iOS'], // Array of platforms supported, example: ['Android', 'iOS'] }) @Injectable() export class WECapInbox extends AwesomeCordovaNativePlugin { - /** * Resets the notification count. * @returns {Promise} @@ -64,12 +62,11 @@ export class WECapInbox extends AwesomeCordovaNativePlugin { @Cordova() getNotificationList( offset: JsonObject | null, - successCallback: (notifications: JsonArray[]) => void, + successCallback: (notifications: NotificationResponse) => void, errorCallback: (error: string) => void ): Promise { return; } - /** * Marks a specific notification as read. @@ -150,13 +147,17 @@ export class WECapInbox extends AwesomeCordovaNativePlugin { deleteAll(notificationList: JsonArray): Promise { return; } - } export type JsonValue = string | number | boolean | null | JsonObject | JsonArray; +export type NotificationResponse = { + hasNext: boolean; + messageList: JsonArray; +}; + export type JsonObject = { [key: string]: JsonValue; }; -export type JsonArray = JsonValue[]; \ No newline at end of file +export type JsonArray = JsonValue[];