import FlowContainer from './flow-container'; import type { TransientContainerInfo, TransientContainerInfoForUpdate, NonEmptyString, ContainerInfo } from './types'; export declare const CONTAINER_TYPES: { SINGLE: string; MULTIPLE: string; }; export declare const CONTAINER_NAMES: { PRIMARY: string; WORKAREA: string; MODAL: string; PREVIEW: string; }; /** * this function returns the container data for the given container name * @function getContainerData * @param target -- target container * @returns - State Object for the given container * @static * * @example Example for getContainerData. * PCore.getContainerUtils().getContainerData('app/primary'); * example for getting containers info under app/primary target */ export declare const getContainerData: (target: string | null) => any; /** * this function returns the container data for the given container name * @private * @function getContainerItemData * @param target -- target container * @param containerItem -- target container item * @returns - State Object for the given container item * @static * * @example Example for getContainerItemData. * PCore.getContainerUtils().getContainerItemData('app/primary', 'app/primary_1'); * example for getting container item app/primary_1 data under app/primary target */ export declare const getContainerItemData: (target: string | null | undefined, containerItem: string | null) => any; /** * this function returns the container items data for the given target * @function getContainerItems * @param target -- target container * @returns - container items data for the given target * @static * * @example Example for getContainerItems. * PCore.getContainerUtils().getContainerItems('app/primary'); * example for getting container items info under app/primary target */ export declare const getContainerItems: (target: string) => object | null; /** * this function returns the container accessOrder data for the given target * @function getContainerAccessOrder * @param target -- target container * @returns returns -- container accessOrder data for the given target * @static * * @example Example for getContainerAccessOrder. * PCore.getContainerUtils().getContainerAccessOrder('app/primary'); * example for getting container accessOrder info under app/primary target */ export declare const getContainerAccessOrder: (target: string) => any[]; /** * this function returns the container items present or not for the given target * @function areContainerItemsPresent * @param target -- target container * @returns - container items present or not for the given target * @static * * @example Example for areContainerItemsPresent. * PCore.getContainerUtils().areContainerItemsPresent('app/primary'); * example for are container items present under app/primary target */ export declare const areContainerItemsPresent: (target: string) => boolean; /** * this function determines whether a containeritem present with given key in a target container. * @function isContainerItemExists * @param target -- target container e.g. app/primary * @param key -- unique key name e.g app/view/1 * @param callback A function to execute on unique key in each containerItem until the function returns true, * indicating that the satisfying containerItem was found. if callback is undefined, we use strict comparison for key match. * @returns returns -- true if containeritem already exists in store OR * -- false if no containeritem found with param information * @static * * @example Example for isContainerItemExists. * PCore.getContainerUtils().isContainerItemExists('app/primary', 'R-1234'); * example for getting to know whether 'R-1234' Work Item under 'app/primary' target exists or not */ export declare const isContainerItemExists: (target: string | null, key: string, callback?: Function) => boolean; /** * this function returns containeritem name if unique key is present in containers data. * @function getContainerItemName * @param target -- target container e.g. app/primary * @param key -- key name e.g. app/view/1 * @param callback -- A function to execute on unique key in each containerItem until the function returns true, * indicating that the satisfying containerItem was found. if callback is undefined, we use strict comparison for key match. * @returns - item name if container already exists in store OR * - null if no container found with param information * @static * * @example Example for getContainerItemName. * PCore.getContainerUtils().getContainerItemName('app/primary', 'R-1234'); * example for getting container item name for 'R-1234' Work Item under 'app/primary' target. */ export declare const getContainerItemName: (target: string | null, key: string | undefined, callback?: Function) => string | null; /** * @private * @function getContainerItemByKey * this function returns containeritem name if unique key is present in containers data * @param key - key name eg: 'R-1234' * @returns - item if container already exists in store OR * - null if no container found with param information * @example Example for getContainerItemByKey. * PCore.getContainerUtils().getContainerItemByKey('R-1234'); */ export declare const getContainerItemByKey: (key: string | undefined) => ContainerInfo | null; /** * this function gives whether container is initialized in corresponding context * @function isContainerInitialized * @param context -- context of the container e.g. app/primary_1 * @param name -- container name e.g. workarea * @returns - is container initialized * @static * * @example Example for isContainerInitialized. * PCore.getContainerUtils().isContainerInitialized('app', 'primary'); * example for getting to know whether container initialized or not for provided information */ export declare const isContainerInitialized: (context: string, name: string) => boolean | undefined; /** * this function gives the container type * @function getContainerType * @param context -- context of the container e.g. app/primary_1 * @param name -- container name e.g. workarea * @returns returns -- container type e.g single or multiple * @static * * @example Example for getContainerType. * PCore.getContainerUtils().getContainerType('app', 'primary'); * example for getting container type for provided information */ export declare const getContainerType: (context: string, name: string) => null | string; /** * this functions gives active containeritem under provided target container * @function getActiveContainerItemName * @param target -- target container e.g. app/primary * @returns - container name e.g. app/primary_4 * @static * * @example Example for getActiveContainerItemName. * PCore.getContainerUtils().getActiveContainerItemName('app/primary_1/workarea'); * example for getting Active Container ItemName under 'app/primary_1/workarea' target. * * @example Example for getActiveContainerItemName. * PCore.getContainerUtils().getActiveContainerItemName('app/primary'); * example for getting Active Container ItemName under 'app/primary' target. */ export declare const getActiveContainerItemName: (target: string | null) => null | string; /** * this functions helps to determine if containeritem is active or not with given inputs * @function isContainerItemActive * @param target -- target container e.g. app/primary * @param key -- unique key of the containeritem e.g app/view/1 * @param callback - A function to execute on unique key in each containerItem until the function returns true, * indicating that the satisfying containerItem was found. if callback is undefined, we use strict comparison for key match. * @returns - 1) true if passed in containerItemName is active * - 2) false if passed in containerItemName is not active * @static * * @example Example for isContainerItemActive with comparator function. * PCore.getContainerUtils().isContainerItemActive('app/primary', 'R-1234', (key, semanticURL) => { }); * example for checking 'R-1234' Work Item is active or not under 'app/primary' target. * * * @example Example for isContainerItemActive without comparator function. * PCore.getContainerUtils().isContainerItemActive('app/primary', 'W-67'); * example for checking 'W-67' Work Item is active or not under 'app/primary' target. * */ export declare const isContainerItemActive: (target: string, key: string, callback: Function) => boolean; /** * this functions gives data context name for provided containeritem * @function getDataContextName * @param containerItemName -- containerItem name e.g. app/primary_4 * @returns - 1) data context if passed in containerItem is present in any of the containers * - 2) null if no data found * @static * * @example Example for getDataContextName. * PCore.getContainerUtils().getDataContextName('app/primary_3'); * example is for returning data context name for container item name --> 'app/primary_3' * * @example Example for getDataContextName. * PCore.getContainerUtils().getDataContextName('app/primary_2/workarea_1'); * example is for returning data context name for container item name --> 'app/primary_2/workarea_1' */ export declare const getDataContextName: (containerItemName: string | null) => string | null; /** * this functions gives active container context under provided target container * @function getActiveContainerItemContext * @param target -- target container e.g. app/primary * @returns - container context e.g. app/primary_4 * @static * * @example Example for getActiveContainerItemContext. * PCore.getContainerUtils().getActiveContainerItemContext('app/primary_1/workarea'); * example for getting Active Container Item Context under 'app/primary_1/workarea' target. * * @example Example for getActiveContainerItemContext. * PCore.getContainerUtils().getActiveContainerItemContext('app/primary'); * example for getting Active Container Item Context under 'app/primary' target. */ export declare const getActiveContainerItemContext: (target: string | null) => string | null; /** * This functions returns child containeritems for given parent containeritem * @function getChildContainerItems * @param containerItemName -- containeritem name e.g. app/primary_4 * @returns e.g. array of child container item names['app/primary_4/workarea_1', 'app/primary_4/workarea_3'] * @static * * @example Example for getChildContainerItems. * PCore.getContainerUtils().getChildContainerItems('app/primary_3'); * example is for returning child containeritems present under 'app/primary_3' (parent containeritem name) * * @example Example for getChildContainerItems. * PCore.getContainerUtils().getChildContainerItems('app/secondary_2'); * example is for returning child containeritems present under 'app/secondary_2' (parent containeritem name) */ export declare const getChildContainerItems: (containerItemName: string) => string[]; /** * This functions returns child containers for given parent container name * @function getChildContainers * @param containerItemName -- containeritem name e.g. app/primary_1 * @returns e.g. array of child container names['app/primary_1/workarea'] * @private * * @example Example for getChildContainers. * PCore.getContainerUtils().getChildContainers('app/primary_1'); * example is for returning child containers present under 'app/primary_1' (parent containeritem name)e * * @example Example for getChildContainers. * PCore.getContainerUtils().getChildContainers('app/primary_2'); * example is for returning child containers present under 'app/primary_2' (parent containeritem name) */ export declare const getChildContainers: (containerItemName: string) => string[]; /** * This functions returns child containers for given parent container name * @function getChildContainersContexts * @param parentContainerItemID -- containeritem name e.g. app/primary_1 * @returns e.g. array of child container names['app/primary_1/workarea'] * @private * * @example Example for getChildContainersContexts. * PCore.getContainerUtils().getChildContainers('app/primary_1'); * example is for returning child containers present under 'app/primary_1' (parent containeritem name)e * * @example Example for getChildContainersContexts. * PCore.getContainerUtils().getChildContainers('app/primary_2'); * example is for returning child containers present under 'app/primary_2' (parent containeritem name) */ export declare const getChildContainersContexts: (parentContainerItemID: string) => (string | null)[]; /** * This functions returns suggestion contexts related to containerItemID * @function getSuggestionContexts * @param containerItemID parent containerItemID e.g. app/primary_1 * @returns array of related suggestion context name e.g. ['app/primary_1/suggestion,app/primary_1/workarea_1/suggestion'] * @private * * @example Example for getSuggestionContexts. * PCore.getContainerUtils().getSuggestionContexts('app/primary_1'); * example is for returning related suggestion context present for 'app/primary_1' (parent containeritemId) */ export declare const getSuggestionContexts: (containerItemID: string) => string[]; /** * This function determines whether container is single mode or not * @function isContainerSingleMode * @param target -- target container e.g. app/primary * @returns - 1) true if passed container type is single * - 2) false if passed container type is other * @private * * @example Example for isContainerSingleMode. * PCore.getContainerUtils().isContainerSingleMode('app/primary'); * example for getting to know whether container is single mode * * @example Example for isContainerSingleMode. * PCore.getContainerUtils().isContainerSingleMode('app/primary_1/workarea'); * example for getting to know whether container is single mode */ export declare const isContainerSingleMode: (target: string | null) => boolean | null; /** * This function determines whether container is multiple mode or not * @function isContainerMultipleMode * @param target -- target container e.g. app/primary * @returns - 1) true if passed container type is multiple * - 2) false if passed container type is other * @private * * @example Example for isContainerMultipleMode. * PCore.getContainerUtils().isContainerMultipleMode('app/primary'); * example for getting to know whether container is multiple mode * * @example Example for isContainerMultipleMode. * PCore.getContainerUtils().isContainerMultipleMode('app/primary_1/workarea'); * example for getting to know whether container is multiple mode */ export declare const isContainerMultipleMode: (target: string | null) => boolean | null; /** * This function determines whether container have items or not * @function hasContainerItems * @param target -- target container e.g. app/primary * @returns - 1) true if passed container has items * - 2) false if passed in container has no items * @private * * @example Example for hasContainerItems. * PCore.getContainerUtils().hasContainerItems('app/primary'); * example for getting to know whether container has items for provided information * * @example Example for hasContainerItems. * PCore.getContainerUtils().hasContainerItems('app/primary_1/workarea'); * example for getting to know whether container has items for provided information */ export declare const hasContainerItems: (target: string | null) => boolean; /** * This function provides container limit information. * @function getContainerLimit * @param target -- target container e.g. app/primary * @returns - container limit value * @private * * @example Example for getContainerLimit. * PCore.getContainerUtils().getContainerLimit('app/primary'); * example to know container limit for `app/primary` */ export declare const getContainerLimit: (target: string) => number; /** * This function helps to set container limit for target. * @function setContainerLimit * @param target -- target container e.g. app/primary * @param limitNumber -- limit value e.g. 8, 16, 32 etc.. * -- if not limitNumber passed, default limit value 16 will be set. * @private * * @example Example for setContainerLimit. * PCore.getContainerUtils().setContainerLimit('app/primary', 8); * example to set container limit for `app/primary` as 8 */ export declare const setContainerLimit: (target: string, limitNumber?: number) => void; /** * This function helps to know whether container limit has been reached or not. * @function isContainerLimitReached * @param target container e.g. app/primary * @returns - 1) true - if container limit reaches * - 2) false - if container limit not reached. * @private * * @example Example for isContainerLimitReached. * PCore.getContainerUtils().isContainerLimitReached('app/primary'); * example to know container limit for `app/primary` */ export declare const isContainerLimitReached: (target: string | null) => boolean; /** * This function helps to give payload for resetContainers. * @function resetContainersPayload * @param containerInfo -- target container e.g. app/primary * @returns - contains context, Array of container items, container name * * @private * * @example Example for resetContainersPayload. * PCore.getContainerUtils().resetContainersPayload({ "context": "app", "name": "preview"}); */ export declare const resetContainersPayload: (containerInfo: { [key: string]: any; }) => { context: NonEmptyString; name: NonEmptyString; containerItems: any[]; childContainers: string[]; } | null; /** * This function checks whether container content is changed or not * i.e. state is dirty or not * @function isContainerDirty * @param containerItemID -- container id e.g. app/primary_1 * @returns - returns true if container is dirty else false * * @example Example for isContainerDirty. * PCore.getContainerUtils().isContainerDirty("app/primary_1"); */ export declare const isContainerDirty: (containerItemID: string) => boolean; /** * This function helps to know whether container limit has been reached or not. * @function getLeastRecentlyUsedNonDirtyContainerItemID * @param target -- target container e.g. app/primary * @returns - 1) containerItemID (string type) - if LRU + ND container item found. * - 2) undefined - if no container item found with non dirty status. * @private * * @example Example for getLeastRecentlyUsedNonDirtyContainerItemID. * PCore.getContainerUtils().getLeastRecentlyUsedNonDirtyContainerItemID('app/primary'); * example to know least used not dirty container item inside `app/primary` */ export declare const getLeastRecentlyUsedNonDirtyContainerItemID: (target: string | null) => string | null; /** * This function helps to get the target of the given containerItemID. * @function getTargetFromContainerItemID * @param containerItemID -- target container e.g. app/primary * @returns - return the target of the containerItem * @private * * @example Example for getTargetFromContainerItemID. * PCore.getContainerUtils().getTargetFromContainerItemID('app/primary/workarea_1'); * example to get the target ('app/primary/workarea') of the containerItemID 'app/primary/workarea_1' */ export declare const getTargetFromContainerItemID: (containerItemID: string | null) => string | null; /** * This function used to close the container item * @function closeContainerItem * @param containerItemID -- container item which need to be closed * @param options options contains additional info like skipDirtyCheck to * @returns this returns promise * skip confirm dialog if container item is dirty * @example Example for closeContainerItem. * In the below example container item with id - "app/primary_4" will be closed * PCore.getContainerUtils().closeContainerItem("app/primary_4"); * * // pass skipDirtyCheck: true in options to prevent confirm dialog * PCore.getContainerUtils().closeContainerItem("app/primary_4",{skipDirtyCheck:true}); * */ export declare const closeContainerItem: (containerItemID: string, options?: { skipDirtyCheck?: boolean; }) => Promise; /** * Adds container item in root context * @example Example for addRootContainerItem * PCore.getContainerUtils().addRootContainerItem(root, containerName, appData, isPortal) * @param viewConfig - view metadata of the root view in UI resources * @param containerName - name of the container item * @param appData - app data in case of portal scenario * @param isPortal - boolean value portal or non-portal * @private */ export declare const addRootContainerItem: (viewConfig: object, containerName: string, appData: object, isPortal: boolean) => void; /** * this function helps to identify whether context refering by current containerItemID is being used by another container in redux store * @private * @param containerItemID - qualified container Item ID e.g. app/primary_1 * @returns - returns true if container item context is being used else false */ export declare const isContainerItemContextBeingUsedInOtherContainers: (containerItemID: string) => boolean; /** * This function returns the transient items present under * the container such as app/primary_1/workarea * @private * @param containerItemsID target container e.g. [app/primary_1/workarea_1] * @returns array of transient items for target container */ export declare const getTransientItems: (containerItemsID: string | string[]) => any[]; /** * Updates the values of the specified fields within a transient item. * @function updateTransientData * @param transientObject - JSON object containing information about transient item and the fields to be Updated. * @example updateTransientData() * Below api will update the transient data of item with transientItemID 'uniqueIdentifier' with data object passed without * resetting the other fields as reset is false in option. * ``` * const containerUtils = PCore.getContainerUtils(); * containerUtils.updateTransientData({ * transientItemID: 'uniqueIdentifier', * data: { * "Prop1": "valueA", * "Prop2": "valueB" * }, * options: { * "reset": false * } * }); * ``` */ export declare const updateTransientData: (transientObject: TransientContainerInfoForUpdate) => void; /** * Replaces the values of the specified fields and deletes the unspecified fields within a transient item. * @function replaceTransientData * @param transientObject - JSON object containing information about transient item and the fields to be replaced. * @example replaceTransientData() * Below api will replace the values of Prop1 and Prop2 and deletes Prop3 in the searchCriteria transient item. * ``` * const containerUtils = PCore.getContainerUtils(); * containerUtils.replaceTransientData({ * transientItemID: 'searchCriteria', * data: { * "Prop1": "valueA", * "Prop2": "valueB" * } * }); * ``` * Before api call * { * "Prop1": "Test1", * "Prop2": "Test2", * "Prop3": "Test3" * } * After api call : * { * "Prop1": "valueA", * "Prop2": "valueB" * } */ export declare const replaceTransientData: (transientObject: TransientContainerInfo) => void; /** * Deletes the data stored in a transient item. * @function clearTransientData * @param transientItemID The ID of the transient item containing the data to be deleted. * @example Example for clearTransientData * // consider transient item value is * // {Name: 'James Bond', department: {id: '007', type: 'agent'}}; * PCore.getContainerUtils().clearTransientData('app/primary_1/workarea_1/transientItem_1'); * // after calling clearTransientData, transient item data will be * // {Name: '', department: {id: '', type: ''}} */ export declare const clearTransientData: (transientItemID: string) => void; /** * Deletes the keys and data stored in a transient item. * @function purgeTransientData * @param transientItemID The ID of the transient item containing the keys and data to be deleted. * @example Example for purgeTransientData * // consider transient item value is * // {Name: 'James Bond', department: {id: '007', type: 'agent'}}; * PCore.getContainerUtils().purgeTransientData('app/primary_1/workarea_1/transientItem_1'); * // after calling purgeTransientData, transient item data will be * // empty object {} */ export declare const purgeTransientData: (transientItemID: string) => void; /** * * Provides APIs to set, get, and container names * This class is independent of the context */ declare class ContainerItems { static items: string[]; /** * adds container items array * @private * @param items - items */ static addContainerItems(items: string[]): void; /** * returns container-items array * @private */ static getContainerItems(): string[]; /** * deletes container item * @private * @param containerName - container name to be deleted */ static deleteContainerItem(containerName: string): void; } /** * exposes Class which contains apis to set, get, and container names * @private * @returns - ContainerItems instance */ export declare const getContainerAPI: () => typeof ContainerItems; /** * Remove container from store * @private * @param containerName - name of the container */ export declare const removeContainer: (containerName: string) => void; /** * This function updates the etag in child containers * @function updateRelatedContextEtag * @private * @param containerItemName -- containeritem name e.g. app/primary_4 * @param etag -- latest etag * @example Example for updateRelatedContextEtag. * PCore.getContainerUtils().updateRelatedContextEtag("app/primary_4","'20211129T130156.399 GMT'") * after calling this etag is updated in the child containers (app/primary_4/workarea_1) */ export declare const updateRelatedContextEtag: (containerItemName: string, etag: string) => void; /** * This function updates the etag in case context * @function updateCaseContextEtag * @private * @param containerItemName -- containeritem name e.g. app/primary_4 * @param etag -- latest etag * @example Example for updateCaseContextEtag. * PCore.getContainerUtils().updateCaseContextEtag("app/primary_4","'20211129T130156.399 GMT'") * after calling this etag is updated in the case context (app/primary_4) */ export declare const updateCaseContextEtag: (containerName: string, etag: string) => void; /** * This function returns the root container name * @private * @returns - Containername -(1) if portal is loaded,app * --------------------------(2) If portal is not loaded, root */ export declare const getRootContainerName: () => "app" | "root"; /** * Obtains an entry point to the {@link ActiveContext|ActiveContext} object that contains APIs that act on the active context for the currently opened container. * * PCore.getContainerUtils().getActiveContext(); * * @returns - ActiveContext instance * @function * @public */ export declare const getActiveContext: () => { getCoreheaders(headerName: string): object | undefined; }; /** * This function updates the lastUpdateTime in primary container * @function updateParentLastUpdateTime * @private * @param context -- context of the container e.g. app/primary_4 * @param lastUpdateTime -- latest lastUpdateTime * @example Example for updateParentLastUpdateTime. * PCore.getContainerUtils().updateParentLastUpdateTime("app/primary_4","2022-08-10T07:03:20.065Z") * after calling this lastUpdateTime is updated in the primary container (app/primary_4) */ export declare const updateParentLastUpdateTime: (context: string, lastUpdateTime: string) => void; /** * This functions returns context for given target container and key * @function getContextByTargetandKey * @param target -- target container name e.g. app/primary * @param key -- key within container item to search for e.g. OO6GFG-TH1COS-WORK T-157004 * @private * * @example Example for getContextByTargetandKey. * PCore.getContainerUtils().getContextByTargetandKey('app/primary', OO6GFG-TH1COS-WORK T-157004); * example is for returning context present under 'app/primary_2/workarea => item => app/primary_2/workarea_1 => context' */ export declare const getContextByTargetAndKey: (target: string, key: string) => string | null; /** * This function returns the parentContext value for given container item if it exists * @private * @function getContainerParentContext * @param containerItemName -- containeritem name e.g. app/primary_4 * @returns - 1) parent context if exists in container item * - 2) null if no data found * * @example Example for getContainerParentContext. * PCore.getContainerUtils().getContainerParentContext('app/primary_3/modal_1'); * example is for returning data context name for container item name --> 'app/primary_3' * */ export declare const getContainerParentContext: (containerItemName: string) => string | null; export declare const getActiveContainerItemIDFromRoutingInfo: (routingInfo: any) => any; /** * This function returns the parentContainerItem given the containerItemID. * @private * @param containerItemId * @returns string * @example Example for getContainerParentContext. * PCore.getContainerUtils().getParentContainerItem('app/primary_3/modal_1'); * example is for returning data context name for container item name --> 'app/primary_3' */ export declare const getParentContainerItem: (containerItemId: string | null) => string | null; export declare const getFlowContainer: () => typeof FlowContainer; export {};