import express from 'express';
import { UserRole } from '../../../shared/models';
import { MOAuthToken, MUser } from '../models';
export declare type RegisterServerAuthOptions = RegisterServerAuthPassOptions | RegisterServerAuthExternalOptions;
export interface RegisterServerAuthenticatedResult {
    username: string;
    email: string;
    role?: UserRole;
    displayName?: string;
}
export interface RegisterServerExternalAuthenticatedResult extends RegisterServerAuthenticatedResult {
    req: express.Request;
    res: express.Response;
}
interface RegisterServerAuthBase {
    authName: string;
    onLogout?(user: MUser, req: express.Request): Promise<string>;
    hookTokenValidity?(options: {
        token: MOAuthToken;
        type: 'access' | 'refresh';
    }): Promise<{
        valid: boolean;
    }>;
}
export interface RegisterServerAuthPassOptions extends RegisterServerAuthBase {
    getWeight(): number;
    login(body: {
        id: string;
        password: string;
    }): Promise<RegisterServerAuthenticatedResult | null>;
}
export interface RegisterServerAuthExternalOptions extends RegisterServerAuthBase {
    authDisplayName: () => string;
    onAuthRequest: (req: express.Request, res: express.Response) => void;
}
export interface RegisterServerAuthExternalResult {
    userAuthenticated(options: RegisterServerExternalAuthenticatedResult): void;
}
export {};
//# sourceMappingURL=register-server-auth.model.d.ts.map