2024-06-08 01:09:15 +02:00
|
|
|
import type { LysandClient } from "@lysand-org/client";
|
2024-04-22 09:38:51 +02:00
|
|
|
import type { Status } from "~/types/mastodon/status";
|
|
|
|
|
|
2024-04-25 08:56:01 +02:00
|
|
|
export const useAccountTimeline = (
|
2024-06-08 01:09:15 +02:00
|
|
|
client: LysandClient | null,
|
2024-04-26 07:54:02 +02:00
|
|
|
id: MaybeRef<string | 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;
|
|
|
|
|
pinned?: boolean | undefined;
|
|
|
|
|
exclude_replies?: boolean | undefined;
|
|
|
|
|
exclude_reblogs?: boolean | undefined;
|
|
|
|
|
only_media?: boolean;
|
|
|
|
|
}>,
|
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 useIdTimeline(
|
|
|
|
|
client,
|
|
|
|
|
id,
|
|
|
|
|
(client, options) =>
|
|
|
|
|
client?.getAccountStatuses(ref(id).value ?? "", {
|
|
|
|
|
only_media: false,
|
|
|
|
|
...options,
|
|
|
|
|
}),
|
|
|
|
|
options,
|
|
|
|
|
);
|
2024-04-22 09:38:51 +02:00
|
|
|
};
|