import type { IGroup, IItem, IPortal, ISearchResult, IUser } from "@esri/arcgis-rest-portal";
import type { ArcGISIdentityManager, IGeometry, IPolygon, IRequestOptions, ISpatialReference } from "@esri/arcgis-rest-request";
import { FileExtension } from "./enums/fileExtension";
import { ItemType } from "./enums/itemType";
/**
 * App keys for User Resources used in Hub
 */
export type UserResourceApp = "self" | "hubforarcgis" | "arcgisonline";
/**
 * Generic Model, used with all items that have a json
 * `/data` payload
 *
 * @export
 * @interface IModel
 */
export interface IModel {
    item: IItem;
    data?: {
        [propName: string]: any;
    };
    resources?: {
        [propName: string]: any;
    };
    [key: string]: any;
}
export interface IDraft {
    item: Partial<IItem>;
    data: any;
}
/**
 * Defined the Initiative Item as having
 * `type: "Hub Initiative"`
 *
 * @export
 * @interface IInitiativeItem
 * @extends {IItemAdd}
 */
export interface IInitiativeItem extends IItem {
    id: string;
    type: "Hub Initiative";
}
/**
 * Initiative Model
 *
 * @export
 * @interface IInitiativeModel
 * @extends {IModel}
 */
export interface IInitiativeModel extends IModel {
    item: IInitiativeItem;
    data?: {
        [propName: string]: any;
    };
}
export interface IInitiativeModelTemplate {
    item: Partial<IInitiativeItem>;
    data: {
        [propName: string]: any;
    };
}
export type IItemTemplate = Record<string, any>;
export interface ITemplateAsset {
    mimeType?: "image/png" | "image/jpg" | "image/jpeg";
    name: string;
    url?: string;
    type?: string;
}
export interface IModelTemplate {
    itemId: string;
    item: IItemTemplate;
    data: {
        [propName: string]: any;
    };
    properties?: {
        [propName: string]: any;
    };
    type: string;
    key: string;
    dependencies?: any[];
    resources?: string[];
    assets?: ITemplateAsset[];
    [propName: string]: any;
}
export interface ISolutionTemplate extends IModel {
    data: {
        templates: IModelTemplate[];
    };
}
export type GenericAsyncFunc = (...args: any) => Promise<any>;
/**
 * @internal
 * This just adds user to the IPortal interface
 */
export interface IHubRequestOptionsPortalSelf extends IPortal {
    user?: IUser;
}
export interface IHubRequestOptions extends IRequestOptions {
    authentication?: ArcGISIdentityManager;
    isPortal?: boolean;
    hubApiUrl?: string;
    portalSelf?: IHubRequestOptionsPortalSelf;
    /**
     * The implementation of `fetch` to use. Defaults to a global `fetch`.
     */
    fetch?: (input: RequestInfo, init?: RequestInit) => Promise<Response>;
    /**
     * This is for server-side usage only, not for front-end use.
     */
    hubApiKey?: string;
}
/**
 * Options for requests that require an authenticated user.
 */
export interface IHubUserRequestOptions extends IHubRequestOptions {
    authentication: ArcGISIdentityManager;
}
export interface IHubTrustedOrgsResponse {
    from: IHubTrustedOrgsRelationship;
    to: IHubTrustedOrgsRelationship;
}
export interface IHubTrustedOrgsRelationship {
    orgId: string;
    usersAccess: boolean;
    established: number;
    name?: string;
    hub: boolean;
    state: string;
    [propName: string]: any;
}
export interface IItemResource {
    type?: string;
    url: string;
    name: string;
}
export type BBox = number[][];
export type IBatch = any[];
export type IBatchTransform = (value: any) => any;
export interface IGetSurveyModelsResponse {
    form: IModel;
    featureService: IModel;
    fieldworker: IModel;
    stakeholder: IModel;
}
export interface IGetGroupSharingDetailsResults {
    group: IGroup;
    modelsToShare: IModel[];
}
export interface IRevertableTaskSuccess {
    status: "fullfilled";
    revert: (...args: any[]) => Promise<any>;
    results: any;
}
export interface IRevertableTaskFailed {
    status: "rejected";
    error: Error;
}
export type IRevertableTaskResult = IRevertableTaskSuccess | IRevertableTaskFailed;
/**
 * All Hub families
 */
