/**
 * Baasix Auth Core
 * Main entry point for the auth module
 * Inspired by better-auth architecture
 */
import type { AuthAdapter, AuthOptions, AuthContext, AuthResponse, OAuthProvider, User, Role, Permission, Tenant, SignUpEmailInput, SignInEmailInput } from "./types.js";
import type { SessionService } from "./services/session.js";
import type { TokenService } from "./services/token.js";
import type { VerificationService } from "./services/verification.js";
import type { CredentialProvider } from "./providers/credential.js";
export interface BaasixAuth {
    context: AuthContext;
    adapter: AuthAdapter;
    sessionService: SessionService;
    tokenService: TokenService;
    verificationService: VerificationService;
    credentialProvider: CredentialProvider;
    providers: Map<string, OAuthProvider>;
    signUp(input: SignUpEmailInput): Promise<AuthResponse>;
    signIn(input: SignInEmailInput): Promise<AuthResponse>;
    getOAuthUrl(provider: string, redirectURI: string, scopes?: string[]): Promise<{
        url: string;
        state: string;
        codeVerifier: string;
    }>;
    handleOAuthCallback(provider: string, code: string, state: string, codeVerifier: string, redirectURI: string): Promise<AuthResponse>;
    validateSession(token: string): Promise<{
        user: User;
        role: Role;
        permissions: Permission[];
        tenant: Tenant | null;
    } | null>;
    invalidateSession(token: string): Promise<void>;
    invalidateAllSessions(userId: string): Promise<void>;
    getUserById(userId: string): Promise<User | null>;
    getUserByEmail(email: string): Promise<User | null>;
    updateUser(userId: string, data: Partial<User>): Promise<User | null>;
    getUserRoleAndPermissions(userId: string, tenantId?: string | null): Promise<{
        role: Role;
        permissions: Permission[];
        tenant: Tenant | null;
    }>;
    changePassword(userId: string, currentPassword: string, newPassword: string): Promise<boolean>;
    resetPassword(userId: string, newPassword: string): Promise<boolean>;
    createEmailVerification(email: string): Promise<{
        token: string;
        expiresAt: Date;
    }>;
    verifyEmail(token: string): Promise<User | null>;
    createMagicLink(email: string): Promise<{
        token: string;
        expiresAt: Date;
    }>;
    updateMagicLinkToken(email: string, newToken: string): Promise<void>;
    verifyMagicLink(token: string): Promise<AuthResponse | null>;
    createPasswordReset(email: string): Promise<{
        token: string;
        expiresAt: Date;
    }>;
    verifyPasswordReset(token: string, newPassword: string): Promise<boolean>;
    generateTokenForUser(userId: string, options?: {
        tenantId?: string | null;
        sessionType?: string;
        ipAddress?: string | null;
        userAgent?: string | null;
    }): Promise<AuthResponse>;
}
/**
 * Create a Baasix Auth instance
 */
export declare function createAuth(options: AuthOptions): BaasixAuth;
export default createAuth;
//# sourceMappingURL=core.d.ts.map