import { Transaction } from 'sequelize';
import { Model } from 'sequelize-typescript';
import { MUserAccountId } from '../../types/models';
import { MOAuthTokenUser } from '../../types/models/oauth/oauth-token';
import { AttributesOnly } from '../../../shared/typescript-utils';
import { UserModel } from '../user/user';
import { OAuthClientModel } from './oauth-client';
export declare type OAuthTokenInfo = {
    refreshToken: string;
    refreshTokenExpiresAt: Date;
    client: {
        id: number;
    };
    user: MUserAccountId;
    token: MOAuthTokenUser;
};
export declare class OAuthTokenModel extends Model<Partial<AttributesOnly<OAuthTokenModel>>> {
    accessToken: string;
    accessTokenExpiresAt: Date;
    refreshToken: string;
    refreshTokenExpiresAt: Date;
    authName: string;
    createdAt: Date;
    updatedAt: Date;
    userId: number;
    User: UserModel;
    oAuthClientId: number;
    OAuthClients: OAuthClientModel[];
    static removeTokenCache(token: OAuthTokenModel): void;
    static loadByRefreshToken(refreshToken: string): Promise<OAuthTokenModel>;
    static getByRefreshTokenAndPopulateClient(refreshToken: string): Promise<OAuthTokenInfo>;
    static getByTokenAndPopulateUser(bearerToken: string): Promise<MOAuthTokenUser>;
    static getByRefreshTokenAndPopulateUser(refreshToken: string): Promise<MOAuthTokenUser>;
    static deleteUserToken(userId: number, t?: Transaction): Promise<number>;
}
//# sourceMappingURL=oauth-token.d.ts.map