fix: apply bugfix agent improvements to src/types/index.ts
This commit is contained in:
parent
90482f2c99
commit
b1c76c7f86
|
|
@ -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;
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue