import type Basemap from "../Basemap.js";
import type Extent from "../geometry/Extent.js";
import type ElevationLayer from "../layers/ElevationLayer.js";
import type PortalItem from "./PortalItem.js";
import type PortalUser from "./PortalUser.js";
import type PortalGroup from "./PortalGroup.js";
import type PortalQueryResult from "./PortalQueryResult.js";
import type { JSONSupportMixin, JSONSupportMixinProperties } from "../core/JSONSupport.js";
import type { Loadable, LoadableMixinProperties } from "../core/Loadable.js";
import type { AbortOptions } from "../core/promiseUtils.js";
import type { PortalQueryParamsProperties } from "./PortalQueryParams.js";
import type { FetchBasemapsOptions, PortalAuthMode } from "./types.js";
import type { ExtentProperties } from "../geometry/Extent.js";

export interface PortalProperties extends LoadableMixinProperties, JSONSupportMixinProperties, Partial<Pick<Portal, "access" | "allSSL" | "authMode" | "authorizedCrossOriginDomains" | "basemapGalleryGroupQuery" | "basemapGalleryGroupQuery3D" | "bingKey" | "canListApps" | "canListData" | "canListPreProvisionedItems" | "canProvisionDirectPurchase" | "canSearchPublic" | "canShareBingPublic" | "canSharePublic" | "canSignInArcGIS" | "canSignInIDP" | "colorSetsGroupQuery" | "commentsEnabled" | "culture" | "customBaseUrl" | "default3DBasemapQuery" | "defaultBasemap" | "defaultDevBasemap" | "defaultVectorBasemap" | "description" | "devBasemapGalleryGroupQuery" | "eueiEnabled" | "featuredGroups" | "featuredItemsGroupQuery" | "g3dTilesEnabled" | "g3DTilesGalleryGroupQuery" | "galleryTemplatesGroupQuery" | "hasCategorySchema" | "hasClassificationSchema" | "helperServices" | "homePageFeaturedContent" | "homePageFeaturedContentCount" | "httpPort" | "httpsPort" | "id" | "ipCntryCode" | "isPortal" | "isReadOnly" | "layerTemplatesGroupQuery" | "maxTokenExpirationMinutes" | "name" | "portalHostname" | "portalMode" | "portalProperties" | "recycleBinEnabled" | "region" | "rotatorPanels" | "showHomePageDescription" | "sourceJSON" | "supportsHostedServices" | "symbolSetsGroupQuery" | "templatesGroupQuery" | "units" | "url" | "urlKey" | "use3dBasemaps" | "useDefault3dBasemap" | "user" | "useStandardizedQuery" | "useVectorBasemaps" | "vectorBasemapGalleryGroupQuery">> {
  /** Date the organization was created. */
  created?: (Date | number | string) | null;
  /**
   * The default extent to use for the portal. Used in the map viewer.
   * The extent will be in the default basemap's spatial reference.
   */
  defaultExtent?: ExtentProperties | null;
  /** Date the organization was last modified. */
  modified?: (Date | number | string) | null;
}

