import * as express from "express";
import { TokenUser } from "@openiap/openflow-api";
import { Provider, KoaContextWithOIDC } from "oidc-provider";
export declare class OAuthProvider {
    private app;
    static instance: OAuthProvider;
    private clients;
    private codes;
    oauthServer: any;
    private authorizationCodeStore;
    oidc: Provider;
    static interactionsUrl(ctx: KoaContextWithOIDC, interaction: any): Promise<any>;
    static logoutSource(ctx: any, form: any): Promise<void>;
    static store: Map<any, any>;
    static generatekeys(): Promise<unknown>;
    static LoadClients(): Promise<void>;
    static configure(app: express.Express): OAuthProvider;
    authorize(req: any, res: any): any;
    authenticateHandler(): {
        handle: (request: any, response: any) => {
            username: any;
        };
    };
    obtainToken(req: any, res: any): any;
    getAccessToken(accessToken: any): Promise<any>;
    getRefreshToken(refreshToken: any): Promise<any>;
    getClient(clientId: any, clientSecret: any): any;
    getClientById(clientId: any): any;
    saveToken(token: any, client: any, user: any): Promise<any>;
    saveAuthorizationCode(code: string, client: any, user: any, redirect_uri: string): Promise<any>;
    sleep(ms: any): Promise<unknown>;
    getAuthorizationCode(code: any): Promise<{
        code: any;
        client: any;
        user: {
            id: any;
            _id: any;
            name: any;
            username: any;
            email: any;
            role: any;
        };
        expiresAt: Date;
        redirectUri: any;
    }>;
    revokeAuthorizationCode(code: any): Promise<boolean>;
    static tokenCache: CachedToken[];
    private static getCachedAccessToken;
    private static getCachedRefreshToken;
    private static addToken;
}
export declare class CachedToken {
    token: any;
    firstsignin: Date;
    constructor(token: any);
}
export declare class Account {
    accountId: string;
    user: TokenUser;
    constructor(accountId: string, user: TokenUser);
    static get storage(): Map<any, any>;
    claims(): TokenUser;
    static findAccount(ctx: KoaContextWithOIDC, id: any): Promise<any>;
    static AddAccount(tuser: TokenUser, client: any): any;
}
