import { Layout } from "@omnia/fx-models"; import { Store } from "@omnia/fx/stores"; import { IPageVersion, Page, PageData, PageId, VersionedPageData, VersionId, VersionReference } from "../models"; export interface ICurrentPageState { /** * Reference to the current page * */ readonly currentPage: Page; /** * Indicates if the current state is for editmode or not * True - In editor * False - Read mode * */ readonly editMode: boolean; /** * The current version of the currentPage * */ readonly currentVersion: IPageVersion; /** * The version data of the current page parent * This relates to currentVersion.pageData.layoutData.parentLayoutPageId and takes into account rules revolving checkout, publish, undocheckout, editmode etc. * if the current version does not have a parentLayoutPageId this version data will be null * */ readonly parentLayout?: IPageVersion; readonly externalParentLayout?: Layout; } export declare class CurrentPageStore extends Store { private pageService; private pagesStore; private securityService; private permissionService; private NavigationStore; private omniaCtx; private subscriptionHandler; private dynamicStateStore; private variationStore; private editMode; private current; private completedMovePageTrackingId; onActivated(): void; private setupPageSecurityTracking; onDisposing(): void; get getters(): { /** * The state of the current page * * */ readonly state: ICurrentPageState; }; /** * Implementation of mutations */ mutations: { /** * Called when the current sate needs to be updated, e.g. a version or page which the current state depend upon changes * */ addOrUpdateCurrentPage: import("@omnia/fx/stores").StoreMutation<(currentPage: ICurrentPageState) => void, (currentPage: ICurrentPageState) => import("@omnia/fx-models").IMessageBusSubscriptionHandler>; }; /** * Implementation of actions * * You can listen for onDispatching, onDispatched and on failure for all actions */ actions: { /** * Changes which page the current page inherites properties from * pageToInheritFrom = null, stop inheriting else the page to inherit from * */ setPropertyInheriteance: import("@omnia/fx/stores").StoreAction void, (result: void, pageToInheritFrom?: PageId, namesOfPropertiesToInherit?: string[]) => void, (failureReason: any, pageToInheritFrom?: PageId, namesOfPropertiesToInherit?: string[]) => void, (pageToInheritFrom?: PageId, namesOfPropertiesToInherit?: Array) => Promise>; /** * * Specifies if editmode is desired or not. * This influences which version of the page is selected, i.e. latest draft,published or checkedout version * * (You can listen for changes on this action) * * */ setEditMode: import("@omnia/fx/stores").StoreAction void, (result: void, editMode: boolean) => void, (failureReason: any, editMode: boolean) => void, (editMode: boolean) => Promise>; /** * This will swap the current page state to match the version specified * This will not take into account any rules regardning version selection based on editmode etc, the specified version is enforced * * This override is valid until a new current page is set using setCurrentPage * * The caller of this is responsible of reseting to current page id (which is returned in the promise) or in another way laod the correct page id using setCurrentPage when the page should no longer be overridden * */ overrideVersionToUse: import("@omnia/fx/stores").StoreAction void, (result: { pageOveridden: PageId; }, versionRef: VersionReference) => void, (failureReason: any, versionRef: VersionReference) => void, (versionRef: VersionReference) => Promise<{ pageOveridden: PageId; }>>; /** * This updates the current page being used. * Any overidden version is removed. * A state is prepared in relation to rules involving editmode,published,draftversion,checkedout version etc * * (You can listen for changes on this action, i.e. new page etc) * * */ setCurrentPage: import("@omnia/fx/stores").StoreAction void, (result: void, pageId: PageId) => void, (failureReason: any, pageId: PageId) => void, (pageId: PageId) => Promise>; /** * CheckOut the current page, when the promise is resolved the * getters.currentVersion will hold the checkedout version * */ checkOutPage: import("@omnia/fx/stores").StoreAction void, (result: { checkedoutVersionId: VersionId; }) => void, (failureReason: any) => void, () => Promise<{ checkedoutVersionId: VersionId; }>>; /** * The current user takes over the currently checkedout version * * (Only allowed if the current version is checked out) * */ takeOverCheckedoutPage: import("@omnia/fx/stores").StoreAction void, (result: void) => void, (failureReason: any) => void, () => Promise>; /** * Undo current checkOut of the current page * * * */ undoCheckout: import("@omnia/fx/stores").StoreAction void, (result: void) => void, (failureReason: any) => void, () => Promise>; /** * Check in if the current version is checked out * */ checkIn: import("@omnia/fx/stores").StoreAction void, (result: { checkedInVersion: VersionId; }) => void, (failureReason: any) => void, () => Promise<{ checkedInVersion: VersionId; }>>; /** * Saves the state of the checkedout version * * (Only checkedout versions can be saved, already existing versions are immutable) * */ saveState: import("@omnia/fx/stores").StoreAction void, (result: void) => void, (failureReason: any) => void, () => Promise>; publish: import("@omnia/fx/stores").StoreAction void, (result: { publishedVersionId: VersionId; }, targetPublishingAppId?: string, withoutNotification?: boolean, sendPreviewEmail?: boolean) => void, (failureReason: any, targetPublishingAppId?: string, withoutNotification?: boolean, sendPreviewEmail?: boolean) => void, (targetPublishingAppId?: string, withoutNotification?: boolean, sendPreviewEmail?: boolean) => Promise<{ publishedVersionId: VersionId; }>>; publishWithoutNavigating: import("@omnia/fx/stores").StoreAction, targetPublishingAppId?: string) => void, (result: { publishedVersionId: VersionId; }, versionPageData: VersionedPageData, targetPublishingAppId?: string) => void, (failureReason: any, versionPageData: VersionedPageData, targetPublishingAppId?: string) => void, (versionPageData: VersionedPageData, targetPublishingAppId?: string) => Promise<{ publishedVersionId: VersionId; }>>; reloadPublishedVersion: import("@omnia/fx/stores").StoreAction void, (result: { publishedVersionId: VersionId; }) => void, (failureReason: any) => void, () => Promise<{ publishedVersionId: VersionId; }>>; ensureMovePageTracking: import("@omnia/fx/stores").StoreAction void, (result: void) => void, (failureReason: any) => void, () => Promise>; }; private onPublishedVersionUpdated; private createCurrentPageState; /** * Temporary solution until we handle this serverside by adding the info in versionrefs to be able to do this using hard caching */ private getInheritedEnterprisepropertiesVersion; private isCurrentVersion; private createVersionRefForVersion; private getPageFromStore; private getPageVersionByRules; private ensureCalculatedProperties; private resetState; private releaseDynamicState; }