/** * @module PConnect */ import ValidationApi from '../validation/validation-api'; import ActionsApi from '../actions/api'; import ContainerManager from '../container/container-manager'; import CaseInfo from '../case/case-info'; import type { PropertyModel } from '../rules/types'; import { LocalizationService } from '../locale/LocalizationService'; import type { Meta, Config, ComponentMetadataConfig, CreateC11nEnv } from './types'; /** * The errorMsgConfig types defines a JSON configuration object used to specify error messages in the store. * It is used as a parameter to {@link C11nEnv.clearErrorMessages} to indicate which messages should be cleared. * @example errorConfig to clear messages on a context * {category: "HTTP", context: "app/primary"} * This will clear the error messages at the "app/primary" level which belong to category of type HTTP (like 4XX errors). * * @example errorConfig to clear messages on AppShell * {category: "HTTP"} * This will clear the error messages at the App level which belongs to category HTTP. * * @example errorConfig to clearing messages on FirstName property * {property: ".firstName"} * This will clear the error messages related to the property: firstName. */ type ErrorMsgConfig = { /** type of message that needs to be deleted (category types - HTTP (App or top level), PAGE (use this category for messages above the assignment)) */ category?: string; /** on which messages needs to be cleared. Can be empty in which case error messages on app container are cleared. */ context?: string; /** name on which messages needs to be cleared. */ property: string; }; /** * */ export declare class C11nEnv { #private; useCustomContext?: boolean; _rawConfig?: ComponentMetadataConfig; _classID: string | null; index?: number; _ruleClass: string | undefined; private readonly meta?; private readonly _isRoot; private readonly options; private readonly _isExpressionExist; private readonly _isWhenExist; private readonly _isValidatorExist; private readonly _pageReference; private readonly _referenceContext; private readonly _contextName; private readonly _stateProps; private _actions; private readonly _children; private readonly _additionalRegisteredProps; private _caseInfo; private readonly viewName; private readonly parentViewName; private _referenceList; private readonly _isInsideList; private _inheritedConfig; private readonly _localeRuleName; private readonly _containerTarget; private readonly _readOnly; private _hasSuggestions; private readonly _isState; private readonly _type; private _actionsApi; private readonly categoryName; constructor(config: Config); /** * This function returns if the paragraph is decision based and if it is then adds it to state props * @private */ _checkAndSetDecisionParagraph(propName: string, propValue: string | undefined): boolean; /** * This function returns if the field is configured with declarative target or not * @private */ isDeclarativeTarget(): boolean; _getPropertyName(): string; addFieldNode(): void; removeNode(): void; addViewNode(): void; addWhenNode(): void; updateContextTree(): void; /** * Returns the properties which are bound to state, in sense these properties * are reactive. * @function getStateProps * * @example * Sample: * { * "FirstName": "test value" * } * @example getPConnect().getStateProps() * const props = getPConnect().getStateProps(); * * @returns the properties that are bound to the Redux state */ getStateProps(): any; /** * Set the properties which are bound to state, in sense these properties * are reactive. * @example getPConnect().setStateProps({'datasourceMetadata':'@FIELD_META .Test'}) * @param propsObj object containing each prop name and its value * @private */ setStateProps(propsObj: any): void; /** * Returns the metadata, this is raw, unresolved metadata * @returns - metadata * @private */ getMetadata(): ComponentMetadataConfig | undefined; /** * Returns shared datapage record, reads data page name from referenceList in view metadata along with parameters * @returns - data page records or undefined if no data page found * @private */ getSharedDataPageForReferenceList(): any; /** * Returns instance of CaseInfo class bound to redux store current container context * @function getCaseInfo * @returns Returns instance of the CaseInfo class */ getCaseInfo(): CaseInfo; /** * Returns returns case reference string as per current case context. * @function getCaseLocaleReference * @returns {String} Returns locale reference for the case type. * @example In the example below * getPconnect().getCaseLocaleReference() returns CASE!SERVICEREQUEST * @private */ getCaseLocaleReference(): string | null; /** * Obtains an entry point to the ListActions class that contains APIs that handle list related actions for * components that display page list data and allow modifications on the list. * @function getListActions * @example In the example * getPConnect().getListActions(); */ getListActions(): import("../page-instructions/types").ListActions; getReferenceList(): string; isInsideList(): boolean; /** * For Advanced Use Only
* Returns the component's complete metadata in its raw and unresolved format. * This API should only * be used in advanced use cases where a component needs the complete, * unresolved metadata. In most situations, the component should * only require getConfigProps() to get the resolved configuration metadata of * the component.

* NOTE: the format and content of the metadata returned * may change as the DX API changes. * * @function getRawMetadata * @returns The raw, unresolved metadata for the component * @public * * @example In the example below, we see the raw, unresolved metadata for a simple "Table" component. * * { * "type": "Table", * "config": { * "referenceList": "D_pyMyWorkList.pxResults", * "rowClickAction": "openAssignment", * "personalizationId": "pyMyWork-D_pyMyWorkList", * "fields": [ * { * "type": "Text", * "config": { "label": "@L Priority", "formatType": "number", "value": "@P .pxUrgencyAssign" } * }, * { * "type": "Text", * "config": { "label": "@L ID", "value": "@P .pxRefObjectInsName" } * }, * { * "type": "Text", * "config": { "label": "@L Label", "value": "@P .pyLabel" } * }, * { * "type": "DateTime", * "config": { "sortDirection": "DESC", "sortPriority": "1", "label": "@L Creation date/time", "value": "@P .pxCreateDateTime" } * }, * { * "type": "Text", * "config": { "label": "@L Status", "value": "@P .pyAssignmentStatus" } * } * ] * } * } * */ getRawMetadata(): ComponentMetadataConfig | undefined; setReferenceList(ref: string): void; /** * Returns the component's configuration information * @function getComponentConfig * @example * example: { * label: "@P .FirstName" * } * * @example getPConnect().getComponentConfig() * const config = getPConnect().getComponentConfig(); * the value of config gets the configuration of the component. * * @returns component configuration information * @private */ getComponentConfig(): any; /** * Checks whether component has expression configured * or not. * * @function isExpressionExist * @returns true or false * @private */ isExpressionExist(): boolean; /** * Checks whether component has when configured * or not. * @function isWhenExist * @returns true or false * @private */ isWhenExist(): boolean; /** * This APIchecks if the component is associated with a condition (such as an expression or when condition) and returns true if anyone of them exists. * @function isConditionExist * @example Usage of isConditionExist - getPConnect().isConditionExist() * Usage: const isConditionConfigured = getPConnect().isConditionExist(); * value of isConditionConfigured will be true or false based on current component configuration. * * @returns true or false * @public */ isConditionExist(): boolean; /** * Checks whether current component is bound to state or not. * If component has any property reference, it will be treated * as bound to state. * * @function isBoundToState * * @example getPConnect().isBoundToState() * const isStateBound = getPConnect().isBoundToState(); * In this example, the API returns a Boolean value which denotes if the current component is bound to a Redux State. * * @returns True if bound to state */ isBoundToState(): boolean; /** * Returns the data reference path of the store, * where the data value has been stored for current component. * @function getPageReference * * @example * For example: * @example While loading a portal(App level) * pageReference value is: "pyPortal" * @example Single component * For components like 'FirstName, LastName', pageReference value is: "caseInfo.content" * @example Embedded components which are under embedded view * For components like 'ZipCode, StreetName' which are under Address view, pageReference value is :"caseInfo.content.Address" * * @returns pageReference path * @public */ getPageReference(): string; getPropertyName(): string; getFullReference(): string; /** * this function returns the context name under which the component has rendered. * * @public * @function getContextName * @returns context name * * @example Example for getContextName() * const context = getPConnect().getContextName(); * //example output : returns => 'app/primary_1' * */ getContextName(): string; /** * this function returns the Container name with which the component is associated * * @public * @function getContainerName * @returns container name * * @example Example for getContainerName() * const { containerName = "primary" } = getPConnect().getContainerName(); * //example output : returns => 'primary' * */ getContainerName(): string; /** * this function returns the fully qualified target container name with which the component is associated * * @public * @function getTarget * @returns target name * * @example Example for getTarget() * const target = getPConnect().getTarget(); * // example output : returns => 'app/primary' */ getTarget(): string | undefined; /** * This API obtains the name of the view under which the current component was rendered.This API returns the name of the views a string. * @public * @function getCurrentView * @returns view name * @example Example for getCurrentView() * In this example, the API returns the name of the view under which the current component was rendered. * const viewName = getPConnect().getCurrentView(); */ getCurrentView(): string | undefined; /** * Populates suggestion props if config has value prop and redux store has field in suggestion context. * * @param configObj configObj to which hasSuggestion props gets added * @function populateSuggestionProps * @example Usage: getPConnect().populateSuggestionProps({ label: 'label-name' }) * Example Usage: * const configProps = { label: 'label-name' } * getPConnect().populateSuggestionProps(configProps); * * After the above populateAdditionalProps function call, the configProps object value gets updated by suggestionProps * all the possible keys added to the configObject are: * configObject.hasSuggestions (string) - hasSuggestion value. * * @private */ populateSuggestionProps(configObj: { [key: string]: any; }): void; /** * Returns the object with resolved component * configuration of the component. * @function getConfigProps * * @example * Example: * { * label: "@P .FirstName" * } * output: * { * label: "Hello Name" * } * * @example getPConnect().getConfigProps() * @param destinationObject the object to which config props gets added. * const props = getPConnect().getConfigProps(); * * * @returns resolved component props. */ getConfigProps(destinationObject?: { [key: string]: any; }): any; /** * * @param localeReference default value is set to Component's type, * @param path nested lookup for the given localeReference object * @returns LocalizationService instance for the combination of localeReference, path * @example getPConnect().getLocalizationService() * const localizationService = getPConnect().getLocalizationService(); * localizationService.getLocalizedText('label'); */ getLocalizationService(localeReference?: string): LocalizationService; /** * Returns the object with raw configuration of the * component along with inherited configuration and * additional registered props. * * @example getPConnect().getRawConfigProps() * const rawProps = getPConnect().getRawConfigProps(); * * @returns Raw component props. * * @private */ getRawConfigProps(): any; /** * Returns the resolved props from the provided input props. * @function resolveConfigProps * @example * Example: * { * label: "@P .FirstName" * } * output: * { * label: "Hello Name" * } * @param configProps Props meant to be resolved. * @param destinationObject the object to which config props gets added. * @example getPConnect().resolveConfigProps() * const props = getPConnect().resolveConfigProps({ label: `@P .FirstName` }); * * @returns resolved props. * @public */ resolveConfigProps(configProps: any, destinationObject?: { [key: string]: any; }): { [key: string]: any; }; /** * Returns the resolved props from the provided input props and registers them to configuration object which are used for component rendering. * When you call the getConfigProps API, the resolved properties are returned. * * @function registerAdditionalProps * @example * Example: * additionalMeta = { * label: "@P .FirstName" * } * output: * { * label: "Hello Name" * } * @param additionalMeta Props meant to be resolved. * @example getPConnect().registerAdditionalProps() * const props = getPConnect().registerAdditionalProps({ label: `@P .FirstName` }); * the props variable will be an object with 'label' value is field value entered for FirstName field. * Also this prop ('label') is registered in component configuration for further usage in re-renders. * In this example, the API resolves the FirstName property, obtains the first name value, and registers it to label. * * @returns resolved props. * @public */ registerAdditionalProps(additionalMeta?: {}): any; /** * This API deregisters the input properties passed from metaConfig. * When you call the getConfigProps API, the deregistered properties are not obtained. * * @param deRegisterKeys The props that needs to be deregistered. * @function deRegisterAdditionalProps * @example getPConnect().deRegisterAdditionalProps() * getPConnect().deRegisterAdditionalProps(['label']); * @returns Returns True after unregistering * @public * */ deRegisterAdditionalProps(deRegisterKeys?: any[]): boolean; /** * Populates any additional properties which are specific to component which are not part of component configuration. * * @function populateAdditionalProps * @param configData an object which has props from configuration props data, this objects get populated with new additional properties. * @example Usage: getPConnect().populateAdditionalProps({ label: 'label-name' }) * Example Usage: * const configProps = { label: 'label-name' } * getPConnect().populateAdditionalProps(configProps); * * After the above populateAdditionalProps function call, the configProps object value gets updated based on type of the component * all the possible keys added to the configObject are: * configObject.pageMessages (string) - page messages are added for case_view template. * configObject.validatemessage (string) - this key is added for components which are editable and when there is any validation message to be shown. * configObject.infoMessage (string) - same as above for editable component which has a warning message to be shown. * configObject.status (string) - "error" or "warning" string values. * configObject.httpMessages (string) - If there are any top (app) level HTTP messages to be displayed * configObject.caseMessages (string) - If there are any cases level messages to be shown. * configObject.stages (object) - contains a particular stage info. * configObject.fieldMetadata (object) - this object contains the information about the extra configuration which is configured in PRPC. * * @public */ populateAdditionalProps(configData: any): void; populateFieldMetadata(configData: any): void; /** * @private * @param propertyMetadata */ resolvePropertyMetadata(propertyMetadata: PropertyModel | PropertyModel[] | null, propName?: string): PropertyModel | PropertyModel[] | null; /** * Resolves the parent page class for a nested property path. * Used internally to traverse property segments and determine the classID for the last prop. * @private * @param propName - The property path (e.g. "Employee.Address.Street"). * @returns The resolved pageClass string, or undefined if not found. */ private resolvePageClass; /** * Returns the field model (single model object (or) Array of model objects) (or) null. * field model is the information like class it belongs to, editValidate, useValidate, maxLength, etc which are configured on the field. * Model becomes an array if the field belongs to more than one class, otherwise we get only one object. * * @param propertyName property (field) name without dot. * @returns - { classID: 'class-1', type: "text"} | {{ classID: 'class-1', type: "text"}, { classID: 'class-1', type: "text", editValidate: 'funcName'}} * @example Usage of getFieldMetadata * Ex: const firstNameMetaData = getPConnect().getFieldMetadata('FirstName'); * * firstNameMetaData will receive the configured information on the field while configuring it. * * @private */ getFieldMetadata(propertyName: string): any; /** * Returns the current page meta data. * * @param contextPageReference context page reference. * @returns - { classID: 'class-1', type: "text"} | {{ classID: 'class-1', type: "text"}, { classID: 'class-1', type: "text", editValidate: 'funcName'}} * @example Usage of getCurrentPageFieldMetadata * Ex: const firstNameMetaData = getPConnect().getCurrentPageFieldMetadata(); * * firstNameMetaData will receive the configured information on the page while configuring it. * * @private */ getCurrentPageFieldMetadata(contextPageReference?: string | null): any; /** * Returns the current field classId * @returns - "class-name" * @function getCurrentClassID * @example Usage of getCurrentClassID * Ex: const firstNameClassId = getPConnect().getCurrentClassID(); * * firstNameClassId will receive the class id corresponding to the field. * * @public */ getCurrentClassID(): string; /** * Returns case summary and isCaseWideAction function consist of below structure * @function getCaseSummary * @example * { * routedTo:"user@constellation.com" * urgency:"10" * caseID:"OPB1HW-SPACE-WORK RA-219" * name:"Request approval" * caseClass:"OPB1HW-SpaceTra-Work-RequestApproval" * ID:"ASSIGN-WORKLIST OPB1HW-SPACE-WORK RA-219!REQUEST_FLOW_0" * isCaseWideAction * } * * isCaseWideAction() function returns true is the action is a case action else false */ getCaseSummary(): any; /** * Returns referencedUsers in view with the below structure * * @function getReferencedUser * @param userId is userIdentifier of a user. * { * "operatorName": { * "UserName": "Chandra" * } * } */ getReferencedUser(userId: string): any; /** * Returns case stages consist of below structure * @function getCaseStages * @example * { * ID: "PRIM1" * entryTime: "20200520T093921.867 GMT" * links: {,…} * name: "Collect Info" * type: "Primary" * visited_status: "active" * } */ getCaseStages(): any; getStageID(): any; /** * Gets the actions object that is used to configure a component’s event actions. * @function getActions * @example Example for getActions() * Example usage - const actions = getPConnect().getActions(); return ; * // the API provides the currency component’s action-set. * * @returns actions configured */ getActions(): any; /** * Returns true if this C11nEnv is the root * @returns True is this is the root * @private */ isRoot(): boolean | undefined; /** * Checks and resolves any context related info. * like, any errors for properties and any validation * info for this component. * @param target target object to update the context. * @private */ resolveContextProps(target: { error: string; validatemessage: string; }): void; /** * Checks whether validators configured for this * component or not. * @returns true or false * @private */ isValidatorExist(): boolean; /** * Obtains an entry point to the {@link ValidationApi} object that contains APIs that handle validations on the field. * @function getValidationApi * @returns entry point to the {@link ValidationApi} * * @example Example for getValidationApi() * const validationApi = pConn.getValidationApi(); * @public */ getValidationApi(): ValidationApi; /** * Checks whether a component is editable, relies on value attribute * * @function isEditable * @example Example for isEditable() * const isEditable = pConn.isEditable(); * where isEditable is the boolean that contains true/false * In this example, the API checks if a component can be edited and returns the resulting boolean value. * * @returns true or false */ isEditable(): boolean; isVisible(): boolean; isReadOnly(): boolean; /** * This API checks if the current component has children. * * @function hasChildren * @example Example for hasChildren - getPConnect().hasChildren() * Usage: const componentHasChildren = getPConnect().hasChildren(); * componentHasChildren will be true or false indicating whether current component has children in the component configuration. * * @returns true or false * @public */ hasChildren(): boolean; /** * Returns whether the node is visible && has some visible children * (if it is of a type which require children). * @returns whether the node should be visible. * @private */ getComputedVisibility(resolvedViews?: string[]): boolean; /** * Returns the children iterator * @returns iterator * @private */ getChildrenIterator(): any; /** * This API assigns a new action(based on the event type and handler)to the list of the actions * associated with the current component. * * @function setAction * @example Example for setAction() * Example usage - setAction("onChange", changeHandler); * // this API associates the change handler to the onChange event type, and assigns the new action to the list of the actions associated with the current component. * * @param eventType The type of the event that determines the new action to be added to the list of actions. * @param handler The function that must be associated with the event type. * * @public */ setAction(eventType: string, handler: Function): void; /** * Returns the component name example Button. * * @function getComponentName * @example getPConnect().getComponentName() * const component = getPConnect().getComponentName(); * * @returns current component name. */ getComponentName(): string | undefined; /** * Checks whether current component is refreshable * or not. * Example: * If section is configured with refresh this section * then section will be treated as refreshable. * @returns true or false * @private */ isComponentRefreshable(): boolean; /** * this function helps to obtain the data of the current context from store. * Here `data` may contain below information * * * @public * @function getDataObject * @param contextName qualified context name e.g. app/primary_1 * @returns data object * * @example Example for getDataObject() * const data = pConn.getDataObject(); * const { caseInfo, pulse } = data; * */ getDataObject(contextName?: string): any; /** * Returns the resolved image path, it resolves the image with current * static service. * * @function getImagePath * @example getPConnect().getImagePath(imageName) * const imagePath = getPConnect().getImagePath("launcher.png"); * // output: imagePath -> https://service/image/launcher.png * @param imageName image name * @returns image path */ getImagePath(imageName: string): string; skipRequiredValidation(): boolean | undefined; isBulkAction(): boolean | undefined; /** * Returns list of children for the current component. * And also resets the iterator to start-index. * * @function getChildren * @example Example usage of getPConnect().getChildren() * const children = getPConnect().getChildren() * the children variable will be receiving the list of children components of the current component. * * @returns returns the list of children * @public */ getChildren(): { getPConnect: () => C11nEnv; }[]; /** * This API set inherited prop and propagates the prop to all its children. * * @function setInheritedProp * @example getPConnect().setInheritedProp("displayMode", "DETAILS") * * @param propName name of the prop eq., displayMode * @param value value to be set ew., LEFT * */ setInheritedProp(propName: string, value: any): void; /** * This API returns locale reference rule name this environment object is referencing for the field values. * * @function getLocaleRuleName * @example getPConnect().getLocaleRuleName() * const localeRuleName = getPConnect().getLocaleRuleName(); * //Returns "VEHICLE-!VIEW!VEHICLEDETAILS", if the current environment object corresponds to a view named VehicleDetails in Work- class. * //The above is the name of localization rule which is 1-1 mapped to a View named VehicleDetails * * @returns Returns the locale reference rule name. */ getLocaleRuleName(): string | undefined; /** * Returns the localized value for a string. * * @function getLocalizedValue * @example getPConnect().getLocalizedValue("First Name", "fields","WORK-!VIEW!CANDIDATEINFO") * If the localization store looks like below. * * { * "WORK-!VIEW!CANDIDATEINFO" : { * "fields" : { * "First Name" : "Primero nome", * "Last Name" : "Ultimo nome" * } * } * } * The API returns "Primero nome" for a rule "WORK-!VIEW!CANDIDATEINFO". * * @param rawString raw string * @param localePath locale path * @param localeRuleKey Rule Key in the localization store * @returns returns the localized value. * @deprecated instead use * * const l11nService = getLocalizationService(localeRuleKey, localePath); * l11nService.getLocalizedText(rawString); * l11nService.getLocalizedText(another); * */ getLocalizedValue(rawString: string, localePath?: string, localeRuleKey?: string): string; /** * Returns the localized value for a string using field label. * @function getLocalizedValue * @example getPConnect().getLocalizedValueForFieldLabel(".FirstName") * If the localization store looks like below. * * { * "WORK-!VIEW!CANDIDATEINFO" : { * "fields" : { * "First Name" : "Primero nome", * "Last Name" : "Ultimo nome" * } * } * } * The API returns "Primero nome" for a rule "WORK-!VIEW!CANDIDATEINFO". * @private * @param propertyName string * @returns returns the localized value. */ getLocalizedValueForFieldLabel(propertyName: string): string; /** * Returns the localeRuleName for the given Localization rule keys. * * @example const ruleKey = getPConnect().getLocaleRuleName("Work-", "View","CandidateInfo") * Here the ruleKey will be "Work-!View!CandidateInfo" * * @param localeClass Localization rule class * @param localeContext Localization rule context * @param localeName Localization rule name * @returns - localeRuleKey * @private */ getLocaleRuleNameFromKeys(localeClass: string, localeContext: string, localeName: string): string; /** * this function helps to resolve the property value from the state (Redux store). * @function getValue * @param prop property whose data value is returned * @param pageReference pageReference of parent view * @returns property value from the state (Redux store). * * @example Example for .firstName property * const firstName = getPConnect().getValue('.firstName'); * // here firstName variable contains the value retrieved from redux store. */ getValue(prop: string, pageReference?: string): any; setInheritedConfig(rawConfig: any): void; /** * This function is used to retrieve props that are set on the parent metadata node within * the inheritedProps metadata structure. The purpose of inheritedProps is to allow cascading * of values in view metadata. * * In the following example, a label can be given to a view reference node in order to give a * unique label each place a view is included, allowing for better reuse. * * @function getInheritedProps * @returns props object that was inherited from the parent * @public * * @example Getting a label from parent reference * // Parent reference metadata * { * "type": "reference", * "config": { * "name": "Address", * "inheritedProps": [ * { * "prop": "label", * "value": "@L Shipping address" * } * ] * } * } * * // Child reusable Address view * { * "name": "Address", * "type": "View", * "config": { * "template": "OneColumn", * "ruleClass": "Data-Address" * "label": "Generic address" * }, * "children": [ * { * "name": "A", * "type": "Region", * "children": [] * } * ] * } * * // During render of the child view called Address, one would retrieve the inherited label as follows * * const propsToUse = { label, ...getPConnect().getInheritedProps() }; * * // This would result in propsToUse.label = “Shipping address”. This inherits the value that was set on the * // parent (if the parent had a “label” property) and would override any “label” property that was set on the child view. */ getInheritedProps(): { [key: string]: any; }; /** * this function helps to assign the value to property name (or key) in state (Redux store). * @function setValue * @param prop property name whose data value need to set * @param value property value which need to get assigned to the property name. * @param initialValue property initialValue which need to get assigned to the property name. * @param isImplicit boolean check if it is implicit setValue action * @param options object containing extra infomation like isArrayDeepMerge * @param options.isArrayDeepMerge flag to decide whether to deep merge the objects or values inside array or not * * @example Example for .firstName property * getPConnect().setValue('.firstName', 'lorem ipsum'); * // here examples shows setting the `lorem ipsum` value in firstName property */ setValue(prop: string, value: { [key: string]: any; } | undefined, initialValue?: string, isImplicit?: boolean, options?: { isArrayDeepMerge?: boolean; }): void; /** * This function helps to update the value to property name in change list * @function updateDirtyCheckChangeList * @param prop property name whose data value need to set * @param value property value which need to get assigned to the property name * * @example Example for .firstName property * getPConnect().updateDirtyCheckChangeList('.firstName', 'lorem ipsum'); * // here examples shows setting the `lorem ipsum` value in firstName property * @private */ updateDirtyCheckChangeList(prop: string, value: string): void; /** * Return context data value like when results etc., * @example getPConnect().getContextDataValue(prop) * const value = getPConnect().getContextDataValue('.summary_of_when_conditions__.testWhen'); * * @param prop property whose context data value is returned * @param pageReference pageReference of parent view * @returns Context data value * @private */ getContextDataValue(prop: string, pageReference?: string): any; /** * this function helps to merge data object in store deeply. * If an element at the same key is present in both store and data object, * the value from data object will stay in the store. * * @function updateState * @param dataObject - object to be merged into store. * * @example Example usage to merge firstName key to store * getPConnect().updateState({ * firstName: "Test" * }); */ updateState(dataObject: any): void; /** * this function helps to replace the state of a property or page in the store. * @function replaceState * @param prop property or page name whose value need to be replaced * @param value value which need to get assigned to the property or page. * * @example Example for .address property * getPConnect().replaceState('.address', { * apartment: "New Heights" * streetName: "Park Street", * }); * @param options.skipDirtyValidation - flag to decide whether the property has to considered in Dirty Validation. Default is false. If passed as true Dirty Validation will be skipped on the respected property. * @example Example for .address property will not be include in the response of formutils.getChanges() API * getPConnect().replaceState('.address', { * apartment: "New Heights" * streetName: "Park Street", * }, {skipDirtyValidation: true }); */ replaceState(prop: string, value: string, options?: { skipDirtyValidation?: boolean; }): void; /** * this function helps to set error at Redux store level * so that the errors that need to be handled at infra level can make use of this function * * @public * @function reportError * @param errorMsg - Error message to be logged to Redux store. * @param errorObj - Error object that contains more error info. * @param context - Context data value * * @example Example usage for reportError function * getPConnect().reportError( * ': Error occurred during ajax call at fetchMessages API :', * { * errorClassification: 'Invalid inputs' * errorDetails: { * localizedValue: 'localized error message' * } * } * ); */ reportError(errorMsg: string, errorObj: any, context?: string): void; /** * Returns the env object. * @returns env object * @private */ getComponent(): any; /** * This API creates a component whose type is provided as part of the meta object and uses the other parameters to resolve the properties and get the context. * The definition of the component type which is provided in meta object is upto consumer. * @param componentMeta The metadata of the component to be created. * @param dataSource The source reference to the Redux store. This contains properties that will be input to the created component. * @param index In case of list datasource mention the index. * @param additionalPropsToComp Props will be passed to component apart from the configured values. * * @function createComponent * @example Usage of createComponent: getPConnect().createComponent(meta, dataSource, index, additionalPropsToComp) * Ex: getPConnect().createComponent( * { * type: "Button", * config: { * label: "@P .FirstName" * } * }, * "D_Employees.pxResults", * 1, * { * active: true * } * ); * * Call the createComponent with meta data and necessary arguments, such that the component receives the resolved props to the created component instance. * For React: JSX: