Skip to main content

Class: MiddlewareList

Constructors

new MiddlewareList()

new MiddlewareList(): MiddlewareList

Returns

MiddlewareList

Methods

add()

add<T>(
name,
handler,
unique): Middleware[]

Type Parameters

Type Parameter
T extends MiddlewareType

Parameters

ParameterTypeDefault value
nameTundefined
handlerMiddlewareHandlers[T]undefined
uniquebooleanfalse

Returns

Middleware[]


clear()

clear(): Middleware[]

Returns

Middleware[]


get()

get(name)

get(name): RequestMiddleware[]
Parameters
ParameterType
nameREQUEST
Returns

RequestMiddleware[]

get(name)

get(name): ResponseMiddleware[]
Parameters
ParameterType
nameRESPONSE
Returns

ResponseMiddleware[]

get(name)

get(name): RenderMiddleware[]
Parameters
ParameterType
nameRENDER
Returns

RenderMiddleware[]

get(name)

get(name): MapLoadMiddleware[]
Parameters
ParameterType
nameMAP_LOAD
Returns

MapLoadMiddleware[]


off()

off(eventName, handler?): MiddlewareList

Parameters

ParameterType
eventNamestring
handler?MiddlewareHandler

Returns

MiddlewareList


removeByType()

removeByType(type): Middleware[]

Parameters

ParameterType
typeMiddlewareType

Returns

Middleware[]


run()

run(type, params)

run(type, params): Record<string, unknown>
Parameters
ParameterType
typeREQUEST
params[unknown, object]
Returns

Record<string, unknown>

run(type, params)

run(type, params): string | Record<string, unknown>
Parameters
ParameterType
typeRESPONSE
params[unknown, object]
Returns

string | Record<string, unknown>

run(type, params)

run(type, params): Record<string, unknown>
Parameters
ParameterType
typeRENDER
params[Record<string, unknown>, object]
Returns

Record<string, unknown>

run(type, params)

run(type, params): MapOptions
Parameters
ParameterType
typeMAP_LOAD
params[MapOptions, object]
Returns

MapOptions

Properties

middlewares

middlewares: Middleware[];