import type { Response } from "express";
export interface UserRow {
    id: number;
    email: string;
    name: string;
    role: "admin" | "user";
    status: "active" | "blocked" | "pending_deletion";
    avatar_url: string | null;
    password_hash: string | null;
    google_id: string | null;
    email_verified_at: string | null;
    legal_accepted_at: string | null;
    legal_accepted_version: string | null;
    token_version: number;
    last_login_at: string | null;
    deletion_requested_at: string | null;
    deletion_scheduled_for: string | null;
    deleted_at: string | null;
    created_at: string;
}
export interface TokenPayload {
    sub: number;
    email: string;
    name: string;
    role: "admin" | "user";
    ver: number;
}
export interface PendingGoogleRegistrationPayload {
    purpose: "google_registration";
    googleSub: string;
    email: string;
    name: string;
    avatarUrl: string | null;
}
export declare function signToken(user: Pick<UserRow, "id" | "email" | "name" | "role" | "token_version">): string;
export declare function verifyToken(token: string): TokenPayload;
export declare function signPendingGoogleRegistrationToken(payload: Omit<PendingGoogleRegistrationPayload, "purpose">): string;
export declare function verifyPendingGoogleRegistrationToken(token: string): PendingGoogleRegistrationPayload;
export declare function setAuthCookie(res: Response, token: string): void;
export declare function clearAuthCookie(res: Response): void;
export declare function hashPassword(password: string): Promise<string>;
export declare function verifyPassword(plain: string, hash: string): Promise<boolean>;
export declare function countUsers(): Promise<number>;
export declare function findUserByEmail(email: string): Promise<UserRow | null>;
export declare function findUserByGoogleId(googleId: string): Promise<UserRow | null>;
export declare function findUserById(id: number): Promise<UserRow | null>;
export declare function bumpTokenVersion(userId: number): Promise<UserRow | null>;
export declare function createUser(email: string, name: string, password: string): Promise<UserRow>;
export declare function isActiveAccount(user: Pick<UserRow, "status">): boolean;
export declare function accountAccessMessage(status: UserRow["status"]): string;
export declare function touchLastLogin(userId: number): Promise<void>;
export declare function getLegalAcceptanceState(userId: number): Promise<{
    accepted: boolean;
    currentVersion: string | null;
}>;
export declare function markLegalAccepted(userId: number, version?: string): Promise<void>;
export declare function getAccountState(userId: number): Promise<{
    user: UserRow;
    hasPassword: boolean;
} | null>;
export declare function updateAccountProfile(input: {
    userId: number;
    name: string;
    email?: string;
    currentPassword?: string;
}): Promise<{
    user: UserRow;
    requiresEmailVerification: boolean;
}>;
export declare function updateAccountPassword(input: {
    userId: number;
    currentPassword: string;
    newPassword: string;
}): Promise<UserRow>;
export declare function createEmailVerification(user: Pick<UserRow, "id" | "email" | "name">): Promise<string>;
export declare function verifyEmailToken(token: string): Promise<UserRow | null>;
export declare function createPasswordResetRequest(email: string): Promise<boolean>;
export declare function resetPasswordWithToken(token: string, password: string): Promise<UserRow | null>;
export declare function findOrCreateGoogleUser(googleId: string, email: string, name: string, avatarUrl?: string | null): Promise<UserRow>;
export declare function safeUser(u: UserRow): {
    id: number;
    email: string;
    name: string;
    role: "user" | "admin";
    status: "active" | "blocked" | "pending_deletion";
    emailVerified: boolean;
    avatarUrl: string | null;
};
//# sourceMappingURL=auth.service.d.ts.map