import { Catalog } from "../search/Catalog"; import type { IArcGISContext } from "../types/IArcGISContext"; import { HubItemEntity } from "../core/HubItemEntity"; import { IEditorConfig } from "../core/schemas/types"; import { IWithEditorBehavior } from "../core/behaviors/IWithEditorBehavior"; import { IWithMetricsBehavior } from "../core/behaviors/IWithMetricsBehavior"; import { IConvertToCardModelOpts, IHubCardViewModel } from "../core/types/IHubCardViewModel"; import { ProjectEditorType } from "./_internal/projectEditorTypes"; import { IResolvedMetric } from "../core/types/Metrics"; import { IWithCardBehavior } from "../core/behaviors/IWithCardBehavior"; import { IWithCatalogBehavior } from "../core/behaviors/IWithCatalogBehavior"; import { IWithSharingBehavior } from "../core/behaviors/IWithSharingBehavior"; import { IWithStoreBehavior } from "../core/behaviors/IWithStoreBehavior"; import { IEntityEditorContext } from "../core/types/HubEntityEditor"; import { IHubProject, IHubProjectEditor } from "../core/types/IHubProject"; /** * Hub Project Class */ export declare class HubProject extends HubItemEntity implements IWithStoreBehavior, IWithCatalogBehavior, IWithMetricsBehavior, IWithSharingBehavior, IWithCardBehavior, IWithEditorBehavior { private _catalog; /** * Private constructor so we don't have `new` all over the place. Allows for * more flexibility in how we create the HubProjectManager over time. * @param context */ private constructor(); /** * Catalog instance for this project. Note: Do not hold direct references to this object; always access it from the project. * @returns */ get catalog(): Catalog; /** * Create an instance from an IHubProject object * @param json - JSON object to create a HubProject from * @param context - ArcGIS context * @returns */ static fromJson(json: Partial, context: IArcGISContext): HubProject; /** * Create a new HubProject, returning a HubProject instance. * Note: This does not persist the Project into the backing store * @param partialProject * @param context * @returns */ static create(partialProject: Partial, context: IArcGISContext, save?: boolean): Promise; /** * Fetch a Project from the backing store and return a HubProject instance. * @param identifier - Identifier of the project to load * @param context * @returns */ static fetch(identifier: string, context: IArcGISContext): Promise; /** * Given a partial project, apply defaults to it to ensure that a baseline of properties are set * @param partialProject * @param context * @returns */ private static applyDefaults; /** * Convert the project entity into a card view model that can * be consumed by the suite of hub gallery components * * @param opts view model options */ convertToCardModel(opts?: IConvertToCardModelOpts): IHubCardViewModel; getEditorConfig(i18nScope: string, type: ProjectEditorType): Promise; /** * Return the project as an editor object * @param editorContext * @returns */ toEditor(editorContext?: IEntityEditorContext, include?: string[]): Promise; /** * Convert editor values back into a HubProject entity, * performing any necessary pre-save operations/transforms. * @param editor - the editor object to convert * @param _editorContext - optional editor context */ fromEditor(editor: IHubProjectEditor, _editorContext?: IEntityEditorContext): Promise; /** * Apply a new state to the instance * @param changes */ update(changes: Partial): void; /** * Save the HubProject to the backing store. Currently Projects are stored as Items in Portal * @returns */ save(): Promise; /** * Delete the HubProject from the store * set a flag to indicate that it is destroyed * @returns */ delete(): Promise; /** * Resolve a single metric for this metric * @param metricId * @returns */ resolveMetric(metricId: string): Promise; }