mirror of
https://github.com/versia-pub/frontend.git
synced 2025-12-06 08:28:20 +01:00
33 lines
919 B
TypeScript
33 lines
919 B
TypeScript
import type { LysandClient } from "@lysand-org/client";
|
|
import type { Status } from "~/types/mastodon/status";
|
|
|
|
export const useAccountTimeline = (
|
|
client: LysandClient | null,
|
|
id: MaybeRef<string | null>,
|
|
options: MaybeRef<{
|
|
limit?: number | undefined;
|
|
max_id?: string | undefined;
|
|
since_id?: string | undefined;
|
|
min_id?: string | undefined;
|
|
pinned?: boolean | undefined;
|
|
exclude_replies?: boolean | undefined;
|
|
exclude_reblogs?: boolean | undefined;
|
|
only_media?: boolean;
|
|
}>,
|
|
): {
|
|
timeline: Ref<Status[]>;
|
|
loadNext: () => Promise<void>;
|
|
loadPrev: () => Promise<void>;
|
|
} => {
|
|
return useIdTimeline(
|
|
client,
|
|
id,
|
|
(client, options) =>
|
|
client?.getAccountStatuses(ref(id).value ?? "", {
|
|
only_media: false,
|
|
...options,
|
|
}),
|
|
options,
|
|
);
|
|
};
|