lume/packages/types/index.d.ts

98 lines
1.6 KiB
TypeScript
Raw Normal View History

2024-02-06 12:28:46 +00:00
export interface Keys {
2024-05-07 07:14:21 +00:00
npub: string;
nsec: string;
2024-02-06 12:28:46 +00:00
}
export enum Kind {
2024-05-07 07:14:21 +00:00
Metadata = 0,
Text = 1,
RecommendRelay = 2,
Contacts = 3,
Repost = 6,
Reaction = 7,
ZapReceipt = 9735,
// NIP-89: App Metadata
AppRecommendation = 31989,
AppHandler = 31990,
// #TODO: Add all nostr kinds
2024-02-06 12:28:46 +00:00
}
export interface Meta {
content: string;
images: string[];
videos: string[];
events: string[];
mentions: string[];
hashtags: string[];
}
export interface NostrEvent {
2024-05-07 07:14:21 +00:00
id: string;
pubkey: string;
created_at: number;
kind: Kind;
tags: string[][];
content: string;
sig: string;
meta: Meta;
2024-02-06 12:28:46 +00:00
}
export interface EventWithReplies extends NostrEvent {
replies: Array<NostrEvent>;
2024-02-09 08:33:27 +00:00
}
export interface EventTag {
id: string;
relayHint: string;
}
2024-02-06 12:28:46 +00:00
export interface Metadata {
2024-05-07 07:14:21 +00:00
name?: string;
display_name?: string;
about?: string;
website?: string;
picture?: string;
banner?: string;
nip05?: string;
lud06?: string;
lud16?: string;
2024-02-06 12:28:46 +00:00
}
2024-04-07 08:11:20 +00:00
export interface ColumnRouteSearch {
2024-05-07 07:14:21 +00:00
account: string;
label: string;
name: string;
redirect?: string;
2024-04-07 08:11:20 +00:00
}
2024-02-09 08:33:27 +00:00
export interface LumeColumn {
2024-05-07 07:14:21 +00:00
label: string;
name: string;
content: URL | string;
description?: string;
author?: string;
logo?: string;
cover?: string;
coverRetina?: string;
featured?: boolean;
}
export interface ColumnEvent {
type: "reset" | "add" | "remove" | "update" | "left" | "right" | "set_title";
2024-05-07 07:14:21 +00:00
label?: string;
title?: string;
column?: LumeColumn;
2024-03-19 08:36:20 +00:00
}
export interface Relays {
connected: string[];
read: string[];
write: string[];
both: string[];
}
export interface Relay {
url: string;
purpose: "read" | "write" | string;
}