0
0
Fork 0

Use Immutable Record for accounts in Redux state (#26559)

This commit is contained in:
Renaud Chaput 2023-11-03 16:00:03 +01:00 committed by GitHub
parent 9d799d40ba
commit 3bf2a7296e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
65 changed files with 765 additions and 662 deletions

View file

@ -1,55 +0,0 @@
import type { Record } from 'immutable';
type CustomEmoji = Record<{
shortcode: string;
static_url: string;
url: string;
}>;
type AccountField = Record<{
name: string;
value: string;
verified_at: string | null;
}>;
interface AccountApiResponseValues {
acct: string;
avatar: string;
avatar_static: string;
bot: boolean;
created_at: string;
discoverable: boolean;
display_name: string;
emojis: CustomEmoji[];
fields: AccountField[];
followers_count: number;
following_count: number;
group: boolean;
header: string;
header_static: string;
id: string;
last_status_at: string;
locked: boolean;
note: string;
statuses_count: number;
url: string;
uri: string;
username: string;
}
type NormalizedAccountField = Record<{
name_emojified: string;
value_emojified: string;
value_plain: string;
}>;
interface NormalizedAccountValues {
display_name_html: string;
fields: NormalizedAccountField[];
note_emojified: string;
note_plain: string;
}
export type Account = Record<
AccountApiResponseValues & NormalizedAccountValues
>;