Skip to content

Welshman Docs / @welshman/domain / EventReader

Class: abstract EventReader

Defined in: core/EventReader.ts:85

A reader whose event can be parsed without IO — the common case. parse() returns the reader itself, so callers never await it. Override parse to derive state from the event, returning this.

Extends

Extended by

Constructors

Constructor

new EventReader(kind, context, event): EventReader

Defined in: core/EventReader.ts:17

Parameters

kind

number

context

KindContext

event

TrustedEvent

Returns

EventReader

Inherited from

BaseEventReader.constructor

Properties

context

readonly context: KindContext

Defined in: core/EventReader.ts:19

Inherited from

BaseEventReader.context


event

readonly event: TrustedEvent

Defined in: core/EventReader.ts:20

Inherited from

BaseEventReader.event


kind

readonly kind: number

Defined in: core/EventReader.ts:18

Inherited from

BaseEventReader.kind

Methods

address()

address(): string

Defined in: core/EventReader.ts:55

Returns

string

Inherited from

BaseEventReader.address


author()

author(): string

Defined in: core/EventReader.ts:35

Returns

string

Inherited from

BaseEventReader.author


content()

content(): string

Defined in: core/EventReader.ts:39

Returns

string

Inherited from

BaseEventReader.content


createdAt()

createdAt(): number

Defined in: core/EventReader.ts:47

Returns

number

Inherited from

BaseEventReader.createdAt


emojis()

emojis(): Emoji[]

Defined in: core/EventReader.ts:71

Returns

Emoji[]

Inherited from

BaseEventReader.emojis


expiration()

expiration(): undefined | number

Defined in: core/EventReader.ts:67

Returns

undefined | number

Inherited from

BaseEventReader.expiration


id()

id(): string

Defined in: core/EventReader.ts:31

Returns

string

Inherited from

BaseEventReader.id


identifier()

identifier(): undefined | string

Defined in: core/EventReader.ts:51

Returns

undefined | string

Inherited from

BaseEventReader.identifier


parse()

parse(): this

Defined in: core/EventReader.ts:86

Returns

this

Overrides

BaseEventReader.parse


protect()

protect(): boolean

Defined in: core/EventReader.ts:63

Returns

boolean

Inherited from

BaseEventReader.protect


room()

room(): undefined | string

Defined in: core/EventReader.ts:59

Returns

undefined | string

Inherited from

BaseEventReader.room


tags()

tags(): string[][]

Defined in: core/EventReader.ts:43

Returns

string[][]

Inherited from

BaseEventReader.tags


zapSplits()

zapSplits(): ZapSplit[]

Defined in: core/EventReader.ts:75

Returns

ZapSplit[]

Inherited from

BaseEventReader.zapSplits