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 { Status } from "@lysand-org/client/types";
|
2024-04-26 01:04:45 +02:00
|
|
|
|
|
|
|
|
export const useLocalTimeline = (
|
2024-06-08 01:09:15 +02:00
|
|
|
client: LysandClient | null,
|
2024-06-21 03:15:14 +02:00
|
|
|
options: MaybeRef<
|
|
|
|
|
Partial<{
|
|
|
|
|
only_media: boolean;
|
|
|
|
|
max_id: string;
|
|
|
|
|
since_id: string;
|
|
|
|
|
min_id: string;
|
|
|
|
|
limit: number;
|
|
|
|
|
}>
|
|
|
|
|
>,
|
2024-04-26 01:04:45 +02:00
|
|
|
): {
|
|
|
|
|
timeline: Ref<Status[]>;
|
|
|
|
|
loadNext: () => Promise<void>;
|
|
|
|
|
loadPrev: () => Promise<void>;
|
|
|
|
|
} => {
|
2024-06-20 02:07:56 +02:00
|
|
|
return useTimeline(
|
|
|
|
|
client,
|
|
|
|
|
(client, options) => client?.getLocalTimeline(options),
|
|
|
|
|
options,
|
2024-04-26 01:04:45 +02:00
|
|
|
);
|
|
|
|
|
};
|