diff --git a/composables/masto/status.ts b/composables/masto/status.ts index 2662eae2..341da775 100644 --- a/composables/masto/status.ts +++ b/composables/masto/status.ts @@ -1,24 +1,6 @@ -import type { mastodon } from 'masto' - type Action = 'reblogged' | 'favourited' | 'bookmarked' | 'pinned' | 'muted' type CountField = 'reblogsCount' | 'favouritesCount' -// Add EmojiReaction type to support fedibird non-mastodon emoji reaction -export interface EmojiReaction { - name: string - count: number - accountIds: string[] - me: boolean - // Only used by custom emoji - url?: string - staticUrl?: string - domain?: string | null - width?: number - height?: number -} - -export type Status = mastodon.v1.Status & { emojiReactionsCount?: number, emojiReactions?: EmojiReaction[] } - export interface StatusActionsProps { status: Status } diff --git a/types/global.d.ts b/types/global.d.ts new file mode 100644 index 00000000..64165b6d --- /dev/null +++ b/types/global.d.ts @@ -0,0 +1,21 @@ +import 'masto' + +declare module 'masto/mastodon/entities/v1/index.js' { + // support fedibird non-mastodon emoji reaction + interface EmojiReaction { + name: string + count: number + accountIds: string[] + me: boolean + url?: string + staticUrl?: string + domain?: string | null + width?: number + height?: number + } + + interface Status { + emojiReactionsCount?: number + emojiReactions?: EmojiReaction[] + } +}