Skip to content

Commit 38c3456

Browse files
committed
[fix] expose init and render for adapters
1 parent 0245ce0 commit 38c3456

File tree

4 files changed

+25
-10
lines changed

4 files changed

+25
-10
lines changed

.changeset/five-bags-prove.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sveltejs/kit': patch
3+
---
4+
5+
[fix] expose init and render for adapters

packages/kit/types/app.d.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
import { ReadOnlyFormData, RequestHeaders } from './helper';
22
import { ServerResponse } from './hooks';
33

4+
export interface Init {
5+
(): void;
6+
}
7+
8+
export interface Render {
9+
(incoming: IncomingRequest): Promise<ServerResponse>;
10+
}
11+
412
export interface App {
5-
init(options?: {
6-
paths: {
7-
base: string;
8-
assets: string;
9-
};
10-
prerendering: boolean;
11-
read(file: string): Buffer;
12-
}): void;
13-
render(incoming: IncomingRequest): Promise<ServerResponse>;
13+
init: Init;
14+
render: Render;
1415
}
1516

1617
export type RawBody = null | Uint8Array;

packages/kit/types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
import './ambient-modules';
55

6-
export { App, IncomingRequest, RawBody } from './app';
6+
export { App, IncomingRequest, Init, RawBody, Render } from './app';
77
export { Adapter, AdapterUtils, Config, PrerenderErrorHandler, ValidatedConfig } from './config';
88
export { EndpointOutput, RequestHandler } from './endpoint';
99
export { ErrorLoad, ErrorLoadInput, Load, LoadInput, LoadOutput, Page } from './page';

packages/kit/types/internal.d.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@ export interface PrerenderOptions {
1919
}
2020

2121
export interface App extends PublicApp {
22+
init(options?: {
23+
paths: {
24+
base: string;
25+
assets: string;
26+
};
27+
prerendering: boolean;
28+
read(file: string): Buffer;
29+
}): void;
30+
2231
render(
2332
incoming: IncomingRequest,
2433
options?: {

0 commit comments

Comments
 (0)