astro 5.16.6 → 5.16.8
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.
- package/components/Code.astro +2 -2
- package/components/Image.astro +2 -2
- package/components/Picture.astro +1 -1
- package/dist/assets/build/remote.js +1 -1
- package/dist/assets/endpoint/dev.js +44 -16
- package/dist/assets/fonts/config.d.ts +3 -0
- package/dist/assets/fonts/config.js +3 -2
- package/dist/assets/fonts/constants.js +2 -1
- package/dist/assets/fonts/core/resolve-families.js +1 -0
- package/dist/assets/fonts/definitions.d.ts +10 -2
- package/dist/assets/fonts/infra/remote-font-provider-resolver.d.ts +2 -2
- package/dist/assets/fonts/infra/unifont-font-resolver.d.ts +24 -0
- package/dist/assets/fonts/infra/unifont-font-resolver.js +59 -0
- package/dist/assets/fonts/orchestrate.d.ts +6 -4
- package/dist/assets/fonts/orchestrate.js +16 -32
- package/dist/assets/fonts/providers/entrypoints/bunny.d.ts +1 -1
- package/dist/assets/fonts/providers/entrypoints/fontshare.d.ts +1 -1
- package/dist/assets/fonts/providers/entrypoints/fontsource.d.ts +1 -1
- package/dist/assets/fonts/providers/index.d.ts +6 -8
- package/dist/assets/fonts/providers/index.js +10 -14
- package/dist/assets/fonts/types.d.ts +17 -4
- package/dist/assets/fonts/vite-plugin-fonts.js +6 -1
- package/dist/assets/utils/index.d.ts +1 -1
- package/dist/assets/utils/index.js +8 -8
- package/dist/assets/utils/vendor/image-size/detector.d.ts +1 -1
- package/dist/assets/utils/vendor/image-size/detector.js +2 -1
- package/dist/assets/utils/vendor/image-size/types/bmp.js +1 -1
- package/dist/assets/utils/vendor/image-size/types/gif.js +1 -1
- package/dist/assets/utils/vendor/image-size/types/heif.js +51 -29
- package/dist/assets/utils/vendor/image-size/types/icns.js +13 -14
- package/dist/assets/utils/vendor/image-size/types/ico.js +5 -5
- package/dist/assets/utils/vendor/image-size/types/index.d.ts +3 -3
- package/dist/assets/utils/vendor/image-size/types/index.js +4 -0
- package/dist/assets/utils/vendor/image-size/types/interface.d.ts +6 -6
- package/dist/assets/utils/vendor/image-size/types/j2c.js +2 -2
- package/dist/assets/utils/vendor/image-size/types/jp2.js +5 -3
- package/dist/assets/utils/vendor/image-size/types/jpg.js +4 -4
- package/dist/assets/utils/vendor/image-size/types/jxl-stream.d.ts +2 -0
- package/dist/assets/utils/vendor/image-size/types/jxl-stream.js +36 -0
- package/dist/assets/utils/vendor/image-size/types/jxl.d.ts +2 -0
- package/dist/assets/utils/vendor/image-size/types/jxl.js +57 -0
- package/dist/assets/utils/vendor/image-size/types/ktx.js +1 -1
- package/dist/assets/utils/vendor/image-size/types/png.js +1 -1
- package/dist/assets/utils/vendor/image-size/types/pnm.js +5 -7
- package/dist/assets/utils/vendor/image-size/types/psd.js +1 -1
- package/dist/assets/utils/vendor/image-size/types/tiff.js +93 -40
- package/dist/assets/utils/vendor/image-size/types/utils.d.ts +3 -2
- package/dist/assets/utils/vendor/image-size/types/utils.js +24 -22
- package/dist/assets/utils/vendor/image-size/types/webp.js +5 -6
- package/dist/assets/utils/vendor/image-size/utils/bit-reader.d.ts +10 -0
- package/dist/assets/utils/vendor/image-size/utils/bit-reader.js +41 -0
- package/dist/assets/vite-plugin-assets.js +7 -0
- package/dist/cli/infra/build-time-astro-version-provider.js +1 -1
- package/dist/config/entrypoint.d.ts +1 -2
- package/dist/config/entrypoint.js +1 -2
- package/dist/content/content-layer.js +3 -3
- package/dist/content/utils.js +9 -2
- package/dist/core/app/index.d.ts +1 -1
- package/dist/core/app/index.js +1 -1
- package/dist/core/config/schemas/base.d.ts +7 -0
- package/dist/core/config/schemas/relative.d.ts +9 -0
- package/dist/core/constants.js +1 -1
- package/dist/core/dev/dev.js +1 -1
- package/dist/core/messages.js +2 -2
- package/dist/core/routing/manifest/create.js +9 -6
- package/dist/runtime/client/dev-toolbar/apps/audit/rules/perf.js +1 -0
- package/dist/runtime/server/render/astro/render.js +26 -3
- package/dist/runtime/server/render/common.d.ts +1 -0
- package/dist/runtime/server/render/common.js +8 -0
- package/dist/transitions/router.js +2 -0
- package/dist/types/public/config.d.ts +2 -2
- package/dist/types/public/context.d.ts +303 -284
- package/dist/vite-plugin-astro-server/base.js +3 -2
- package/dist/vite-plugin-astro-server/request.js +3 -0
- package/dist/vite-plugin-astro-server/response.js +4 -6
- package/package.json +14 -14
- package/dist/assets/fonts/core/dedupe-font-faces.d.ts +0 -2
- package/dist/assets/fonts/core/dedupe-font-faces.js +0 -30
- package/dist/assets/fonts/core/extract-unifont-providers.d.ts +0 -10
- package/dist/assets/fonts/core/extract-unifont-providers.js +0 -28
- package/dist/assets/utils/remotePattern.d.ts +0 -1
- package/dist/assets/utils/remotePattern.js +0 -16
|
@@ -5,166 +5,94 @@ import type { AstroCookies } from '../../core/cookies/cookies.js';
|
|
|
5
5
|
import type { CspDirective, CspHash } from '../../core/csp/config.js';
|
|
6
6
|
import type { AstroSession } from '../../core/session.js';
|
|
7
7
|
import type { AstroComponentFactory } from '../../runtime/server/index.js';
|
|
8
|
-
import type {
|
|
8
|
+
import type { RewritePayload } from './common.js';
|
|
9
9
|
import type { ValidRedirectStatus } from './config.js';
|
|
10
10
|
import type { AstroInstance, MarkdownInstance, MDXInstance } from './content.js';
|
|
11
11
|
/**
|
|
12
12
|
* Astro global available in all contexts in .astro files
|
|
13
13
|
*
|
|
14
|
-
* [Astro reference](https://docs.astro.build/reference/api-reference
|
|
14
|
+
* [Astro reference](https://docs.astro.build/en/reference/api-reference/)
|
|
15
15
|
*/
|
|
16
16
|
export interface AstroGlobal<Props extends Record<string, any> = Record<string, any>, Self = AstroComponentFactory, Params extends Record<string, string | undefined> = Record<string, string | undefined>> extends AstroGlobalPartial, AstroSharedContext<Props, Params> {
|
|
17
17
|
/**
|
|
18
|
-
* A
|
|
19
|
-
* Equivalent to: `new URL(Astro.request.url)`
|
|
18
|
+
* A standard [ResponseInit](https://developer.mozilla.org/en-US/docs/Web/API/Response/Response#init) object describing the outgoing response.
|
|
20
19
|
*
|
|
21
|
-
*
|
|
22
|
-
*/
|
|
23
|
-
url: AstroSharedContext['url'];
|
|
24
|
-
/** Parameters passed to a dynamic page generated using [getStaticPaths](https://docs.astro.build/en/reference/api-reference/#getstaticpaths)
|
|
25
|
-
*
|
|
26
|
-
* Example usage:
|
|
27
|
-
* ```astro
|
|
28
|
-
* ---
|
|
29
|
-
* export async function getStaticPaths() {
|
|
30
|
-
* return [
|
|
31
|
-
* { params: { id: '1' } },
|
|
32
|
-
* ];
|
|
33
|
-
* }
|
|
34
|
-
*
|
|
35
|
-
* const { id } = Astro.params;
|
|
36
|
-
* ---
|
|
37
|
-
* <h1>{id}</h1>
|
|
38
|
-
* ```
|
|
39
|
-
*
|
|
40
|
-
* [Astro reference](https://docs.astro.build/en/reference/api-reference/#astroparams)
|
|
41
|
-
*/
|
|
42
|
-
params: AstroSharedContext<Props, Params>['params'];
|
|
43
|
-
/** List of props passed to this component
|
|
44
|
-
*
|
|
45
|
-
* A common way to get specific props is through [destructuring](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment), ex:
|
|
46
|
-
* ```typescript
|
|
47
|
-
* const { name } = Astro.props
|
|
48
|
-
* ```
|
|
49
|
-
*
|
|
50
|
-
* [Astro reference](https://docs.astro.build/en/basics/astro-components/#component-props)
|
|
51
|
-
*/
|
|
52
|
-
props: AstroSharedContext<Props, Params>['props'];
|
|
53
|
-
/** Information about the current request. This is a standard [Request](https://developer.mozilla.org/en-US/docs/Web/API/Request) object
|
|
54
|
-
*
|
|
55
|
-
* For example, to get a URL object of the current URL, you can use:
|
|
56
|
-
* ```typescript
|
|
57
|
-
* const url = new URL(Astro.request.url);
|
|
58
|
-
* ```
|
|
59
|
-
*
|
|
60
|
-
* [Astro reference](https://docs.astro.build/en/reference/api-reference/#astrorequest)
|
|
61
|
-
*/
|
|
62
|
-
request: Request;
|
|
63
|
-
/** Information about the outgoing response. This is a standard [ResponseInit](https://developer.mozilla.org/en-US/docs/Web/API/Response/Response#init) object
|
|
20
|
+
* ## Example
|
|
64
21
|
*
|
|
65
|
-
*
|
|
22
|
+
* You can change the status code by assigning a value to this property:
|
|
66
23
|
* ```typescript
|
|
67
24
|
* Astro.response.status = 404;
|
|
68
25
|
* ```
|
|
69
26
|
*
|
|
70
|
-
* [Astro reference](https://docs.astro.build/en/reference/api-reference/#
|
|
27
|
+
* [Astro reference](https://docs.astro.build/en/reference/api-reference/#response)
|
|
71
28
|
*/
|
|
72
29
|
response: ResponseInit & {
|
|
73
30
|
readonly headers: Headers;
|
|
74
31
|
};
|
|
75
32
|
/**
|
|
76
|
-
*
|
|
77
|
-
* Expects the action function as a parameter.
|
|
78
|
-
* Returns a type-safe result with the action data when
|
|
79
|
-
* a matching POST request is received
|
|
80
|
-
* and `undefined` otherwise.
|
|
81
|
-
*
|
|
82
|
-
* Example usage:
|
|
83
|
-
*
|
|
84
|
-
* ```typescript
|
|
85
|
-
* import { actions } from 'astro:actions';
|
|
86
|
-
*
|
|
87
|
-
* const result = await Astro.getActionResult(actions.myAction);
|
|
88
|
-
* ```
|
|
89
|
-
*/
|
|
90
|
-
getActionResult: AstroSharedContext['getActionResult'];
|
|
91
|
-
/**
|
|
92
|
-
* Call an Action directly from an Astro page or API endpoint.
|
|
93
|
-
* Expects the action function as the first parameter,
|
|
94
|
-
* and the type-safe action input as the second parameter.
|
|
95
|
-
* Returns a Promise with the action result.
|
|
33
|
+
* Allows a component to be recursively called.
|
|
96
34
|
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
* ```typescript
|
|
100
|
-
* import { actions } from 'astro:actions';
|
|
101
|
-
*
|
|
102
|
-
* const result = await Astro.callAction(actions.getPost, { postId: 'test' });
|
|
103
|
-
* ```
|
|
104
|
-
*/
|
|
105
|
-
callAction: AstroSharedContext['callAction'];
|
|
106
|
-
/** Redirect to another page
|
|
107
|
-
*
|
|
108
|
-
* Example usage:
|
|
109
|
-
* ```typescript
|
|
110
|
-
* if(!isLoggedIn) {
|
|
111
|
-
* return Astro.redirect('/login');
|
|
112
|
-
* }
|
|
113
|
-
* ```
|
|
114
|
-
*
|
|
115
|
-
* [Astro reference](https://docs.astro.build/en/reference/api-reference/#astroredirect)
|
|
116
|
-
*/
|
|
117
|
-
redirect: AstroSharedContext['redirect'];
|
|
118
|
-
/**
|
|
119
|
-
* It rewrites to another page. As opposed to redirects, the URL won't change, and Astro will render the HTML emitted
|
|
120
|
-
* by the rewritten URL passed as argument.
|
|
35
|
+
* This is useful when you need to render an Astro component from within
|
|
36
|
+
* itself. `Astro.self` accepts the same properties as the component itself.
|
|
121
37
|
*
|
|
122
38
|
* ## Example
|
|
123
39
|
*
|
|
124
|
-
* ```
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
*
|
|
40
|
+
* ```astro
|
|
41
|
+
* ---
|
|
42
|
+
* const { items } = Astro.props;
|
|
43
|
+
* ---
|
|
44
|
+
* <ul>
|
|
45
|
+
* {items.map((item) => (
|
|
46
|
+
* <li>
|
|
47
|
+
* {Array.isArray(item) ? (
|
|
48
|
+
* <Astro.self items={item} />
|
|
49
|
+
* ) : (
|
|
50
|
+
* item
|
|
51
|
+
* )}
|
|
52
|
+
* </li>
|
|
53
|
+
* ))}
|
|
54
|
+
* </ul>
|
|
128
55
|
* ```
|
|
129
|
-
*/
|
|
130
|
-
rewrite: AstroSharedContext['rewrite'];
|
|
131
|
-
/**
|
|
132
|
-
* The route currently rendered. It's stripped of the `srcDir` and the `pages` folder, and it doesn't contain the extension.
|
|
133
|
-
*
|
|
134
|
-
* ## Example
|
|
135
|
-
* - The value when rendering `src/pages/index.astro` will be `/`.
|
|
136
|
-
* - The value when rendering `src/pages/blog/[slug].astro` will be `/blog/[slug]`.
|
|
137
|
-
* - The value when rendering `src/pages/[...path].astro` will be `/[...path]`.
|
|
138
|
-
*/
|
|
139
|
-
routePattern: string;
|
|
140
|
-
/**
|
|
141
|
-
* The <Astro.self /> element allows a component to reference itself recursively.
|
|
142
56
|
*
|
|
143
|
-
* [Astro reference](https://docs.astro.build/en/reference/
|
|
57
|
+
* [Astro reference](https://docs.astro.build/en/reference/astro-syntax/#astroself)
|
|
144
58
|
*/
|
|
145
59
|
self: Self;
|
|
146
|
-
/**
|
|
60
|
+
/**
|
|
61
|
+
* An object containing utility functions for modifying an Astro component’s
|
|
62
|
+
* slotted children.
|
|
147
63
|
*
|
|
148
|
-
* [Astro reference](https://docs.astro.build/en/reference/
|
|
64
|
+
* [Astro reference](https://docs.astro.build/en/reference/astro-syntax/#astroslots)
|
|
149
65
|
*/
|
|
150
66
|
slots: Record<string, true | undefined> & {
|
|
151
67
|
/**
|
|
152
68
|
* Check whether content for this slot name exists
|
|
153
69
|
*
|
|
154
|
-
*
|
|
155
|
-
*
|
|
156
|
-
*
|
|
70
|
+
* @param {string} slotName - The name of the slot to check.
|
|
71
|
+
* @returns {boolean} Whether the slot exists.
|
|
72
|
+
*
|
|
73
|
+
* ## Example
|
|
74
|
+
*
|
|
75
|
+
* ```astro
|
|
76
|
+
* ---
|
|
77
|
+
* ---
|
|
78
|
+
* <slot />
|
|
79
|
+
* {Astro.slots.has('more') && (
|
|
157
80
|
* // Do something...
|
|
158
|
-
*
|
|
81
|
+
* }
|
|
159
82
|
* ```
|
|
160
83
|
*
|
|
161
|
-
* [Astro reference](https://docs.astro.build/en/reference/
|
|
84
|
+
* [Astro reference](https://docs.astro.build/en/reference/astro-syntax/#astroslotshas)
|
|
162
85
|
*/
|
|
163
86
|
has(slotName: string): boolean;
|
|
164
87
|
/**
|
|
165
|
-
* Asynchronously renders
|
|
88
|
+
* Asynchronously renders the contents of a slot to a string of HTML.
|
|
89
|
+
*
|
|
90
|
+
* @param {string} slotName - The name of the slot to render.
|
|
91
|
+
* @param {any[]} [args] - The additional arguments to pass to the callback.
|
|
92
|
+
* @returns {Promise<string>} The rendered slot as HTML string.
|
|
93
|
+
*
|
|
94
|
+
* ## Examples
|
|
166
95
|
*
|
|
167
|
-
* Example usage:
|
|
168
96
|
* ```astro
|
|
169
97
|
* ---
|
|
170
98
|
* let html: string = '';
|
|
@@ -177,7 +105,6 @@ export interface AstroGlobal<Props extends Record<string, any> = Record<string,
|
|
|
177
105
|
*
|
|
178
106
|
* A second parameter can be used to pass arguments to a slotted callback
|
|
179
107
|
*
|
|
180
|
-
* Example usage:
|
|
181
108
|
* ```astro
|
|
182
109
|
* ---
|
|
183
110
|
* html = await Astro.slots.render('default', ["Hello", "World"])
|
|
@@ -190,18 +117,19 @@ export interface AstroGlobal<Props extends Record<string, any> = Record<string,
|
|
|
190
117
|
* </Component>
|
|
191
118
|
* ```
|
|
192
119
|
*
|
|
193
|
-
* [Astro reference](https://docs.astro.build/en/reference/
|
|
120
|
+
* [Astro reference](https://docs.astro.build/en/reference/astro-syntax/#astroslotsrender)
|
|
194
121
|
*/
|
|
195
122
|
render(slotName: string, args?: any[]): Promise<string>;
|
|
196
123
|
};
|
|
197
124
|
}
|
|
198
125
|
/** Union type of supported markdown file extensions */
|
|
199
126
|
type MarkdownFileExtension = (typeof SUPPORTED_MARKDOWN_FILE_EXTENSIONS)[number];
|
|
200
|
-
export interface AstroGlobalPartial {
|
|
127
|
+
export interface AstroGlobalPartial extends Pick<AstroSharedContext, 'site' | 'generator'> {
|
|
201
128
|
/**
|
|
202
129
|
* Fetch local files into your static site setup
|
|
203
130
|
*
|
|
204
|
-
* Example
|
|
131
|
+
* ## Example
|
|
132
|
+
*
|
|
205
133
|
* ```typescript
|
|
206
134
|
* const posts = await Astro.glob('../pages/post/*.md');
|
|
207
135
|
* ```
|
|
@@ -222,193 +150,159 @@ export interface AstroGlobalPartial {
|
|
|
222
150
|
* @deprecated `Astro.glob` is deprecated and will be removed in the next major version of Astro. Use `import.meta.glob` instead: https://vitejs.dev/guide/features.html#glob-import
|
|
223
151
|
*/
|
|
224
152
|
glob<T extends Record<string, any>>(globStr: string): Promise<T[]>;
|
|
153
|
+
}
|
|
154
|
+
export interface AstroSharedContext<Props extends Record<string, any> = Record<string, any>, Params extends Record<string, string | undefined> = Record<string, string | undefined>> {
|
|
225
155
|
/**
|
|
226
|
-
*
|
|
156
|
+
* The site provided in the astro config, parsed as an instance of `URL`, without base.
|
|
157
|
+
* `undefined` if the site is not provided in the config.
|
|
158
|
+
*
|
|
159
|
+
* ## Example
|
|
227
160
|
*
|
|
228
|
-
*
|
|
161
|
+
* ```astro
|
|
162
|
+
* <link
|
|
163
|
+
* rel="alternate"
|
|
164
|
+
* type="application/rss+xml"
|
|
165
|
+
* title="Your Site's Title"
|
|
166
|
+
* href={new URL("rss.xml", Astro.site)}
|
|
167
|
+
* />
|
|
168
|
+
* ```
|
|
169
|
+
*
|
|
170
|
+
* [Astro reference](https://docs.astro.build/en/reference/api-reference/#site)
|
|
229
171
|
*/
|
|
230
172
|
site: URL | undefined;
|
|
231
173
|
/**
|
|
232
|
-
*
|
|
174
|
+
* A human-readable string representing the Astro version used to create the project. It follows the format "Astro v5.x.x".
|
|
233
175
|
*
|
|
234
|
-
*
|
|
176
|
+
* ## Example
|
|
235
177
|
*
|
|
236
|
-
*
|
|
178
|
+
* ```astro
|
|
179
|
+
* <meta name="generator" content={Astro.generator} />
|
|
180
|
+
* ```
|
|
237
181
|
*
|
|
238
|
-
* [Astro reference](https://docs.astro.build/en/reference/api-reference/#
|
|
182
|
+
* [Astro reference](https://docs.astro.build/en/reference/api-reference/#generator)
|
|
239
183
|
*/
|
|
240
184
|
generator: string;
|
|
241
|
-
}
|
|
242
|
-
export interface AstroSharedContext<Props extends Record<string, any> = Record<string, any>, RouteParams extends Record<string, string | undefined> = Record<string, string | undefined>> {
|
|
243
185
|
/**
|
|
244
186
|
* The address (usually IP address) of the user.
|
|
245
187
|
*
|
|
246
188
|
* Throws an error if used within a static site, or within a prerendered page.
|
|
247
|
-
*/
|
|
248
|
-
clientAddress: string;
|
|
249
|
-
/**
|
|
250
|
-
* Utility for getting and setting the values of cookies.
|
|
251
|
-
*/
|
|
252
|
-
cookies: AstroCookies;
|
|
253
|
-
/**
|
|
254
|
-
* Utility for handling sessions.
|
|
255
|
-
*/
|
|
256
|
-
session?: AstroSession;
|
|
257
|
-
/**
|
|
258
|
-
* Information about the current request. This is a standard [Request](https://developer.mozilla.org/en-US/docs/Web/API/Request) object
|
|
259
|
-
*/
|
|
260
|
-
request: Request;
|
|
261
|
-
/**
|
|
262
|
-
* A full URL object of the request URL.
|
|
263
|
-
*/
|
|
264
|
-
url: URL;
|
|
265
|
-
/**
|
|
266
|
-
* The origin pathname of the request URL.
|
|
267
|
-
* Useful to track the original URL before rewrites were applied.
|
|
268
|
-
*/
|
|
269
|
-
originPathname: string;
|
|
270
|
-
/**
|
|
271
|
-
* Get action result on the server when using a form POST.
|
|
272
|
-
*/
|
|
273
|
-
getActionResult: <TAccept extends ActionAccept, TInputSchema extends z.ZodType, TAction extends ActionClient<unknown, TAccept, TInputSchema>>(action: TAction) => ActionReturnType<TAction> | undefined;
|
|
274
|
-
/**
|
|
275
|
-
* Call action handler from the server.
|
|
276
|
-
*/
|
|
277
|
-
callAction: <TAccept extends ActionAccept, TInputSchema extends z.ZodType, TOutput, TAction extends ActionClient<TOutput, TAccept, TInputSchema> | ActionClient<TOutput, TAccept, TInputSchema>['orThrow']>(action: TAction, input: Parameters<TAction>[0]) => Promise<ActionReturnType<TAction>>;
|
|
278
|
-
/**
|
|
279
|
-
* Route parameters for this request if this is a dynamic route.
|
|
280
|
-
*/
|
|
281
|
-
params: RouteParams;
|
|
282
|
-
/**
|
|
283
|
-
* List of props returned for this path by `getStaticPaths` (**Static Only**).
|
|
284
|
-
*/
|
|
285
|
-
props: Props;
|
|
286
|
-
/**
|
|
287
|
-
* Redirect to another page (**SSR Only**).
|
|
288
|
-
*/
|
|
289
|
-
redirect(path: string, status?: ValidRedirectStatus): Response;
|
|
290
|
-
/**
|
|
291
|
-
* It rewrites to another page. As opposed to redirects, the URL won't change, and Astro will render the HTML emitted
|
|
292
|
-
* by the rerouted URL passed as argument.
|
|
293
189
|
*
|
|
294
190
|
* ## Example
|
|
295
191
|
*
|
|
296
|
-
* ```
|
|
297
|
-
*
|
|
298
|
-
*
|
|
192
|
+
* ```ts
|
|
193
|
+
* import type { APIContext } from 'astro';
|
|
194
|
+
*
|
|
195
|
+
* export function GET({ clientAddress }: APIContext) {
|
|
196
|
+
* return new Response(`Your IP address is: ${clientAddress}`);
|
|
299
197
|
* }
|
|
300
198
|
* ```
|
|
199
|
+
*
|
|
200
|
+
* [Astro reference](https://docs.astro.build/en/reference/api-reference/#clientaddress)
|
|
301
201
|
*/
|
|
302
|
-
|
|
303
|
-
/**
|
|
304
|
-
* Object accessed via Astro middleware
|
|
305
|
-
*/
|
|
306
|
-
locals: App.Locals;
|
|
307
|
-
/**
|
|
308
|
-
* The current locale that is computed from the `Accept-Language` header of the browser (**SSR Only**).
|
|
309
|
-
*/
|
|
310
|
-
preferredLocale: string | undefined;
|
|
311
|
-
/**
|
|
312
|
-
* The list of locales computed from the `Accept-Language` header of the browser, sorted by quality value (**SSR Only**).
|
|
313
|
-
*/
|
|
314
|
-
preferredLocaleList: string[] | undefined;
|
|
315
|
-
/**
|
|
316
|
-
* The current locale computed from the URL of the request. It matches the locales in `i18n.locales`, and returns `undefined` otherwise.
|
|
317
|
-
*/
|
|
318
|
-
currentLocale: string | undefined;
|
|
202
|
+
clientAddress: string;
|
|
319
203
|
/**
|
|
320
|
-
*
|
|
204
|
+
* An object containing utilities for reading and manipulating the values of cookies in on-demand routes.
|
|
205
|
+
*
|
|
206
|
+
* [Astro reference](https://docs.astro.build/en/reference/api-reference/#cookies)
|
|
321
207
|
*/
|
|
322
|
-
|
|
208
|
+
cookies: AstroCookies;
|
|
323
209
|
/**
|
|
324
|
-
*
|
|
210
|
+
* An object containing utilities for handling sessions in on-demand rendered routes.
|
|
211
|
+
*
|
|
212
|
+
* [Astro reference](https://docs.astro.build/en/reference/api-reference/#session)
|
|
325
213
|
*/
|
|
326
|
-
|
|
327
|
-
}
|
|
328
|
-
export type AstroSharedContextCsp = {
|
|
214
|
+
session?: AstroSession;
|
|
329
215
|
/**
|
|
330
|
-
*
|
|
216
|
+
* A standard [Request](https://developer.mozilla.org/en-US/docs/Web/API/Request) object containing information about the current request.
|
|
331
217
|
*
|
|
332
218
|
* ## Example
|
|
333
219
|
*
|
|
334
|
-
*
|
|
335
|
-
*
|
|
220
|
+
* To get a URL object of the current URL, you can use:
|
|
221
|
+
* ```typescript
|
|
222
|
+
* const url = new URL(Astro.request.url);
|
|
336
223
|
* ```
|
|
224
|
+
*
|
|
225
|
+
* [Astro reference](https://docs.astro.build/en/reference/api-reference/#request)
|
|
337
226
|
*/
|
|
338
|
-
|
|
227
|
+
request: Request;
|
|
339
228
|
/**
|
|
340
|
-
*
|
|
229
|
+
* A URL object constructed from the current `request.url` value. This is
|
|
230
|
+
* equivalent to doing `new URL(context.request.url)`.
|
|
341
231
|
*
|
|
342
232
|
* ## Example
|
|
343
233
|
*
|
|
344
|
-
* ```
|
|
345
|
-
*
|
|
234
|
+
* ```astro
|
|
235
|
+
* <p>The current URL is: {Astro.url}</p>
|
|
236
|
+
* <p>The current URL pathname is: {Astro.url.pathname}</p>
|
|
237
|
+
* <p>The current URL origin is: {Astro.url.origin}</p>
|
|
346
238
|
* ```
|
|
239
|
+
*
|
|
240
|
+
* [Astro reference](https://docs.astro.build/en/reference/api-reference/#url)
|
|
347
241
|
*/
|
|
348
|
-
|
|
242
|
+
url: URL;
|
|
349
243
|
/**
|
|
350
|
-
*
|
|
244
|
+
* The origin pathname of the request URL.
|
|
245
|
+
* Useful to track the original URL before rewrites were applied.
|
|
351
246
|
*
|
|
352
247
|
* ## Example
|
|
353
248
|
*
|
|
354
|
-
* ```
|
|
355
|
-
*
|
|
249
|
+
* ```astro
|
|
250
|
+
* <p>The origin path is {Astro.originPathname}</p>
|
|
251
|
+
* <p>The rewritten path is {Astro.url.pathname}</p>
|
|
356
252
|
* ```
|
|
253
|
+
*
|
|
254
|
+
* [Astro reference](https://docs.astro.build/en/reference/api-reference/#originpathname)
|
|
357
255
|
*/
|
|
358
|
-
|
|
256
|
+
originPathname: string;
|
|
359
257
|
/**
|
|
360
|
-
*
|
|
258
|
+
* A function that returns the result of an Action submission when using a form POST.
|
|
259
|
+
*
|
|
260
|
+
* This accepts an action function as an argument and returns a type-safe
|
|
261
|
+
* data or error object when a submission is received. Otherwise, it will
|
|
262
|
+
* return undefined.
|
|
263
|
+
*
|
|
264
|
+
* @param {TAction} action - The action function to process.
|
|
265
|
+
* @returns {ActionReturnType<TAction> | undefined} An object describing the result of an action.
|
|
361
266
|
*
|
|
362
267
|
* ## Example
|
|
363
268
|
*
|
|
364
|
-
* ```
|
|
365
|
-
*
|
|
269
|
+
* ```astro
|
|
270
|
+
* import { actions } from 'astro:actions';
|
|
271
|
+
*
|
|
272
|
+
* const result = await Astro.getActionResult(actions.myAction);
|
|
366
273
|
* ```
|
|
274
|
+
*
|
|
275
|
+
* [Astro reference](https://docs.astro.build/en/reference/api-reference/#getactionresult)
|
|
367
276
|
*/
|
|
368
|
-
|
|
277
|
+
getActionResult: <TAccept extends ActionAccept, TInputSchema extends z.ZodType, TAction extends ActionClient<unknown, TAccept, TInputSchema>>(action: TAction) => ActionReturnType<TAction> | undefined;
|
|
369
278
|
/**
|
|
370
|
-
*
|
|
279
|
+
* A function used to call an Action handler directly from your Astro
|
|
280
|
+
* component or API endpoint.
|
|
281
|
+
*
|
|
282
|
+
* This accepts an Action function and a type-safe action input, and returns
|
|
283
|
+
* the result of the action as a Promise.
|
|
371
284
|
*
|
|
372
285
|
* ## Example
|
|
373
286
|
*
|
|
374
|
-
* ```
|
|
375
|
-
*
|
|
376
|
-
* ```
|
|
377
|
-
*/
|
|
378
|
-
insertScriptHash: (hash: CspHash) => void;
|
|
379
|
-
};
|
|
380
|
-
/**
|
|
381
|
-
* The `APIContext` is the object made available to endpoints and middleware.
|
|
382
|
-
* It is a subset of the `Astro` global object available in pages.
|
|
383
|
-
*
|
|
384
|
-
* [Reference](https://docs.astro.build/en/reference/api-reference/#endpoint-context)
|
|
385
|
-
*/
|
|
386
|
-
export interface APIContext<Props extends Record<string, any> = Record<string, any>, APIParams extends Record<string, string | undefined> = Record<string, string | undefined>> extends AstroSharedContext<Props, Params> {
|
|
387
|
-
/**
|
|
388
|
-
* The site provided in the astro config, parsed as an instance of `URL`, without base.
|
|
389
|
-
* `undefined` if the site is not provided in the config.
|
|
390
|
-
*/
|
|
391
|
-
site: URL | undefined;
|
|
392
|
-
/**
|
|
393
|
-
* A human-readable string representing the Astro version used to create the project.
|
|
394
|
-
* For example, `"Astro v1.1.1"`.
|
|
395
|
-
*/
|
|
396
|
-
generator: string;
|
|
397
|
-
/**
|
|
398
|
-
* The url of the current request, parsed as an instance of `URL`.
|
|
287
|
+
* ```typescript
|
|
288
|
+
* import { actions } from 'astro:actions';
|
|
399
289
|
*
|
|
400
|
-
*
|
|
401
|
-
* ```ts
|
|
402
|
-
* new URL(context.request.url)
|
|
290
|
+
* const result = await Astro.callAction(actions.getPost, { postId: 'test' });
|
|
403
291
|
* ```
|
|
292
|
+
*
|
|
293
|
+
* [Astro reference](https://docs.astro.build/en/reference/api-reference/#callaction)
|
|
294
|
+
*
|
|
295
|
+
* @param {TAction} action - Any Action function.
|
|
296
|
+
* @param {Parameters<TAction>[0]} input - Any input that the given action receives.
|
|
404
297
|
*/
|
|
405
|
-
|
|
298
|
+
callAction: <TAccept extends ActionAccept, TInputSchema extends z.ZodType, TOutput, TAction extends ActionClient<TOutput, TAccept, TInputSchema> | ActionClient<TOutput, TAccept, TInputSchema>['orThrow']>(action: TAction, input: Parameters<TAction>[0]) => Promise<ActionReturnType<TAction>>;
|
|
406
299
|
/**
|
|
407
|
-
*
|
|
408
|
-
*
|
|
409
|
-
* In
|
|
300
|
+
* An object containing the values of dynamic route segments matched for a request.
|
|
301
|
+
*
|
|
302
|
+
* In static builds, this will be the `params` returned by [`getStaticPaths()`](https://docs.astro.build/en/reference/api-reference/#getstaticpaths). With on-demand rendering, `params` can be any value matching the path segments in the dynamic route pattern.
|
|
303
|
+
*
|
|
304
|
+
* ## Example
|
|
410
305
|
*
|
|
411
|
-
* Example usage:
|
|
412
306
|
* ```ts
|
|
413
307
|
* import type { APIContext } from "astro"
|
|
414
308
|
*
|
|
@@ -420,18 +314,19 @@ export interface APIContext<Props extends Record<string, any> = Record<string, a
|
|
|
420
314
|
* ];
|
|
421
315
|
* }
|
|
422
316
|
*
|
|
423
|
-
* export
|
|
424
|
-
* return new Response(`
|
|
317
|
+
* export function GET({ params }: APIContext): Response {
|
|
318
|
+
* return new Response(`The current id is ${params.id}.`);
|
|
425
319
|
* }
|
|
426
320
|
* ```
|
|
427
321
|
*
|
|
428
|
-
* [
|
|
322
|
+
* [Astro reference](https://docs.astro.build/en/reference/api-reference/#params)
|
|
429
323
|
*/
|
|
430
|
-
params:
|
|
324
|
+
params: Params;
|
|
431
325
|
/**
|
|
432
|
-
*
|
|
326
|
+
* An object containing any values that have been passed as component attributes. In static builds, this can also be the `props` returned by [`getStaticPaths()`](https://docs.astro.build/en/reference/api-reference/#getstaticpaths).
|
|
327
|
+
*
|
|
328
|
+
* ## Example
|
|
433
329
|
*
|
|
434
|
-
* Example usage:
|
|
435
330
|
* ```ts
|
|
436
331
|
* import type { APIContext } from "astro"
|
|
437
332
|
*
|
|
@@ -448,13 +343,20 @@ export interface APIContext<Props extends Record<string, any> = Record<string, a
|
|
|
448
343
|
* }
|
|
449
344
|
* ```
|
|
450
345
|
*
|
|
451
|
-
* [
|
|
346
|
+
* [Astro reference](https://docs.astro.build/en/reference/api-reference/#props)
|
|
452
347
|
*/
|
|
453
|
-
props:
|
|
348
|
+
props: Props;
|
|
454
349
|
/**
|
|
455
350
|
* Create a response that redirects to another page.
|
|
456
351
|
*
|
|
457
|
-
*
|
|
352
|
+
* This accepts a custom status code when redirecting for on-demand rendered routes only.
|
|
353
|
+
*
|
|
354
|
+
* @param {string} path - The path to redirect to.
|
|
355
|
+
* @param {ValidRedirectStatus} [status] - An optional HTTP status code.
|
|
356
|
+
* @returns {Response} A Response object describing the redirection.
|
|
357
|
+
*
|
|
358
|
+
* ## Example
|
|
359
|
+
*
|
|
458
360
|
* ```ts
|
|
459
361
|
* // src/pages/secret.ts
|
|
460
362
|
* export function GET({ redirect }) {
|
|
@@ -462,12 +364,18 @@ export interface APIContext<Props extends Record<string, any> = Record<string, a
|
|
|
462
364
|
* }
|
|
463
365
|
* ```
|
|
464
366
|
*
|
|
465
|
-
* [
|
|
367
|
+
* [Astro reference](https://docs.astro.build/en/reference/api-reference/#redirect)
|
|
466
368
|
*/
|
|
467
|
-
redirect:
|
|
369
|
+
redirect: (path: string, status?: ValidRedirectStatus) => Response;
|
|
468
370
|
/**
|
|
469
|
-
*
|
|
470
|
-
*
|
|
371
|
+
* Allows you to serve content from a different URL or path without
|
|
372
|
+
* redirecting the browser to a new page.
|
|
373
|
+
*
|
|
374
|
+
* As opposed to redirects, the URL won't change, and Astro will render the
|
|
375
|
+
* HTML emitted by the rerouted URL passed as argument.
|
|
376
|
+
*
|
|
377
|
+
* @param {RewritePayload} rewritePayload - The location of the path.
|
|
378
|
+
* @returns {Promise<Response>} A Response object describing the rewrite.
|
|
471
379
|
*
|
|
472
380
|
* ## Example
|
|
473
381
|
*
|
|
@@ -477,14 +385,16 @@ export interface APIContext<Props extends Record<string, any> = Record<string, a
|
|
|
477
385
|
* return ctx.rewrite(new URL("../"), ctx.url);
|
|
478
386
|
* }
|
|
479
387
|
* ```
|
|
388
|
+
*
|
|
389
|
+
* [Astro reference](https://docs.astro.build/en/reference/api-reference/#rewrite)
|
|
480
390
|
*/
|
|
481
|
-
rewrite:
|
|
391
|
+
rewrite: (rewritePayload: RewritePayload) => Promise<Response>;
|
|
482
392
|
/**
|
|
483
393
|
* An object that middlewares can use to store extra information related to the request.
|
|
484
394
|
*
|
|
485
395
|
* It will be made available to pages as `Astro.locals`, and to endpoints as `context.locals`.
|
|
486
396
|
*
|
|
487
|
-
* Example
|
|
397
|
+
* ## Example
|
|
488
398
|
*
|
|
489
399
|
* ```ts
|
|
490
400
|
* // src/middleware.ts
|
|
@@ -495,7 +405,7 @@ export interface APIContext<Props extends Record<string, any> = Record<string, a
|
|
|
495
405
|
* return next();
|
|
496
406
|
* });
|
|
497
407
|
* ```
|
|
498
|
-
*
|
|
408
|
+
* You can then access the value inside a `.astro` file:
|
|
499
409
|
* ```astro
|
|
500
410
|
* ---
|
|
501
411
|
* // src/pages/index.astro
|
|
@@ -504,47 +414,156 @@ export interface APIContext<Props extends Record<string, any> = Record<string, a
|
|
|
504
414
|
* <h1>{greeting}</h1>
|
|
505
415
|
* ```
|
|
506
416
|
*
|
|
507
|
-
* [
|
|
417
|
+
* [Astro reference](https://docs.astro.build/en/reference/api-reference/#locals)
|
|
508
418
|
*/
|
|
509
419
|
locals: App.Locals;
|
|
510
420
|
/**
|
|
511
|
-
*
|
|
421
|
+
* A computed value to find the best match between your visitor’s browser
|
|
422
|
+
* language preferences and the locales supported by your site.
|
|
512
423
|
*
|
|
513
|
-
*
|
|
514
|
-
*
|
|
424
|
+
* This property is only available for routes rendered on demand and cannot
|
|
425
|
+
* be used on prerendered, static pages.
|
|
515
426
|
*
|
|
516
|
-
*
|
|
517
|
-
*
|
|
427
|
+
* The preferred locale of the user is computed by checking the supported
|
|
428
|
+
* locales in `i18n.locales` and locales supported by the users's browser via
|
|
429
|
+
* the header `Accept-Language`.
|
|
518
430
|
*
|
|
519
|
-
*
|
|
431
|
+
* ## Example
|
|
432
|
+
*
|
|
433
|
+
* Given `i18n.locales` equals to `['fr', 'de']`, and the `Accept-Language` value equals to `en, de;q=0.2, fr;q=0.6`, the
|
|
434
|
+
* `Astro.preferredLanguage` will be `fr` because `en` is not supported, its [quality value](https://developer.mozilla.org/en-US/docs/Glossary/Quality_values) is the highest.
|
|
435
|
+
*
|
|
436
|
+
* [Astro reference](https://docs.astro.build/en/reference/api-reference/#preferredlocale)
|
|
520
437
|
*/
|
|
521
438
|
preferredLocale: string | undefined;
|
|
522
439
|
/**
|
|
523
|
-
*
|
|
440
|
+
* Represents the list of all locales, sorted via [quality value](https://developer.mozilla.org/en-US/docs/Glossary/Quality_values), that are both
|
|
441
|
+
* requested by the browser and supported by your website.
|
|
524
442
|
*
|
|
525
|
-
*
|
|
443
|
+
* This property is only available for routes rendered on demand and cannot
|
|
444
|
+
* be used on prerendered, static pages.
|
|
526
445
|
*
|
|
527
|
-
*
|
|
528
|
-
*
|
|
529
|
-
* header.
|
|
446
|
+
* When the `Accept-Header` is `*`, the original `i18n.locales` are returned.
|
|
447
|
+
* The value `*` means no preferences, so Astro returns all the supported locales.
|
|
530
448
|
*
|
|
531
|
-
*
|
|
449
|
+
* ## Example
|
|
450
|
+
*
|
|
451
|
+
* Given `i18n.locales` equals to `['fr', 'pt', 'de']`, and the
|
|
452
|
+
* `Accept-Language` value equals to `en, de;q=0.2, fr;q=0.6`, the
|
|
453
|
+
* `Astro.preferredLocaleList` will be equal to `['fs', 'de']` because `en`
|
|
454
|
+
* isn't supported, and `pt` isn't part of the locales contained in the
|
|
455
|
+
* header.
|
|
532
456
|
*
|
|
533
|
-
* [
|
|
457
|
+
* [Astro reference](https://docs.astro.build/en/reference/api-reference/#preferredlocalelist)
|
|
534
458
|
*/
|
|
535
459
|
preferredLocaleList: string[] | undefined;
|
|
536
460
|
/**
|
|
537
461
|
* The current locale computed from the URL of the request. It matches the locales in `i18n.locales`, and returns `undefined` otherwise.
|
|
462
|
+
*
|
|
463
|
+
* [Astro reference](https://docs.astro.build/en/reference/api-reference/#currentlocale)
|
|
538
464
|
*/
|
|
539
465
|
currentLocale: string | undefined;
|
|
466
|
+
/**
|
|
467
|
+
* Whether the current route is prerendered or not.
|
|
468
|
+
*
|
|
469
|
+
* [Astro reference](https://docs.astro.build/en/reference/api-reference/#isprerendered)
|
|
470
|
+
*/
|
|
471
|
+
isPrerendered: boolean;
|
|
472
|
+
/**
|
|
473
|
+
* It exposes utilities to control CSP headers
|
|
474
|
+
*
|
|
475
|
+
* [Astro reference](https://docs.astro.build/en/reference/experimental-flags/csp/)
|
|
476
|
+
*/
|
|
477
|
+
csp: {
|
|
478
|
+
/**
|
|
479
|
+
* It adds a specific CSP directive to the route being rendered.
|
|
480
|
+
*
|
|
481
|
+
* @param {CspDirective} directive - The directive to add to the current page.
|
|
482
|
+
*
|
|
483
|
+
* ## Example
|
|
484
|
+
*
|
|
485
|
+
* ```js
|
|
486
|
+
* ctx.insertDirective("default-src 'self' 'unsafe-inline' https://example.com")
|
|
487
|
+
* ```
|
|
488
|
+
*
|
|
489
|
+
* [Astro reference](https://docs.astro.build/en/reference/experimental-flags/csp/#cspinsertdirective)
|
|
490
|
+
*/
|
|
491
|
+
insertDirective: (directive: CspDirective) => void;
|
|
492
|
+
/**
|
|
493
|
+
* It set the resource for the directive `style-src` in the route being rendered. It overrides Astro's default.
|
|
494
|
+
*
|
|
495
|
+
* @param {string} payload - The source to insert in the `style-src` directive.
|
|
496
|
+
*
|
|
497
|
+
* ## Example
|
|
498
|
+
*
|
|
499
|
+
* ```js
|
|
500
|
+
* ctx.insertStyleResource("https://styles.cdn.example.com/")
|
|
501
|
+
* ```
|
|
502
|
+
*
|
|
503
|
+
* [Astro reference](https://docs.astro.build/en/reference/experimental-flags/csp/#cspinsertstyleresource)
|
|
504
|
+
*/
|
|
505
|
+
insertStyleResource: (payload: string) => void;
|
|
506
|
+
/**
|
|
507
|
+
* Insert a single style hash to the route being rendered.
|
|
508
|
+
*
|
|
509
|
+
* @param {CspHash} hash - The hash to insert in the `style-src` directive.
|
|
510
|
+
*
|
|
511
|
+
* ## Example
|
|
512
|
+
*
|
|
513
|
+
* ```js
|
|
514
|
+
* ctx.insertStyleHash("sha256-1234567890abcdef1234567890")
|
|
515
|
+
* ```
|
|
516
|
+
*
|
|
517
|
+
* [Astro reference](https://docs.astro.build/en/reference/experimental-flags/csp/#cspinsertstylehash)
|
|
518
|
+
*/
|
|
519
|
+
insertStyleHash: (hash: CspHash) => void;
|
|
520
|
+
/**
|
|
521
|
+
* It set the resource for the directive `script-src` in the route being rendered.
|
|
522
|
+
*
|
|
523
|
+
* @param {string} resource - The source to insert in the `script-src` directive.
|
|
524
|
+
*
|
|
525
|
+
* ## Example
|
|
526
|
+
*
|
|
527
|
+
* ```js
|
|
528
|
+
* ctx.insertScriptResource("https://scripts.cdn.example.com/")
|
|
529
|
+
* ```
|
|
530
|
+
*
|
|
531
|
+
* [Astro reference](https://docs.astro.build/en/reference/experimental-flags/csp/#cspinsertscriptresource)
|
|
532
|
+
*/
|
|
533
|
+
insertScriptResource: (resource: string) => void;
|
|
534
|
+
/**
|
|
535
|
+
* Insert a single script hash to the route being rendered.
|
|
536
|
+
*
|
|
537
|
+
* @param {CspHash} hash - The hash to insert in the `script-src` directive.
|
|
538
|
+
*
|
|
539
|
+
* ## Example
|
|
540
|
+
*
|
|
541
|
+
* ```js
|
|
542
|
+
* ctx.insertScriptHash("sha256-1234567890abcdef1234567890")
|
|
543
|
+
* ```
|
|
544
|
+
*
|
|
545
|
+
* [Astro reference](https://docs.astro.build/en/reference/experimental-flags/csp/#cspinsertscripthash)
|
|
546
|
+
*/
|
|
547
|
+
insertScriptHash: (hash: CspHash) => void;
|
|
548
|
+
};
|
|
540
549
|
/**
|
|
541
550
|
* The route currently rendered. It's stripped of the `srcDir` and the `pages` folder, and it doesn't contain the extension.
|
|
542
551
|
*
|
|
543
552
|
* ## Example
|
|
553
|
+
*
|
|
544
554
|
* - The value when rendering `src/pages/index.astro` will be `/`.
|
|
545
555
|
* - The value when rendering `src/pages/blog/[slug].astro` will be `/blog/[slug]`.
|
|
546
556
|
* - The value when rendering `src/pages/[...path].astro` will be `/[...path]`.
|
|
557
|
+
*
|
|
558
|
+
* [Astro reference](https://docs.astro.build/en/reference/api-reference/#routepattern)
|
|
547
559
|
*/
|
|
548
560
|
routePattern: string;
|
|
549
561
|
}
|
|
562
|
+
/**
|
|
563
|
+
* The `APIContext` is the object made available to endpoints and middleware.
|
|
564
|
+
* It is a subset of the `Astro` global object available in pages.
|
|
565
|
+
*
|
|
566
|
+
* [Astro reference](https://docs.astro.build/en/reference/api-reference/)
|
|
567
|
+
*/
|
|
568
|
+
export type APIContext<Props extends Record<string, any> = Record<string, any>, Params extends Record<string, string | undefined> = Record<string, string | undefined>> = AstroSharedContext<Props, Params>;
|
|
550
569
|
export {};
|