Skip to content

Commit 8c53262

Browse files
committed
[docs] clean up type alias syntax in interfaces
Follow up to #2307
1 parent 1a8ca30 commit 8c53262

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

documentation/docs/01-routing.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,12 @@ export interface RequestHandler<
8888
Locals = Record<string, any>,
8989
Input = unknown,
9090
Output extends DefaultBody = DefaultBody
91-
> = (
92-
request: ServerRequest<Locals, Input>
93-
) => void | EndpointOutput<Output> | Promise<void | EndpointOutput<Output>>;
91+
> {
92+
(request: ServerRequest<Locals, Input>):
93+
| void
94+
| EndpointOutput<Output>
95+
| Promise<void | EndpointOutput<Output>>;
96+
}
9497
```
9598

9699
For example, our hypothetical blog page, `/blog/cool-article`, might request data from `/blog/cool-article.json`, which could be represented by a `src/routes/blog/[slug].json.js` endpoint:

documentation/docs/03-loading.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export interface LoadInput<
1212
PageParams extends Record<string, string> = Record<string, string>,
1313
Context extends Record<string, any> = Record<string, any>,
1414
Session = any
15-
> = {
15+
> {
1616
page: {
1717
host: string;
1818
path: string;
@@ -22,19 +22,19 @@ export interface LoadInput<
2222
fetch(info: RequestInfo, init?: RequestInit): Promise<Response>;
2323
session: Session;
2424
context: Context;
25-
};
25+
}
2626

2727
export interface LoadOutput<
2828
Props extends Record<string, any> = Record<string, any>,
2929
Context extends Record<string, any> = Record<string, any>
30-
> = {
30+
> {
3131
status?: number;
3232
error?: string | Error;
3333
redirect?: string;
3434
props?: Props;
3535
context?: Context;
3636
maxage?: number;
37-
};
37+
}
3838
```
3939

4040
Our example blog page might contain a `load` function like the following:

0 commit comments

Comments
 (0)