Interface: DelegateContext

Server.DelegateContext

A delegate context used in delegate builder in Config.

Allows to emit logs, notify about compilation events and broadcast events to connected clients.

Table of contents

Properties

Methods

Properties

log

log: FastifyLoggerInstance

A logger instance, useful for emitting logs from the delegate.

Defined in

types.ts:81

Methods

broadcastToHmrClients

broadcastToHmrClients<E>(event, platform, clientIds?): void

Broadcast arbitrary event to all connected HMR clients for given platform.

Type parameters

Name Type
E any

Parameters

Name Type Description
event E Arbitrary event to broadcast.
platform string Platform of the clients to which broadcast should be sent.
clientIds? string[] Ids of the client to which broadcast should be sent. If undefined the broadcast will be sent to all connected clients for the given platform.

Returns

void

Defined in

types.ts:97


broadcastToMessageClients

broadcastToMessageClients<E>(event): void

Broadcast arbitrary method-like event to all connected message clients.

Type parameters

Name Type
E extends Object

Parameters

Name Type Description
event E Arbitrary method-like event to broadcast.

Returns

void

Defined in

types.ts:108


notifyBuildEnd

notifyBuildEnd(platform): void

Send notification about compilation end for given platform.

Parameters

Name Type
platform string

Returns

void

Defined in

types.ts:87


notifyBuildStart

notifyBuildStart(platform): void

Send notification about compilation start for given platform.

Parameters

Name Type
platform string

Returns

void

Defined in

types.ts:84