diff options
| author | polwex <polwex@sortug.com> | 2025-11-19 05:47:30 +0700 |
|---|---|---|
| committer | polwex <polwex@sortug.com> | 2025-11-19 05:47:30 +0700 |
| commit | 74d84cb2f22600b6246343e9ea606cf0db7517f0 (patch) | |
| tree | 0d68285c8e74e6543645e17ab2751d543c1ff9a6 /gui/src/types/nostrill.ts | |
| parent | e6e657be3a3b1dae426b46f3bc16f9a5cf4861c2 (diff) | |
Big GUI improvements on Nostr rendering and fetchingpolwex/iris
Diffstat (limited to 'gui/src/types/nostrill.ts')
| -rw-r--r-- | gui/src/types/nostrill.ts | 43 |
1 files changed, 40 insertions, 3 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[] }; |
