feat(web): add TypeScript types for Acc and User

This commit is contained in:
yiekheng 2026-05-02 20:50:38 +08:00
parent a9642a7121
commit aa76131b23

24
web/lib/types.ts Normal file
View File

@ -0,0 +1,24 @@
// Mirrors the SQL schema in docker/mysql/init.d/01-schema.sql and the
// JSON projection from app/cm_api.py's get_account / get_user routes.
export type Acc = {
username: string;
password: string;
status: string;
link: string;
};
export type User = {
f_username: string;
f_password: string;
t_username: string;
t_password: string;
last_update_time: string | null;
};
export type AccUpdate = Acc;
export type UserUpdate = Pick<
User,
"f_username" | "f_password" | "t_username" | "t_password"
>;