Refactor primitives into namespaces.

This commit is contained in:
Jay
2025-10-31 20:44:36 -04:00
parent c7935326e9
commit efe2814c8a
29 changed files with 192 additions and 275 deletions

20
src/events/event.ts Normal file
View File

@@ -0,0 +1,20 @@
/**
* Tag represents a single tag within an event as an array of strings.
* The first element identifies the tag name, the second contains the value,
* and subsequent elements are optional.
*/
export type Tag = string[];
/**
* Event represents a Nostr protocol event with its seven required fields.
* All fields must be present for a valid event.
*/
export interface Event {
id: string;
pubkey: string;
created_at: number;
kind: number;
tags: Tag[];
content: string;
sig: string;
}