refactor: reorganize project structure and improve type definitions
- Split types into separate modules for better organization - Move data files to dedicated directories with proper documentation - Enhance i18n utilities with better type safety and performance - Maintain backward compatibility with legacy imports
This commit is contained in:
88
src/types/data.ts
Normal file
88
src/types/data.ts
Normal file
@@ -0,0 +1,88 @@
|
||||
/**
|
||||
* Data types module
|
||||
* Contains type definitions for all data structures used in the application
|
||||
*/
|
||||
import type { Lang } from './i18n.ts';
|
||||
|
||||
/**
|
||||
* Multi-language text type
|
||||
*/
|
||||
export type LocalizedText = {
|
||||
[K in Lang]: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Personal information interface
|
||||
*/
|
||||
export interface PersonalInfo {
|
||||
name: string;
|
||||
location: string;
|
||||
avatar: string;
|
||||
email: string;
|
||||
github: string;
|
||||
linkedin: string;
|
||||
website: string;
|
||||
twitter: string;
|
||||
position: LocalizedText;
|
||||
description: LocalizedText;
|
||||
about: {
|
||||
[K in Lang]: string[];
|
||||
};
|
||||
stats: {
|
||||
repositories: number;
|
||||
commits: string;
|
||||
contributions: number;
|
||||
};
|
||||
skills: {
|
||||
frontend: string[];
|
||||
backend: string[];
|
||||
database: string[];
|
||||
devops: string[];
|
||||
mobile: string[];
|
||||
};
|
||||
terminal: {
|
||||
username: string;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Project image interface
|
||||
*/
|
||||
export interface ProjectImage {
|
||||
bg: string;
|
||||
hover: string;
|
||||
text: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Project interface
|
||||
*/
|
||||
export interface Project {
|
||||
id: string;
|
||||
tag: string;
|
||||
title: string;
|
||||
icon: string;
|
||||
color: string;
|
||||
image: ProjectImage;
|
||||
description: string[];
|
||||
tech: string[];
|
||||
link: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Service icon interface
|
||||
*/
|
||||
export interface ServiceIcon {
|
||||
svg: string;
|
||||
gradient: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Service interface
|
||||
*/
|
||||
export interface Service {
|
||||
title: string;
|
||||
icon: ServiceIcon;
|
||||
items: string[];
|
||||
color: string;
|
||||
}
|
||||
Reference in New Issue
Block a user