-
-
Notifications
You must be signed in to change notification settings - Fork 51
/
media-attachment.ts
73 lines (67 loc) · 2.01 KB
/
media-attachment.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
export type MediaAttachmentType =
| "image"
| "video"
| "gifv"
| "audio"
| "unknown";
export interface MediaAttachmentMetaImage {
width: number;
height: number;
size: string;
aspect: number;
}
export interface MediaAttachmentMetaVideo {
width: number;
height: number;
frameRate: string;
duration: number;
bitrate: number;
aspect: number;
}
export interface MediaAttachmentMetaFocus {
x: number;
y: number;
}
export interface MediaAttachmentMetaColors {
background: string;
foreground: string;
accent: string;
}
export interface MediaAttachmentMeta {
small?: MediaAttachmentMetaImage | MediaAttachmentMetaVideo | null;
original?: MediaAttachmentMetaImage | MediaAttachmentMetaVideo | null;
focus?: MediaAttachmentMetaFocus | null;
colors?: MediaAttachmentMetaColors | null;
}
/**
* Represents a file or media MediaAttachment that can be added to a status.
* @see https://docs.joinmastodon.org/entities/MediaAttachment/
*/
export interface MediaAttachment {
/** The ID of the MediaAttachment in the database. */
id: string;
/** The type of the MediaAttachment. */
type: MediaAttachmentType;
/** The location of the original full-size MediaAttachment. */
url?: string | null;
/** The location of a scaled-down preview of the MediaAttachment. */
previewUrl: string;
/** The location of the full-size original MediaAttachment on the remote website. */
remoteUrl?: string | null;
/** Remote version of previewUrl */
previewRemoteUrl?: string | null;
/** A shorter URL for the MediaAttachment. */
textUrl?: string | null;
/** Metadata returned by Paperclip. */
meta?: MediaAttachmentMeta | null;
/**
* Alternate text that describes what is in the media MediaAttachment,
* to be used for the visually impaired or when media MediaAttachments do not load.
*/
description?: string | null;
/**
* A hash computed by the BlurHash algorithm,
* for generating colorful preview thumbnails when media has not been downloaded yet.
*/
blurhash?: string | null;
}