export declare const HubFamilies: readonly ["app", "content", "dataset", "document", "event", "feedback", "initiative", "map", "people", "site", "team", "template", "project", "channel", "discussion", "eventAttendee", "organization", "post"];
/**
 * All Hub families
 */
export type HubFamily = (typeof HubFamilies)[number];
/**
 * Visibility levels of a Hub resource
 */
export type Visibility = "private" | "org" | "public";
/**
 * User"s access level to a Hub resource
 */
export type AccessControl = "view" | "edit" | "admin";
export type GeographyProvenance = "item" | "none" | "automatic";
/**
 * properties to be used with the ArcGIS API geometry class constructors
 */
export interface IGeometryProperties extends IGeometry {
    type: string;
}
export interface IPolygonProperties extends IPolygon, IGeometryProperties {
    type: "polygon";
}
/**
 * Location of a Hub resource
 *
 * @export
 * @interface IHubGeography
 */
export interface IHubGeography {
    center?: [number, number];
    geometry?: IPolygonProperties;
    provenance?: GeographyProvenance;
    spatialReference?: ISpatialReference;
}
export type SearchableType = IItem | IGroup | IUser;
export type SearchFunction = (...args: any[]) => Promise<ISearchResult<SearchableType>>;
/**
 * Information about an error that occurred while indexing or composing content
 */
export interface IEnrichmentErrorInfo {
    type: "HTTP" | "AGO" | "Other";
    statusCode?: number;
    message?: string;
}
export interface IActionLink {
    /** Link title */
    title: string;
    /** Link URL */
    url: string;
}
/**
 * IOperation
 * Represents some operation within the system.
 *
 * Used as a means to track the calls, inputs and outputs
 * during complex processes
 *
 * @export
 * @interface IOperation
 */
export interface IOperation {
    /**
     * Unique identifier:
     * i.e `getItem-3fc`, `convertToTemplate-bc7`
     */
    id: string;
    /**
     * What type of operation is this
     * i.e. getItem, convertToTemplate
     */
    type: string;
    /**
     * Inputs to the operation
     */
    inputs: Record<string, unknown>;
    state?: string;
    startedAt?: number;
    duration?: number;
    output?: Record<string, unknown>;
}
/**
 * Serialized Operation Stack
 *
 * @export
 * @interface SerializedOperationStack
 */
export interface ISerializedOperationStack {
    operations: IOperation[];
}
/**
 * IUpdateSiteOptions
 *
 * Options for site updates
 *
 * @export
 * @interface UpdateSiteOptions
 */
export interface IUpdateSiteOptions extends IUpdatePageOptions {
    updateVersions?: boolean;
}
/**
 * IUpdatePageOptions
 *
 * Options for page updates
 *
 * @export
 * @interface UpdatePageOptions
 */
export interface IUpdatePageOptions extends IHubUserRequestOptions {
    allowList?: string[];
}
export interface IDomainEntry {
    clientKey?: string;
    createdAt?: string;
    hostname: string;
    id: string;
    orgId: string;
    orgKey: string;
    orgTitle: string;
    permanentRedirect: boolean;
    siteId: string;
    siteTitle: string;
    sslOnly: boolean;
    updatedAt?: string;
}
export interface IHubTeam extends IGroup {
    properties: {
        [key: string]: any;
    };
}
/**
 * BEGIN CONTENT UPLOAD RELATED TYPES
 * Please note that the below enum/types are duplicated from the AGO
 * content upload modal. They were brought over for forward compability purposes and changes
 * to them may impact how our content upload works.
 */
/**
 * File type to extension interface
 */
export interface IFileType {
    type: ItemType;
    typeKeywords: string[];
    fileExt?: FileExtension[];
}
/**
 * Array of ItemTypes and/or array of extensions. Primarily used for the create new content flow
 */
export interface IAllowedFileTypes {
    types?: ItemType[];
    extensions?: FileExtension[];
}
/**
 * Maps human readable file names to extensions IE Image === jpg, png, etc
 */
export declare const addCreateItemTypes: Record<string, IFileType>;
/**
 * END CONTENT UPLOAD TYPES/ENUMS
 */
