forked from RomainLanz/async-http-context
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
24 lines (20 loc) · 760 Bytes
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
declare module '@ioc:Adonis/Core/AsyncHttpContext' {
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
interface IAsyncHttpContext {
/**
* Returns the current AdonisJS HTTP context or throws if there is none.
*/
readonly ctx: HttpContextContract
/**
* Returns the current AdonisJS HTTP context or `undefined`.
*/
getStore(): HttpContextContract | undefined
/**
* Transition into the context for the remainder of the current synchronous
* execution. This method can be used in tests to mock the AdonisJS context.
*/
enterWith(context: Partial<HttpContextContract>): void
}
const AsyncHttpContext: HttpContextContract & IAsyncHttpContext
export default AsyncHttpContext
}