@sveltejs/kit 1.0.0-next.2 → 1.0.0-next.202

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/README.md +12 -9
  2. package/assets/components/error.svelte +19 -3
  3. package/assets/runtime/app/env.js +20 -0
  4. package/assets/runtime/app/navigation.js +42 -34
  5. package/assets/runtime/app/paths.js +1 -0
  6. package/assets/runtime/app/stores.js +15 -9
  7. package/assets/runtime/chunks/utils.js +13 -0
  8. package/assets/runtime/env.js +8 -0
  9. package/assets/runtime/internal/singletons.js +5 -6
  10. package/assets/runtime/internal/start.js +1020 -320
  11. package/assets/runtime/paths.js +13 -0
  12. package/dist/chunks/cert.js +29255 -0
  13. package/dist/chunks/constants.js +8 -0
  14. package/dist/chunks/error.js +21 -0
  15. package/dist/chunks/index.js +4746 -0
  16. package/dist/chunks/index2.js +797 -0
  17. package/dist/chunks/index3.js +1042 -0
  18. package/dist/chunks/index4.js +398 -0
  19. package/dist/chunks/index5.js +827 -0
  20. package/dist/chunks/index6.js +15575 -0
  21. package/dist/chunks/multipart-parser.js +449 -0
  22. package/dist/chunks/url.js +62 -0
  23. package/dist/cli.js +958 -59
  24. package/dist/hooks.js +28 -0
  25. package/dist/install-fetch.js +6514 -0
  26. package/dist/node.js +51 -0
  27. package/dist/ssr.js +1771 -0
  28. package/package.json +90 -52
  29. package/svelte-kit.js +2 -0
  30. package/types/ambient-modules.d.ts +173 -0
  31. package/types/app.d.ts +21 -0
  32. package/types/config.d.ts +96 -0
  33. package/types/endpoint.d.ts +18 -0
  34. package/types/helper.d.ts +41 -0
  35. package/types/hooks.d.ts +36 -0
  36. package/types/index.d.ts +17 -0
  37. package/types/internal.d.ts +219 -0
  38. package/types/page.d.ts +77 -0
  39. package/CHANGELOG.md +0 -159
  40. package/assets/renderer/index.js +0 -2492
  41. package/assets/renderer/index.js.map +0 -1
  42. package/assets/runtime/app/navigation.js.map +0 -1
  43. package/assets/runtime/app/stores.js.map +0 -1
  44. package/assets/runtime/internal/singletons.js.map +0 -1
  45. package/assets/runtime/internal/start.js.map +0 -1
  46. package/dist/api.js +0 -38
  47. package/dist/api.js.map +0 -1
  48. package/dist/cli.js.map +0 -1
  49. package/dist/create_app.js +0 -550
  50. package/dist/create_app.js.map +0 -1
  51. package/dist/index.js +0 -10708
  52. package/dist/index.js.map +0 -1
  53. package/dist/index2.js +0 -506
  54. package/dist/index2.js.map +0 -1
  55. package/dist/index3.js +0 -62
  56. package/dist/index3.js.map +0 -1
  57. package/dist/index4.js +0 -563
  58. package/dist/index4.js.map +0 -1
  59. package/dist/index5.js +0 -276
  60. package/dist/index5.js.map +0 -1
  61. package/dist/package.js +0 -235
  62. package/dist/package.js.map +0 -1
  63. package/dist/utils.js +0 -58
  64. package/dist/utils.js.map +0 -1
  65. package/svelte-kit +0 -3
