Skip to content

Welshman Docs / @welshman/domain / AsyncEventReader

Class: abstract AsyncEventReader

Defined in: core/EventReader.ts:96

A reader that has to decrypt (or otherwise await something) before its accessors are complete. parse() returns a promise, so the type system makes callers await it rather than silently reading a half-parsed event.

Extends

Extended by

Constructors

Constructor

new AsyncEventReader(kind, context, event): AsyncEventReader

Defined in: core/EventReader.ts:17

Parameters

kind

number

context

KindContext

event

TrustedEvent

Returns

AsyncEventReader

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()

abstract parse(): Promise<AsyncEventReader>

Defined in: core/EventReader.ts:97

Returns

Promise<AsyncEventReader>

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