user.d.ts 895 B

1234567891011121314151617181920212223242526
  1. export type UserRole = 'admin' | 'user' | 'viewer';
  2. export interface User {
  3. id: string;
  4. username: string;
  5. password: string;
  6. email?: string;
  7. role: UserRole;
  8. created_at: Date;
  9. updated_at: Date;
  10. }
  11. export interface UserCreateParams {
  12. username: string;
  13. password: string;
  14. role?: UserRole;
  15. email?: string;
  16. }
  17. export declare class UserModel {
  18. static create(params: UserCreateParams): Promise<User>;
  19. static getById(id: any): Promise<User | null>;
  20. static getByUsername(username: string): Promise<User | null>;
  21. static update(id: any, updates: Partial<Omit<User, 'id' | 'created_at' | 'password'>>): Promise<User | null>;
  22. static updatePassword(id: any, newPassword: string): Promise<void>;
  23. static delete(id: number): Promise<boolean>;
  24. static getAll(limit?: number, offset?: number): Promise<User[]>;
  25. }
  26. //# sourceMappingURL=user.d.ts.map