diff options
Diffstat (limited to 'gui/src/types')
| -rw-r--r-- | gui/src/types/nostrill.ts | 43 | ||||
| -rw-r--r-- | gui/src/types/notifications.ts | 8 | ||||
| -rw-r--r-- | gui/src/types/trill.ts | 1 | ||||
| -rw-r--r-- | gui/src/types/ui.ts | 2 |
4 files changed, 47 insertions, 7 deletions
diff --git a/gui/src/types/nostrill.ts b/gui/src/types/nostrill.ts index 5ce033c..13ec942 100644 --- a/gui/src/types/nostrill.ts +++ b/gui/src/types/nostrill.ts @@ -1,13 +1,14 @@ import type { NostrEvent } from "./nostr"; -import type { Poast } from "./trill"; +import type { FC, Poast } from "./trill"; export type UserType = { urbit: string } | { nostr: string }; export type UserProfile = { name: string; picture: string; // URL about: string; - other: Record<string, string>; + other: Record<string, any>; }; +export type DateObj = { month: number; day: number; year?: number }; export type PostWrapper = | { nostr: NostrPost } @@ -18,7 +19,43 @@ export type NostrPost = { post: Poast; }; export type NostrMetadata = { - pubkey?: string; + pubkey: string; eventId: string; relay?: string; + post: Poast; +}; +export type Relays = Record<string, RelayStats>; +export type RelayStats = { + start: number; + wid: number; + reqs: Record<string, number>; }; + +export type Fact = + | { nostr: NostrFact } + | { post: PostFact } + | { enga: EngaFact } + | { fols: FolsFact } + | { hark: Notification }; + +export type NostrFact = + | { feed: NostrEvent[] } + | { user: NostrEvent[] } + | { thread: NostrEvent[] } + | { event: NostrEvent } + | { relays: Relays }; + +export type PostFact = { add: { post: Poast } } | { del: { post: Poast } }; + +export type EngaFact = { add: NostrEvent[] } | { del: NostrEvent[] }; + +export type FolsFact = + | { new: { user: string; feed: FC; profile: UserProfile } } + | { quit: string }; + +export type Notification = + | { prof: NostrEvent[] } + | { fols: NostrEvent[] } + | { beg: NostrEvent[] } + | { fans: NostrEvent[] } + | { post: NostrEvent[] }; diff --git a/gui/src/types/notifications.ts b/gui/src/types/notifications.ts index 760702a..4d0bd3f 100644 --- a/gui/src/types/notifications.ts +++ b/gui/src/types/notifications.ts @@ -1,6 +1,6 @@ import type { Ship } from "./urbit"; -export type NotificationType = +export type NotificationType = | "follow" | "unfollow" | "mention" @@ -8,7 +8,9 @@ export type NotificationType = | "repost" | "react" | "access_request" - | "access_granted"; + | "access_granted" + | "fetching_nostr" + | "nostr_fetch_success"; export interface Notification { id: string; @@ -25,4 +27,4 @@ export interface Notification { export interface NotificationState { notifications: Notification[]; unreadCount: number; -}
\ No newline at end of file +} diff --git a/gui/src/types/trill.ts b/gui/src/types/trill.ts index a2fccc2..6d67b66 100644 --- a/gui/src/types/trill.ts +++ b/gui/src/types/trill.ts @@ -45,6 +45,7 @@ export type Poast = { contents: Content; id: string; time: number; // not in the backend + hash: string; children: ID[]; engagement: Engagement; tlonRumor?: boolean; diff --git a/gui/src/types/ui.ts b/gui/src/types/ui.ts index 4596236..b80b4ca 100644 --- a/gui/src/types/ui.ts +++ b/gui/src/types/ui.ts @@ -1,4 +1,4 @@ -import type { NostrMetadata } from "./nostrill"; +import type { NostrMetadata, NostrPost } from "./nostrill"; import type { Poast } from "./trill"; import type { Tweet } from "./twatter"; import type { Ship } from "./urbit"; |
