export interface SymKey {
    t: string;
    v: number;
    sym: string;
}
export interface User {
    id: string;
    commonKey: SymKey;
    commonKeyId: string;
    tek: SymKey;
}
export interface Permission {
    id: string;
    appId: string;
    owner: string;
    grantee: string;
    granteePublicKey: string;
    commonKey: SymKey;
    scope: string[];
}
declare const userService: {
    currentUserId: any;
    currentAppId: any;
    users: {};
    commonKeys: {};
    privateKey: any;
    userPollAction: any;
    resetUser(): void;
    /**
     * Sets the loggedin user's privateKey.
     *
     * CryptoKey: https://developer.mozilla.org/en-US/docs/Web/API/CryptoKey
     *
     * @param privateKey  an unexportable CryptoKey.
     */
    setPrivateKey(privateKey: any): void;
    /**
     * Get the id of the current user
     */
    getCurrentUserId(): string;
    /**
     * Get the id of the current app
     */
    getCurrentAppId(): string;
    /**
     * Set a language for the current user
     * @param languageCode The code of the language that should be set
     */
    setCurrentUserLanguage(languageCode: string): void;
    /**
     * Check if a the id is the one of the current user
     * @param userId The id to check
     */
    isCurrentUser(userId: string): boolean;
    /**
     * Get the user for an id.
     * Defaults to `this.currentUserId`.
     *  @param userId Id of the user whos data is requested.
     *                Loggedin user by default(even if `this.currentUserId` is not set yet).
     *  @returns Resolves to a userObject that contains `userId`, `commonKey` and `tagEncryptionKey`.
     */
    getUser(userId?: string): Promise<User>;
    /**
     * Get the user for an id.
     *  @param userId Id of the user whos data is requested.
     *                Loggedin user by default(even if `this.currentUserId` is not set yet).
     * @returns Resolves to a userObject that contains `userId`, `commonKey` and `tagEncryptionKey`.
     */
    pullUser(userId?: string): Promise<User>;
    /**
     * Get the `commonKey` for a user
     * @param userId  Id of the user whose key to retrieve
     * @param keyId  Id of key to retrieve
     * @returns Resolves to the (decrypted) common key
     */
    getCommonKey(userId: string, keyId: string): Promise<Record<string, any>>;
    /**
     * Get a list of received permissions
     *
     * @returns Resolves to an array of received permissions.
     *      A permission contains:
     *          - `permissionId`: the id of the permission
     *          - `appId`: the id of the user-client combination that is allowed to access data
     *          - `owner`: the id of the user that owns the data
     *          - `grantee`: the id of the user that received the permission
     *          - `granteePublicKey`: the publicKey of the grantee (base64 encoded)
     *          - `commonKey`: the common key of the owner, encrypted with the grantee's
     *              public key (base64 encoded)
     *          - `scope`: the scope of the permission (array of strings)
     *
     * TODO: decide on which data should be exposed
     */
    getReceivedPermissions(): Promise<Permission[]>;
    /**
     * Grant permissions to a certain app
     * @param appId The id of the user-client tuple the permission shall be granted to
     * @param annotations The annotations that shall be shared.
     */
    grantPermission(appId: string, annotations?: string[]): Promise<void>;
    /**
     * Starts a regular, recurring call to /userinfo to get common key updates
     * @param interval interval between calls in seconds
     */
    beginUserInfoPoll(interval: number): void;
};
export default userService;
