fix: apply bugfix agent improvements to src/types/index.ts

This commit is contained in:
cupadev-admin 2026-03-09 12:48:38 +00:00
parent 90482f2c99
commit b1c76c7f86
1 changed files with 40 additions and 0 deletions

40
src/types/index.ts Normal file
View File

@ -0,0 +1,40 @@
export type PostStatus = "draft" | "published";
export interface Post {
id: string;
title: string;
slug: string;
content: string;
excerpt?: string;
status: PostStatus;
tags: string[];
coverImage?: string;
views?: number;
createdAt: string;
updatedAt: string;
}
export interface User {
id: string;
name: string;
email: string;
password?: string;
avatar?: string;
}
export interface AuthState {
user: User | null;
isAuthenticated: boolean;
login: (email: string, password: string) => boolean;
logout: () => void;
checkAuth: () => void;
updateUser: (data: Partial<User>) => void;
}
export interface ContentState {
posts: Post[];
addPost: (post: Omit<Post, "id" | "createdAt" | "updatedAt">) => Post;
updatePost: (id: string, data: Partial<Post>) => void;
deletePost: (id: string) => void;
getPostById: (id: string) => Post | undefined;
}