refactor(types): centralize type definitions in shared types file

Move all interface and type definitions to src/types/index.ts to reduce code duplication and improve maintainability. This includes types for components, blog posts, personal info, and localization.
This commit is contained in:
joyzhao
2025-06-19 11:26:47 +08:00
parent acd0fa4bb9
commit 25281f4459
15 changed files with 180 additions and 91 deletions

View File

@@ -1,17 +1,11 @@
---
import type { MarkdownLayoutProps } from 'astro';
import { type Lang } from '@/i18n/utils';
import { type Lang, type FrontmatterProps } from '@/types';
import { defaultLang } from '@/i18n/ui';
import GlassHeader from '@/components/GlassHeader';
import Footer from '@/components/Footer';
import "../styles/global.css";
// Define the frontmatter structure
interface FrontmatterProps {
title: string;
description?: string;
}
// Use Astro's MarkdownLayoutProps for proper type safety
export type Props = MarkdownLayoutProps<FrontmatterProps>;