~cytrogen/masto-fe

9a52a7f7a03e7dfc269a9eb13ece2290f2b705fd — Renaud Chaput 2 years ago e38b391
Remove MastodonMap TS type (#24807)

2 files changed, 3 insertions(+), 8 deletions(-)

M app/javascript/types/resources.ts
M app/javascript/types/util.ts
M app/javascript/types/resources.ts => app/javascript/types/resources.ts +3 -2
@@ 1,4 1,4 @@
import type { MastodonMap } from './util';
import type { Record } from 'immutable';

type AccountValues = {
  id: number;


@@ 6,4 6,5 @@ type AccountValues = {
  avatar_static: string;
  [key: string]: any;
};
export type Account = MastodonMap<AccountValues>;

export type Account = Record<AccountValues>;

M app/javascript/types/util.ts => app/javascript/types/util.ts +0 -6
@@ 1,7 1,1 @@
export interface MastodonMap<T> {
  get<K extends keyof T>(key: K): T[K];
  has<K extends keyof T>(key: K): boolean;
  set<K extends keyof T>(key: K, value: T[K]): this;
}

export type ValueOf<T> = T[keyof T];