talawa-api / Exports / libraries/requestContext
Module: libraries/requestContext
Table of contents
Variables
Functions
- getRequestContextValue
- init
- middleware
- setRequestContext
- setRequestContextValue
- translate
- translatePlural
Variables
requestContextNamespace
• Const
requestContextNamespace: Namespace
<Record
<string
, any
>>
Defined in
src/libraries/requestContext.ts:6
Functions
getRequestContextValue
▸ getRequestContextValue<T
>(key
): T
Type parameters
Name |
---|
T |
Parameters
Name | Type |
---|---|
key | string |
Returns
T
Defined in
src/libraries/requestContext.ts:14
init
▸ init<T
>(options?
): T
Type parameters
Name |
---|
T |
Parameters
Name | Type |
---|---|
options | InterfaceInitOptions <T > |
Returns
T
Defined in
src/libraries/requestContext.ts:38
middleware
▸ middleware(): (req
: Request
<ParamsDictionary
, any
, any
, ParsedQs
, Record
<string
, any
>>, res
: Response
<any
, Record
<string
, any
>>, next
: NextFunction
) => void
Returns
fn
▸ (req
, res
, next
): void
Parameters
Name | Type |
---|---|
req | Request <ParamsDictionary , any , any , ParsedQs , Record <string , any >> |
res | Response <any , Record <string , any >> |
next | NextFunction |
Returns
void
Defined in
src/libraries/requestContext.ts:23
setRequestContext
▸ setRequestContext(obj
): void
Parameters
Name | Type |
---|---|
obj | any |
Returns
void
Defined in
src/libraries/requestContext.ts:18
setRequestContextValue
▸ setRequestContextValue<T
>(key
, value
): T
Type parameters
Name |
---|
T |
Parameters
Name | Type |
---|---|
key | string |
value | T |
Returns
T
Defined in
src/libraries/requestContext.ts:10
translate
▸ translate(...args
): any
Parameters
Name | Type |
---|---|
...args | any |
Returns
any
Defined in
src/libraries/requestContext.ts:68
translatePlural
▸ translatePlural(...args
): any
Parameters
Name | Type |
---|---|
...args | any |
Returns
any