2024-06-08 01:09:15 +02:00
|
|
|
import type { LysandClient } from "@lysand-org/client";
|
2024-06-20 01:57:38 +02:00
|
|
|
import type { Notification } from "@lysand-org/client/types";
|
2024-04-27 03:28:12 +02:00
|
|
|
|
|
|
|
|
export const useNotificationTimeline = (
|
2024-06-08 01:09:15 +02:00
|
|
|
client: LysandClient | null,
|
2024-04-27 03:28:12 +02:00
|
|
|
options: MaybeRef<{
|
|
|
|
|
limit?: number | undefined;
|
|
|
|
|
max_id?: string | undefined;
|
|
|
|
|
since_id?: string | undefined;
|
|
|
|
|
min_id?: string | undefined;
|
|
|
|
|
exclude_types?: string[] | undefined;
|
|
|
|
|
account_id?: string | undefined;
|
|
|
|
|
}>,
|
|
|
|
|
): {
|
|
|
|
|
timeline: Ref<Notification[]>;
|
|
|
|
|
loadNext: () => Promise<void>;
|
|
|
|
|
loadPrev: () => Promise<void>;
|
|
|
|
|
} => {
|
|
|
|
|
return useTimeline(
|
|
|
|
|
client,
|
2024-06-20 01:57:38 +02:00
|
|
|
// @ts-expect-error dont listen to the voices jesse
|
2024-04-27 03:28:12 +02:00
|
|
|
(client, options) => client?.getNotifications(options),
|
|
|
|
|
options,
|
|
|
|
|
);
|
|
|
|
|
};
|