Class: MiddlewareStore
Since
1.0.0
Extends
Store
<Middleware
,"middlewares"
>
Constructors
new MiddlewareStore()
new MiddlewareStore():
MiddlewareStore
Returns
Overrides
Store<Middleware, 'middlewares'>.constructor
Defined in
projects/plugins/packages/api/src/lib/structures/MiddlewareStore.ts:13
Properties
sortedMiddlewares
readonly
sortedMiddlewares:Middleware
<MiddlewareOptions
>[] =[]
The sorted middlewares, in ascending order of see Middleware.position.
Defined in
projects/plugins/packages/api/src/lib/structures/MiddlewareStore.ts:11
Methods
clear()
clear():
void
Returns
void
Overrides
Store.clear
Defined in
projects/plugins/packages/api/src/lib/structures/MiddlewareStore.ts:43
delete()
delete(
key
:string
):boolean
Parameters
Parameter | Type |
---|---|
key | string |
Returns
boolean
true if an element in the Map existed and has been removed, or false if the element does not exist.
Overrides
Store.delete
Defined in
projects/plugins/packages/api/src/lib/structures/MiddlewareStore.ts:34
run()
run(
request
:ApiRequest
,response
:Response
):Promise
<void
>
Parameters
Parameter | Type |
---|---|
request | ApiRequest |
response | Response |
Returns
Promise
<void
>
Defined in
projects/plugins/packages/api/src/lib/structures/MiddlewareStore.ts:17
set()
set(
key
:string
,value
:Middleware
<MiddlewareOptions
>):this
Adds a new element with a specified key and value to the Map. If an element with the same key already exists, the element will be updated.
Parameters
Parameter | Type |
---|---|
key | string |
value | Middleware <MiddlewareOptions > |
Returns
this
Overrides
Store.set
Defined in
projects/plugins/packages/api/src/lib/structures/MiddlewareStore.ts:24