mirror of
https://github.com/versia-pub/frontend.git
synced 2025-12-06 16:38:20 +01:00
24 lines
569 B
TypeScript
24 lines
569 B
TypeScript
import type { Mastodon } from "megalodon";
|
|
import type { Status } from "~/types/mastodon/status";
|
|
|
|
export const usePublicTimeline = (
|
|
client: Mastodon | null,
|
|
options: MaybeRef<{
|
|
only_media?: boolean;
|
|
limit?: number;
|
|
max_id?: string;
|
|
since_id?: string;
|
|
min_id?: string;
|
|
}>,
|
|
): {
|
|
timeline: Ref<Status[]>;
|
|
loadNext: () => Promise<void>;
|
|
loadPrev: () => Promise<void>;
|
|
} => {
|
|
return useTimeline(
|
|
client,
|
|
(client, options) => client?.getPublicTimeline(options),
|
|
options,
|
|
);
|
|
};
|