2020-11-21 00:40:55 +01:00
|
|
|
declare namespace Mastodon {
|
2020-10-31 21:04:46 +01:00
|
|
|
type Account = {
|
|
|
|
// Base
|
|
|
|
id: string
|
|
|
|
username: string
|
|
|
|
acct: string
|
|
|
|
url: string
|
|
|
|
|
|
|
|
// Attributes
|
|
|
|
display_name: string
|
|
|
|
note?: string
|
|
|
|
avatar: string
|
|
|
|
avatar_static: string
|
|
|
|
header: string
|
|
|
|
header_static: string
|
|
|
|
locked: boolean
|
|
|
|
emojis?: Emoji[]
|
|
|
|
discoverable: boolean
|
|
|
|
|
|
|
|
// Statistics
|
|
|
|
created_at: string
|
|
|
|
last_status_at: string
|
|
|
|
statuses_count: number
|
|
|
|
followers_count: number
|
|
|
|
following_count: number
|
|
|
|
|
|
|
|
// Others
|
2021-01-23 02:41:50 +01:00
|
|
|
moved?: Account
|
2020-10-31 21:04:46 +01:00
|
|
|
fields: Field[]
|
|
|
|
bot: boolean
|
2021-05-09 21:59:03 +02:00
|
|
|
source?: Source
|
2022-11-06 23:39:31 +01:00
|
|
|
suspended?: boolean
|
2022-12-09 21:09:00 +01:00
|
|
|
role?: Role
|
2020-10-31 21:04:46 +01:00
|
|
|
}
|
|
|
|
|
2020-12-22 00:10:55 +01:00
|
|
|
type Announcement = {
|
|
|
|
// Base
|
|
|
|
id: string
|
2020-12-23 01:31:11 +01:00
|
|
|
content: string
|
2020-12-22 00:10:55 +01:00
|
|
|
all_day: boolean
|
2020-12-23 01:31:11 +01:00
|
|
|
published_at: string
|
2020-12-22 00:10:55 +01:00
|
|
|
updated_at: string
|
|
|
|
read: boolean
|
|
|
|
|
|
|
|
// Others
|
|
|
|
scheduled_at?: string
|
|
|
|
starts_at?: string
|
|
|
|
ends_at?: string
|
2020-12-23 01:31:11 +01:00
|
|
|
reactions?: AnnouncementReaction[]
|
|
|
|
mentions?: Mention[]
|
|
|
|
statuses?: Status[]
|
|
|
|
tags?: Tag[]
|
|
|
|
emojis?: Emoji[]
|
2020-12-22 00:10:55 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
type AnnouncementReaction = {
|
|
|
|
// Base
|
|
|
|
name: string
|
|
|
|
count: number
|
|
|
|
me: boolean
|
|
|
|
url: string
|
|
|
|
static_url: string
|
|
|
|
}
|
|
|
|
|
2020-10-31 21:04:46 +01:00
|
|
|
type Application = {
|
|
|
|
// Base
|
|
|
|
name: string
|
|
|
|
website?: string
|
|
|
|
vapid_key?: string
|
|
|
|
}
|
|
|
|
|
2021-01-07 19:13:09 +01:00
|
|
|
type Apps = {
|
2020-12-15 00:01:48 +01:00
|
|
|
id: string
|
|
|
|
name: string
|
|
|
|
website?: string
|
|
|
|
redirect_uri: string
|
|
|
|
client_id: string
|
|
|
|
client_secret: string
|
|
|
|
vapid_key: string
|
|
|
|
}
|
|
|
|
|
2020-12-06 16:06:38 +01:00
|
|
|
type Attachment =
|
|
|
|
| AttachmentImage
|
|
|
|
| AttachmentVideo
|
|
|
|
| AttachmentGifv
|
|
|
|
| AttachmentAudio
|
2020-12-25 21:09:43 +01:00
|
|
|
| AttachmentUnknown
|
2020-12-06 21:42:19 +01:00
|
|
|
|
|
|
|
type AttachmentImage = {
|
|
|
|
// Base
|
|
|
|
id: string
|
|
|
|
type: 'image'
|
|
|
|
url: string
|
|
|
|
preview_url: string
|
|
|
|
|
|
|
|
// Others
|
|
|
|
remote_url?: string
|
|
|
|
text_url?: string
|
|
|
|
meta?: {
|
|
|
|
original?: { width: number; height: number; size: string; aspect: number }
|
|
|
|
small?: { width: number; height: number; size: string; aspect: number }
|
|
|
|
focus?: { x: number; y: number }
|
|
|
|
}
|
|
|
|
description?: string
|
|
|
|
blurhash?: string
|
|
|
|
}
|
|
|
|
|
|
|
|
type AttachmentVideo = {
|
|
|
|
// Base
|
|
|
|
id: string
|
|
|
|
type: 'video'
|
|
|
|
url: string
|
|
|
|
preview_url: string
|
|
|
|
|
|
|
|
// Others
|
|
|
|
remote_url?: string
|
|
|
|
text_url?: string
|
|
|
|
meta?: {
|
|
|
|
length: string
|
|
|
|
duration: number
|
|
|
|
fps: number
|
|
|
|
size: string
|
|
|
|
width: number
|
|
|
|
height: number
|
|
|
|
aspect: number
|
|
|
|
audio_encode: string
|
|
|
|
audio_bitrate: string
|
|
|
|
audio_channels: string
|
|
|
|
original: {
|
|
|
|
width: number
|
|
|
|
height: number
|
|
|
|
frame_rate: string
|
|
|
|
duration: number
|
|
|
|
bitrate: number
|
|
|
|
}
|
|
|
|
small: {
|
|
|
|
width: number
|
|
|
|
height: number
|
|
|
|
size: string
|
|
|
|
aspect: number
|
|
|
|
}
|
|
|
|
}
|
|
|
|
description?: string
|
|
|
|
blurhash?: string
|
|
|
|
}
|
|
|
|
|
|
|
|
type AttachmentGifv = {
|
|
|
|
// Base
|
|
|
|
id: string
|
|
|
|
type: 'gifv'
|
|
|
|
url: string
|
|
|
|
preview_url: string
|
|
|
|
|
|
|
|
// Others
|
|
|
|
remote_url?: string
|
|
|
|
text_url?: string
|
|
|
|
meta?: {
|
|
|
|
length: string
|
|
|
|
duration: number
|
|
|
|
fps: number
|
|
|
|
size: string
|
|
|
|
width: number
|
|
|
|
height: number
|
|
|
|
aspect: number
|
|
|
|
original: {
|
|
|
|
width: number
|
|
|
|
height: number
|
|
|
|
frame_rate: string
|
|
|
|
duration: number
|
|
|
|
bitrate: number
|
|
|
|
}
|
|
|
|
small: {
|
|
|
|
width: number
|
|
|
|
height: number
|
|
|
|
size: string
|
|
|
|
aspect: number
|
|
|
|
}
|
|
|
|
}
|
|
|
|
description?: string
|
|
|
|
blurhash?: string
|
|
|
|
}
|
|
|
|
|
|
|
|
type AttachmentAudio = {
|
|
|
|
// Base
|
|
|
|
id: string
|
|
|
|
type: 'audio'
|
|
|
|
url: string
|
|
|
|
preview_url: string
|
|
|
|
|
|
|
|
// Others
|
|
|
|
remote_url?: string
|
2020-12-25 21:09:43 +01:00
|
|
|
preview_remote_url?: string // undocumented
|
2020-12-06 21:42:19 +01:00
|
|
|
text_url?: string
|
2020-12-25 21:09:43 +01:00
|
|
|
meta: {
|
2020-12-06 21:42:19 +01:00
|
|
|
length: string
|
|
|
|
duration: number
|
|
|
|
audio_encode: string
|
|
|
|
audio_bitrate: string
|
|
|
|
audio_channels: string
|
|
|
|
original: {
|
|
|
|
duration: number
|
|
|
|
bitrate: number
|
|
|
|
}
|
|
|
|
}
|
|
|
|
description?: string
|
|
|
|
blurhash?: string
|
|
|
|
}
|
|
|
|
|
2020-12-25 21:09:43 +01:00
|
|
|
type AttachmentUnknown = {
|
|
|
|
// Base
|
|
|
|
id: string
|
|
|
|
type: 'unknown'
|
|
|
|
url: string
|
|
|
|
preview_url: string
|
|
|
|
|
|
|
|
// Others
|
|
|
|
remote_url?: string
|
|
|
|
text_url?: string
|
|
|
|
meta?: any
|
|
|
|
description?: string
|
|
|
|
blurhash?: string
|
|
|
|
}
|
2020-10-31 21:04:46 +01:00
|
|
|
|
|
|
|
type Card = {
|
|
|
|
// Base
|
|
|
|
url: string
|
|
|
|
title: string
|
|
|
|
description: string
|
|
|
|
type: 'link' | 'photo' | 'video' | 'rich'
|
|
|
|
|
|
|
|
// Attributes
|
|
|
|
author_name: string
|
|
|
|
author_url: string
|
|
|
|
provider_name: string
|
|
|
|
provider_url: string
|
|
|
|
html: string
|
|
|
|
width: number
|
|
|
|
height: number
|
|
|
|
image: string
|
|
|
|
embed_url: string
|
|
|
|
blurhash: string
|
|
|
|
}
|
|
|
|
|
2020-11-22 00:46:23 +01:00
|
|
|
type Conversation = {
|
|
|
|
id: string
|
|
|
|
accounts: Account[]
|
|
|
|
unread: boolean
|
|
|
|
last_status?: Status
|
|
|
|
}
|
|
|
|
|
2020-10-31 21:04:46 +01:00
|
|
|
type Emoji = {
|
|
|
|
// Base
|
|
|
|
shortcode: string
|
|
|
|
url: string
|
|
|
|
static_url: string
|
|
|
|
visible_in_picker: boolean
|
|
|
|
category?: string
|
|
|
|
}
|
|
|
|
|
|
|
|
type Field = {
|
|
|
|
name: string
|
|
|
|
value: string
|
2021-05-09 21:59:03 +02:00
|
|
|
verified_at: string | null
|
2020-10-31 21:04:46 +01:00
|
|
|
}
|
|
|
|
|
2022-12-18 17:25:18 +01:00
|
|
|
type Filter<T extends 'v1' | 'v2'> = T extends 'v2' ? Filter_V2 : Filter_V1
|
|
|
|
type Filter_V2 = {
|
|
|
|
id: string
|
|
|
|
title: string
|
|
|
|
context: ('home' | 'notifications' | 'public' | 'thread' | 'account')[]
|
|
|
|
expires_at?: string
|
|
|
|
filter_action: 'warn' | 'hide'
|
|
|
|
keywords: FilterKeyword[]
|
|
|
|
statuses: FilterStatus[]
|
|
|
|
}
|
2022-12-28 23:41:36 +01:00
|
|
|
type Filter_V1 = {
|
|
|
|
id: string
|
|
|
|
phrase: string
|
|
|
|
context: ('home' | 'notifications' | 'public' | 'thread' | 'account')[]
|
|
|
|
expires_at?: string
|
|
|
|
irreversible: boolean
|
|
|
|
whole_word: boolean
|
|
|
|
}
|
2022-12-18 17:25:18 +01:00
|
|
|
|
|
|
|
type FilterKeyword = { id: string; keyword: string; whole_word: boolean }
|
|
|
|
|
|
|
|
type FilterStatus = { id: string; status_id: string }
|
|
|
|
|
|
|
|
type FilterResult = {
|
|
|
|
filter: Filter<'v2'>
|
|
|
|
keyword_matches?: FilterKeyword['keyword'][]
|
|
|
|
status_matches?: FilterStatus['id'][]
|
|
|
|
}
|
2021-05-30 23:39:07 +02:00
|
|
|
|
2020-11-22 00:46:23 +01:00
|
|
|
type List = {
|
|
|
|
id: string
|
|
|
|
title: string
|
2022-11-30 22:42:42 +01:00
|
|
|
replies_policy: 'none' | 'list' | 'followed'
|
2020-11-22 00:46:23 +01:00
|
|
|
}
|
|
|
|
|
2022-12-28 23:41:36 +01:00
|
|
|
type Instance<T extends 'v1' | 'v2'> = T extends 'v2' ? Instance_V2 : Instance_V1
|
|
|
|
type Instance_V2 = {
|
|
|
|
domain: string
|
|
|
|
title: string
|
|
|
|
version: string
|
|
|
|
source_url: string
|
|
|
|
description: string
|
|
|
|
usage: { users: { active_month: number } }
|
|
|
|
thumbnail: { url: string; blurhash?: string; versions?: { '@1x'?: string; '@2x'?: string } }
|
|
|
|
languages: string[]
|
|
|
|
configuration: {
|
|
|
|
urls: { streaming_api: string }
|
|
|
|
accounts: { max_featured_tags: number }
|
|
|
|
statuses: {
|
|
|
|
max_characters: number
|
|
|
|
max_media_attachments: number
|
|
|
|
characters_reserved_per_url: number
|
|
|
|
}
|
|
|
|
media_attachments: {
|
|
|
|
supported_mime_types: string[]
|
|
|
|
image_size_limit: number
|
|
|
|
image_matrix_limit: number
|
|
|
|
video_size_limit: number
|
|
|
|
video_frame_rate_limit: number
|
|
|
|
video_matrix_limit: number
|
|
|
|
}
|
|
|
|
polls: {
|
|
|
|
max_options: number
|
|
|
|
max_characters_per_option: number
|
|
|
|
min_expiration: number
|
|
|
|
max_expiration: number
|
|
|
|
}
|
|
|
|
translation: { enabled: boolean }
|
|
|
|
registrations: { enabled: boolean; approval_required: boolean; message?: string }
|
|
|
|
contact: { email: string; account: Account }
|
|
|
|
rules: Rule[]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
type Instance_V1 = {
|
2020-12-13 21:09:21 +01:00
|
|
|
// Base
|
|
|
|
uri: string
|
|
|
|
title: string
|
|
|
|
description: string
|
|
|
|
short_description: string
|
|
|
|
email: string
|
|
|
|
version: string
|
|
|
|
languages: string[]
|
|
|
|
registrations: boolean
|
|
|
|
approval_required: boolean
|
|
|
|
invites_enabled: boolean
|
|
|
|
urls: {
|
|
|
|
streaming_api: string
|
|
|
|
}
|
|
|
|
stats: {
|
|
|
|
user_count: number
|
|
|
|
status_count: number
|
|
|
|
domain_count: number
|
|
|
|
}
|
|
|
|
|
|
|
|
// Others
|
|
|
|
thumbnail?: string
|
|
|
|
contact_account?: Account
|
2021-11-15 22:34:43 +01:00
|
|
|
configuration?: {
|
|
|
|
statuses: {
|
|
|
|
max_characters: number
|
|
|
|
max_media_attachments: number
|
|
|
|
characters_reserved_per_url: number
|
|
|
|
}
|
|
|
|
media_attachments: {
|
|
|
|
supported_mime_types: string[]
|
|
|
|
image_size_limit: number
|
|
|
|
image_matrix_limit: number
|
|
|
|
video_size_limit: number
|
|
|
|
video_frame_rate_limit: number
|
|
|
|
video_matrix_limit: number
|
|
|
|
}
|
|
|
|
polls: {
|
|
|
|
max_options: number
|
|
|
|
max_characters_per_option: number
|
|
|
|
min_expiration: number
|
|
|
|
max_expiration: number
|
|
|
|
}
|
|
|
|
}
|
2020-12-13 21:09:21 +01:00
|
|
|
}
|
|
|
|
|
2020-10-31 21:04:46 +01:00
|
|
|
type Mention = {
|
|
|
|
// Base
|
|
|
|
id: string
|
|
|
|
username: string
|
|
|
|
acct: string
|
|
|
|
url: string
|
|
|
|
}
|
|
|
|
|
2022-12-12 23:57:07 +01:00
|
|
|
type Notification =
|
|
|
|
| {
|
|
|
|
// Base
|
|
|
|
id: string
|
|
|
|
type: 'favourite' | 'mention' | 'poll' | 'reblog' | 'status' | 'update'
|
|
|
|
created_at: string
|
|
|
|
account: Account
|
|
|
|
status: Status
|
|
|
|
report: undefined
|
|
|
|
}
|
|
|
|
| {
|
|
|
|
// Base
|
|
|
|
id: string
|
|
|
|
type: 'follow' | 'follow_request' | 'admin.sign_up'
|
|
|
|
created_at: string
|
|
|
|
account: Account
|
|
|
|
status: undefined
|
|
|
|
report: undefined
|
|
|
|
}
|
|
|
|
| {
|
|
|
|
// Base
|
|
|
|
id: string
|
|
|
|
type: 'admin.report'
|
|
|
|
created_at: string
|
|
|
|
account: Account
|
|
|
|
status: undefined
|
|
|
|
report: Report
|
|
|
|
}
|
2020-10-31 21:04:46 +01:00
|
|
|
|
|
|
|
type Poll = {
|
|
|
|
// Base
|
|
|
|
id: string
|
|
|
|
expires_at: string
|
|
|
|
expired: boolean
|
|
|
|
multiple: bool
|
|
|
|
votes_count: number
|
|
|
|
voters_count: number
|
|
|
|
voted?: boolean
|
|
|
|
own_votes?: number[]
|
|
|
|
options: { title: string; votes_count: number }[]
|
|
|
|
emojis: Emoji[]
|
|
|
|
}
|
|
|
|
|
2020-11-21 00:40:55 +01:00
|
|
|
type Preferences = {
|
|
|
|
'posting:default:visibility'?: 'public' | 'unlisted' | 'private' | 'direct'
|
|
|
|
'posting:default:sensitive'?: boolean
|
|
|
|
'posting:default:language'?: string
|
|
|
|
'reading:expand:media'?: 'default' | 'show_all' | 'hide_all'
|
|
|
|
'reading:expand:spoilers'?: boolean
|
|
|
|
}
|
|
|
|
|
2021-02-20 19:12:44 +01:00
|
|
|
type PushSubscription = {
|
|
|
|
id: string
|
|
|
|
endpoint: string
|
|
|
|
alerts: {
|
|
|
|
follow: boolean
|
2022-05-29 01:57:15 +02:00
|
|
|
follow_request: boolean
|
2021-02-20 19:12:44 +01:00
|
|
|
favourite: boolean
|
|
|
|
reblog: boolean
|
|
|
|
mention: boolean
|
|
|
|
poll: boolean
|
2022-05-29 01:57:15 +02:00
|
|
|
status: boolean
|
2022-12-15 19:31:20 +01:00
|
|
|
update: boolean
|
2022-12-09 21:09:00 +01:00
|
|
|
'admin.sign_up': boolean
|
|
|
|
'admin.report': boolean
|
2021-02-20 19:12:44 +01:00
|
|
|
}
|
|
|
|
server_key: string
|
|
|
|
}
|
|
|
|
|
2020-12-12 18:22:22 +01:00
|
|
|
type Relationship = {
|
|
|
|
id: string
|
|
|
|
following: boolean
|
|
|
|
showing_reblogs: boolean
|
2022-12-18 01:12:58 +01:00
|
|
|
notifying?: boolean
|
|
|
|
languages?: string[]
|
2020-12-12 18:22:22 +01:00
|
|
|
followed_by: boolean
|
|
|
|
blocking: boolean
|
|
|
|
blocked_by: boolean
|
|
|
|
muting: boolean
|
|
|
|
muting_notifications: boolean
|
|
|
|
requested: boolean
|
|
|
|
domain_blocking: boolean
|
|
|
|
endorsed: boolean
|
|
|
|
note: string
|
|
|
|
}
|
|
|
|
|
2022-12-12 23:57:07 +01:00
|
|
|
type Report = {
|
|
|
|
id: string
|
|
|
|
action_taken: boolean
|
|
|
|
action_taken_at?: string
|
|
|
|
category: 'spam' | 'violation' | 'other'
|
|
|
|
comment: string
|
|
|
|
forwarded: boolean
|
|
|
|
created_at: string
|
|
|
|
status_ids?: string[]
|
|
|
|
rule_ids?: string[]
|
|
|
|
target_account: Account
|
|
|
|
}
|
|
|
|
|
2020-12-10 19:19:56 +01:00
|
|
|
type Results = {
|
|
|
|
accounts?: Account[]
|
|
|
|
statuses?: Status[]
|
|
|
|
hashtags?: Tag[]
|
|
|
|
}
|
|
|
|
|
2022-12-09 21:09:00 +01:00
|
|
|
type Role = {
|
|
|
|
// Added since 4.0
|
|
|
|
id: string
|
|
|
|
name: string
|
|
|
|
color: string
|
|
|
|
position: number
|
|
|
|
permissions: string
|
|
|
|
highlighted: boolean
|
|
|
|
created_at: string
|
|
|
|
updated_at: string
|
|
|
|
}
|
|
|
|
|
2022-12-22 01:21:51 +01:00
|
|
|
type Rule = {
|
|
|
|
id: string
|
|
|
|
text: string
|
|
|
|
}
|
|
|
|
|
2020-10-31 21:04:46 +01:00
|
|
|
type Status = {
|
|
|
|
// Base
|
|
|
|
id: string
|
2020-11-06 00:59:33 +01:00
|
|
|
uri: string
|
2020-10-31 21:04:46 +01:00
|
|
|
created_at: string
|
|
|
|
account: Account
|
|
|
|
content: string
|
|
|
|
visibility: 'public' | 'unlisted' | 'private' | 'direct'
|
|
|
|
sensitive: boolean
|
|
|
|
spoiler_text?: string
|
|
|
|
media_attachments: Attachment[]
|
2022-12-18 17:25:18 +01:00
|
|
|
application?: Application
|
2020-10-31 21:04:46 +01:00
|
|
|
|
|
|
|
// Attributes
|
|
|
|
mentions: Mention[]
|
|
|
|
tags: Tag[]
|
|
|
|
emojis: Emoji[]
|
|
|
|
|
|
|
|
// Interaction
|
|
|
|
reblogs_count: number
|
|
|
|
favourites_count: number
|
|
|
|
replies_count: number
|
2022-12-18 17:25:18 +01:00
|
|
|
edited_at?: string
|
2020-10-31 21:04:46 +01:00
|
|
|
favourited: boolean
|
|
|
|
reblogged: boolean
|
|
|
|
muted: boolean
|
|
|
|
bookmarked: boolean
|
|
|
|
pinned: boolean
|
|
|
|
|
|
|
|
// Others
|
|
|
|
url?: string
|
|
|
|
in_reply_to_id?: string
|
|
|
|
in_reply_to_account_id?: string
|
2020-12-07 12:31:40 +01:00
|
|
|
reblog?: Status
|
|
|
|
poll?: Poll
|
|
|
|
card?: Card
|
2020-10-31 21:04:46 +01:00
|
|
|
language?: string
|
|
|
|
text?: string
|
2022-12-18 17:25:18 +01:00
|
|
|
filtered?: FilterResult[]
|
2023-01-01 16:44:55 +01:00
|
|
|
|
|
|
|
// Internal
|
|
|
|
_level?: number
|
|
|
|
_remote?: boolean
|
2020-10-31 21:04:46 +01:00
|
|
|
}
|
|
|
|
|
2022-04-29 23:57:18 +02:00
|
|
|
type StatusHistory = {
|
|
|
|
content: Status['content']
|
|
|
|
spoiler_text: Status['spoiler_text']
|
|
|
|
sensitive: Status['sensitive']
|
|
|
|
created_at: Status['created_at']
|
|
|
|
poll: Status['poll']
|
|
|
|
account: Status['account']
|
|
|
|
media_attachments: Status['media_attachments']
|
|
|
|
emojis: Status['emojis']
|
|
|
|
}
|
|
|
|
|
2020-10-31 21:04:46 +01:00
|
|
|
type Source = {
|
|
|
|
// Base
|
|
|
|
note: string
|
|
|
|
fields: Field[]
|
|
|
|
|
|
|
|
// Others
|
|
|
|
privacy?: 'public' | 'unlisted' | 'private' | 'direct'
|
|
|
|
sensitive?: boolean
|
|
|
|
language?: string
|
|
|
|
follow_requests_count?: number
|
|
|
|
}
|
|
|
|
|
|
|
|
type Tag = {
|
|
|
|
// Base
|
|
|
|
name: string
|
|
|
|
url: string
|
2022-11-20 16:14:08 +01:00
|
|
|
history: { day: string; accounts: string; uses: string }[]
|
|
|
|
following: boolean // Since v4.0
|
2020-10-31 21:04:46 +01:00
|
|
|
}
|
|
|
|
}
|