import type { Database as DatabaseType } from 'better-sqlite3'; export interface AuthConfig { session_days: number; token_ttl_minutes: number; } export declare function createInviteToken(db: DatabaseType, email: string, ttlMinutes?: number): string; export declare function createLoginToken(db: DatabaseType, email: string, ttlMinutes?: number): string; export interface TokenValidation { valid: boolean; userId?: string; email?: string; purpose?: string; error?: string; } export declare function validateToken(db: DatabaseType, token: string): TokenValidation; export declare function consumeToken(db: DatabaseType, token: string): void; export declare function createSession(db: DatabaseType, email: string, sessionDays?: number, userAgent?: string, ip?: string): string; export interface SessionUser { id: string; email: string; handle: string | null; role: string; status: string; } export declare function getSession(db: DatabaseType, sessionId: string): SessionUser | null; export declare function deleteSession(db: DatabaseType, sessionId: string): void; export declare function deleteUserSessions(db: DatabaseType, email: string): void; export declare function invalidateUserTokens(db: DatabaseType, email: string): void; export interface AcceptResult { ok: boolean; error?: string; sessionId?: string; user?: SessionUser; } export declare function acceptInvite(db: DatabaseType, token: string, handle: string, sessionDays?: number, userAgent?: string, ip?: string): AcceptResult; export declare function ensureOwner(db: DatabaseType, ownerEmail: string): void; export declare function getOrCreateOwnerSession(db: DatabaseType, ownerEmail: string, sessionDays?: number): string; export declare function countOwners(db: DatabaseType): number; export declare function promoteToOwner(db: DatabaseType, email: string, actorEmail?: string): { ok: boolean; error?: string; }; export declare function demoteFromOwner(db: DatabaseType, email: string, actorEmail?: string, targetRole?: string): { ok: boolean; error?: string; }; export declare function setUserRole(db: DatabaseType, email: string, role: string, actorEmail?: string): { ok: boolean; error?: string; }; export declare function revokeUserFull(db: DatabaseType, email: string): boolean; export declare function reEnableUser(db: DatabaseType, email: string): boolean; export declare function deleteUserPermanently(db: DatabaseType, email: string): boolean; //# sourceMappingURL=auth.d.ts.map