-
-
Notifications
You must be signed in to change notification settings - Fork 44
/
media-attachment-repository.ts
31 lines (28 loc) 路 1.1 KB
/
media-attachment-repository.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import { type HttpMetaParams } from "../../../interfaces";
import { type MediaAttachment } from "../../entities/v1";
export interface CreateMediaAttachmentParams {
/** The file to be attached, using multipart form data. */
readonly file: Blob | 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 interface CreateMediaAttachmentExtraParams {
/** Wait resolving promise for the media to be uploaded. Defaults to `false` */
readonly skipPolling?: boolean;
}
export interface MediaAttachmentRepository {
/**
* Creates an attachment to be used with a new status.
* @param params Parameters
* @return Attachment
* @see https://docs.joinmastodon.org/methods/statuses/media/
*/
create(
params: CreateMediaAttachmentParams & CreateMediaAttachmentExtraParams,
meta?: HttpMetaParams<"multipart-form">,
): Promise<MediaAttachment>;
}