@bzr/bazaar
Version:
The Bazaar SDK. Conveniently use Bazaar with your app in the browser.
43 lines (42 loc) • 1.33 kB
TypeScript
import { type SubscribeListener, CreateNotification, Notification } from "../types";
import { API } from "./raw";
/**
* The class that encapsulates the notification API
* @internal
*/
export declare class NotificationsAPI {
private api;
constructor(api: API);
/**
* Creates notification for a target user.
*/
create(notification: CreateNotification): Promise<{
data: Notification;
}>;
/**
* Lists notifications.
* @returns All notifications for this app and user
*/
list(options?: {
includeHidden?: boolean;
senderId?: string;
startTs?: Date;
endTs?: Date;
}): Promise<Notification[]>;
subscribe(options: {
includeHidden?: boolean;
senderId?: string;
startTs?: Date;
endTs?: Date;
}, listener: SubscribeListener<Notification>): Promise<() => Promise<import("../types").BazaarMessage>>;
/**
* Hides notification with a given ID
* @param notificationId - ID of the notification to hide
*/
hide(notificationId: string): Promise<import("../types").BazaarMessage>;
/**
* Deletes notification with a given ID
* @param notificationId - ID of the notification to delete
*/
delete(notificationId: string): Promise<import("../types").BazaarMessage>;
}