import { User, Role, Base, TokenUser, WorkitemQueue, Resource, ResourceUsage } from "@openiap/openflow-api";
import { Span } from "@opentelemetry/api";
import { Observable } from '@opentelemetry/api-metrics';
import { WebSocketServerClient } from "./WebSocketServerClient";
import { Provider } from "./LoginProvider";
import { TokenRequest } from "./TokenRequest";
export declare class DBHelper {
    memoryCache: any;
    mongoCache: any;
    init(): Promise<void>;
    clearCache(reason: string, span: Span): Promise<void>;
    item_cache: Observable;
    ensureotel(): void;
    FindByIdWrap(_id: any, span: Span): Promise<User>;
    FindById(_id: string, parent: Span): Promise<User>;
    GetResourcesWrap(span: Span): Promise<Resource[]>;
    GetResources(parent: Span): Promise<Resource[]>;
    GetResourceUsageByUserIDWrap(userid: string, span: Span): Promise<ResourceUsage[]>;
    GetResourceUsageByUserID(userid: string, parent: Span): Promise<ResourceUsage[]>;
    GetProvidersWrap(span: any): Promise<Provider[]>;
    GetProviders(parent: Span): Promise<Provider[]>;
    ClearProviders(): Promise<void>;
    FindRequestTokenID(key: string, parent: Span): Promise<TokenRequest>;
    AdddRequestTokenID(key: string, data: any, parent: Span): Promise<TokenRequest>;
    RemoveRequestTokenID(key: string, parent: Span): Promise<TokenRequest>;
    FindByAuthorizationWrap(token: any, jwt: any, span: any): Promise<User>;
    FindByAuthorizationWrap2(login: any, password: any, jwt: any, span: any): Promise<User>;
    FindByAuthorization(authorization: string, jwt: string, span: Span): Promise<User>;
    FindQueueByIdWrap(_id: any, jwt: any, span: any): Promise<User>;
    FindQueueById(_id: string, jwt: string, parent: Span): Promise<User>;
    FindQueueByNameWrap(name: any, jwt: any, span: Span): Promise<User>;
    FindQueueByName(name: string, jwt: string, parent: Span): Promise<User>;
    FindExchangeByIdWrap(_id: string, jwt: string, span: Span): Promise<User>;
    FindExchangeById(_id: string, jwt: string, parent: Span): Promise<User>;
    FindExchangeByNameWrap(name: string, jwt: string, span: Span): Promise<User>;
    FindExchangeByName(name: string, jwt: string, parent: Span): Promise<User>;
    FindRoleByIdWrap(_id: string, jwt: string, span: Span): Promise<User>;
    FindRoleById(_id: string, jwt: string, parent: Span): Promise<Role>;
    FindByUsernameWrap(username: string, jwt: string, span: Span): Promise<User>;
    FindByUsername(username: string, jwt: string, parent: Span): Promise<User>;
    GetDisposableDomainWrap(domain: string, span: Span): Promise<Base>;
    GetDisposableDomain(domain: string, parent: Span): Promise<Base>;
    FindByUsernameOrFederationidWrap(username: string, issuer: string, span: Span): Promise<User>;
    FindByUsernameOrFederationid(username: string, issuer: string, parent: Span): Promise<User>;
    DecorateWithRolesWrap(user: any, span: Span): Promise<User[]>;
    DecorateWithRolesAllRolesWrap(span: Span): Promise<Role[]>;
    DecorateWithRoles<T extends TokenUser | User>(user: T, parent: Span): Promise<T>;
    FindRoleByNameWrap(name: string, jwt: string, span: Span): Promise<Role>;
    FindRoleByName(name: string, jwt: string, parent: Span): Promise<Role>;
    UserRoleUpdateId(id: string, watch: boolean, span: Span): Promise<void>;
    DeleteKey(key: string, watch: boolean, frombroadcast: boolean, span: Span): Promise<void>;
    private _doClear;
    UserRoleUpdate(userrole: Base | TokenUser, watch: boolean, span: Span): Promise<void>;
    QueueUpdate(_id: string, name: string, watch: boolean, span: Span): Promise<void>;
    ExchangeUpdate(_id: string, name: string, watch: boolean, span: Span): Promise<void>;
    WorkitemQueueUpdate(wiqid: string, watch: boolean, span: Span): Promise<void>;
    GetPushableQueuesWrap(span: Span): Promise<WorkitemQueue[]>;
    GetPushableQueues(parent: Span): Promise<WorkitemQueue[]>;
    GetPendingWorkitemsCountWrap(wiqid: string, span: Span): Promise<number>;
    GetPendingWorkitemsCount(wiqid: string, parent: Span): Promise<number>;
    Save(item: User | Role, jwt: string, parent: Span): Promise<void>;
    EnsureRole(jwt: string, name: string, id: string, parent: Span): Promise<Role>;
    EnsureUser(jwt: string, name: string, username: string, id: string, password: string, extraoptions: any, parent: Span): Promise<User>;
    EnsureNoderedRoles(user: TokenUser | User, jwt: string, force: boolean, parent: Span): Promise<void>;
    UpdateHeartbeat(cli: WebSocketServerClient): any;
    GetIPBlockListWrap(span: any): Promise<Base[]>;
    GetIPBlockList(parent: Span): Promise<Base[]>;
    ClearIPBlockList(): Promise<void>;
}
