import Emitter, { IEmitter } from "./Emitter";
import { IStorageService } from "./Storage";
import { IApiService } from "./Api";
import Promise from "bluebird";
import { IUserDataService } from "./UserData";
export interface IAuthService extends IEmitter {
    EVENT_LOGGED_IN: string;
    EVENT_RE_LOGGING: string;
    EVENT_LOGIN_REFRESHED: string;
    EVENT_LOGGED_OUT: string;
    EVENT_POLLING: string;
    EVENT_ERROR: string;
    EVENT_401: string;
    EVENT_USER_UPDATED: string;
    user: IUserSelf;
    isEnterprise: boolean;
    isOrgAdmin: boolean;
    isWorkflowDesigner: boolean;
    allowWorkflowTools: boolean;
    isResourceAdmin: boolean;
    isSMSEnabled: boolean;
    authenticate: (force?: boolean) => Promise<any>;
    getUserInfo(): Promise<IUserSelf>;
    login: (username: string, password: string) => Promise<any>;
    logout: () => void;
}
export interface IUserSelfOrganization {
    allow_client_app_downloads: boolean;
    is_enterprise: boolean;
    is_paying_customer: boolean;
    stripe_plan_id: string;
    support_level: string;
    workflow_tools_enabled: boolean;
    sms_enabled: boolean;
    notifications_enabled: boolean;
}
export interface IUserSelf {
    id: number;
    url: string;
    email: string;
    screen_name: string;
    first_name: string;
    last_name: string;
    mobile_phone_number: string;
    pushbullet_id: string;
    default_domain_id: number;
    default_page_id: number;
    default_domain_name: string;
    default_page_name: string;
    pending_invitation_count: number;
    can_create_folders: boolean;
    meta_data: any[];
    organization_id: number;
    UserData: IUserDataService;
    organization: IUserSelfOrganization;
    invited_user?: any;
    is_organization_admin: boolean;
    is_workflow_designer: boolean;
    is_resource_admin: boolean;
    is_notification_admin: boolean;
}
export declare class Auth extends Emitter {
    private config;
    private ippApi;
    private storage;
    static $inject: string[];
    readonly EVENT_LOGGED_IN: string;
    readonly EVENT_RE_LOGGING: string;
    readonly EVENT_LOGIN_REFRESHED: string;
    readonly EVENT_LOGGED_OUT: string;
    readonly EVENT_POLLING: string;
    readonly EVENT_ERROR: string;
    readonly EVENT_401: string;
    readonly EVENT_USER_UPDATED: string;
    readonly isEnterprise: boolean;
    readonly isOrgAdmin: boolean;
    readonly isNotificationAdmin: boolean;
    readonly isWorkflowDesigner: boolean;
    readonly allowWorkflowTools: boolean;
    readonly isResourceAdmin: boolean;
    readonly isSMSEnabled: boolean;
    polling: boolean;
    tokenExpiresIn: number;
    UserData: IUserDataService;
    private _user;
    private _authenticated;
    private _authInProgress;
    private _selfTimer;
    private _selfTimeout;
    readonly user: IUserSelf;
    constructor(config: any, ippApi: IApiService, storage: IStorageService);
    authenticate(force?: boolean, tokens?: any): Promise<any>;
    login(username: string, password: string): Promise<any>;
    logout(all?: boolean, ignore?: boolean): void;
    private processAuth;
    private refreshTokens;
    private saveTokens;
    getUserInfo(): Promise<IUserSelf>;
    private authenticated;
    private startPollingSelf;
    private on401;
}
