This commit is contained in:
toom1996
2025-07-24 16:05:56 +08:00
parent 7a12c336d4
commit 3ba9239522
14 changed files with 301 additions and 73 deletions

43
src/types/astro.d.ts vendored Normal file
View File

@ -0,0 +1,43 @@
// src/types/astro.d.ts
// import 'astro';
import type { z } from 'zod';
import type { ActionAccept, ActionClient, ActionReturnType } from '../../actions/runtime/virtual/server.js';
import type { SUPPORTED_MARKDOWN_FILE_EXTENSIONS } from '../../core/constants.js';
import type { AstroCookies } from '../../core/cookies/cookies.js';
import type { CspDirective, CspHash } from '../../core/csp/config.js';
import type { AstroSession } from '../../core/session.js';
import type { AstroComponentFactory } from '../../runtime/server/index.js';
import type { Params, RewritePayload } from './common.js';
import type { ValidRedirectStatus } from './config.js';
import type { AstroInstance, MarkdownInstance, MDXInstance } from './content.js';
declare module 'astro' {
export interface AstroSharedContext<Props extends Record<string, any> = Record<string, any>, RouteParams extends Record<string, string | undefined> = Record<string, string | undefined>> {
/**
* Object accessed via Astro middleware
*/
locals: {
column_data?: {
desc?: string;
// 你可以继续补充
};
column_base_uri?: string;
column_page?: number;
custom?: number;
// 你还可以加其它自定义属性
};
}
}
// // src/types/astro.d.ts
// declare module "astro" {
// interface AstroLocals {
// customProp: string;
// anotherProp: number;
// }
// }