import { type HttpMetaParams, type HttpResponse } from "../../../interfaces/index.js"; import { type Account, type Context, type PreviewCard, type ScheduledStatus, type Status, type StatusEdit, type StatusSource, type StatusVisibility, type Translation } from "../../entities/v1/index.js"; import { type Method } from "../../method.js"; import { type Paginator } from "../../paginator.js"; export interface FetchStatusesParams { /** The IDs of the Statuses in the database. */ readonly id: readonly string[]; } export interface QuoteApprovalPolicyRegistry { /** Anyone is allowed to quote this status and will have their quote automatically accepted, unless they are blocked. */ public: never; /** Only followers and the author are allowed to quote this status, and will have their quote automatically accepted. */ followers: never; /** Only the author is allowed to quote the status. */ nobody: never; } export type QuoteApprovalPolicy = keyof QuoteApprovalPolicyRegistry; export interface CreateStatusParamsBase { /** ID of the status being replied to, if status is a reply */ readonly inReplyToId?: string | null; /** ID of the status being quoted, if any. Will raise an error if the status does not exist, the author does not have access to it, or quoting is denied by Mastodon’s understanding of the attached quote policy. All posts except Private Mentions (direct visibility) are quotable by their author. Quoting a private post will restrict the quoting post’s visibility to private or direct (if the given visibility is public or unlisted, private will be used instead). An error will be returned when making a quote post with direct visibility and the quote author is not explicitly mentioned. If the status text doesn’t include a link to the quoted post, Mastodon will prepend a
RE: …
paragraph for backward compatibility (such a paragraph will be hidden by Mastodon’s web interface). */ readonly quotedStatusId?: string | null; /** Sets who is allowed to quote the status. When omitted, the user’s default setting will be used instead. Ignored if visibility is private or direct, in which case the policy will always be set to nobody. */ readonly quoteApprovalPolicy?: QuoteApprovalPolicy | null; /** Mark status and attached media as sensitive? */ readonly sensitive?: boolean | null; /** Text to be shown as a warning or subject before the actual content. Statuses are generally collapsed behind this field. */ readonly spoilerText?: string | null; /** Visibility of the posted status. Enumerable oneOf public, unlisted, private, direct. */ readonly visibility?: StatusVisibility | null; /** ISO 639 language code for this status. */ readonly language?: string | null; /** https://github.com/mastodon/mastodon/pull/18350 */ readonly allowedMentions?: readonly string[] | null; } export interface CreateStatusPollParam { /** Array of possible answers. If provided, `media_ids` cannot be used, and `poll[expires_in]` must be provided. */ readonly options: readonly string[]; /** Duration the poll should be open, in seconds. If provided, media_ids cannot be used, and poll[options] must be provided. */ readonly expiresIn: number; /** Allow multiple choices? */ readonly multiple?: boolean | null; /** Hide vote counts until the poll ends? */ readonly hideTotals?: boolean | null; } export interface CreateStatusParamsWithStatus extends CreateStatusParamsBase { /** Text content of the status. If `media_ids` is provided, this becomes optional. Attaching a `poll` is optional while `status` is provided. */ readonly status: string; /** Array of Attachment ids to be attached as media. If provided, `status` becomes optional, and `poll` cannot be used. */ readonly mediaIds?: never | null; readonly poll?: CreateStatusPollParam | null; } export interface CreateStatusParamsWithMediaIds extends CreateStatusParamsBase { /** Array of Attachment ids to be attached as media. If provided, `status` becomes optional, and `poll` cannot be used. */ readonly mediaIds: readonly string[]; /** Text content of the status. If `media_ids` is provided, this becomes optional. Attaching a `poll` is optional while `status` is provided. */ readonly status?: string | null; readonly poll?: never | null; } export type CreateStatusParams = CreateStatusParamsWithStatus | CreateStatusParamsWithMediaIds; export type CreateScheduledStatusParams = CreateStatusParams & { /** ISO 8601 Date-time at which to schedule a status. Providing this parameter will cause ScheduledStatus to be returned instead of Status. Must be at least 5 minutes in the future. */ readonly scheduledAt?: string | null; }; interface UpdateStatusMediaAttribute { /** The ID of the media attachment to be modified */ readonly id: string; /** A plain-text description of the media, for accessibility purposes. */ readonly description?: string | null; /** Two floating points (x,y), comma-delimited, ranging from -1.0 to 1.0 */ readonly focus?: string | null; /** Custom thumbnail */ readonly thumbnail?: Blob | string | null; } export type UpdateStatusParams = CreateStatusParams & { /** https://github.com/mastodon/mastodon/pull/20878 */ readonly mediaAttributes?: readonly UpdateStatusMediaAttribute[] | null; }; export interface ReblogStatusParams { /** any visibility except limited or direct (i.e. public, unlisted, private). Defaults to public. Currently unused in UI. */ readonly visibility?: StatusVisibility | null; } export interface TranslateStatusParams { /** String (ISO 639 language code). The status content will be translated into this language. Defaults to the user’s current locale. */ readonly lang?: string | null; } export interface Statuses$SelectContextResource { /** * View statuses above and below this status in the thread. * @return Context * @see https://docs.joinmastodon.org/methods/statuses/ */ fetch: Method