summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/astro/src/types/public/config.ts3
-rw-r--r--packages/astro/src/types/public/context.ts10
-rw-r--r--packages/astro/src/types/public/elements.ts2
-rw-r--r--packages/astro/src/types/public/integrations.ts2
4 files changed, 9 insertions, 8 deletions
diff --git a/packages/astro/src/types/public/config.ts b/packages/astro/src/types/public/config.ts
index 9630313ec..27f7a3784 100644
--- a/packages/astro/src/types/public/config.ts
+++ b/packages/astro/src/types/public/config.ts
@@ -9,6 +9,7 @@ import type { UserConfig as OriginalViteUserConfig, SSROptions as ViteSSROptions
import type { RemotePattern } from '../../assets/utils/remotePattern.js';
import type { AssetsPrefix } from '../../core/app/types.js';
import type { AstroConfigType } from '../../core/config/schema.js';
+import type { REDIRECT_STATUS_CODES } from '../../core/constants.js';
import type { Logger, LoggerLevel } from '../../core/logger/core.js';
import type { EnvSchema } from '../../env/schema.js';
import type { AstroIntegration } from './integrations.js';
@@ -22,7 +23,7 @@ export interface ImageServiceConfig<T extends Record<string, any> = Record<strin
export type RuntimeMode = 'development' | 'production';
-export type ValidRedirectStatus = 300 | 301 | 302 | 303 | 304 | 307 | 308;
+export type ValidRedirectStatus = (typeof REDIRECT_STATUS_CODES)[number];
export type RedirectConfig =
| string
diff --git a/packages/astro/src/types/public/context.ts b/packages/astro/src/types/public/context.ts
index c3d3ff14f..cd51f8b6b 100644
--- a/packages/astro/src/types/public/context.ts
+++ b/packages/astro/src/types/public/context.ts
@@ -1,7 +1,7 @@
+import type { z } from 'zod';
import type {
ActionAccept,
ActionClient,
- ActionInputSchema,
ActionReturnType,
} from '../../actions/runtime/virtual/server.js';
import type { SUPPORTED_MARKDOWN_FILE_EXTENSIONS } from '../../core/constants.js';
@@ -140,7 +140,7 @@ export interface AstroGlobal<
/**
* The route currently rendered. It's stripped of the `srcDir` and the `pages` folder, and it doesn't contain the extension.
- *
+ *
* ## Example
* - The value when rendering `src/pages/index.astro` will `index`.
* - The value when rendering `src/pages/blog/[slug].astro` will `blog/[slug]`.
@@ -273,7 +273,7 @@ interface AstroSharedContext<
*/
getActionResult: <
TAccept extends ActionAccept,
- TInputSchema extends ActionInputSchema<TAccept>,
+ TInputSchema extends z.ZodType,
TAction extends ActionClient<unknown, TAccept, TInputSchema>,
>(
action: TAction,
@@ -283,7 +283,7 @@ interface AstroSharedContext<
*/
callAction: <
TAccept extends ActionAccept,
- TInputSchema extends ActionInputSchema<TAccept>,
+ TInputSchema extends z.ZodType,
TOutput,
TAction extends
| ActionClient<TOutput, TAccept, TInputSchema>
@@ -518,5 +518,5 @@ export interface APIContext<
* - The value when rendering `src/pages/blog/[slug].astro` will `blog/[slug]`.
* - The value when rendering `src/pages/[...path].astro` will `[...path]`.
*/
- routePattern: string
+ routePattern: string;
}
diff --git a/packages/astro/src/types/public/elements.ts b/packages/astro/src/types/public/elements.ts
index 83301f7b8..518b133ca 100644
--- a/packages/astro/src/types/public/elements.ts
+++ b/packages/astro/src/types/public/elements.ts
@@ -6,7 +6,7 @@ export interface AstroComponentDirectives extends Astro.ClientDirectives {
export interface AstroClientDirectives {
'client:load'?: boolean;
- 'client:idle'?: boolean;
+ 'client:idle'?: IdleRequestOptions | boolean;
'client:media'?: string;
'client:visible'?: ClientVisibleOptions | boolean;
'client:only'?: boolean | string;
diff --git a/packages/astro/src/types/public/integrations.ts b/packages/astro/src/types/public/integrations.ts
index ea463c961..a65f2513b 100644
--- a/packages/astro/src/types/public/integrations.ts
+++ b/packages/astro/src/types/public/integrations.ts
@@ -164,7 +164,7 @@ export type HookParameters<
export interface BaseIntegrationHooks {
'astro:config:setup': (options: {
config: AstroConfig;
- command: 'dev' | 'build' | 'preview';
+ command: 'dev' | 'build' | 'preview' | 'sync';
isRestart: boolean;
updateConfig: (newConfig: DeepPartial<AstroConfig>) => AstroConfig;
addRenderer: (renderer: AstroRenderer) => void;