/**
 * The Portal class is part of the [ArcGIS Enterprise portal](https://enterprise.arcgis.com/en/portal/)
 * that provides a way to build applications that work with content from [ArcGIS Online](https://www.arcgis.com/home/) or
 * an [ArcGIS Enterprise portal](https://enterprise.arcgis.com/en/portal/). [ArcGIS Enterprise](https://enterprise.arcgis.com/en/portal/)
 * is software from Esri that customers can deploy either on-premises or in the cloud.
 * [ArcGIS Online](https://www.arcgis.com/home/) is Esri's Software as a Service offering that
 * represents GIS as a Service and is implemented using the same technology as ArcGIS Enterprise.
 *
 * The Portal API allows application developers to work with users, groups and content hosted
 * within ArcGIS Online or within an ArcGIS Enterprise portal. The API allows developers to build web,
 * mobile, and desktop applications that support sharing and collaboration using web maps.
 * Organizational developers can also use the API to build custom applications for their users.
 *
 * The Portal class provides a view of the portal as seen by the current user, anonymous or logged in.
 * It includes information such as the name, logo, featured items and supported protocols
 * (http vs https) for this portal. If the user is not logged in, this call will return the default
 * view of the portal. If the user is logged in, the view of the portal returned will be
 * specific to the organization that the user belongs to. The default view of the portal is
 * dependent on the culture of the user that is obtained from the users profile.
 *
 * If no [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#url) is set before loading the Portal, the API defaults to that of [esriConfig.portalUrl](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#ConfigWithPortalUrl).
 * There may be scenarios when more than one portal instance are needed. In these circumstances, there are a couple
 * of different options to take into account.
 *
 * 1. Set a new Portal instance within the [PortalItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html)
 * and set the portal's [url](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#url).
 *     ```js
 *     Layer.fromPortalItem({
 *       portalItem: {
 *         id: "e691172598f04ea8881cd2a4adaa45ba",
 *         // autocastable to Portal
 *         portal: {
 *           url: "https://thePortalUrl"
 *         }
 *       }
 *     });
 *     ```
 * 2. Create separate portal instances before passing them into the [PortalItem's portal](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html#portal) property.
 *     ```js
 *     let portalA = new Portal({
 *       url: "https://www.exampleA.com/arcgis" // First instance
 *     });
 *
 *     let portalB = new Portal({
 *       url: "https://www.exampleB.com/arcgis" // Second instance
 *     });
 *
 *     let item = new PortalItem({
 *       id: "e691172598f04ea8881cd2a4adaa45ba",
 *       portal: portalA // This loads the first portal instance set above
 *     });
 *
 *     item.load();
 *     ```
 *
 * The [when()](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#when) method on the Portal instance can be called to execute processes that may only run after the Portal is [loaded](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#loaded).
 *
 * ```js
 * // load the Portal and PortalQueryParams modules
 * const [Portal, PortalQueryParams] = await $arcgis.import([
 *   "@arcgis/core/portal/Portal.js",
 *   "@arcgis/core/portal/PortalQueryParams.js"
 * ]);
 * portal = new Portal();
 * // Setting authMode to immediate signs the user in once loaded
 * portal.authMode = "immediate";
 *
 * // Once portal is loaded, user signed in
 * portal.load().then(function() {
 *   console.log(portal);
 *
 *   // Create query parameters for the portal search
 *   // This object autocasts as new PortalQueryParams()
 *   let queryParams = {
 *     query: "owner:" + portal.user.username,
 *     sortField: "numViews",
 *     sortOrder: "desc",
 *     num: 20
 *   };
 *   // Query the items based on the queryParams created from portal above
 *   portal.queryItems(queryParams).then(createGallery);
 * });
 * ```
 *
 * @since 4.0
 * @see [ArcGIS Organization portals](https://developers.arcgis.com/javascript/latest/arcgis-organization-portals/)
 * @see [Sample - Access ArcGIS Online items using OAuth 2.0](https://developers.arcgis.com/javascript/latest/sample-code/identity-oauth-basic/)
 */
