CreateReplyFilters mastodon.ts
Declarations #
20 declarations
CreateReplyFilters #
CreateReplyFilters
CustomReplyFilter #
CustomReplyFilter
CustomReplyFilter type
type
'custom'should_include
type
(
status: MastodonStatus,
root_status: MastodonStatus,
status_context: MastodonStatusContext,
) => booleanFavouritedByReplyFilter #
FavouritedByReplyFilter
FavouritedByReplyFilter type
type
'favourited_by'favourited_by
type
Array<string>fetch_mastodon_favourites #
fetch_mastodon_favourites
(host: string, status_id: string, cache?: Map<string, { key: string; url: string; params: any; value: any; etag: string | null; last_modified: string | null; }> | null | undefined, log?: Logger | undefined, request?: RequestInit | undefined, token?: string | undefined, fetch?: ((input: RequestInfo | URL, init?: RequestInit | undefined) => Promise<...>) | undefined): Promise<...> host
type
stringstatus_id
type
stringcache?
type
Map<string, { key: string; url: string; params: any; value: any; etag: string | null; last_modified: string | null; }> | null | undefinedoptional
log?
type
Logger | undefinedoptional
request?
type
RequestInit | undefinedoptional
token?
type
string | undefinedoptional
fetch?
type
((input: RequestInfo | URL, init?: RequestInit | undefined) => Promise<Response>) | undefinedoptional
returns
Promise<MastodonFavourite[] | null> fetch_mastodon_status #
fetch_mastodon_status
(host: string, id: string, cache?: Map<string, { key: string; url: string; params: any; value: any; etag: string | null; last_modified: string | null; }> | null | undefined, log?: Logger | undefined, request?: RequestInit | undefined, token?: string | undefined, fetch?: ((input: RequestInfo | URL, init?: RequestInit | undefined) => Promise<...>) | undefined): Promise<...> host
type
stringid
type
stringcache?
type
Map<string, { key: string; url: string; params: any; value: any; etag: string | null; last_modified: string | null; }> | null | undefinedoptional
log?
type
Logger | undefinedoptional
request?
type
RequestInit | undefinedoptional
token?
type
string | undefinedoptional
fetch?
type
((input: RequestInfo | URL, init?: RequestInit | undefined) => Promise<Response>) | undefinedoptional
returns
Promise<MastodonStatus | null> fetch_mastodon_status_context #
fetch_mastodon_status_context
(host: string, id: string, cache?: Map<string, { key: string; url: string; params: any; value: any; etag: string | null; last_modified: string | null; }> | null | undefined, log?: Logger | undefined, request?: RequestInit | undefined, token?: string | undefined, fetch?: ((input: RequestInfo | URL, init?: RequestInit | undefined) => Promise<...>) | undefined): Promise<...> host
type
stringid
type
stringcache?
type
Map<string, { key: string; url: string; params: any; value: any; etag: string | null; last_modified: string | null; }> | null | undefinedoptional
log?
type
Logger | undefinedoptional
request?
type
RequestInit | undefinedoptional
token?
type
string | undefinedoptional
fetch?
type
((input: RequestInfo | URL, init?: RequestInit | undefined) => Promise<Response>) | undefinedoptional
returns
Promise<MastodonStatusContext | null> filter_valid_replies #
filter_valid_replies
(root_status: MastodonStatus, status_context: MastodonStatusContext, reply_filter: ReplyFilter | ReplyFilter[] | null, cache: Map<...> | ... 1 more ... | undefined, log: Logger | undefined): Promise<...> root_status
type MastodonStatus
status_context
reply_filter
type
ReplyFilter | ReplyFilter[] | nullcache
type
Map<string, { key: string; url: string; params: any; value: any; etag: string | null; last_modified: string | null; }> | null | undefinedlog
type
Logger | undefinedreturns
Promise<MastodonStatus[]> MastodonFavourite #
MastodonFavourite
MastodonFavourite id
type
stringusername
type
stringacct
type
stringdisplay_name
type
stringlocked
type
booleanbot
type
booleandiscoverable
type
booleangroup
type
booleancreated_at
type
stringnote
type
stringurl
type
stringavatar
type
stringavatar_static
type
stringheader
type
stringheader_static
type
stringfollowers_count
type
numberfollowing_count
type
numberstatuses_count
type
numberlast_status_at
type
stringemojis
type
Array<unknown>fields
type
Array<{
name: string;
value: string;
verified_at: string; // Datetime
}>MastodonStatus #
MastodonStatus
MastodonStatus id
type
stringcreated_at
type
stringin_reply_to_id
type
stringin_reply_to_account_id
type
stringsensitive
type
booleanspoiler_text
type
stringvisibility
type
stringlanguage
type
stringuri
type
stringurl
type
stringreplies_count
type
numberreblogs_count
type
numberfavourites_count
type
numberedited_at
type
null | stringfavourited
type
booleanreblogged
type
booleanmuted
type
booleanbookmarked
type
booleancontent
type
stringfiltered
type
Array<unknown>reblog
type
unknownaccount
type
{
id: string;
username: string;
acct: string;
display_name: string;
locked: boolean;
bot: boolean;
discoverable: boolean;
group: boolean;
created_at: string;
note: string;
url: string;
avatar: string;
avatar_static: string;
header: string;
header_static: string;
followers_count: number;
following_count: number;
statuses_count: number;
last_status_at: string;
emojis: Array<unknown>;
fields: Array<unknown>;
}media_attachments
type
Array<unknown>mentions
type
[
{
id: string;
username: string;
url: string;
acct: string;
},
]tags
type
[
{
name: string;
url: string;
},
]emojis
type
Array<unknown>card
type
unknownpoll
type
unknownMastodonStatusContext #
MastodonStatusContext
MastodonStatusContext Result from https://:host/api/v1/statuses/:id/context.
see also
ancestors
type
Array<MastodonStatus>descendants
type
Array<MastodonStatus>MastodonStatusUrl #
MastodonStatusUrl
MastodonStatusUrl href
type
stringhost
type
stringstatus_id
type
stringauthor
type
stringMinimumFavouritesReplyFilter #
MinimumFavouritesReplyFilter
MinimumFavouritesReplyFilter type
type
'minimum_favourites'minimum_favourites
type
numberparse_mastodon_status_url #
parse_mastodon_status_url
(url: string): MastodonStatusUrl | null Parses a url to a post or API endpoint for a post, aka Mastodon status context.
url
type
stringreturns
MastodonStatusUrl | null the parsed host and id params, if any
ReplyFilter #
ReplyFilter
ReplyFilter When filtering replies, at least one rule must pass for a reply to be included.
to_mastodon_api_favourites_url #
to_mastodon_api_favourites_url
(host: string, id: string): string host
type
stringid
type
stringreturns
string to_mastodon_api_status_context_url #
to_mastodon_api_status_context_url
(host: string, id: string): string host
type
stringid
type
stringreturns
string to_mastodon_api_status_url #
to_mastodon_api_status_url
(host: string, id: string): string host
type
stringid
type
stringreturns
string to_mastodon_status_url #
to_mastodon_status_url
(host: string, id: string): string host
type
stringid
type
stringreturns
string to_mastodon_status_url_with_author #
to_mastodon_status_url_with_author
(host: string, id: string, author: string): string host
type
stringid
type
stringauthor
type
stringreturns
string to_mastodon_status_url_with_users_author #
to_mastodon_status_url_with_users_author
(host: string, id: string, author: string): string longhand for to_mastodon_status_url_with_author, apperas
host
type
stringid
type
stringauthor
type
stringreturns
string