import { IUser, IUserRequestOptions, ArcGISIdentityManager } from "@esri/arcgis-rest-request";
import { IPortal, IPortalSettings } from "@esri/arcgis-rest-portal";
import { IRequestOptions } from "@esri/arcgis-rest-request";
import { IHubHistory, IHubHistoryEntry } from "./core/hubHistory";
import { IHubRequestOptions, IHubTrustedOrgsResponse } from "./hub-types";
import { UserResourceApp } from "./hub-types";
import type { IUserResourceToken } from "./types/IUserResourceToken";
import { IUserHubSettings } from "./utils/IUserHubSettings";
import { HubServiceStatus } from "./core/types/ISystemStatus";
import { HubEntity } from "./core/types/HubEntity";
import type { IArcGISContext } from "./types/IArcGISContext";
import type { IArcGISContextOptions } from "./types/IArcGISContextOptions";
import { HubEnvironment, IFeatureFlags } from "./permissions/types/IPermissionPolicy";
import { HubLicense } from "./permissions/types/HubLicense";
import { Permission } from "./permissions/types/Permission";
import { IPermissionAccessResponse } from "./permissions/types/IPermissionAccessResponse";
export declare const ENTERPRISE_SITES_PATH = "/apps/sites";
export declare const ENTERPRISE_HOME_SUBDOMAIN = "home";
/**
 * Abstraction that holds a `ArcGISIdentityManager`, along with
 * getters to streamline access to various platform
 * urls, and common constructs like `IRequestOptions`,
 * `IUserRequestOptions` etc.
 *
 * Instances are intended to be immutable, but this is not directly enforced.
 *
 * In most circumstances, this class should be created by
 * the ArcGISContextManager class.
 */
