lume/packages/types/index.d.ts

182 lines
2.9 KiB
TypeScript
Raw Normal View History

2024-02-09 08:33:27 +00:00
export interface Settings {
2024-05-07 07:14:21 +00:00
notification: boolean;
enhancedPrivacy: boolean;
autoUpdate: boolean;
zap: boolean;
nsfw: boolean;
2024-05-26 01:23:29 +00:00
gossip: boolean;
2024-05-26 09:11:27 +00:00
theme: "auto" | "light" | "dark";
2024-05-07 07:14:21 +00:00
[key: string]: string | number | boolean;
2024-02-09 08:33:27 +00:00
}
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 NostrEvent {
2024-05-07 07:14:21 +00:00
id: string;
pubkey: string;
created_at: number;
kind: Kind;
tags: string[][];
content: string;
sig: string;
2024-02-06 12:28:46 +00:00
}
export interface EventWithReplies extends NostrEvent {
replies: Array<NostrEvent>;
2024-02-09 08:33:27 +00:00
}
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-02-23 07:56:24 +00:00
export interface Contact {
2024-05-07 07:14:21 +00:00
pubkey: string;
profile: Metadata;
2024-02-23 07:56:24 +00:00
}
2024-02-19 02:58:27 +00:00
export interface Account {
2024-05-07 07:14:21 +00:00
npub: string;
nsec?: string;
contacts?: string[];
interests?: Interests;
2024-02-06 12:28:46 +00:00
}
export interface Topic {
icon: string;
title: string;
content: string[];
}
2024-02-06 12:28:46 +00:00
export interface Interests {
2024-05-07 07:14:21 +00:00
hashtags: string[];
users: string[];
words: string[];
2024-02-06 12:28:46 +00:00
}
2023-12-25 07:28:39 +00:00
export interface RichContent {
2024-05-07 07:14:21 +00:00
parsed: string;
images: string[];
videos: string[];
links: string[];
notes: string[];
2023-12-25 07:28:39 +00:00
}
2024-04-10 07:11:05 +00:00
export interface AppRouteSearch {
2024-05-07 07:14:21 +00:00
account: string;
2024-04-10 07:11:05 +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;
}
2024-03-19 08:36:20 +00:00
export interface EventColumns {
2024-05-07 07:14:21 +00:00
type: "add" | "remove" | "update" | "left" | "right" | "set_title";
label?: string;
title?: string;
column?: LumeColumn;
2024-03-19 08:36:20 +00:00
}
2023-12-25 07:28:39 +00:00
export interface Opengraph {
2024-05-07 07:14:21 +00:00
url: string;
title?: string;
description?: string;
image?: string;
2023-12-25 07:28:39 +00:00
}
export interface NostrBuildResponse {
2024-05-07 07:14:21 +00:00
ok: boolean;
data?: {
message: string;
status: string;
data: Array<{
blurhash: string;
dimensions: {
width: number;
height: number;
};
mime: string;
name: string;
sha256: string;
size: number;
url: string;
}>;
};
2023-12-25 07:28:39 +00:00
}
export interface NIP11 {
2024-05-07 07:14:21 +00:00
name: string;
description: string;
pubkey: string;
contact: string;
supported_nips: number[];
software: string;
version: string;
limitation: {
[key: string]: string | number | boolean;
};
relay_countries: string[];
language_tags: string[];
tags: string[];
posting_policy: string;
payments_url: string;
icon: string[];
2023-12-25 07:28:39 +00:00
}
export interface NIP05 {
2024-05-07 07:14:21 +00:00
names: {
[key: string]: string;
};
nip46: {
[key: string]: {
[key: string]: string[];
};
};
2023-12-25 07:28:39 +00:00
}
export interface Relays {
connected: string[];
read: string[];
write: string[];
both: string[];
}