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-22 09:38:51 +02:00
|
|
|
|
|
|
|
|
export const usePublicTimeline = (
|
2024-06-08 01:09:15 +02:00
|
|
|
client: LysandClient | null,
|
2024-04-27 03:28:12 +02:00
|
|
|
options: MaybeRef<{
|
|
|
|
|
only_media?: boolean;
|
|
|
|
|
limit?: number;
|
|
|
|
|
max_id?: string;
|
|
|
|
|
since_id?: string;
|
|
|
|
|
min_id?: string;
|
|
|
|
|
}>,
|
2024-04-22 09:38:51 +02:00
|
|
|
): {
|
|
|
|
|
timeline: Ref<Status[]>;
|
|
|
|
|
loadNext: () => Promise<void>;
|
|
|
|
|
loadPrev: () => Promise<void>;
|
|
|
|
|
} => {
|
2024-04-27 03:28:12 +02:00
|
|
|
return useTimeline(
|
|
|
|
|
client,
|
|
|
|
|
(client, options) => client?.getPublicTimeline(options),
|
|
|
|
|
options,
|
2024-04-22 09:38:51 +02:00
|
|
|
);
|
|
|
|
|
};
|