Skip to content

@istock/iswork / Exports / MessageChannelAdapter

Class: MessageChannelAdapter

Implements

  • AbstractMessage<MessageChannel>

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new MessageChannelAdapter(options?): MessageChannelAdapter

Parameters

NameType
options?StructuredSerializeOptions

Returns

MessageChannelAdapter

Defined in

src/packages/iswork/src/message/message-channel.ts:14

Properties

#onErrorCallback

Private #onErrorCallback: (event: MessageEvent<any>) => void

Type declaration

▸ (event): void

Parameters
NameType
eventMessageEvent<any>
Returns

void

Defined in

src/packages/iswork/src/message/message-channel.ts:8


#onMessageCallback

Private #onMessageCallback: (event: MessageEvent<any>) => void

Type declaration

▸ (event): void

Parameters
NameType
eventMessageEvent<any>
Returns

void

Defined in

src/packages/iswork/src/message/message-channel.ts:7


instance

Readonly instance: MessageChannel

Implementation of

AbstractMessage.instance

Defined in

src/packages/iswork/src/message/message-channel.ts:5


options

Readonly options: undefined | StructuredSerializeOptions

Defined in

src/packages/iswork/src/message/message-channel.ts:6

Accessors

hasOnMessageCallback

get hasOnMessageCallback(): boolean

Returns

boolean

Defined in

src/packages/iswork/src/message/message-channel.ts:10

Methods

close

close(): Promise<void>

Returns

Promise<void>

Implementation of

AbstractMessage.close

Defined in

src/packages/iswork/src/message/message-channel.ts:22


onError

onError(callback): void

Parameters

NameType
callback(error: Error, event: MessageEvent<any>) => Promise<void>

Returns

void

Implementation of

AbstractMessage.onError

Defined in

src/packages/iswork/src/message/message-channel.ts:43


onMessage

onMessage(callback): void

Parameters

NameType
callback(message: any) => Promise<void>

Returns

void

Implementation of

AbstractMessage.onMessage

Defined in

src/packages/iswork/src/message/message-channel.ts:33


open

open(): Promise<void>

Returns

Promise<void>

Implementation of

AbstractMessage.open

Defined in

src/packages/iswork/src/message/message-channel.ts:18


send

send(message): Promise<void>

Parameters

NameType
messageany

Returns

Promise<void>

Implementation of

AbstractMessage.send

Defined in

src/packages/iswork/src/message/message-channel.ts:28

免责声明:本站所有信息、数据、软件仅供学习研究,都不构成投资建议,本站不承担由此导致的任何责任。