3.0.0 - Dependency updates, improved typesafe config, improve typing
All checks were successful
Docker Deploy / build-and-push (push) Successful in 3m44s
All checks were successful
Docker Deploy / build-and-push (push) Successful in 3m44s
This commit is contained in:
161
src/types.ts
Normal file
161
src/types.ts
Normal file
@@ -0,0 +1,161 @@
|
||||
import type { ImageMetadata } from "astro";
|
||||
import type { ComponentType } from "preact";
|
||||
|
||||
// Icon Types
|
||||
export type LucideIcon = ComponentType<{ size?: number; class?: string }>;
|
||||
export type AstroIconName = string; // For astro-icon string references like "mdi:email"
|
||||
export type CustomIconComponent = ComponentType<any>;
|
||||
export type IconType = LucideIcon | AstroIconName | CustomIconComponent;
|
||||
|
||||
export interface Talk {
|
||||
id: string;
|
||||
name: string;
|
||||
description: string;
|
||||
link: string;
|
||||
date?: string;
|
||||
}
|
||||
|
||||
export interface Project {
|
||||
id: string;
|
||||
name: string;
|
||||
description: string;
|
||||
link: string;
|
||||
tags?: string[];
|
||||
status?: string;
|
||||
}
|
||||
|
||||
export interface SocialLink {
|
||||
id: string;
|
||||
name: string;
|
||||
url: string;
|
||||
icon: IconType;
|
||||
ariaLabel: string;
|
||||
}
|
||||
|
||||
export interface TechLink {
|
||||
id: string;
|
||||
name: string;
|
||||
url: string;
|
||||
icon: IconType;
|
||||
ariaLabel: string;
|
||||
}
|
||||
|
||||
export interface NavigationItem {
|
||||
id: string;
|
||||
name: string;
|
||||
path: string;
|
||||
tooltip: string;
|
||||
icon: IconType;
|
||||
enabled?: boolean;
|
||||
isActive?: (path: string) => boolean;
|
||||
}
|
||||
|
||||
export type ResumeSectionKey =
|
||||
| "summary"
|
||||
| "experience"
|
||||
| "education"
|
||||
| "skills"
|
||||
| "volunteer"
|
||||
| "profiles"
|
||||
| "awards";
|
||||
|
||||
export interface ResumeConfig {
|
||||
tomlFile: string; // Can be a file path or raw TOML content
|
||||
layout?: {
|
||||
leftColumn?: ResumeSectionKey[];
|
||||
rightColumn?: ResumeSectionKey[];
|
||||
};
|
||||
sections: {
|
||||
enabled: ResumeSectionKey[];
|
||||
summary?: {
|
||||
title?: string;
|
||||
};
|
||||
experience?: {
|
||||
title?: string;
|
||||
};
|
||||
education?: {
|
||||
title?: string;
|
||||
};
|
||||
skills?: {
|
||||
title?: string;
|
||||
};
|
||||
volunteer?: {
|
||||
title?: string;
|
||||
};
|
||||
profiles?: {
|
||||
title?: string;
|
||||
};
|
||||
awards?: {
|
||||
title?: string;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
export interface PersonalInfo {
|
||||
name: string;
|
||||
profileImage: {
|
||||
src: ImageMetadata;
|
||||
alt: string;
|
||||
width?: number;
|
||||
height?: number;
|
||||
};
|
||||
tagline: string;
|
||||
description?: string;
|
||||
}
|
||||
|
||||
export interface HomepageSections {
|
||||
socialLinks: {
|
||||
title: string;
|
||||
description?: string;
|
||||
};
|
||||
techStack: {
|
||||
title: string;
|
||||
description?: string;
|
||||
};
|
||||
}
|
||||
|
||||
export interface SiteConfig {
|
||||
personal: PersonalInfo;
|
||||
homepage: HomepageSections;
|
||||
resume: ResumeConfig;
|
||||
meta: {
|
||||
title: string;
|
||||
description: string;
|
||||
url: string;
|
||||
author: string;
|
||||
};
|
||||
}
|
||||
|
||||
export interface Config {
|
||||
personalInfo: PersonalInfo;
|
||||
homepageSections: HomepageSections;
|
||||
resumeConfig: ResumeConfig;
|
||||
siteConfig: SiteConfig;
|
||||
talks: readonly Talk[];
|
||||
projects: readonly Project[];
|
||||
sections: {
|
||||
readonly resume: {
|
||||
readonly name: string;
|
||||
readonly path: string;
|
||||
readonly description: string;
|
||||
};
|
||||
readonly posts: {
|
||||
readonly name: string;
|
||||
readonly path: string;
|
||||
readonly description: string;
|
||||
};
|
||||
readonly talks: {
|
||||
readonly name: string;
|
||||
readonly path: string;
|
||||
readonly description: string;
|
||||
};
|
||||
readonly projects: {
|
||||
readonly name: string;
|
||||
readonly path: string;
|
||||
readonly description: string;
|
||||
};
|
||||
};
|
||||
socialLinks: readonly SocialLink[];
|
||||
techLinks: readonly TechLink[];
|
||||
navigationItems: readonly NavigationItem[];
|
||||
}
|
||||
Reference in New Issue
Block a user