diff options
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[] }; |
