import { C11nEnv } from '../interpreter/c11n-env';
import type { ContainerInfo, TransientContainerInfo, TransientItemInfo } from './types';
/**
* @description
* Provides the basic APIs to manage the containers that are used in complex
* components such as the ViewContainer and FlowContainer. These composite
* components use regions on the page called "containers" to map different
* aspects of the data that's displayed.
*/
declare class ContainerManager {
private readonly c11nEnv;
/**
* Constructor - Not for use outside of Core! Included for reference only.
* @param contextObj The context object that will be used for this instance of the Container Manager
*/
constructor(contextObj: C11nEnv);
/**
* Create a promise for the container manager action and return an object containing the promise
* and the ActionManager actionMgrID associated with that promise
* @param theActionType the action type for which we're creating a promise
* @returns object with actionMgrID and promise keys: { actionMgrID: , promise: }
* @function
* @private
*/
containerManagerPromise: (theActionType: string) => {
actionMgrID: string;
promise: Promise;
};
/**
*
* Initializes the container(s) in a complex component.
*
* @param containerInfo
* Typically, the JSON object contains the type of the container being initialized.
* For example: "single" or "multiple"
*
* { type: "single"} or {type: "multiple"}
* @returns A promise associated with the action (and stored in ActionManager)
* @example Example for initializeContainers()
* const containerManager = getPConnect().getContainerManager();
* containerManager.initializeContainers({
* type: "multiple"
* });
*/
initializeContainers(containerInfo: ContainerInfo): Promise;
/**
*
* Adds a container item to the container
*
* @param containerInfo
* Typically, the JSON object contains information about any _semantic URL_ associated with
* the _context_ of the container. Additional information can specify a specific, targeted
* region in the container (via _acName_), how the information should be rendered in the
* container, etc.
*
* Examples include:
*
* { semanticURL: "", context: "app", acName: "primary"}
*
and
* { semanticURL: "", context: "app/primary_5", caseViewMode: perform }
* @returns A promise associated with the action (and stored in ActionManager)
* @example Example for addContainerItem()
* const containerManager = getPConnect().getContainerManager();
* containerManager.addContainerItem({
* context: "app/primary_1",
* semanticURL: "RequestApprovals/REQ-1",
* caseViewMode: "review"
* });
*/
addContainerItem(containerInfo: ContainerInfo): Promise;
/**
* Updates the information within an item in the container
* @param containerInfo
* Typically, the JSON object contains information about context, target, containerItemID and any _semantic URL_ associated with
* the _context_ of the container. Additional information can specify a specific, targeted
* region in the container (via _acName_), how the information should be rendered in the
* container.
* @returns A promise associated with the action (and stored in ActionManager)
* @example Example for updateContainerItem()
* const containerManager = getPConnect().getContainerManager();
* containerManager.updateContainerItem({
* semanticURL: "RequestApprovals/REQ-1",
* caseViewMode: "review",
* target:"app/primary_0/workarea",
* containerItemID:"app/primary_0/workarea_0",
* context:"app/primary_0"
* });
*/
updateContainerItem(containerInfo: ContainerInfo): Promise;
/**
* Activates the container item in a container
* @param containerInfo
* this is the JSON Object containing containerItemID, target
* @returns A promise associated with the action
* @example Example for activateContainerItem()
* const containerManager = getPConnect().getContainerManager();
containerManager.activateContainerItem({
target: "app/primary",
containerItemID: "app/primary_3"
});
*/
activateContainerItem(containerInfo: ContainerInfo): Promise;
/**
* Removes a container item from a container
* @param containerInfo
* this is the JSON Object containing containerItemID, target
* @returns A promise associated with the action
* @example Example for removeContainerItem()
* const containerManager = getPConnect().getContainerManager();
containerManager.removeContainerItem({
target: "app/primary",
containerItemID: "app/primary_3"
});
*/
removeContainerItem(containerInfo: ContainerInfo): Promise;
/**
*
* Reset the container(s) to its initial state.
*
* @param containerInfo
* Typically, the JSON object contains information about context, containerName, containeritems associated with the container.
* @returns A promise associated with the action
* @example Example for resetContainers()
* const containerManager = getPConnect().getContainerManager();
* containerManager.resetContainers({
* context:"app",
* name:"preview",
* containerItems: ["app/preview_1","app/preview_2"]
* });
*/
resetContainers(containerInfo: ContainerInfo): Promise;
/**
* Add a transient item to the current context
* which can be used to hold the values which doesn't
* get submitted with content. Example: creating search filters which should not be submitted
* along with the other data to server.
* @param containerInfo JSON object containing info about id and data to add
* whereas id is the unique id for the transient item name and
* data contains the properties and their values
* @returns newly created transient item id
* @example Example for addTransientItem()
* const containerManager = getPConnect().getContainerManager();
* containerManager.addTransientItem({
* id: 'uniqueIdentifier',
* data: {
* "Prop1": "valueA",
* "Prop2": "valueB"
* }
* });
*/
addTransientItem(containerInfo: ContainerInfo): string;
/**
* Update a transient item in the current context
* which can be used to hold the values which doesn't
* get submitted with content. Example: creating search filters which should not be submitted
* along with the other data to server.
* @param transientObject JSON object containing info about id and data to add
* whereas id is the unique id for the transient item and
* data contains the properties and their values.
* @returns for successful update of transient item id
* @example Example for updateTransientData()
* const containerManager = getPConnect().getContainerManager();
* containerManager.updateTransientData({
* id: 'uniqueIdentifier',
* data: {
* "Prop1": "valueA",
* "Prop2": "valueB"
* }
* });
*/
updateTransientData(transientObject: TransientContainerInfo): void;
/**
* Remove a transient item from the current context
* @param transientItemInfo JSON object containing target, containerItemID and transientItemId
* @returns on removing transient item
* @example Example for removeTransientItem()
* const containerManager = getPConnect().getContainerManager();
* containerManager.removeTransientItem('uniqueIdentifier');
*/
removeTransientItem(transientItemInfo: TransientItemInfo): void;
createContainerPConnect(flowContainerInfo: {
accessedOrder: any;
items: any;
}, pageReference: string, containerName: string, isAssignmentView?: boolean): void;
hasContainerItems(): boolean;
isContainerInitialized(): boolean | undefined;
}
export default ContainerManager;