import express from 'express';
import { MOAuthClient } from '../../types/models';
import { MOAuthTokenUser } from '../../types/models/oauth/oauth-token';
import { MUser } from '../../types/models/user/user';
import { UserRole } from '../../../shared/models/users/user-role';
import { OAuthClientModel } from '../../models/oauth/oauth-client';
declare type TokenInfo = {
    accessToken: string;
    refreshToken: string;
    accessTokenExpiresAt: Date;
    refreshTokenExpiresAt: Date;
};
export declare type BypassLogin = {
    bypass: boolean;
    pluginName: string;
    authName?: string;
    user: {
        username: string;
        email: string;
        displayName: string;
        role: UserRole;
    };
};
declare function getAccessToken(bearerToken: string): Promise<MOAuthTokenUser>;
declare function getClient(clientId: string, clientSecret: string): Promise<OAuthClientModel>;
declare function getRefreshToken(refreshToken: string): Promise<import("../../models/oauth/oauth-token").OAuthTokenInfo>;
declare function getUser(usernameOrEmail?: string, password?: string, bypassLogin?: BypassLogin): Promise<import("../../types/models").MUserDefault>;
declare function revokeToken(tokenInfo: {
    refreshToken: string;
}, options?: {
    req?: express.Request;
    explicitLogout?: boolean;
}): Promise<{
    success: boolean;
    redirectUrl?: string;
}>;
declare function saveToken(token: TokenInfo, client: MOAuthClient, user: MUser, options?: {
    refreshTokenAuthName?: string;
    bypassLogin?: BypassLogin;
}): Promise<{
    accessToken: string;
    accessTokenExpiresAt: Date;
    refreshToken: string;
    refreshTokenExpiresAt: Date;
    client: MOAuthClient;
    user: MUser;
    accessTokenExpiresIn: number;
    refreshTokenExpiresIn: number;
}>;
export { getAccessToken, getClient, getRefreshToken, getUser, revokeToken, saveToken };
//# sourceMappingURL=oauth-model.d.ts.map