package/package.json CHANGED
@@ -1,53 +1,91 @@
1
1
  {
2
- "name": "@sveltejs/kit",
3
- "version": "1.0.0-next.2",
4
- "dependencies": {
5
- "@sveltejs/app-utils": "1.0.0-next.0",
6
- "cheap-watch": "^1.0.2",
7
- "http-proxy": "^1.18.1",
8
- "rollup": "^2.32.0",
9
- "rollup-dependency-tree": "0.0.14",
10
- "rollup-plugin-css-chunks": "^1.2.8",
11
- "rollup-plugin-terser": "^7.0.2",
12
- "sade": "^1.7.4",
13
- "scorta": "^1.0.0",
14
- "snowpack": "^2.17.0"
15
- },
16
- "devDependencies": {
17
- "@types/node": "^14.11.10",
18
- "@types/rimraf": "^3.0.0",
19
- "@types/sade": "^1.7.2",
20
- "eslint": "^7.14.0",
21
- "esm": "^3.2.25",
22
- "estree-walker": "^2.0.1",
23
- "kleur": "^4.1.3",
24
- "magic-string": "^0.25.7",
25
- "meriyah": "^3.0.3",
26
- "node-fetch": "^2.6.1",
27
- "periscopic": "^2.0.2",
28
- "port-authority": "^1.1.1",
29
- "require-relative": "^0.8.7",
30
- "rimraf": "^3.0.2",
31
- "sirv": "^1.0.7",
32
- "source-map-support": "^0.5.19",
33
- "svelte": "^3.29.0",
34
- "tiny-glob": "^0.2.8"
35
- },
36
- "bin": {
37
- "svelte-kit": "svelte-kit"
38
- },
39
- "files": [
40
- "assets",
41
- "dist",
42
- "client"
43
- ],
44
- "scripts": {
45
- "dev": "rollup -cw",
46
- "build": "rollup -c",
47
- "lint": "eslint --ignore-pattern node_modules/ --ignore-pattern dist/ --ignore-pattern assets/ \"**/*.{ts,mjs,js,svelte}\" && npm run check-format",
48
- "format": "prettier --write . --config ../../.prettierrc --ignore-path .gitignore",
49
- "check-format": "prettier --check . --config ../../.prettierrc --ignore-path .gitignore",
50
- "prepublishOnly": "npm run build",
51
- "test": "uvu src \"(spec.js|test/index.js)\" -r esm"
52
- }
53
- }
2
+ "name": "@sveltejs/kit",
3
+ "version": "1.0.0-next.202",
4
+ "repository": {
5
+ "type": "git",
6
+ "url": "https://github.com/sveltejs/kit",
7
+ "directory": "packages/kit"
8
+ },
9
+ "license": "MIT",
10
+ "homepage": "https://kit.svelte.dev",
11
+ "type": "module",
12
+ "dependencies": {
13
+ "@sveltejs/vite-plugin-svelte": "^1.0.0-next.30",
14
+ "cheap-watch": "^1.0.4",
15
+ "sade": "^1.7.4",
16
+ "vite": "^2.7.2"
17
+ },
18
+ "devDependencies": {
19
+ "@rollup/plugin-replace": "^3.0.0",
20
+ "@types/amphtml-validator": "^1.0.1",
21
+ "@types/cookie": "^0.4.1",
22
+ "@types/marked": "^4.0.1",
23
+ "@types/mime": "^2.0.3",
24
+ "@types/node": "^16.11.11",
25
+ "@types/sade": "^1.7.3",
26
+ "amphtml-validator": "^1.0.35",
27
+ "cookie": "^0.4.1",
28
+ "devalue": "^2.0.1",
29
+ "eslint": "^8.3.0",
30
+ "kleur": "^4.1.4",
31
+ "locate-character": "^2.0.5",
32
+ "marked": "^4.0.5",
33
+ "mime": "^3.0.0",
34
+ "node-fetch": "^3.1.0",
35
+ "port-authority": "^1.1.2",
36
+ "rollup": "^2.60.2",
37
+ "selfsigned": "^1.10.11",
38
+ "sirv": "^1.0.19",
39
+ "svelte": "^3.44.2",
40
+ "svelte-check": "^2.2.10",
41
+ "svelte2tsx": "~0.4.10",
42
+ "tiny-glob": "^0.2.9",
43
+ "uvu": "^0.5.2"
44
+ },
45
+ "peerDependencies": {
46
+ "svelte": "^3.44.0"
47
+ },
48
+ "bin": {
49
+ "svelte-kit": "svelte-kit.js"
50
+ },
51
+ "files": [
52
+ "assets",
53
+ "dist",
54
+ "types",
55
+ "svelte-kit.js"
56
+ ],
57
+ "exports": {
58
+ "./package.json": "./package.json",
59
+ ".": {
60
+ "types": "./types/index.d.ts"
61
+ },
62
+ "./ssr": {
63
+ "import": "./dist/ssr.js"
64
+ },
65
+ "./node": {
66
+ "import": "./dist/node.js"
67
+ },
68
+ "./hooks": {
69
+ "import": "./dist/hooks.js"
70
+ },
71
+ "./install-fetch": {
72
+ "import": "./dist/install-fetch.js"
73
+ }
74
+ },
75
+ "types": "types/index.d.ts",
76
+ "engines": {
77
+ "node": ">=14.13"
78
+ },
79
+ "scripts": {
80
+ "build": "rollup -c",
81
+ "dev": "rollup -cw",
82
+ "lint": "eslint --ignore-path .gitignore --ignore-pattern \"src/packaging/test/**\" \"{src,test}/**/*.{ts,mjs,js,svelte}\" && npm run check-format",
83
+ "check": "tsc && svelte-check --ignore \"src/packaging/test\"",
84
+ "format": "npm run check-format -- --write",
85
+ "check-format": "prettier --check . --config ../../.prettierrc --ignore-path .gitignore",
86
+ "test": "npm run test:unit && npm run test:packaging && npm run test:integration",
87
+ "test:unit": "uvu src \"(spec\\.js|test[\\\\/]index\\.js)\" -i packaging",
88
+ "test:packaging": "uvu src/packaging \"(spec\\.js|test[\\\\/]index\\.js)\"",
89
+ "test:integration": "uvu test test.js"
90
+ }
91
+ }
package/svelte-kit.js ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import './dist/cli.js';
@@ -0,0 +1,173 @@
1
+ /* eslint-disable import/no-duplicates */
2
+
3
+ declare module '$app/env' {
4
+ /**
5
+ * Whether or not app is in AMP mode.
6
+ */
7
+ export const amp: boolean;
8
+ /**
9
+ * Whether the app is running in the browser or on the server.
10
+ */
11
+ export const browser: boolean;
12
+ /**
13
+ * `true` in development mode, `false` in production.
14
+ */
15
+ export const dev: boolean;
16
+ /**
17
+ * `true` when prerendering, `false` otherwise.
18
+ */
19
+ export const prerendering: boolean;
20
+ /**
21
+ * The Vite.js mode the app is running in. Configure in `config.kit.vite.mode`.
22
+ * Vite.js loads the dotenv file associated with the provided mode, `.env.[mode]` or `.env.[mode].local`.
23
+ * By default, `svelte-kit dev` runs with `mode=development` and `svelte-kit build` runs with `mode=production`.
24
+ */
25
+ export const mode: string;
26
+ }
27
+
28
+ declare module '$app/navigation' {
29
+ /**
30
+ * Returns a Promise that resolves when SvelteKit navigates (or fails to navigate, in which case the promise rejects) to the specified href.
31
+ *
32
+ * @param href Where to navigate to
33
+ * @param opts.replaceState If `true`, will replace the current `history` entry rather than creating a new one with `pushState`
34
+ * @param opts.noscroll If `true`, the browser will maintain its scroll position rather than scrolling to the top of the page after navigation
35
+ * @param opts.keepfocus If `true`, the currently focused element will retain focus after navigation. Otherwise, focus will be reset to the body
36
+ * @param opts.state The state of the new/updated history entry
37
+ */
38
+ export function goto(
39
+ href: string,
40
+ opts?: { replaceState?: boolean; noscroll?: boolean; keepfocus?: boolean; state?: any }
41
+ ): Promise<any>;
42
+ /**
43
+ * Returns a Promise that resolves when SvelteKit re-runs any current `load` functions that depend on `href`
44
+ * @param href The invalidated resource
45
+ */
46
+ export function invalidate(href: string): Promise<any>;
47
+ /**
48
+ * Programmatically prefetches the given page, which means
49
+ * 1. ensuring that the code for the page is loaded, and
50
+ * 2. calling the page's load function with the appropriate options.
51
+ *
52
+ * This is the same behaviour that SvelteKit triggers when the user taps or mouses over an `<a>` element with `sveltekit:prefetch`.
53
+ * If the next navigation is to `href`, the values returned from load will be used, making navigation instantaneous.
54
+ * Returns a Promise that resolves when the prefetch is complete.
55
+ *
56
+ * @param href Page to prefetch
57
+ */
58
+ export function prefetch(href: string): Promise<any>;
59
+ /**
60
+ * Programmatically prefetches the code for routes that haven't yet been fetched.
61
+ * Typically, you might call this to speed up subsequent navigation.
62
+ *
63
+ * If no argument is given, all routes will be fetched, otherwise you can specify routes by any matching pathname
64
+ * such as `/about` (to match `src/routes/about.svelte`) or `/blog/*` (to match `src/routes/blog/[slug].svelte`).
65
+ *
66
+ * Unlike prefetch, this won't call preload for individual pages.
67
+ * Returns a Promise that resolves when the routes have been prefetched.
68
+ */
69
+ export function prefetchRoutes(routes?: string[]): Promise<any>;
70
+ }
71
+
72
+ declare module '$app/paths' {
73
+ /**
74
+ * A root-relative (i.e. begins with a `/`) string that matches `config.kit.paths.base` in your project configuration.
75
+ */
76
+ export const base: string;
77
+ /**
78
+ * A root-relative or absolute path that matches `config.kit.paths.assets` (after it has been resolved against base).
79
+ */
80
+ export const assets: string;
81
+ }
82
+
83
+ declare module '$app/stores' {
84
+ import { Readable, Writable } from 'svelte/store';
85
+ import { Page } from '@sveltejs/kit';
86
+ type Navigating = { from: Page; to: Page };
87
+
88
+ /**
89
+ * A convenience function around `getContext` that returns `{ navigating, page, session }`.
90
+ * Most of the time, you won't need to use it.
91
+ */
92
+ export function getStores<Session = any>(): {
93
+ navigating: Readable<Navigating | null>;
94
+ page: Readable<Page>;
95
+ session: Writable<Session>;
96
+ };
97
+ /**
98
+ * A readable store whose value reflects the object passed to load functions.
99
+ */
100
+ export const page: Readable<Page>;
101
+ /**
102
+ * A readable store.
103
+ * When navigating starts, its value is `{ from, to }`, where from and to both mirror the page store value.
104
+ * When navigating finishes, its value reverts to `null`.
105
+ */
106
+ export const navigating: Readable<Navigating | null>;
107
+ /**
108
+ * A writable store whose initial value is whatever was returned from `getSession`.
109
+ * It can be written to, but this will not cause changes to persist on the server — this is something you must implement yourself.
110
+ */
111
+ export const session: Writable<any>;
112
+ }
113
+
114
+ declare module '$service-worker' {
115
+ /**
116
+ * An array of URL strings representing the files generated by Vite, suitable for caching with `cache.addAll(build)`.
117
+ * This is only available to service workers.
118
+ */
119
+ export const build: string[];
120
+ /**
121
+ * An array of URL strings representing the files in your static directory,
122
+ * or whatever directory is specified by `config.kit.files.assets`.
123
+ * This is only available to service workers.
124
+ */
125
+ export const files: string[];
126
+ /**
127
+ * The result of calling `Date.now()` at build time.
128
+ * It's useful for generating unique cache names inside your service worker,
129
+ * so that a later deployment of your app can invalidate old caches.
130
+ * This is only available to service workers.
131
+ */
132
+ export const timestamp: number;
133
+ }
134
+
135
+ declare module '@sveltejs/kit/hooks' {
136
+ import { Handle } from '@sveltejs/kit';
137
+
138
+ /**
139
+ * Utility function that allows chaining `handle` functions in a
140
+ * middleware-like manner.
141
+ *
142
+ * @param handlers The chain of `handle` functions
143
+ */
144
+ export function sequence(...handlers: Handle[]): Handle;
145
+ }
146
+
147
+ declare module '@sveltejs/kit/node' {
148
+ import { IncomingMessage } from 'http';
149
+ import { RawBody } from '@sveltejs/kit';
150
+
151
+ export interface GetRawBody {
152
+ (request: IncomingMessage): Promise<RawBody>;
153
+ }
154
+ export const getRawBody: GetRawBody;
155
+ }
156
+
157
+ declare module '@sveltejs/kit/ssr' {
158
+ import { IncomingRequest, Response } from '@sveltejs/kit';
159
+ // TODO import from public types, right now its heavily coupled with internal
160
+ type Options = import('@sveltejs/kit/types/internal').SSRRenderOptions;
161
+ type State = import('@sveltejs/kit/types/internal').SSRRenderState;
162
+
163
+ export interface Respond {
164
+ (incoming: IncomingRequest, options: Options, state?: State): Promise<Response>;
165
+ }
166
+ export const respond: Respond;
167
+ }
168
+
169
+ declare module '@sveltejs/kit/install-fetch' {
170
+ import fetch, { Headers, Request, Response } from 'node-fetch';
171
+
172
+ export { fetch, Headers, Request, Response };
173
+ }
package/types/app.d.ts ADDED
@@ -0,0 +1,21 @@
1
+ import { ReadOnlyFormData, RequestHeaders } from './helper';
2
+ import { ServerResponse } from './hooks';
3
+
4
+ export interface App {
5
+ init(): void;
6
+ render(incoming: IncomingRequest): Promise<ServerResponse>;
7
+ }
8
+
9
+ export type RawBody = null | Uint8Array;
10
+ export type ParameterizedBody<Body = unknown> = Body extends FormData
11
+ ? ReadOnlyFormData
12
+ : (string | RawBody | ReadOnlyFormData) & Body;
13
+
14
+ export interface IncomingRequest {
15
+ method: string;
16
+ host: string;
17
+ path: string;
18
+ query: URLSearchParams;
19
+ headers: RequestHeaders;
20
+ rawBody: RawBody;
21
+ }
@@ -0,0 +1,96 @@
1
+ import { UserConfig as ViteConfig } from 'vite';
2
+ import { RecursiveRequired } from './helper';
3
+ import { Logger, TrailingSlash } from './internal';
4
+
5
+ export interface AdapterUtils {
6
+ log: Logger;
7
+ rimraf(dir: string): void;
8
+ mkdirp(dir: string): void;
9
+ /**
10
+ * @param dest the destination folder to which files should be copied
11
+ * @returns an array of paths corresponding to the files that have been created by the copy
12
+ */
13
+ copy_client_files(dest: string): string[];
14
+ /**
15
+ * @param dest the destination folder to which files should be copied
16
+ * @returns an array of paths corresponding to the files that have been created by the copy
17
+ */
18
+ copy_server_files(dest: string): string[];
19
+ /**
20
+ * @param dest the destination folder to which files should be copied
21
+ * @returns an array of paths corresponding to the files that have been created by the copy
22
+ */
23
+ copy_static_files(dest: string): string[];
24
+ /**
25
+ * @param from the source folder from which files should be copied
26
+ * @param to the destination folder to which files should be copied
27
+ * @returns an array of paths corresponding to the files that have been created by the copy
28
+ */
29
+ copy(from: string, to: string, filter?: (basename: string) => boolean): string[];
30
+ prerender(options: { all?: boolean; dest: string; fallback?: string }): Promise<void>;
31
+ }
32
+
33
+ export interface Adapter {
34
+ name: string;
35
+ adapt(context: { utils: AdapterUtils; config: ValidatedConfig }): Promise<void>;
36
+ }
37
+
38
+ export interface PrerenderErrorHandler {
39
+ (details: {
40
+ status: number;
41
+ path: string;
42
+ referrer: string | null;
43
+ referenceType: 'linked' | 'fetched';
44
+ }): void;
45
+ }
46
+
47
+ export type PrerenderOnErrorValue = 'fail' | 'continue' | PrerenderErrorHandler;
48
+
49
+ export interface Config {
50
+ compilerOptions?: any;
51
+ extensions?: string[];
52
+ kit?: {
53
+ adapter?: Adapter;
54
+ amp?: boolean;
55
+ appDir?: string;
56
+ files?: {
57
+ assets?: string;
58
+ hooks?: string;
59
+ lib?: string;
60
+ routes?: string;
61
+ serviceWorker?: string;
62
+ template?: string;
63
+ };
64
+ floc?: boolean;
65
+ host?: string;
66
+ hostHeader?: string;
67
+ hydrate?: boolean;
68
+ package?: {
69
+ dir?: string;
70
+ emitTypes?: boolean;
71
+ exports?(filepath: string): boolean;
72
+ files?(filepath: string): boolean;
73
+ };
74
+ paths?: {
75
+ assets?: string;
76
+ base?: string;
77
+ };
78
+ prerender?: {
79
+ crawl?: boolean;
80
+ enabled?: boolean;
81
+ entries?: string[];
82
+ onError?: PrerenderOnErrorValue;
83
+ };
84
+ router?: boolean;
85
+ serviceWorker?: {
86
+ files?(filepath: string): boolean;
87
+ };
88
+ ssr?: boolean;
89
+ target?: string;
90
+ trailingSlash?: TrailingSlash;
91
+ vite?: ViteConfig | (() => ViteConfig);
92
+ };
93
+ preprocess?: any;
94
+ }
95
+
96
+ export type ValidatedConfig = RecursiveRequired<Config>;
@@ -0,0 +1,18 @@
1
+ import { ServerRequest } from './hooks';
2
+ import { JSONString, MaybePromise, ResponseHeaders } from './helper';
3
+
4
+ type DefaultBody = JSONString | Uint8Array;
5
+
6
+ export interface EndpointOutput<Body extends DefaultBody = DefaultBody> {
7
+ status?: number;
8
+ headers?: ResponseHeaders;
9
+ body?: Body;
10
+ }
11
+
12
+ export interface RequestHandler<
13
+ Locals = Record<string, any>,
14
+ Input = unknown,
15
+ Output extends DefaultBody = DefaultBody
16
+ > {
17
+ (request: ServerRequest<Locals, Input>): MaybePromise<void | EndpointOutput<Output>>;
18
+ }
@@ -0,0 +1,41 @@
1
+ interface ReadOnlyFormData {
2
+ get(key: string): string;
3
+ getAll(key: string): string[];
4
+ has(key: string): boolean;
5
+ entries(): Generator<[string, string], void>;
6
+ keys(): Generator<string, void>;
7
+ values(): Generator<string, void>;
8
+ [Symbol.iterator](): Generator<[string, string], void>;
9
+ }
10
+
11
+ type ToJSON = { toJSON(...args: any[]): JSONValue };
12
+ type JSONValue = Exclude<JSONString, ToJSON>;
13
+ export type JSONString =
14
+ | string
15
+ | number
16
+ | boolean
17
+ | null
18
+ | ToJSON
19
+ | JSONString[]
20
+ | { [key: string]: JSONString };
21
+
22
+ /** `string[]` is only for set-cookie, everything else must be type of `string` */
23
+ export type ResponseHeaders = Record<string, string | string[]>;
24
+ export type RequestHeaders = Record<string, string>;
25
+
26
+ // Utility Types
27
+ export type InferValue<T, Key extends keyof T, Default> = T extends Record<Key, infer Val>
28
+ ? Val
29
+ : Default;
30
+ export type MaybePromise<T> = T | Promise<T>;
31
+ export type Rec<T = any> = Record<string, T>;
32
+ export type RecursiveRequired<T> = {
33
+ // Recursive implementation of TypeScript's Required utility type.
34
+ // Will recursively continue until it reaches primitive or union
35
+ // with a Function in it, except those commented below
36
+ [K in keyof T]-?: Extract<T[K], Function> extends never // If it does not have a Function type
37
+ ? RecursiveRequired<T[K]> // recursively continue through.
38
+ : K extends 'vite' // If it reaches the 'vite' key
39
+ ? Extract<T[K], Function> // only take the Function type.
40
+ : T[K]; // Use the exact type for everything else
41
+ };
@@ -0,0 +1,36 @@
1
+ import { IncomingRequest, ParameterizedBody } from './app';
2
+ import { MaybePromise, ResponseHeaders } from './helper';
3
+
4
+ export type StrictBody = string | Uint8Array;
5
+
6
+ export interface ServerRequest<Locals = Record<string, any>, Body = unknown>
7
+ extends IncomingRequest {
8
+ params: Record<string, string>;
9
+ body: ParameterizedBody<Body>;
10
+ locals: Locals;
11
+ }
12
+
13
+ export interface ServerResponse {
14
+ status: number;
15
+ headers: ResponseHeaders;
16
+ body?: StrictBody;
17
+ }
18
+
19
+ export interface GetSession<Locals = Record<string, any>, Body = unknown, Session = any> {
20
+ (request: ServerRequest<Locals, Body>): MaybePromise<Session>;
21
+ }
22
+
23
+ export interface Handle<Locals = Record<string, any>, Body = unknown> {
24
+ (input: {
25
+ request: ServerRequest<Locals, Body>;
26
+ resolve(request: ServerRequest<Locals, Body>): MaybePromise<ServerResponse>;
27
+ }): MaybePromise<ServerResponse>;
28
+ }
29
+
30
+ export interface HandleError<Locals = Record<string, any>, Body = unknown> {
31
+ (input: { error: Error & { frame?: string }; request: ServerRequest<Locals, Body> }): void;
32
+ }
33
+
34
+ export interface ExternalFetch {
35
+ (req: Request): Promise<Response>;
36
+ }
@@ -0,0 +1,17 @@
1
+ /// <reference types="svelte" />
2
+ /// <reference types="vite/client" />
3
+
4
+ import './ambient-modules';
5
+
6
+ export { App, IncomingRequest, RawBody } from './app';
7
+ export { Adapter, AdapterUtils, Config, PrerenderErrorHandler, ValidatedConfig } from './config';
8
+ export { EndpointOutput, RequestHandler } from './endpoint';
9
+ export { ErrorLoad, ErrorLoadInput, Load, LoadInput, LoadOutput, Page } from './page';
10
+ export {
11
+ ExternalFetch,
12
+ GetSession,
13
+ Handle,
14
+ HandleError,
15
+ ServerRequest as Request,
16
+ ServerResponse as Response
17
+ } from './hooks';