export default class Portal extends PortalSuperclass {
  /**
   * A new `Portal` instance is created the first time this method is called. The URL from
   * [ConfigWithPortalUrl](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#ConfigWithPortalUrl) is automatically used for this instance.
   * This instance is then cached and used for any subsequent calls to this method.
   *
   * @returns The Portal instance.
   */
  static getDefault(): Portal;
  constructor(properties?: PortalProperties);
  /**
   * The access level of the organization. When public, anonymous users can access the
   * organization. When private, access is restricted to only members of the organization.
   */
  accessor access: "public" | "private" | null | undefined;
  /**
   * When `true`, access to the organization's Portal resources must occur over SSL.
   *
   * @default false
   */
  accessor allSSL: boolean;
  /**
   * The authentication mode for handling authentication when the user attempts to
   * access a secure resource.
   *
   * Possible Value | Description
   * ---------------|------------
   * anonymous | An error will be returned when a secure resource is requested.
   * auto | The user will be signed in when a secure resource is requested.
   * immediate | The user will be signed in when the Portal is loaded.
   * no-prompt | Checks for whether the user is already signed in. If so, no additional prompts display for sign-in.
   *
   * @default "auto"
   */
  accessor authMode: PortalAuthMode;
  /**
   * Array of trusted servers to send credentials to when making Cross-Origin Resource Sharing (CORS) requests to access services
   * secured with web-tier authentication.
   */
  accessor authorizedCrossOriginDomains: string[] | null | undefined;
  /**
   * The query that defines the basemaps that should be displayed in the
   * [BasemapGallery](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html) when [useVectorBasemaps](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#useVectorBasemaps) is not true.
   * The [fetchBasemaps()](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#fetchBasemaps) method does this automatically.
   *
   * @since 4.4
   */
  accessor basemapGalleryGroupQuery: string | null | undefined;
  /**
   * The query that defines the 3D basemaps that should be displayed in the
   * [BasemapGallery](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html).
   * The [fetchBasemaps()](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#fetchBasemaps) method does this automatically.
   *
   * @since 4.27
   */
  accessor basemapGalleryGroupQuery3D: string | null | undefined;
  /** The Bing key to use for web maps using Bing Maps. */
  accessor bingKey: string | null | undefined;
  /**
   * Indicates whether an organization can list applications in the marketplace.
   *
   * @default false
   */
  accessor canListApps: boolean;
  /**
   * Indicates whether an organization can list data services in the marketplace.
   *
   * @default false
   */
  accessor canListData: boolean;
  /**
   * Indicates whether an organization can list pre-provisioned items in the marketplace.
   *
   * @default false
   */
  accessor canListPreProvisionedItems: boolean;
  /**
   * Indicates whether an organization can provision direct purchases in the marketplace without customer request.
   *
   * @default false
   */
  accessor canProvisionDirectPurchase: boolean;
  /**
   * When `true`, the organization's public items, groups and users are included in search queries.
   * When `false`, no public items outside of the organization are included. However,
   * public items which are part of the organization are included.
   *
   * @default true
   */
  accessor canSearchPublic: boolean;
  /**
   * The Bing key can be shared to the public and is returned as part of a portal's description call (`/sharing/rest/portals/<orgid>`).
   * This requires the access of the portal to be set to public. The canShareBingPublic property is not returned publicly but only
   * shown to users within the organization.
   *
   * @default false
   */
  accessor canShareBingPublic: boolean;
  /**
   * When `true`, members of the organization can share resources outside the organization.
   *
   * @default false
   */
  accessor canSharePublic: boolean;
  /**
   * Indicates whether to allow an organization with an enterprise IDP configured to be able to turn on or off the ArcGIS sign in.
   *
   * @default false
   */
  accessor canSignInArcGIS: boolean;
  /**
   * Indicates whether to allow an organization with an enterprise IDP configured to be able to turn on or off the enterprise sign in.
   *
   * @default false
   */
  accessor canSignInIDP: boolean;
  /** The query that identifies the group containing the color sets used for rendering in the map viewer. */
  accessor colorSetsGroupQuery: string | null | undefined;
  /**
   * Indicates whether to allow the organization to disable commenting. When commentsEnabled is false, comments are hidden and not
   * removed. numComments are set to zero for all items in the organization. Calls to add a comment and view comments will fail. If the
   * organization re-enables comments, the comments display and numComments are restored.
   *
   * @default false
   */
  accessor commentsEnabled: boolean;
  /** Date the organization was created. */
  get created(): Date | null | undefined;
  set created(value: (Date | number | string) | null | undefined);
  /** The default locale (language and country) information. */
  accessor culture: string | null | undefined;
  /** The custom base URL for the portal. */
  accessor customBaseUrl: string | null | undefined;
  /**
   * The query that defines the default 3d basemap to use in scene views for the portal.
   * The [fetchDefault3DBasemap()](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#fetchDefault3DBasemap) method uses this to return a basemap object.
   *
   * @since 4.31
   */
  accessor default3DBasemapQuery: string | null | undefined;
  /** The default basemap to use for the portal. Used in the map viewer. */
  accessor defaultBasemap: Basemap | null | undefined;
  /**
   * The default developer basemap to use for the portal when an [ConfigWithApiKey](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#ConfigWithApiKey) is defined.
   *
   * @since 4.22
   */
  accessor defaultDevBasemap: Basemap | null | undefined;
  /**
   * The default extent to use for the portal. Used in the map viewer.
   * The extent will be in the default basemap's spatial reference.
   */
  get defaultExtent(): Extent | null | undefined;
  set defaultExtent(value: ExtentProperties | null | undefined);
  /**
   * The default vector basemap to use for the portal. Used in the map viewer.
   *
   * @since 4.4
   */
  accessor defaultVectorBasemap: Basemap | null | undefined;
  /** A description of the organization/portal. */
  accessor description: string | null | undefined;
  /**
   * The query that defines the basemaps that should be displayed in the
   * [BasemapGallery](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html) when an [ConfigWithApiKey](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#ConfigWithApiKey) is defined.
   * The [fetchBasemaps()](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#fetchBasemaps) method does this automatically.
   *
   * @since 4.22
   */
  accessor devBasemapGalleryGroupQuery: string | null | undefined;
  /**
   * Boolean value indicating whether to opt-in to the
   * [Esri User Experience Improvement (EUEI) program](https://doc.arcgis.com/en/arcgis-online/reference/faq.htm#ESRI_QUESTIONANSWER_AED97F28DCD84F7682623C2FA9E5CE49).
   *
   * @since 4.7
   */
  accessor eueiEnabled: boolean | null | undefined;
  /**
   * The featured groups for the portal. Returns an array of objects that provide access to the owner and title for each featured group.
   * Each item in this array has the following specification:
   */
  accessor featuredGroups: Array<FeaturedGroup> | null | undefined;
  /** The query that defines the featured group. If null, then the most viewed items in the organization will be the featured items. */
  accessor featuredItemsGroupQuery: string | null | undefined;
  /**
   * Indicates whether Google 3D Tiles basemaps are enabled on this portal
   *
   * @since 4.34
   */
  accessor g3dTilesEnabled: boolean | null | undefined;
  /**
   * The query defining Google 3D Tiles basemaps displayed in the
   * [BasemapGallery](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html).
   * The [fetchBasemaps()](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#fetchBasemaps) method does this automatically.
   *
   * @since 4.34
   */
  accessor g3DTilesGalleryGroupQuery: string | null | undefined;
  /**
   * The query that identifies the group containing features items for the gallery. Set a Group ID or, if null, then the most viewed
   * items in your organization are displayed in the gallery.
   */
  accessor galleryTemplatesGroupQuery: string | null | undefined;
  /**
   * Indicates whether the organization has content categories.
   *
   * @default false
   * @since 4.8
   */
  accessor hasCategorySchema: boolean;
  /**
   * Indicates whether the organization has classification schema.
   *
   * @default false
   * @since 4.31
   */
  accessor hasClassificationSchema: boolean;
  /**
   * This class contains properties to obtain information for various web services available on the portal.
   * This is useful for determining the URLs for relevant methods from the `portal.helperServices` object.
   * The `url` property of each helper service is the URL to the REST endpoint for that service.
   *
   * It is recommended to use these URLs with their respective `rest` modules instead of the deprecated helper methods.
   * For additional information about helper services,
   * see the [about utility services](https://enterprise.arcgis.com/en/portal/latest/administer/windows/about-utility-services.htm)
   * topic from the ArcGIS Server documentation.
   *
   * @since 4.4
   * @example
   * // create new Portal object with relevant URL
   * const portal = new Portal({
   *   url: "YOUR_PORTAL_URL"
   * });
   *
   * // load Portal instance
   * portal.load().then(function() {
   *   // display all helper services
   *   console.log("Show available helperServices: ", portal.helperServices);
   *   // access helperServices from the Portal instance
   *   // to get the routing URL of interest
   *   const routeURL = portal.helperServices.route.url;
   *   // use helperServices to perform routing
   *   route.solve(routeURL, routeParams).then(showRouteInfo);
   * }
   */
  accessor helperServices: any | null | undefined;
  /** The group that contains featured content to be displayed on the home page. */
  accessor homePageFeaturedContent: string | null | undefined;
  /** The number of featured items that can be displayed on the home page. The max is 100. Accepts integers only. */
  accessor homePageFeaturedContentCount: number | null | undefined;
  /** The port used by the portal for HTTP communication. */
  accessor httpPort: number | null | undefined;
  /** The port used by the portal for HTTPS communication. */
  accessor httpsPort: number | null | undefined;
  /**
   * The id of the organization that owns this portal. If `null` then this is the
   * default portal for anonymous and non-organizational users.
   */
  accessor id: string | null | undefined;
  /** The country code of the calling IP (ArcGIS Online only). */
  accessor ipCntryCode: string | null | undefined;
  /** Indicates whether the portal is an organization. */
  get isOrganization(): boolean;
  /**
   * Indicates if the portal is on-premises.
   *
   * @default false
   */
  accessor isPortal: boolean;
  /**
   * Indicates if the portal is in read-only mode.
   * When `true`, content cannot be created, modified,
   * or deleted on the Portal.
   *
   * @default false
   * @since 4.14
   */
  accessor isReadOnly: boolean;
  /** The query that identifies the group containing editing templates. */
  accessor layerTemplatesGroupQuery: string | null | undefined;
  /**
   * Indicates whether the portal's resources have loaded. When `true`,
   * all the properties of the object can be accessed.
   *
   * @default false
   */
  get loaded(): boolean;
  /**
   * The maximum validity in minutes of tokens issued for users of the organization.
   * -1 is the default and is a special value that indicates infinite timeout or permanent
   * tokens. For tokens granted using OAuth 2.0 authorization grant, it represents the maximum
   * validity of refresh tokens. For access tokens, the maximum validity is the lower of
   * two weeks or this value.
   */
  accessor maxTokenExpirationMinutes: number | null | undefined;
  /** Date the organization was last modified. */
  get modified(): Date | null | undefined;
  set modified(value: (Date | number | string) | null | undefined);
  /** Name of the organization. */
  accessor name: string | null | undefined;
  /** URL of the portal host. */
  accessor portalHostname: string | null | undefined;
  /** The portal mode. */
  accessor portalMode: "multitenant" | "singletenant" | null | undefined;
  /**
   * Properties specific to the organization, for example the "contact us" link. If the
   * organization is public, the properties are visible to the anonymous user.
   */
  accessor portalProperties: any;
  /**
   * Indicates whether the recycle bin is enabled for the organization.
   *
   * @default false
   * @since 4.30
   */
  accessor recycleBinEnabled: boolean;
  /** The region for the organization. */
  accessor region: string | null | undefined;
  /**
   * The REST URL for the portal, for example "https://www.arcgis.com/sharing/rest" for ArcGIS Online
   * and "https://www.example.com/arcgis/sharing/rest" for your in-house portal.
   */
  get restUrl(): string;
  /** Custom HTML for the home page. */
  accessor rotatorPanels: any[] | null | undefined;
  /**
   * Indicates whether the description of your organization displays on the home page.
   *
   * @default false
   */
  accessor showHomePageDescription: boolean;
  /**
   * The JSON used to create the property values when the `Portal` is loaded.
   * Although most commonly used properties are exposed on the `Portal` class directly,
   * this provides access to all information returned by the portal. This property is
   * useful if working in an application built using an older version of the API which
   * requires access to portal properties from a more recent version.
   *
   * @since 4.13
   * @see [ArcGIS REST API - Portal Self](https://developers.arcgis.com/rest/users-groups-and-items/portal-self.htm)
   */
  accessor sourceJSON: any;
  /**
   * Indicates whether hosted services are supported.
   *
   * @default false
   */
  accessor supportsHostedServices: boolean;
  /** The query that defines the symbols sets. */
  accessor symbolSetsGroupQuery: string | null | undefined;
  /**
   * The query that defines the collection of templates that will appear in the template
   * gallery.
   */
  accessor templatesGroupQuery: string | null | undefined;
  /** The URL to the thumbnail of the organization. */
  get thumbnailUrl(): string | null;
  /**
   * Sets the units of measure for the organization's users. The user default is derived
   * from the organization's [region](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#region).
   */
  accessor units: "english" | "metric" | null | undefined;
  /**
   * The URL to the portal instance. Setting the location of the portal instance via
   * [esriConfig.portalUrl](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#ConfigWithPortalUrl)
   * should be used in favor of setting it directly on this property.
   *
   * If using an on-premise portal, the syntax should look similar to:
   * `https://www.example.com/arcgis`
   *
   * Default Value: The default value for this property is the same as the
   * [esriConfig.portalUrl](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#ConfigWithPortalUrl)
   * property value.
   */
  accessor url: string;
  /** The prefix selected by the organization's administrator to be used with the customBaseURL. */
  accessor urlKey: string | null | undefined;
  /**
   * When `false`, 3D basemaps are hidden from the [BasemapGallery](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html), regardless
   * of the type of the view.
   *
   * @default true
   * @since 4.27
   */
  accessor use3dBasemaps: boolean;
  /**
   * When `false`, The default 3d basemap is not used in the SceneViewer.
   *
   * @default false
   * @since 4.31
   */
  accessor useDefault3dBasemap: boolean;
  /** Information representing a registered user of the portal. */
  accessor user: PortalUser | null | undefined;
  /**
   * When `true`, only simple where clauses that are compliant with SQL92 can be used when querying layers and tables.
   * The recommended security setting is true.
   *
   * @default false
   */
  accessor useStandardizedQuery: boolean;
  /**
   * When `true`, the organization has opted in to use the vector tile basemaps,
   * and (a) [vectorBasemapGalleryGroupQuery](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#vectorBasemapGalleryGroupQuery) should
   * be used instead of [basemapGalleryGroupQuery](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#basemapGalleryGroupQuery), while
   * (b) [defaultVectorBasemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#defaultVectorBasemap) should be used instead of [defaultBasemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#defaultBasemap).
   * The [fetchBasemaps()](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#fetchBasemaps) method automatically uses vectorBasemapGalleryGroupQuery.
   *
   * @default false
   * @since 4.4
   */
  accessor useVectorBasemaps: boolean;
  /**
   * The query that defines the vector tiles basemaps that should be displayed in the
   * [BasemapGallery](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html) when [useVectorBasemaps](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#useVectorBasemaps) is true.
   * The [fetchBasemaps()](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#fetchBasemaps) method does this automatically.
   *
   * @since 4.4
   */
  accessor vectorBasemapGalleryGroupQuery: string | null | undefined;
  /**
   * A helper function that returns an array of [ElevationsLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html)
   * derived from the Portal's [Limited Error Raster Compression (LERC) elevation helper service](https://enterprise.arcgis.com/en/portal/latest/administer/windows/about-utility-services.htm).
   *
   * @returns When resolved, returns an array of [ElevationLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html).
   * @since 4.12
   * @see [helperServices](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#helperServices)
   */
  createElevationLayers(): Promise<ElevationLayer[]>;
  /**
   * Fetches the [basemaps](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html) that are displayed in the
   * [BasemapGallery](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapGallery.html). When an [ConfigWithApiKey](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#ConfigWithApiKey) is defined, the basemaps will be based on
   * [devBasemapGalleryGroupQuery](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#devBasemapGalleryGroupQuery).
   * When [useVectorBasemaps](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#useVectorBasemaps) is `true`, the basemaps will be based on
   * [vectorBasemapGalleryGroupQuery](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#vectorBasemapGalleryGroupQuery).  Otherwise, it is based on
   * [basemapGalleryGroupQuery](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#basemapGalleryGroupQuery).
   *
   * @param basemapGalleryGroupQuery - When provided, this argument is used
   *   to fetch basemaps based on input query parameters.
   * @param options - An object with the following properties.
   * @returns Resolves to an array of [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html) objects
   * representing the basemaps used in the Basemap Gallery of the Portal.
   * @example
   * portal.fetchBasemaps("title:\"Cloud Creek Basemaps\" AND owner:jsmith")
   *  .then(function(basemaps){
   *    // do something with the basemaps
   *  });
   */
  fetchBasemaps(basemapGalleryGroupQuery?: string, options?: FetchBasemapsOptions | null | undefined): Promise<Basemap[]>;
  /**
   * If present, fetches the organization's category schema.
   *
   * @param options - An object with the following properties.
   * @returns Resolves to an array of objects containing the following properties:
   *
   * Property | Type | Description
   * ---------|--------|-------------
   * title | string | The title of the category schema.
   * categories | object[] | An array of objects containing a title and an array of categories.
   * @since 4.8
   * @example
   * // Fetches the category schema
   * portal.fetchCategorySchema().then(function(schemas){
   *   schemas.forEach(function(schema){
   *     console.log("schema: ", schema);
   *   });
   * });
   */
  fetchCategorySchema(options?: AbortOptions | null | undefined): Promise<object[]>;
  /**
   * If present, fetches the organization's classification schema.
   *
   * @param options - An object.
   * @returns Resolves to an object with properties listed [here](https://developers.arcgis.com/rest/users-groups-and-items/classification-schema/#json-response-example).
   * @since 4.32
   * @see [hasClassificationSchema](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#hasClassificationSchema)
   * @example
   * // Fetches the classification schema
   * portal.fetchClassificationSchema().then(function(schema){
   *   console.log("schema: ", schema);
   * });
   */
  fetchClassificationSchema(options?: AbortOptions | null | undefined): Promise<object | null | undefined>;
  /**
   * Fetches the default 3d [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html) to use in [SceneView](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html) for this portal.
   *
   * @param options - An object with the following properties.
   * @returns Resolves to a [Basemap](https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html) object.
   * @since 4.31
   */
  fetchDefault3DBasemap(options?: AbortOptions): Promise<Basemap | null | undefined>;
  /**
   * Fetches the featured groups in the Portal.
   *
   * @param options - An object with the following properties.
   * @returns Resolves to an array of
   *   [PortalGroup](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html) objects.
   * @example
   * // fetch featured groups
   * portal.fetchFeaturedGroups().then(function(groups){
   *    groups.forEach(function(group){
   *      group.fetchMembers().then(function(members){
   *        console.log("member", members);
   *      });
   *    });
   * });
   */
  fetchFeaturedGroups(options?: AbortOptions | null | undefined): Promise<PortalGroup[]>;
  /**
   * Fetches and returns the associated regions with the portal instance.
   *
   * @param options - An object with the following properties.
   * @returns Resolves to an array of objects containing the following properties:
   *
   * Property | Type | Description
   * ---------|--------|-------------
   * localizedName | string | The localized name for the region. For example, "Australia".
   * name          | string | The name of the region. For example, "Australia".
   * region        | string | Region name. For example, "AU".
   * @since 4.8
   * @see [ArcGIS REST API Documentation](https://developers.arcgis.com/rest/users-groups-and-items/regions.htm)
   */
  fetchRegions(options?: AbortOptions | null | undefined): Promise<object[]>;
  /**
   * Fetches and returns the portal settings as seen by the current user(s), whether anonymous or signed in. This returns information such as any accessible helper services, allowed redirect URIs, and the configuration for any access notices or information banners.
   *
   * @param options - An object with the following properties.
   * @returns Resolves to an object containing information such as helper services, redirect URIs, and configurations for access notices or information banners.
   * @since 4.23
   * @see [ArcGIS REST API Documentation](https://developers.arcgis.com/rest/users-groups-and-items/organization-settings.htm)
   */
  fetchSettings(options?: AbortOptions | null | undefined): Promise<object>;
  /**
   * Executes a query against the Portal to return an array of
   * [PortalGroup](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html) objects that match the input query.
   *
   * @param queryParams - The input query parameters
   *  defined in [PortalQueryParams](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html).
   * @param options - An object with the following properties.
   * @returns When resolved, resolves to an instance of [PortalQueryResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryResult.html)
   * which contains a `results` array of [PortalGroup](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalGroup.html) objects representing
   * all the groups that match the input query.
   * @see [PortalQueryResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryResult.html)
   */
  queryGroups(queryParams: PortalQueryParamsProperties, options?: AbortOptions | null | undefined): Promise<PortalQueryResult<PortalGroup>>;
  /**
   * Executes a query against the Portal to return an array of [PortalItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html)
   * objects that match the input query.
   *
   * @param queryParams - The input query parameters
   *  defined in [PortalQueryParams](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html).
   * @param options - An object with the following properties.
   * @returns When resolved, resolves to an instance of [PortalQueryResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryResult.html)
   * which contains a `results` array of [PortalItem](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalItem.html) objects representing
   * all the items that match the input query.
   * @see [PortalQueryResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryResult.html)
   * @example
   * // Once portal is loaded, user signed in
   *   portal.load().then(function() {
   *     console.log(portal);
   *
   *     // Create query parameters for the portal search
   *     // This object autocasts as new PortalQueryParams()
   *     let queryParams = {
   *       query: "owner:" + portal.user.username,
   *       sortField: "numViews",
   *       sortOrder: "desc",
   *       num: 20
   *     };
   *
   *     // Query the items based on the queryParams created from portal above
   *     portal.queryItems(queryParams).then(createGallery);
   *   });
   */
  queryItems(queryParams: PortalQueryParamsProperties, options?: AbortOptions | null | undefined): Promise<PortalQueryResult<PortalItem>>;
  /**
   * Executes a query against the Portal to return an array of [PortalUser](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html)
   * objects that match the input query.
   *
   * @param queryParams - The input query parameters
   *  defined in [PortalQueryParams](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html).
   * @param options - An object with the following properties.
   * @returns When resolved, resolves to an instance of [PortalQueryResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryResult.html)
   * which contains a `results` array of [PortalUser](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalUser.html) objects representing
   * all the items that match the input query.
   * @see [PortalQueryResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryResult.html)
   * @example
   * // Once portal is loaded, user signed in
   * portal.load().then(function() {
   *    // queryUsers
   *    // This object autocasts as new PortalQueryParams()
   *    let queryParameters = {
   *      query: "username:" + portal.user.username
   *    };
   *
   *    portal.queryUsers(queryParameters).then(function(queryResults){
   *      queryResults.results[0].fetchFolders().then(function(folders){
   *        folders.forEach(function(folder){
   *          console.log(" user folder", folder.title);
   *        });
   *      });
   *    });
   * });
   */
  queryUsers(queryParams: PortalQueryParamsProperties, options?: AbortOptions | null | undefined): Promise<PortalQueryResult<PortalUser>>;
}
declare const PortalSuperclass: typeof Loadable & typeof JSONSupportMixin

export interface FeaturedGroup {
  /** Name of the group owner. */
  owner: string;
  /** Group title. */
  title: string;
}