import { IGroup } from "@esri/arcgis-rest-portal";
import type { IArcGISContext } from "../types/IArcGISContext";
import { IWithThumbnailBehavior } from "./behaviors/IWithThumbnailBehavior";
import { IHubItemEntity } from "./types/IHubItemEntity";
import { SettableAccessLevel } from "./types/types";
import { IWithDiscussionsBehavior } from "./behaviors/IWithDiscussionsBehavior";
import { IWithFollowersBehavior } from "./behaviors/IWithFollowersBehavior";
import { IEntityPermissionPolicy } from "../permissions/types/IEntityPermissionPolicy";
import { IPermissionAccessResponse } from "../permissions/types/IPermissionAccessResponse";
import { Permission } from "../permissions/types/Permission";
import { IWithFeaturedImageBehavior } from "./behaviors/IWithFeaturedImageBehavior";
import { IWithPermissionBehavior } from "./behaviors/IWithPermissionBehavior";
import { IWithSharingBehavior } from "./behaviors/IWithSharingBehavior";
import { IWithStoreBehavior } from "./behaviors/IWithStoreBehavior";
/**
 * Base class for all Hub Entities backed by items
 */
export declare abstract class HubItemEntity<T extends IHubItemEntity> implements IWithStoreBehavior<T>, IWithSharingBehavior, IWithThumbnailBehavior, IWithFeaturedImageBehavior, IWithPermissionBehavior, IWithDiscussionsBehavior, IWithFollowersBehavior {
    protected context: IArcGISContext;
    protected entity: T;
    protected isDestroyed: boolean;
    protected thumbnailCache: {
        file?: any;
        filename?: string;
        clear?: boolean;
    };
    constructor(entity: T, context: IArcGISContext);
    /**
     * Check if current user has a specific permission, accounting for
     * both system and entity level policies
     * @param permission
     * @returns
     */
    checkPermission(permission: Permission): IPermissionAccessResponse;
    /**
     * Get all policies related to a specific permission
     * @param permission
     * @returns
     */
    getPermissionPolicies(permission: Permission): IEntityPermissionPolicy[];
    /**
     * Add a policy to the entity
     * @param policy
     */
    addPermissionPolicy(policy: IEntityPermissionPolicy): void;
    /**
     * Remove a policy from the entity
     * @param permission
     * @param id
     */
    removePermissionPolicy(permission: Permission, id: string): void;
    /**
     * Return the entity id
     */
    get id(): string;
    /**
     * Return the entity owner
     */
    get owner(): string;
    /**
     * Return the backing entity as an object literal
     * @returns
     */
    toJson(): T;
    abstract update(changes: Partial<T>): void;
    abstract save(): Promise<void>;
    abstract delete(): Promise<void>;
    /**
     * Can the current user edit the Entity?
     * In order to edit an item, the user must be the owner of the item
     * or be a member of a shared editing group, to which the item is shared.
     * @returns
     */
    get canEdit(): boolean;
    /**
     * Can the current user delete the Entity?
     * In order to delete an item, the user must be the owner of the item or a full org_admin
     * in the owner's organization.
     * @returns
     */
    get canDelete(): boolean;
    /**
     * The orgId of the Entity, if available
     * @returns the entity orgId, when available
     */
    get orgId(): string;
    /**
     * Share the Entity with the specified group id
     * @param groupId
     */
    shareWithGroup(groupId: string): Promise<void>;
    /**
     * Share the Entity with the specified group ids
     * @param groupIds
     */
    shareWithGroups(groupIds: string[]): Promise<void>;
    /**
     * Unshare the Entity with the specified group id
     * @param groupId
     */
    unshareWithGroup(groupId: string): Promise<void>;
    /**
     * Unshare the Entity with the specified group ids
     * @param groupIds
     */
    unshareWithGroups(groupIds: string[]): Promise<void>;
    /**
     * Set the access level of the backing item
     * @param access
     */
    setAccess(access: SettableAccessLevel): Promise<void>;
    /**
     * Returns the followers group
     */
    getFollowersGroup(): Promise<IGroup>;
    /**
     * Sets the access level of the followers group
     * @param access
     */
    setFollowersGroupAccess(access: SettableAccessLevel): Promise<void>;
    /**
     * Sets whether or not the followers group is discussable
     * @param isDiscussable
     */
    setFollowersGroupIsDiscussable(isDiscussable: boolean): Promise<void>;
    /**
     * Return a list of groups the Entity is shared to.
     * @returns
     */
    sharedWith(): Promise<IGroup[]>;
    /**
     * Hook that subclasses should call to invoke shared post-save behavior
     */
    afterSave(): Promise<void>;
    /**
     * Store thumbnail information to be sent with the next `.save()` call
     * @param file
     * @param filename
     */
    setThumbnail(file: any, filename: string): void;
    /**
     * Clear the thumbnail from the item, if one exists. Persisted on next `.save()` call
     */
    clearThumbnail(): void;
    /**
     * Return the full url to the thumbnail, optionally with a width parameter
     * @param width
     */
    getThumbnailUrl(width?: number): string;
    /**
     * Set a featured image on the Entity, if one already exists it is cleared out before the new one is set
     * to keep the number of resources in control
     * @param file
     */
    setFeaturedImage(file: any, clearExisting?: boolean): Promise<void>;
    /**
     * Remove the featured image from the item
     */
    clearFeaturedImage(): Promise<void>;
    /**
     * Updates the isDiscussable property
     * @param isDiscussable whether to enable or disable discussions
     */
    updateIsDiscussable(isDiscussable: boolean): void;
}
