/// <reference types="jquery" />
import { EnumObject, InitModelOf, ObjectModel, ObjectOrModel, SomeRequired } from '../index';
export declare class Permission implements PermissionModel {
    self: Permission;
    model: PermissionModel;
    initModel: SomeRequired<this['model'], 'name'>;
    name: string;
    level: PermissionLevel;
    constructor();
    static Level: {
        UNDEFINED: number;
        NONE: number;
        ALL: number;
    };
    init(model: InitModelOf<this>): void;
    /**
     * Check if the given {@link Permission} is implied.
     * Quick implies is executed synchronously while non-quick implies is executed asynchronously.
     */
    implies(permission: Permission, quick: true): boolean;
    implies(permission: Permission, quick?: false): JQuery.Promise<boolean>;
    implies(permission: Permission, quick?: boolean): boolean | JQuery.Promise<boolean>;
    matches(permission: Permission): boolean;
    /**
     * Precondition: `matches(permission)`
     */
    protected _evalPermissionQuick(permission: Permission): boolean;
    /**
     * Precondition: `matches(permission)`
     */
    protected _evalPermission(permission: Permission): JQuery.Promise<boolean>;
    /**
     * @returns a {@link Permission} with the given `name`.
     */
    static quick(name: string): Permission;
    /**
     * Ensures that the given `permission` is of type {@link Permission}. If a model is provided, a new {@link Permission} will be created.
     */
    static ensure<T extends Permission = Permission>(permission: ObjectOrModel<T>): T;
}
export interface PermissionModel extends ObjectModel<Permission> {
    /**
     * The name and identifier of the {@link Permission}.
     */
    name?: string;
    /**
     * The level of the {@link Permission}.
     */
    level?: PermissionLevel;
}
export type PermissionLevel = EnumObject<typeof Permission.Level>;
//# sourceMappingURL=Permission.d.ts.map