-
-
Notifications
You must be signed in to change notification settings - Fork 2k
/
Copy pathindex.d.ts
75 lines (69 loc) · 2.8 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import { Adapter } from '@sveltejs/kit';
import './ambient.js';
import { GetPlatformProxyOptions } from 'wrangler';
export default function plugin(options?: AdapterOptions): Adapter;
export interface AdapterOptions {
/**
* Path to your [Wrangler configuration file](https://developers.cloudflare.com/workers/wrangler/configuration/).
*/
config?: string;
/**
* Whether to render a plaintext 404.html page or a rendered SPA fallback page
* for non-matching asset requests.
*
* For Cloudflare Workers, the default behaviour is to return a null-body
* 404-status response for non-matching assets requests. However, if the
* [`assets.not_found_handling`](https://developers.cloudflare.com/workers/static-assets/routing/#2-not_found_handling)
* Wrangler configuration setting is set to `"404-page"`, this page will be
* served if a request fails to match an asset. If `assets.not_found_handling`
* is set to `"single-page-application"`, the adapter will render a SPA fallback
* index.html page regardless of the `fallback` option specified.
*
* For Cloudflare Pages, this page will only be served when a request that
* matches an entry in `routes.exclude` fails to match an asset.
*
* Most of the time `plaintext` is sufficient, but if you are using `routes.exclude` to manually
* exclude a set of prerendered pages without exceeding the 100 route limit, you may wish to
* use `spa` instead to avoid showing an unstyled 404 page to users.
*
* See [Cloudflare Pages' Not Found behavior](https://developers.cloudflare.com/pages/configuration/serving-pages/#not-found-behavior) for more info.
*
* @default 'plaintext'
*/
fallback?: 'plaintext' | 'spa';
/**
* Only for Cloudflare Pages. Customize the automatically-generated [`_routes.json`](https://developers.cloudflare.com/pages/platform/functions/routing/#create-a-_routesjson-file) file.
*/
routes?: {
/**
* Routes that will be invoked by functions. Accepts wildcards.
* @default ["/*"]
*/
include?: string[];
/**
* Routes that will not be invoked by functions. Accepts wildcards.
* `exclude` takes priority over `include`.
*
* To have the adapter automatically exclude certain things, you can use these placeholders:
*
* - `<build>` to exclude build artifacts (files generated by Vite)
* - `<files>` for the contents of your `static` directory
* - `<prerendered>` for prerendered routes
* - `<all>` to exclude all of the above
*
* @default ["<all>"]
*/
exclude?: string[];
};
/**
* Config object passed to [`getPlatformProxy`](https://developers.cloudflare.com/workers/wrangler/api/#getplatformproxy)
* during development and preview.
*/
platformProxy?: GetPlatformProxyOptions;
}
export interface RoutesJSONSpec {
version: 1;
description: string;
include: string[];
exclude: string[];
}