@@ -5,23 +5,23 @@ import { Load } from './page';
55
66type PageId = string ;
77
8- export type Incoming = Omit < Location , 'params' > & {
8+ export interface Incoming extends Omit < Location , 'params' > {
99 method : string ;
1010 headers : Headers ;
1111 rawBody : StrictBody ;
1212 body ?: ParameterizedBody ;
13- } ;
13+ }
1414
15- export type Logger = {
15+ export interface Logger {
1616 ( msg : string ) : void ;
1717 success : ( msg : string ) => void ;
1818 error : ( msg : string ) => void ;
1919 warn : ( msg : string ) => void ;
2020 minor : ( msg : string ) => void ;
2121 info : ( msg : string ) => void ;
22- } ;
22+ }
2323
24- export type App = {
24+ export interface App {
2525 init : ( {
2626 paths,
2727 prerendering,
@@ -44,9 +44,9 @@ export type App = {
4444 } ;
4545 }
4646 ) => Promise < ServerResponse > ;
47- } ;
47+ }
4848
49- export type SSRComponent = {
49+ export interface SSRComponent {
5050 ssr ?: boolean ;
5151 router ?: boolean ;
5252 hydrate ?: boolean ;
@@ -65,22 +65,22 @@ export type SSRComponent = {
6565 } ;
6666 } ;
6767 } ;
68- } ;
68+ }
6969
7070export type SSRComponentLoader = ( ) => Promise < SSRComponent > ;
7171
7272export type CSRComponent = any ; // TODO
7373
7474export type CSRComponentLoader = ( ) => Promise < CSRComponent > ;
7575
76- export type SSRPagePart = {
76+ export interface SSRPagePart {
7777 id : string ;
7878 load : SSRComponentLoader ;
79- } ;
79+ }
8080
8181export type GetParams = ( match : RegExpExecArray ) => Record < string , string > ;
8282
83- export type SSRPage = {
83+ export interface SSRPage {
8484 type : 'page' ;
8585 pattern : RegExp ;
8686 params : GetParams ;
@@ -90,16 +90,16 @@ export type SSRPage = {
9090 // plan b — and render that instead
9191 a : PageId [ ] ;
9292 b : PageId [ ] ;
93- } ;
93+ }
9494
95- export type SSREndpoint = {
95+ export interface SSREndpoint {
9696 type : 'endpoint' ;
9797 pattern : RegExp ;
9898 params : GetParams ;
9999 load : ( ) => Promise < {
100100 [ method : string ] : RequestHandler ;
101101 } > ;
102- } ;
102+ }
103103
104104export type SSRRoute = SSREndpoint | SSRPage ;
105105
@@ -109,28 +109,28 @@ export type CSREndpoint = [RegExp];
109109
110110export type CSRRoute = CSREndpoint | CSRPage ;
111111
112- export type SSRManifest = {
112+ export interface SSRManifest {
113113 assets : Asset [ ] ;
114114 layout : string ;
115115 error : string ;
116116 routes : SSRRoute [ ] ;
117- } ;
117+ }
118118
119- export type Hooks = {
119+ export interface Hooks {
120120 getSession : GetSession ;
121121 handle : Handle ;
122122 serverFetch : ServerFetch ;
123- } ;
123+ }
124124
125- export type SSRNode = {
125+ export interface SSRNode {
126126 module : SSRComponent ;
127127 entry : string ; // client-side module corresponding to this component
128128 css : string [ ] ;
129129 js : string [ ] ;
130130 styles : string [ ] ;
131- } ;
131+ }
132132
133- export type SSRRenderOptions = {
133+ export interface SSRRenderOptions {
134134 amp : boolean ;
135135 dev : boolean ;
136136 entry : {
@@ -157,9 +157,9 @@ export type SSRRenderOptions = {
157157 target : string ;
158158 template : ( { head, body } : { head : string ; body : string } ) => string ;
159159 trailing_slash : TrailingSlash ;
160- } ;
160+ }
161161
162- export type SSRRenderState = {
162+ export interface SSRRenderState {
163163 fetched ?: string ;
164164 initiator ?: SSRPage | null ;
165165 prerender ?: {
@@ -169,54 +169,54 @@ export type SSRRenderState = {
169169 error : Error ;
170170 } ;
171171 fallback ?: string ;
172- } ;
172+ }
173173
174- export type Asset = {
174+ export interface Asset {
175175 file : string ;
176176 size : number ;
177177 type : string | null ;
178- } ;
178+ }
179179
180- export type PageData = {
180+ export interface PageData {
181181 type : 'page' ;
182182 pattern : RegExp ;
183183 params : string [ ] ;
184184 path : string ;
185185 a : string [ ] ;
186186 b : string [ ] ;
187- } ;
187+ }
188188
189- export type EndpointData = {
189+ export interface EndpointData {
190190 type : 'endpoint' ;
191191 pattern : RegExp ;
192192 params : string [ ] ;
193193 file : string ;
194- } ;
194+ }
195195
196196export type RouteData = PageData | EndpointData ;
197197
198- export type ManifestData = {
198+ export interface ManifestData {
199199 assets : Asset [ ] ;
200200 layout : string ;
201201 error : string ;
202202 components : string [ ] ;
203203 routes : RouteData [ ] ;
204- } ;
204+ }
205205
206- export type BuildData = {
206+ export interface BuildData {
207207 client : string [ ] ;
208208 server : string [ ] ;
209209 static : string [ ] ;
210210 entries : string [ ] ;
211- } ;
211+ }
212212
213- export type NormalizedLoadOutput = {
213+ export interface NormalizedLoadOutput {
214214 status : number ;
215215 error ?: Error ;
216216 redirect ?: string ;
217217 props ?: Record < string , any > | Promise < Record < string , any > > ;
218218 context ?: Record < string , any > ;
219219 maxage ?: number ;
220- } ;
220+ }
221221
222222export type TrailingSlash = 'never' | 'always' | 'ignore' ;
0 commit comments