summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/astro/src/@types/astro.ts137
1 files changed, 71 insertions, 66 deletions
diff --git a/packages/astro/src/@types/astro.ts b/packages/astro/src/@types/astro.ts
index e26fd11b9..cfd3ed63d 100644
--- a/packages/astro/src/@types/astro.ts
+++ b/packages/astro/src/@types/astro.ts
@@ -538,71 +538,6 @@ export interface AstroUserConfig {
/**
* @docs
- * @name prefetch
- * @type {boolean | object}
- * @description
- * Enable prefetching for links on your site to provide faster page transitions.
- * (Enabled by default on pages using the `<ViewTransitions />` router. Set `prefetch: false` to opt out of this behaviour.)
- *
- * This configuration automatically adds a prefetch script to every page in the project
- * giving you access to the `data-astro-prefetch` attribute.
- * Add this attribute to any `<a />` link on your page to enable prefetching for that page.
- *
- * ```html
- * <a href="/about" data-astro-prefetch>About</a>
- * ```
- * Further customize the default prefetching behavior using the [`prefetch.defaultStrategy`](#prefetchdefaultstrategy) and [`prefetch.prefetchAll`](#prefetchprefetchall) options.
- *
- * See the [Prefetch guide](https://docs.astro.build/en/guides/prefetch/) for more information.
- */
- prefetch?:
- | boolean
- | {
- /**
- * @docs
- * @name prefetch.prefetchAll
- * @type {boolean}
- * @description
- * Enable prefetching for all links, including those without the `data-astro-prefetch` attribute.
- * This value defaults to `true` when using the `<ViewTransitions />` router. Otherwise, the default value is `false`.
- *
- * ```js
- * prefetch: {
- * prefetchAll: true
- * }
- * ```
- *
- * When set to `true`, you can disable prefetching individually by setting `data-astro-prefetch="false"` on any individual links.
- *
- * ```html
- * <a href="/about" data-astro-prefetch="false">About</a>
- *```
- */
- prefetchAll?: boolean;
-
- /**
- * @docs
- * @name prefetch.defaultStrategy
- * @type {'tap' | 'hover' | 'viewport'}
- * @default `'hover'`
- * @description
- * The default prefetch strategy to use when the `data-astro-prefetch` attribute is set on a link with no value.
- *
- * - `'tap'`: Prefetch just before you click on the link.
- * - `'hover'`: Prefetch when you hover over or focus on the link. (default)
- * - `'viewport'`: Prefetch as the links enter the viewport.
- *
- * You can override this default value and select a different strategy for any individual link by setting a value on the attribute.
- *
- * ```html
- * <a href="/about" data-astro-prefetch="viewport">About</a>
- * ```
- */
- defaultStrategy?: 'tap' | 'hover' | 'viewport';
- };
-
- /**
- * @docs
* @name site
* @type {string}
* @description
@@ -979,6 +914,72 @@ export interface AstroUserConfig {
excludeMiddleware?: boolean;
};
+ /**
+ * @docs
+ * @kind heading
+ * @name Prefetch Options
+ * @type {boolean | object}
+ * @description
+ * Enable prefetching for links on your site to provide faster page transitions.
+ * (Enabled by default on pages using the `<ViewTransitions />` router. Set `prefetch: false` to opt out of this behaviour.)
+ *
+ * This configuration automatically adds a prefetch script to every page in the project
+ * giving you access to the `data-astro-prefetch` attribute.
+ * Add this attribute to any `<a />` link on your page to enable prefetching for that page.
+ *
+ * ```html
+ * <a href="/about" data-astro-prefetch>About</a>
+ * ```
+ * Further customize the default prefetching behavior using the [`prefetch.defaultStrategy`](#prefetchdefaultstrategy) and [`prefetch.prefetchAll`](#prefetchprefetchall) options.
+ *
+ * See the [Prefetch guide](https://docs.astro.build/en/guides/prefetch/) for more information.
+ */
+ prefetch?:
+ | boolean
+ | {
+ /**
+ * @docs
+ * @name prefetch.prefetchAll
+ * @type {boolean}
+ * @description
+ * Enable prefetching for all links, including those without the `data-astro-prefetch` attribute.
+ * This value defaults to `true` when using the `<ViewTransitions />` router. Otherwise, the default value is `false`.
+ *
+ * ```js
+ * prefetch: {
+ * prefetchAll: true
+ * }
+ * ```
+ *
+ * When set to `true`, you can disable prefetching individually by setting `data-astro-prefetch="false"` on any individual links.
+ *
+ * ```html
+ * <a href="/about" data-astro-prefetch="false">About</a>
+ *```
+ */
+ prefetchAll?: boolean;
+
+ /**
+ * @docs
+ * @name prefetch.defaultStrategy
+ * @type {'tap' | 'hover' | 'viewport'}
+ * @default `'hover'`
+ * @description
+ * The default prefetch strategy to use when the `data-astro-prefetch` attribute is set on a link with no value.
+ *
+ * - `'tap'`: Prefetch just before you click on the link.
+ * - `'hover'`: Prefetch when you hover over or focus on the link. (default)
+ * - `'viewport'`: Prefetch as the links enter the viewport.
+ *
+ * You can override this default value and select a different strategy for any individual link by setting a value on the attribute.
+ *
+ * ```html
+ * <a href="/about" data-astro-prefetch="viewport">About</a>
+ * ```
+ */
+ defaultStrategy?: 'tap' | 'hover' | 'viewport';
+ };
+
/**
* @docs
* @kind heading
@@ -1456,6 +1457,7 @@ export interface AstroUserConfig {
i18n?: {
/**
* @docs
+ * @kind h4
* @name experimental.i18n.defaultLocale
* @type {string}
* @version 3.5.0
@@ -1468,6 +1470,7 @@ export interface AstroUserConfig {
defaultLocale: string;
/**
* @docs
+ * @kind h4
* @name experimental.i18n.locales
* @type {string[]}
* @version 3.5.0
@@ -1481,6 +1484,7 @@ export interface AstroUserConfig {
/**
* @docs
+ * @kind h4
* @name experimental.i18n.fallback
* @type {Record<string, string>}
* @version 3.5.0
@@ -1490,7 +1494,7 @@ export interface AstroUserConfig {
*
* Use this object to declare a fallback `locale` route for each language you support. If no fallback is specified, then unavailable pages will return a 404.
*
- * #### Example
+ * ##### Example
*
* The following example configures your content fallback strategy to redirect unavailable pages in `/pt-br/` to their `es` version, and unavailable pages in `/fr/` to their `en` version. Unavailable `/es/` pages will return a 404.
*
@@ -1513,6 +1517,7 @@ export interface AstroUserConfig {
/**
* @docs
+ * @kind h4
* @name experimental.i18n.routingStrategy
* @type {'prefix-always' | 'prefix-other-locales'}
* @default 'prefix-other-locales'