react-playmakers
Version:
React wrapper providing utilities for PlayMakers integration
26 lines (25 loc) • 963 B
TypeScript
import { ExtendedNotificationType, NotificationType } from "../types/notifications.types";
type NotificationMarkAllAsReadMethod = () => Promise<void>;
type NotificationFetchMethod = (quiet?: boolean) => Promise<NotificationType[]>;
type NotificationFetchMoreMethod = (refresh?: boolean) => Promise<void>;
interface UseNotificationsReturn {
fetched: boolean;
notifications: ExtendedNotificationType[];
toNotify: ExtendedNotificationType[];
currentPage: number;
markAllAsRead: NotificationMarkAllAsReadMethod;
refetch: NotificationFetchMethod;
fetchMore: NotificationFetchMoreMethod;
}
interface useNotificationsParams {
params?: Partial<{
from: string;
importance: string;
type: string;
page: number;
limit: number;
}>;
poll?: boolean;
}
export declare const useNotifications: ({ params, poll }?: useNotificationsParams) => UseNotificationsReturn;
export {};