import { type NostrNode } from "https://deno.land/x/lophus@0.0.13/core/nodes.ts";
Common interface for relays and clients, which extends EventTarget
.
Type Parameters
optional
W extends NostrMessage = NostrMessageoptional
R extends EventTypeRecord = EventTypeRecordProperties
readonly
config: Readonly<NostrNodeConfig<W, R>>readonly
ws: WebSocketLikereadonly
writable: WritableStream<W>status: WebSocketLike["readyState"]
Methods
send(msg: W): void | Promise<void>
install(mod: NostrNodeModule<W, R>): void
addEventListener<T extends EventType<R>>(): void
type: T,
options?: AddEventListenerOptions,
removeEventListener<T extends EventType<R>>(): void
type: T,
options?: boolean | EventListenerOptions,
dispatchEvent<T extends EventType<R>>(event: NostrNodeEvent<R, T>): boolean