import { BaseEngine, IMetadataProvider, UserInfo } from "@memberjunction/core";
import { MJResourcePermissionEntity, MJResourceTypeEntity } from "../../generated/entity_subclasses.js";
/**
 * Resource Permission Engine is used for accessing metadata about permissions for resources and also determining if a user has access to a resource and at what level.
 */
export declare class ResourcePermissionEngine extends BaseEngine<ResourcePermissionEngine> {
    /**
     * Returns the global instance of the class. This is a singleton class, so there is only one instance of it in the application. Do not directly create new instances of it, always use this method to get the instance.
     */
    static get Instance(): ResourcePermissionEngine;
    private _Permissions;
    private _ResourceTypes;
    Config(forceRefresh?: boolean, contextUser?: UserInfo, provider?: IMetadataProvider): Promise<void>;
    get ResourceTypes(): MJResourceTypeEntity[];
    get Permissions(): MJResourcePermissionEntity[];
    /**
     * Case-insensitive name → ID lookup against the cached `MJ: Resource Types`
     * catalog. Returns null when the catalog isn't loaded yet or no matching
     * type exists. Used by `shareNotification.ts` and `shareNotificationHandler.ts`
     * to resolve the `ResourceTypeID` for notification deep-links.
     */
    ResourceTypeIdByName(name: string | null | undefined): string | null;
    /**
     * Convenience method to find all of the permissions for a given Resource Type and Resource Record ID, no additional filtering takes place in this method regarding
     * the status or level of the permission.
     * @param ResourceTypeID
     * @param ResourceRecordID
     * @returns
     */
    GetResourcePermissions(ResourceTypeID: string, ResourceRecordID: string): MJResourcePermissionEntity[];
    /**
     * Determines the highest level of resource permission a user has for a specific resource.
     * This function checks both user-specific permissions and permissions assigned through roles
     * and returns the highest level of permission ('View', 'Edit', 'Owner', or `null` if no permission is found).
     * Note: This only returns MJResourcePermissionEntity objects that have Status === Approved.
     *
     * @param {string} ResourceTypeID - The ID of the resource type (e.g., document, project).
     * @param {string} ResourceRecordID - The ID of the specific resource record.
     * @param {UserInfo} user - The user object containing user details, including roles and ID.
     *
     * @returns {'View' | 'Edit' | 'Owner' | null} - The highest permission level the user has for the resource,
     * or `null` if no permission exists.
     *
     * Permission Levels:
     * - 'Owner': Full control over the resource.
     * - 'Edit': Can modify the resource.
     * - 'View': Can only view the resource.
     * - `null`: No permissions found for the user on this resource.
     */
    GetUserResourcePermissionLevel(ResourceTypeID: string, ResourceRecordID: string, user: UserInfo): 'View' | 'Edit' | 'Owner' | null;
    /**
     * Returns all the permissions a user has for a specific resource type based on both their user-specific permissions and permissions assigned through roles.
     * This only returns MJResourcePermissionEntity objects that have Status === Approved.
     * @param user
     * @param ResourceTypeID
     * @returns
     */
    GetUserAvailableResources(user: UserInfo, ResourceTypeID?: string): MJResourcePermissionEntity[];
    /**
     * This method will use the MJ metadata to find the fields names for the fields that represent the OwnerID and the Name of the resource in the given resource type.
     * Often, these fields are simply named OwnerID and Name in the underlying entity that represents the resource, but this method uses metadata lookups to find the first
     * foreign key to the Users entity from the resource type's entity and looks for the field that is consider the "Name Field" for the entity and returns those values.
     */
    GetResourceTypeInfoFields(ResourceTypeID: string): {
        OwnerIDFieldName: string;
        NameFieldName: string;
        PrimaryKeyFieldName: string;
    };
}
//# sourceMappingURL=ResourcePermissionEngine.d.ts.map