@@ -5,23 +5,23 @@ import { Load } from './page';
5
5
6
6
type PageId = string ;
7
7
8
- export type Incoming = Omit < Location , 'params' > & {
8
+ export interface Incoming extends Omit < Location , 'params' > {
9
9
method : string ;
10
10
headers : Headers ;
11
11
rawBody : StrictBody ;
12
12
body ?: ParameterizedBody ;
13
- } ;
13
+ }
14
14
15
- export type Logger = {
15
+ export interface Logger {
16
16
( msg : string ) : void ;
17
17
success : ( msg : string ) => void ;
18
18
error : ( msg : string ) => void ;
19
19
warn : ( msg : string ) => void ;
20
20
minor : ( msg : string ) => void ;
21
21
info : ( msg : string ) => void ;
22
- } ;
22
+ }
23
23
24
- export type App = {
24
+ export interface App {
25
25
init : ( {
26
26
paths,
27
27
prerendering,
@@ -44,9 +44,9 @@ export type App = {
44
44
} ;
45
45
}
46
46
) => Promise < ServerResponse > ;
47
- } ;
47
+ }
48
48
49
- export type SSRComponent = {
49
+ export interface SSRComponent {
50
50
ssr ?: boolean ;
51
51
router ?: boolean ;
52
52
hydrate ?: boolean ;
@@ -65,22 +65,22 @@ export type SSRComponent = {
65
65
} ;
66
66
} ;
67
67
} ;
68
- } ;
68
+ }
69
69
70
70
export type SSRComponentLoader = ( ) => Promise < SSRComponent > ;
71
71
72
72
export type CSRComponent = any ; // TODO
73
73
74
74
export type CSRComponentLoader = ( ) => Promise < CSRComponent > ;
75
75
76
- export type SSRPagePart = {
76
+ export interface SSRPagePart {
77
77
id : string ;
78
78
load : SSRComponentLoader ;
79
- } ;
79
+ }
80
80
81
81
export type GetParams = ( match : RegExpExecArray ) => Record < string , string > ;
82
82
83
- export type SSRPage = {
83
+ export interface SSRPage {
84
84
type : 'page' ;
85
85
pattern : RegExp ;
86
86
params : GetParams ;
@@ -90,16 +90,16 @@ export type SSRPage = {
90
90
// plan b — and render that instead
91
91
a : PageId [ ] ;
92
92
b : PageId [ ] ;
93
- } ;
93
+ }
94
94
95
- export type SSREndpoint = {
95
+ export interface SSREndpoint {
96
96
type : 'endpoint' ;
97
97
pattern : RegExp ;
98
98
params : GetParams ;
99
99
load : ( ) => Promise < {
100
100
[ method : string ] : RequestHandler ;
101
101
} > ;
102
- } ;
102
+ }
103
103
104
104
export type SSRRoute = SSREndpoint | SSRPage ;
105
105
@@ -109,28 +109,28 @@ export type CSREndpoint = [RegExp];
109
109
110
110
export type CSRRoute = CSREndpoint | CSRPage ;
111
111
112
- export type SSRManifest = {
112
+ export interface SSRManifest {
113
113
assets : Asset [ ] ;
114
114
layout : string ;
115
115
error : string ;
116
116
routes : SSRRoute [ ] ;
117
- } ;
117
+ }
118
118
119
- export type Hooks = {
119
+ export interface Hooks {
120
120
getSession : GetSession ;
121
121
handle : Handle ;
122
122
serverFetch : ServerFetch ;
123
- } ;
123
+ }
124
124
125
- export type SSRNode = {
125
+ export interface SSRNode {
126
126
module : SSRComponent ;
127
127
entry : string ; // client-side module corresponding to this component
128
128
css : string [ ] ;
129
129
js : string [ ] ;
130
130
styles : string [ ] ;
131
- } ;
131
+ }
132
132
133
- export type SSRRenderOptions = {
133
+ export interface SSRRenderOptions {
134
134
amp : boolean ;
135
135
dev : boolean ;
136
136
entry : {
@@ -157,9 +157,9 @@ export type SSRRenderOptions = {
157
157
target : string ;
158
158
template : ( { head, body } : { head : string ; body : string } ) => string ;
159
159
trailing_slash : TrailingSlash ;
160
- } ;
160
+ }
161
161
162
- export type SSRRenderState = {
162
+ export interface SSRRenderState {
163
163
fetched ?: string ;
164
164
initiator ?: SSRPage | null ;
165
165
prerender ?: {
@@ -169,54 +169,54 @@ export type SSRRenderState = {
169
169
error : Error ;
170
170
} ;
171
171
fallback ?: string ;
172
- } ;
172
+ }
173
173
174
- export type Asset = {
174
+ export interface Asset {
175
175
file : string ;
176
176
size : number ;
177
177
type : string | null ;
178
- } ;
178
+ }
179
179
180
- export type PageData = {
180
+ export interface PageData {
181
181
type : 'page' ;
182
182
pattern : RegExp ;
183
183
params : string [ ] ;
184
184
path : string ;
185
185
a : string [ ] ;
186
186
b : string [ ] ;
187
- } ;
187
+ }
188
188
189
- export type EndpointData = {
189
+ export interface EndpointData {
190
190
type : 'endpoint' ;
191
191
pattern : RegExp ;
192
192
params : string [ ] ;
193
193
file : string ;
194
- } ;
194
+ }
195
195
196
196
export type RouteData = PageData | EndpointData ;
197
197
198
- export type ManifestData = {
198
+ export interface ManifestData {
199
199
assets : Asset [ ] ;
200
200
layout : string ;
201
201
error : string ;
202
202
components : string [ ] ;
203
203
routes : RouteData [ ] ;
204
- } ;
204
+ }
205
205
206
- export type BuildData = {
206
+ export interface BuildData {
207
207
client : string [ ] ;
208
208
server : string [ ] ;
209
209
static : string [ ] ;
210
210
entries : string [ ] ;
211
- } ;
211
+ }
212
212
213
- export type NormalizedLoadOutput = {
213
+ export interface NormalizedLoadOutput {
214
214
status : number ;
215
215
error ?: Error ;
216
216
redirect ?: string ;
217
217
props ?: Record < string , any > | Promise < Record < string , any > > ;
218
218
context ?: Record < string , any > ;
219
219
maxage ?: number ;
220
- } ;
220
+ }
221
221
222
222
export type TrailingSlash = 'never' | 'always' | 'ignore' ;
0 commit comments