import { BimChangeBase } from './bim-api-client';
/**
 * Represents the access levels a {@link Permission} can be given.
 */
export declare enum Access {
    /** No access. */
    none = "none",
    /** Can view. */
    view = "view",
    /** Can add. */
    add = "add",
    /** Can edit. */
    edit = "edit",
    /** Can delete. */
    delete = "delete"
}
/**
 * Predefined permission masks. More will be added in the future.
 * Why not an enum? Enums can only use numbers but we need bigints sinec
 * the permission mask can have more bits than what number supports.
 */
declare const permissionMask: {
    readonly none: bigint;
    readonly view: bigint;
    readonly add: bigint;
    readonly edit: bigint;
    readonly delete: bigint;
};
/** string definitions for the predefined permission masks. */
export type PermissionIndex = keyof typeof permissionMask;
/**
 * Represents a permission. Use together with {@link Permissions}.
 * If using the string representation ('view', 'add' etc) then it represents a single
 * permission. If using the bigint representation then it is assumed to be a bitmask
 * and can represent all permissions.
 */
export type Permission = PermissionIndex | keyof typeof Access | bigint;
/**
 * Defines how {@link Permissions} is represented in JSON.
 */
export type PermissionJson = string;
/**
 * Represents a set of permissions.
 */
export declare class Permissions {
    /**
     * Permission bitmask.
     * Since permissions are Uint64 bitmasks it must be represented
     * as a bigint. Watch out for `number` type coercion if
     * reading this property directly.
     * While it is possible to use bitwise operations on the mask, to determine
     * the permissions, it is better to use the provided methods such as {@link hasAny} and {@link hasAll}.
     */
    readonly mask: bigint;
    /**
     * Constructor
     * @param permissions Permission instances to create the {@link Permissions} instance from.
     */
    constructor(...permissions: Permission[]);
    /**
     * Create a {@link Permissions} instance from a permission mask represented
     * as a bigint string. This is how permissions are represented in JSON as it is
     * not possible to send 64bit integers in JSON.
     * @param permission If a real bigint string then it is converted to a {@link Permissions} instance.
     * If it is a `falsy` returns a {@link Permissions} instance without any permissions.
     * If it is a `truthy` but not a bigint string then a exception is generated.
     * @returns {@link Permissions} instance.
     */
    static fromJsonObject(permission: PermissionJson): Permissions;
    /**
     * Copies the permissions defined by `permissions` to the `dst`.permissions property.
     * @param permissions Permission to copy to `dst`.permissions property.
     * @param dst Change to use.
     * @returns Reference to `dst`.
     */
    static copyToRef<T extends Pick<BimChangeBase, 'permissions'>>(permissions: {
        json: PermissionJson;
    } | Permission | Permissions, dst: T): T;
    /**
     * Converts a number of {@link Permission} instances into a human readable string.
     * @param permissions Permissions to convert.
     * @returns Human readable string.
     */
    static toString(...permissions: Permission[]): string;
    /**
     * Join one or more permissions into a single numeric permission mask. Permissions are bitwise OR:ed together.
     * @param permissions Permissions to join.
     * @returns Numeric permission mask. Can be compared directly with {@link mask}.
     * Can also be used in constructor of {@link Permissions}.
     */
    static join(...permissions: (Permission[] | Permission)[]): bigint;
    /**
     * Checks if {@link mask} has any of the specified permissions.
     * @param permissions Permissions to compare with {@link mask}.
     * @returns `true` if {@link mask} holds any of the specified permissions.
     */
    hasAny(...permissions: Permission[]): boolean;
    /**
     * Checks if {@link mask} has all of the specified permissions.
     * @param permissions Permissions to compare with {@link mask}.
     * @returns `true` if {@link mask} holds all of the specified permissions.
     */
    hasAll(...permissions: Permission[]): boolean;
    /**
     * Converts to a human readable string.
     * @returns Human readable string.
     */
    toString(): string;
    /**
     * Converts the Permission object to a JSON representation.
     * @returns The JSON representation of the Permission object.
     */
    toJson(): PermissionJson;
    private static toMask;
}
export {};
//# sourceMappingURL=Permission.d.ts.map