From 5f0d2b6e3b5fa80310213c88696961b74bef0835 Mon Sep 17 00:00:00 2001 From: Claire Date: Mon, 8 May 2023 21:32:26 +0200 Subject: [PATCH] Copy Typescript type definitions to glitch-soc --- .../flavours/glitch/components/avatar.tsx | 2 +- app/javascript/flavours/glitch/types/resources.ts | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 app/javascript/flavours/glitch/types/resources.ts diff --git a/app/javascript/flavours/glitch/components/avatar.tsx b/app/javascript/flavours/glitch/components/avatar.tsx index a21ffc9888..d6a9621462 100644 --- a/app/javascript/flavours/glitch/components/avatar.tsx +++ b/app/javascript/flavours/glitch/components/avatar.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import classNames from 'classnames'; import { autoPlayGif } from 'flavours/glitch/initial_state'; import { useHovering } from 'hooks/useHovering'; -import type { Account } from 'types/resources'; +import type { Account } from 'flavours/glitch/types/resources'; type Props = { account: Account | undefined; diff --git a/app/javascript/flavours/glitch/types/resources.ts b/app/javascript/flavours/glitch/types/resources.ts new file mode 100644 index 0000000000..efbb1faa76 --- /dev/null +++ b/app/javascript/flavours/glitch/types/resources.ts @@ -0,0 +1,13 @@ +interface MastodonMap { + get(key: K): T[K]; + has(key: K): boolean; + set(key: K, value: T[K]): this; +} + +type AccountValues = { + id: number; + avatar: string; + avatar_static: string; + [key: string]: any; +} +export type Account = MastodonMap