export declare class ArcGISContext implements IArcGISContext {
    /**
     * Unique id from the ArcGISContextManager that created
     * this instance. Primarily useful for debugging possible
     * race-conditions that can result in multiple ArcGISContextManager
     * instances being created.
     */
    id: number;
    private _authentication;
    private _portalUrl;
    private _hubUrl;
    private _hubHomeUrl;
    private _portalSelf;
    private _portalSettings;
    private _currentUser;
    private _properties;
    private _serviceStatus;
    private _featureFlags;
    private _trustedOrgIds;
    private _trustedOrgs;
    private _userResourceTokens;
    private _userHubSettings;
    /**
     * Create a new instance of `ArcGISContext`.
     *
     * @param opts
     */
    constructor(opts: IArcGISContextOptions);
    /**
     * Return the ArcGISIdentityManager if authenticated
     */
    get session(): ArcGISIdentityManager;
    /**
     * Return boolean indicating if authenticatio is present
     */
    get isAuthenticated(): boolean;
    /**
     * Return hash of feature flags passed into constructor.
     * Default is empty object.
     */
    get featureFlags(): IFeatureFlags;
    /**
     * Is the users org in the alpha orgs list?
     * Alpha orgs are passed in via properties.alphaOrgs
     */
    get isAlphaOrg(): boolean;
    /**
     * Is the users org in the beta orgs list?
     * Beta orgs are passed in via properties.betaOrgs
     */
    get isBetaOrg(): boolean;
    /**
     * Return the HubEnvironment of the current context
     */
    get environment(): HubEnvironment;
    /**
     * Return `IUserRequestOptions`, which is used for REST-JS
     * functions which require authentication information.
     *
     * If context is not authenticated, this function will throw
     */
    get userRequestOptions(): IUserRequestOptions;
    /**
     * Return `IRequestOptions`, which is used by REST-JS functions
     * which *may* use authentication information if provided.
     *
     * If context is not authenticated, this function just returns
     * the `portal` property, which informs REST-JS what Sharing API
     * instance to use (i.e. AGO, Enterprise etc)
     */
    get requestOptions(): IRequestOptions;
    /**
     * Return a `IHubRequestOptions` object
     */
    get hubRequestOptions(): IHubRequestOptions;
    /**
     * Return the portal url i.e. https://www.arcgis.com
     *
     * If authenticated @ ArcGIS Online, it will return
     * the https://org.env.arcgis.com
     *
     * If authenticated @ ArcGIS Enterprise, it will return
     * https://{portalHostname}/{webadaptor}
     */
    get portalUrl(): string;
    /**
     * Returns the current user's hub-home url. If not authenticated,
     * returns the Hub Url.
     */
    get hubHomeUrl(): string;
    /**
     * Returns the current user's Hub License
     */
    get hubLicense(): HubLicense;
    /**
     * Returns the current hub service status information
     */
    get serviceStatus(): HubServiceStatus;
    /**
     * Returns the url to the sharing api composed from portalUrl
     * i.e. https://myorg.maps.arcgis.com/sharing/rest
     */
    get sharingApiUrl(): string;
    /**
     * Returns the Hub url, based on the portalUrl
     *
     * For ArcGIS Enterprise this will return `undefined`
     */
    get hubUrl(): string;
    /**
     * Returns boolean indicating if the backing system
     * is ArcGIS Enterprise (formerly ArcGIS Portal) or not
     */
    get isPortal(): boolean;
    /**
     * Returns the discussions API URL
     */
    get discussionsServiceUrl(): string;
    /**
     * Returns the Hub Search API URL
     */
    get hubSearchServiceUrl(): string;
    /**
     * Returns Hub Domain Service URL
     */
    get domainServiceUrl(): string;
    /**
     * Returns Hub OGCAPI Service URL
     */
    get ogcApiUrl(): string;
    /**
     * Returns the Events configuration object from portal/self
     *
     * `{serviceId: '3ef..', publicViewId: 'bc3...'}`
     */
    get eventsConfig(): Record<string, unknown>;
    /**
     * Returns boolean indicating if the current user
     * belongs to an organization that has licensed
     * ArcGIS Hub
     */
    get hubEnabled(): boolean;
    /**
     * Return the Hub Community Org Id, if defined
     */
    get communityOrgId(): string;
    /**
     * If we are in a community org with an associated e-org
     * Return the Hub Enterprise Org Id, if defined
     */
    get enterpriseOrgId(): string;
    /**
     * Returns the Hub Community Org Hostname, if defined
     *
     * i.e. c-org.maps.arcgis.com
     */
    get communityOrgHostname(): string;
    /**
     * Returns the Hub Community Org url
     *
     * i.e. https://c-org.maps.arcgis.com
     */
    get communityOrgUrl(): string;
    /**
     * Returns the hash of helper services from portal self
     */
    get helperServices(): Array<unknown>;
    /**
     * Returns the current user as IUser
     */
    get currentUser(): IUser;
    /**
     * Returns the portal object as IPortal
     */
    get portal(): IPortal;
    /**
     * Returns the portal settings object as IPortalSettings
     */
    get portalSettings(): IPortalSettings;
    /**
     * Return the properties hash that was passed in.
     * Useful for app-specific context such as the active
     * Site for ArcGIS Hub
     */
    get properties(): Record<string, unknown>;
    /**
     * Returns the array of Trusted Org Ids
     */
    get trustedOrgIds(): string[];
    /**
     * Returns the array of Trusted Orgs
     */
    get trustedOrgs(): IHubTrustedOrgsResponse[];
    /**
     * Returns whether the current user's org type is a community org
     */
    get isCommunityOrg(): boolean;
    /**
     * Returns whether the current user is an org admin and not in a custom role.
     */
    get isOrgAdmin(): boolean;
    /**
     * Return the whole array of user resource tokens
     */
    get userResourceTokens(): IUserResourceToken[];
    /**
     * Return the user hub settings.
     * Updates must be done via `contextManager.updateUserHubSettings`
     */
    get userHubSettings(): IUserHubSettings;
    get orgThumbnailUrl(): string;
    /**
     * Return the survey123 url
     */
    get survey123Url(): string;
    /**
     * Return a token for a specific app
     * @param app
     * @returns
     */
    tokenFor(app: UserResourceApp): string;
    /**
     * Re-fetch the current user, including their groups
     * @returns
     */
    refreshUser(): Promise<void>;
    /**
     * Return the user's history
     * @returns
     */
    get history(): IHubHistory;
    /**
     * Return an array of GroupIds, per-environment, that contain
     * Hub Resources (linkable documents etc) that are tagged to appear
     * in different areas of the appliation.
     */
    get resourceGroupIDs(): string[];
    /**
     * Check specific permission for the current user, and optionally an entity
     * @param permission
     * @param entity
     * @returns
     */
    checkPermission(permission: Permission, entity?: HubEntity): IPermissionAccessResponse;
    /**
     * Add an entry to the user's history
     * @param entry
     * @param win
     * @returns
     */
    addToHistory(entry: IHubHistoryEntry): Promise<void>;
    /**
     * Clear the entire history
     * @returns
     */
    clearHistory(): Promise<void>;
    /**
     * Remove a specific entry from the user's history
     * @param entry
     * @returns
     */
    removeFromHistory(entry: IHubHistoryEntry): Promise<void>;
    /**
     * Update the user's hub settings
     *
     * Possible issue here is that we're not updating the contextManager
     * so the contextManager will be out of sync with this instance of
     * ArcGISContext. Unclear if this will be an actual problem.
     * @param settings
     */
    updateUserHubSettings(settings: IUserHubSettings): Promise<void>;
}
