-
Notifications
You must be signed in to change notification settings - Fork 57
Expand file tree
/
Copy pathServerContext.d.ts
More file actions
89 lines (79 loc) · 2.23 KB
/
ServerContext.d.ts
File metadata and controls
89 lines (79 loc) · 2.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
import { NullstackEnvironment } from './Environment'
import { NullstackProject } from './Project'
import { NullstackRequest } from './Request'
import { NullstackResponse } from './Response'
import { NullstackSecrets } from './Secrets'
import { NullstackServer } from './Server'
import { NullstackSettings } from './Settings'
import { NullstackWorker } from './Worker'
/**
* @see https://nullstack.app/context
*/
interface BaseNullstackServerContext {
/**
* Callback function that bootstrap the context for the application.
*/
start?: () => Promise<void>
/**
* Information about the app manifest and some metatags.
*
* @see https://nullstack.app/context-project
*/
project: NullstackProject
/**
* Gives you granular control of your PWA behavior.
*
* @see https://nullstack.app/service-worker
*/
worker: NullstackWorker
/**
* It gives you information about the current environment.
*
* @see https://nullstack.app/context-environment
*/
environment: NullstackEnvironment
/**
* The server key is a proxy around the [Express](https://expressjs.com/) instance that runs Nullstack under the hood.
*
* @scope server
* @see https://nullstack.app/server-request-and-response
*/
server: NullstackServer
/**
* Original `request` object from [Express](https://expressjs.com/)
*
* @scope server
* @see https://nullstack.app/server-request-and-response
*/
request?: NullstackRequest
/**
* Original `response` object from [Express](https://expressjs.com/)
*
* @scope server
* @see https://nullstack.app/server-request-and-response
*/
response?: NullstackResponse
/**
* You can assign any key with any type of public information.
*
* @example
* ```
* // .env NULLSTACK_SETTINGS_PUBLIC_KEY
* settings.publicKey
* ```
* @see https://nullstack.app/context-settings
*/
settings: NullstackSettings
/**
* You can assign any key with any type of private information.
*
* @example
* ```
* // .env NULLSTACK_SECRETS_PRIVATE_KEY
* secrets.privateKey
* ```
* @see https://nullstack.app/context-secrets
*/
secrets: NullstackSecrets
}
export type NullstackServerContext<TProps = unknown> = BaseNullstackServerContext & TProps