/** * @license * Copyright (c) 2021, 2024, Oracle and/or its affiliates. * Licensed under The Universal Permissive License (UPL), Version 1.0 * as shown at https://oss.oracle.com/licenses/upl/ * @ignore */ /** * Returns the engine's version */ export declare const IAEngineVersion: string; /** * A reference to a specific record. * * @remarks * The Engine API will only accept objects implementing this interface that it created. */ export interface IARecordRef { /** * The identity value of this record if defined. */ readonly identityValue?: string | number | null; /** * This Record's parent record. Will be null when this refers to the global record */ readonly parent: IARecordRef | null; /** * Returns a string representation of this record which can be used to uniquely identify this record. */ toString(): string; /** * Returns true if the provide parameter is also a reference to the same record * @param other - the other reference to test */ equals(other: any): boolean; } /** * A date value * * @remarks * The Engine API only accepts objects implementing this interface created either by it or by using the date creation functions on {@link IAFlowSession} * @see {@link IAFlowSession.createDate} * @see {@link IAFlowSession.parseDate} * @see {@link IAFlowSession.tryParseDate} */ export interface IADateValue { /** * The date's year. Years must be between 1000 and 9000 */ readonly year: number; /** * The date's month, starting with 1 representing January */ readonly month: number; /** * The date's day of the month */ readonly day: number; /** * Returns the date in ISO 8601 format of yyyy-mm-dd */ toString(): string; } /** * The data sent from the session for a given data action. * * @see {@link IACustomDataAction} */ export interface IASentDataObject { /** * The reference to the record this set data object belongs to */ recordReference: IARecordRef; /** * session data to be saved */ fields: { [fieldName: string]: string | number | boolean | IASentDataObject[] | string[] | number[]; }; } /** * A signed set of data sent from the server for a given action. * * @remarks * Sent data is verified server side to ensure that the current data in the session as applied to the flow definition produces the sent data. The signature provided can be used to * validate the integrity of the sent data. */ export interface IAVerifiedSentData { /** * The verified sent data for an action. Returns null if the action does not allow sent data or the verified action is hidden */ verifiedData: IASentDataObject; /** * The verified sent data as a JSON object. */ serialVerifiedData: any; /** * The signature of the verified data. */ signature: string; } /** * An action that can send data from, or return data into the flow, or both. * * @remarks * Data actions are governed by the linearization algorithm. Any data sent to them can only be affected by values set earlier than * this item's place within the flow model. Any data returned by them can only affect the state of items later in the flow model. */ export type IADataAction = IACustomDataAction; /** * A custom data action that can be used to send data from the session into an external system, or return from an external system into the session, or both. * * @remarks * A custom data action describes data sent from or returned into the flow, or both. * Users of this API are responsible for integration with the external system. * */ export interface IACustomDataAction { readonly kind: "customDataAction"; /** * The identifier that uniquely identifies this item within the flow model. */ readonly id: string; /** * The plain text label for the group * @since 23.0.0 */ readonly text: string; /** * The translation key for the plain text label for the group * @since 23.0.0 * */ readonly textTranslationKey: string; /** * The HTML marked-up label for the group * @since 23.0.0 * */ readonly html: string; /** * The translation key for the HTML marked-up label for the group * @since 23.0.0 * */ readonly htmlTranslationKey: string; /** * The substitution parameters for translations * @since 23.0.0 */ readonly translationParameters: string[]; /** * The identifier of the scheme item this action was derived from */ readonly schemeId: string; /** * The reference of the record this data action belongs to */ readonly recordReference: IARecordRef; /** * If true, signifies there are errors on one or previous items in the flow model. This indicates that any {@link sentData} on this * data action is invalid because it was calculated using erroneous information. */ readonly hasPreviousErrors: boolean; /** * The data that can be sent from this session via this data action. Returns null if this action does not allow sent data or the action is hidden. */ readonly sentData: IASentDataObject | null; /** * The JSON Object schema definition for the data that can be returned into the session by this data action or null if this * action does not allow return data. * * @see {@link setReturnedData} */ readonly returnedDataDefinition: any; /** * Returns true if this action is currently visible within the model. * * @remarks * If an action is not visible, any data loaded via it will have no effect on the system */ readonly isVisible: boolean; /** * Sets data returned from the data action. * * @remarks * The schema of the JSON payload is defined by {@link returnedDataDefinition}. Setting data that is invalid will result in an {@link IAReturnedDataError} * Any value set will not be reflected in the model until {@link IAFlowSession.refreshModel} is called * * @param data - the data to set * * @throws string - when {@link isVisible} is false */ setReturnedData(data: any): any; /** * The width of the control when in an IARow, otherwise undefined when the control is in an IAFlowItemGroup. * @since 23.1.0 */ readonly layoutWidth?: number; /** * The names of the custom properties set on this action */ readonly customPropertyNames: string[]; /** * Gets a custom property value * @param name - the name of the custom property */ getCustomProperty: (name: string) => any; /** * The errors associated with this data action. */ readonly errors: IAErrorInfo[]; } /** * The set of items that can be contained by an {@link IARecordListFlowItemGroup} or {@link IAFlowItemGroup} */ export type IAFlowItem = IARecordListFlowItemGroup | IAFlowItemGroup | IADataAction | IAPage; /** * Options for session serialization. * * @see {@link IAFlowSession.getSessionState} */ export interface IASessionSerializationOptions { /** * If true, data values set via a data action are not included in the serialised session state. Defaults to false. * * @remarks * This can be used to reduce the size of the serialised session. For example if the implementor wants to re-run * any {@link IADataAction} operations that returned data, after a session is recreated using serialisation data. * * @default false */ excludeDataActions: boolean; } /** * A Flow session. * * @remarks * Each flow session keeps track of all the data values for a particular flow. It generates a model of the current state of the flow * by applying the linearization algorithm to the authored flow definition with the data in the session. * * The linearization algorithm ensures consistent evaluation of every flow, independent of the order in which the data is collected. * It ensures no value collected later in the flow can influence the state of an item earlier in the flow. * Data set in the session is always retained, even if it does not currently influence flow evaluation - for example data for a currently hidden screen or control is not discarded. * * The flow model is a tree structure of all pages, groups and controls in their current form. * The model changes only when {@link refreshModel} is called. * Setting data into the session is an idempotent operation and will not have any effect on the model until it is refreshed. * During a refresh, object identity is generally preserved for all objects in the model. The exception is when an object is removed from a group and re-added in a subsequent refresh cycle. */ export interface IAFlowSession { /** * Contains a model consisting of all the pages, containers and controls that make up the model in their current form. * * The model will not change until {@link refreshModel} is called. */ readonly model: IAFlowItemGroup; /** * The name of the flow * * @since 23.1.0 */ readonly name: string; /** * Gets a value from the currently calculated session data. * * The session data is calculated during the refresh cycle and will not update in response to new data being set until {@link refreshModel} is called. * @param instanceRef - the record reference * @param fieldName - the name of the field * @returns the value of the field in the specified instance */ getSessionValue(instanceRef: IARecordRef, fieldName: string): IAFieldValue; /** * Gets the list of fields that were relevant for determining the value of a field. * * @param instanceRef - the record reference * @param fieldName - the name of the field * @returns the list of details for the relevant fields * @since 23.3.0 */ getSessionValueRelevance(instanceRef: IARecordRef, fieldName: string): IARelevantField[]; /** * Gets the serialised state of the session which can be used to restore a session at a later point * * @param options - options to control what is data is serialised. * @returns a string that can be used to restore a flow session. */ getSessionState(options?: IASessionSerializationOptions): string; /** * Recalculates the state of the flow model and the session data. */ refreshModel(): Promise; /** * The JSON Object schema definition for the reference data to be set at the beginning of the interview or null * if this session does not have any global input data defined for it * * @see {@link setGlobalInputData} */ readonly globalInputDataDefinition: any; /** * Sets the global input data for this session. * * @remarks The schema of the JSON payload is defined by {@link globalInputDataDefinition}. Setting data that does not conform to the schema will result in an {@link IAReturnedDataError} * @param data - the data to set * */ setGlobalInputData(data: any): any; /** * Errors associated with this session. * * @remarks * This is a collection of errors that attach to the session only. Errors relating to specific items in the model (for example controls) will be attached to those model items. */ readonly errors: IAErrorInfo[]; /** * Creates an {@link IADateValue} with the specified year, month and day * @param year - the date's year * @param month - the date's month, with the 1 representing January and 12 representing December * @param day - the date's day * * @returns IADateValue the date */ createDate: (year: number, month: number, day: number) => IADateValue; /** * Parses a date from a canonical date string in the ISO 8601 format of yyyy-mm-dd * @param dateString - the date as a string in the form of yyyy-mm-dd * @returns IADateValue - the parsed date * @throws string - error message if the dateString cannot be parsed as a valid date */ parseDate: (dateString: string) => IADateValue; /** * Attempts to parse a date from a canonical date string in the ISO 8601 format yyyy-mm-dd. If the string cannot be parsed * as a date, this method returns null. * * @param dateString - the date as a string in the form of yyyy-mm-dd * @returns IADateValue - if the dateString can be parsed as a valid date, otherwise null. */ tryParseDate: (dateString: string) => IADateValue | null; } /** * A Flow session with debugging features enabled * * @remarks * A debugging session adds additional instrumentation and access to the Debugger UI widget to enable * users to see how the rules, pages, controls and data actions in their flow are behaving inside their currently running * application. *
* This option is only available when running in a browser. *
* The additional features enabled in the debugging session can impact performance * and provide the ability for users to interrogate rules and data within the currently running flow in detail. * It is strongly advised this feature not be enabled in production applications. * * */ export interface IADebugFlowSession extends IAFlowSession { /** * Loads a serialised session state in to this flow session. * * @remarks * Loading a serialised session will cause any data currently in the session to * be destroyed and the session reset to the contents of the stored session state * @param storedSessionState - the session state to restore * @see {@link IAFlowSession.getSessionState} */ loadSessionState(storedSessionState: string): Promise; /** * Creates the Debugger UI widget and attaches it to the specified element * @param el - the element to attach the debugger widget to */ createDebugger(el: HTMLElement): void; /** * Destroys the Debugger UI and removes it from its parent element. */ destroyDebugger(): void; /** * Shows the specified item in the Debugger UI widget. * * @param modelId - the id of the item in the flow model to show */ debugNavigateTo(modelId: string): void; } /** * An array of {@link IAFlowItem} */ export interface IAFlowItemGroup { readonly kind: "flowItemGroup"; /** * The identifier that uniquely identifies this item within the flow model. */ readonly id: string; /** * The id of the scheme item this group was derived from */ readonly schemeId: string; /** * The plain text label for the group */ readonly text: string; /** * The translation key for the plain text label for the group */ readonly textTranslationKey: string; /** * The HTML marked-up label for the group */ readonly html: string; /** * The translation key for the HTML marked-up label for the group */ readonly htmlTranslationKey: string; /** * The substitution parameters for translations */ readonly translationParameters: string[]; /** * The reference of the record this flow item belongs to */ readonly recordReference: IARecordRef; /** * True if this group is visible, otherwise false */ readonly isVisible: boolean; /** * True if this group is read-only, otherwise false * @since 23.1.0 */ readonly isReadOnly: boolean; /** * The items owned by this container */ readonly items: IAFlowItem[]; /** * The names of all custom properties set on this group */ readonly customPropertyNames: string[]; /** * Gets a custom property value * @param name - the name of the custom property */ getCustomProperty: (name: string) => any; } /** * A Group of {@link IAFlowItem} that are repeated for each record in a record list */ export interface IARecordListFlowItemGroup { readonly kind: "recordListFlowItemGroup"; /** * The identifier that uniquely identifies this item within the flow model. */ readonly id: string; /** * The plain text label for the group * @since 23.0.0 */ readonly text: string; /** * The translation key for the plain text label for the group * @since 23.0.0 */ readonly textTranslationKey: string; /** * The HTML marked-up label for the group * @since 23.0.0 */ readonly html: string; /** * The translation key for the HTML marked-up label for the group * @since 23.0.0 */ readonly htmlTranslationKey: string; /** * The substitution parameters for translations * @since 23.0.0 */ readonly translationParameters: string[]; /** * The identifier of the scheme item this action was derived from */ readonly schemeId: string; /** * The reference of the record this flow item belongs to */ readonly recordReference: IARecordRef; /** * True if this group is visible, otherwise false */ readonly isVisible: boolean; /** * True if this group is read-only, otherwise false * @since 23.1.0 */ readonly isReadOnly: boolean; /** * A {@link IAFlowItemGroup} for each record in the list */ readonly items: IAFlowItemGroup[]; /** * The names of all custom properties set on this group */ readonly customPropertyNames: string[]; /** * Gets a custom property value * @param name - the name of the custom property */ getCustomProperty: (name: string) => any; } /** * The array of control rows for a page */ export interface IAPage extends IARowArray { readonly kind: "page"; /** * The identifier of the scheme item this page was derived from */ readonly schemeId: any; /** * The flow session */ readonly session: IAFlowSession; /** * The plain text title of the page */ readonly text: string; /** * The translation key for the plain text label of the page */ readonly textTranslationKey: string; /** * The HTML marked-up title of the page */ readonly html: string; /** * The translation key for the HTML marked-up title of the page */ readonly htmlTranslationKey: string; /** * The substitution parameters for translations */ readonly translationParameters: string[]; /** * True if this page is visible, otherwise false */ readonly isVisible: boolean; /** * True if this page is read-only, otherwise false * @since 23.1.0 */ readonly isReadOnly: boolean; /** * The set of errors that are currently attached to this page */ readonly errors: IAErrorInfo[]; /** * The names of all custom properties set on this group */ readonly customPropertyNames: string[]; /** * Gets a custom property value * @param name - the name of the custom property */ getCustomProperty: (name: string) => any; } /** * An error belonging to a flow session, control or data action */ export type IAErrorInfo = IAFormatError | IAInvalidValueError | IAReturnedDataError | IARecordRecordNoLongerExistsError; /** * An error caused by text value that cannot be parsed * * @see {@link IAInputControl.textValue} */ export interface IAFormatError { /** * Error kind: * - dateFormat - the value cannot be parsed as a date * - numberFormat - the value cannot be parsed as a number */ kind: "dateFormat" | "numberFormat"; /** * The plain text error message, suitable for user display */ message: string; /** * The translation key for the plain text error message, suitable for localized user display */ messageTranslationKey: string; /** * The substitution parameters for translations */ translationParameters: string[]; /** * the internal error message. Not suitable for user display */ internalMessage: string; /** * An example of a formatted date or number string that can be parsed. */ formatExample: string; } /** * Error caused by setting an invalid value */ export interface IAInvalidValueError { /** * The type of error * * @remarks *
* Error kind: * */ kind: "dateNotExist" | "mandatory" | "rule" | "invalidSelection" | "dataType"; /** * The plain text error message, suitable for user display */ message: string; /** * The translation key for the plain text error message, suitable for localized user display */ messageTranslationKey: string; /** * The substitution parameters for translations */ translationParameters: string[]; /** * the internal error message. Not suitable for user display */ internalMessage: string; } /** * Error caused where a field's value contains a reference to a record that no longer exists in the model * * @remarks * This error can occur where an {@link IAInputControl} of type "record" or an {@link IAReferenceListInputControl}'s value * references a record that exists at the time the control was collected, but no longer exists in the final flow model state. * This can happen where the control collects references to an inferred record list whose records are conditionally inferred, * and some value that causes a record to be inferred out of existence is collected after the reference control in the flow. * * The root cause of the problem is in the flow's design which should be corrected to ensure that any values which * affect what records exist in an inferred record list are collected before any controls which reference values from * that record list. */ export interface IARecordRecordNoLongerExistsError { kind: "recordNoLongerExists"; /** * The plain text error message, suitable for user display */ message: string; /** * The translation key for the plain text error message, suitable for localized user display */ messageTranslationKey: string; /** * The substitution parameters for translations */ translationParameters: string[]; /** * the internal error message. Not suitable for user display */ internalMessage: string; /** * A reference to the record that no longer exists */ missingRecord: IARecordRef; } /** * Error caused by setting invalid returned data. * * @remarks This error can be raised on either an {@link IACustomDataAction} if the returned data set does not conform to the {@link IACustomDataAction.returnedDataDefinition} defined for that data action, * or on a {@link IAFlowSession} if the global input data set does not conform to the {@link IAFlowSession.globalInputDataDefinition}. * * @see {@link IACustomDataAction.setReturnedData} * @see {@link IAFlowSession.setGlobalInputData} */ export interface IAReturnedDataError { /** * Error type */ kind: "invalidReturnedData"; /** * The plain text error message, suitable for user display */ message: string; /** * The translation key for the plain text error message, suitable for localized user display */ messageTranslationKey: string; /** * The substitution parameters for translations */ translationParameters: string[]; /** * the internal error message. Not suitable for user display */ internalMessage: string; /** * The path to the returned data property that caused the error */ propertyPath: string; /** * The reason the error occurred * * @remarks * Error reasons: * */ invalidReason: "required" | "dataType" | "identityNotUnique" | "invalidProperty" | "referenceNotFound" | "missingNamedRecord" | "duplicateNamedRecord"; } /** * An array of {@link IARow} */ export interface IARowArray { /** * The identifier that uniquely identifies this item within the flow model. */ readonly id: string; /** * The set of rows in this container */ readonly rows: IARow[]; /** * The reference of the record this row array belongs to */ readonly recordReference: IARecordRef; } /** * A row of controls organized into a single row */ export interface IARow { /** * The identifier that uniquely identifies this item within the flow model. */ readonly id: string; /** * The container to which this row belongs */ readonly container: IARowArray; /** * The controls in this row */ readonly controls: IAControl[]; /** * True if this row is visible, otherwise false */ readonly isVisible: boolean; /** * True if this row is read-only, otherwise false * @since 23.1.0 */ readonly isReadOnly: boolean; /** * the page to which this row belongs */ readonly page: IAPage; } /** * The control type */ export type IAControlType = "custom" | "input" | "referenceList" | "label" | "recordList" | "recordCollect" | "group" | "validation"; /** * The super-interface for all controls */ export interface IAControlBase { kind: IAControlType; /** * The identifier that uniquely identifies this item within the flow model. */ readonly id: string; /** * The identifier of the scheme item this control was derived from */ readonly schemeId: string; /** * the page to which this row belongs */ readonly page: IAPage; /** * The plain text label of the control */ readonly text: string; /** * The translation key for the plain text label of the control */ readonly textTranslationKey: string; /** * The HTML mark-up label of the control */ readonly html: string; /** * The translation key for the HTML mark-up label of the control */ readonly htmlTranslationKey: string; /** * The substitution parameters for translations */ readonly translationParameters: string[]; /** * True if this control is visible, otherwise false */ readonly isVisible: boolean; /** * The reference of the record this control belongs to */ readonly recordReference: IARecordRef; /** * The width of the control in the row */ readonly layoutWidth: number; /** * The names of all custom properties set on this control */ readonly customPropertyNames: string[]; /** * Gets a custom property value * @param name - the name of the custom property */ getCustomProperty: (name: string) => any; } /** * A control */ export type IAControl = IAInputControl | IAReferenceListInputControl | IALabelControl | IARecordListControl | IARecordCollectControl | IAGroupControl | IAValidationControl | IADataAction; /** * An option for selection type controls. */ export type IAOption = { /** * The display text of the option */ text: string; /** * The parameterized display text of the option */ textTranslationKey: string; /** * The substitution parameters for translations */ translationParameters: string[]; /** * The canonical session value of the option that should be set if selected. */ value: T | null; }; /** * The full control value. */ export type IAFullControlValue = { /** * A record of the user's input for a given control. Provided as a convenience to allow user input to be stored but has no effect on the session */ rawValue?: any; /** * The canonical value as set in the session */ sessionValue: T | null; }; /** * The data type of an {@link IAInputControl} */ export type IAInputDataType = "number" | "boolean" | "text" | "date" | "record"; /** * The canonical session value for an {@link IAInputControl} */ export type IAInputValue = string | number | IADateValue | boolean | IARecordRef | null; /** * The canonical session value for any control */ export type IAFieldValue = IAInputValue | IARecordRef[]; /** * The style of input control. * @since 23.0.0 */ export type IAInputControlStyle = "radioButtons" | "checkBox" | "textBox" | "textArea" | "dropDown" | "custom"; /** * The style of a label control * @since 23.3.0 */ export type IALabelControlStyle = "default" | "h1" | "h2" | "h3" | "h4"; /*** * Specifies the input validations specified for a given {@link IAInputControl}, excluding 'Must satisfy' conditions. * @since 23.1.0 */ export interface IAInputRestrictions { /** * For number inputs. Indicates the value must be a whole number only. */ wholeNumber?: boolean; /** * For number inputs. Indicates the value must be at least the specified value. */ atLeast?: number; /** * For number inputs. Indicates the value must be at most the specified value. */ atMost?: number; /** * For text inputs. Specifies the set of regular expression the input must match. */ matches?: string[]; /** * For text inputs. Specifies the minimum character length of the input. */ minimumLength?: number; /** * For text inputs. Specifies the maximum character length of the input. */ maximumLength?: number; } /** * A control that collects a single value. * * @remarks * This control provides three methods for getting and setting the control's value: *
    *
  • {@link value} - gets or sets the controls as its canonical object representation.
  • *
  • {@link textValue} - gets or sets the control's value as text. Note: this option is not available for controls that have options.
  • *
  • {@link fullControlValue} - gets or sets the control's full {@link IAFullControlValue}. This is useful certain scenarios such as when it is easier to represent raw user input as * something other than a string, for example when a single value is collected using multiple UI controls.
  • *
* * As a general rule consumers should pick one method to get and set a control's value and not mix and match between the different options. *
* Any value set will not be reflected in the model until {@link IAFlowSession.refreshModel} is called. */ export interface IAInputControl extends IAControlBase { readonly kind: "input"; /** * The name of the field the control is collecting a value for. May be null if the * control is always read-only */ readonly fieldName: string | null; /** * the data type of the control */ readonly dataType: IAInputDataType; /** * The control's input style. * @since 23.0.0 */ readonly inputStyle: IAInputControlStyle; /** * Returns true if this control is read-only, otherwise false */ readonly isReadOnly: boolean; /** * Returns true if this control is required */ readonly isRequired: boolean; /** * Returns true if the control is editable, otherwise false. * * @remarks * An editable control is one which is both visible and not read-only */ readonly isEditable: boolean; /** * Returns true, if this control has constrained set of options */ readonly hasOptions: boolean; /** * If {@link hasOptions} is true, returns the set of options for this control, otherwise returns null. */ readonly options: IAOption[] | null; /** * Returns true if the specified value is the currently * @param v */ isSelected(v: T): boolean; /** * Gets or sets the value as a string. Cannot be used where {@link hasOptions} is true. * * @remarks * On get, returns the control's value as text. If the control has a non-null rawValue of type string it will return that, otherwise will return the session value as formatted by the default * formatter. * * On set, the control's rawValue will be set with the provided text value. If the provided value can be parsed according to the input formatters specified for this control, * it will set the control's sessionValue to the canonical parsed value, otherwise sessionValue will be set to null and an {@link IAFormatError} will be raised. * * * Any value set will not be reflected in the model until {@link IAFlowSession.refreshModel} is called. * * @throws string - error when attempting set a value if {@link isEditable} is false. Also throws error when accessing this property if {@link hasOptions} is true. * * @see {@link IAFullControlValue} * @see {@link value} * @see {@link fullControlValue} */ textValue: string; /** * Gets or sets the canonical sessionValue for this control. * * @remarks * Any rawValue previously held for this control will be set to null. * * Any value set will not be reflected in the model until {@link IAFlowSession.refreshModel} is called. * * @throws string - if the value is not valid for the control's type or when attempting set a value if {@link isEditable} is false. * * @see {@link IAFullControlValue} * @see {@link textValue} * @see {@link fullControlValue} */ value: T | null; /** * Gets or sets the full control value for the control. * * @remarks * This is equivalent to simultaneously setting {@link textValue} and {@link value} * * Any value set will not be reflected in the model until {@link IAFlowSession.refreshModel} is called. * * @throws string if the value is not valid for the control's type or when attempting set a value if {@link isEditable} is false. * @see {@link IAFullControlValue} */ fullControlValue: IAFullControlValue; /** * Returns the set of current errors for this control */ readonly errors: IAErrorInfo[]; /** * Returns the set of input restrictions defined for this control * @since 23.1.0 */ readonly inputRestrictions: IAInputRestrictions; /** * Parse the provided input according to the input formatters defined for the control. Cannot be used where {@link dataType} is "record" * @param input - the string to parse * * @returns the parsed value or null if the value cannot be parsed * @throws string - if this control's {@link dataType} is "record" */ parseValue(input: string): T | null; /** * Format a value according to the control's output formatter. Cannot be used where {@link dataType} is "record" * @param value - the value to format * * @returns the formatted value * @throws string - if this control's {@link dataType} is "record" */ formatValue(value: T): string; /** * Resets the control's value to the default value, or null if no default is configured for this control */ resetValue(): void; } /** * A control whose value is a list of references to records */ export interface IAReferenceListInputControl extends IAControlBase { readonly kind: "referenceList"; /** * The name of the field the control is collecting a value for. May be null if the * control is always read-only */ readonly fieldName: string | null; /** * Returns true if this control is read-only, otherwise false */ readonly isReadOnly: boolean; /** * Returns true if this control is required */ readonly isRequired: boolean; /** * Returns true if the control is editable, otherwise false. * * An editable control is one which is both visible and not read-only */ readonly isEditable: boolean; /** * Returns the set of options for this control. */ readonly options: IAOption[]; /** * Gets or sets the control's value * * Any value set will not be reflected in the model until {@link IAFlowSession.refreshModel} is called. * * @see {@link IAFullControlValue} * @see {@link fullControlValue} * * @throws string if the option is invalid for this control or {@link isEditable} is false. */ value: IARecordRef[] | null; /** * Gets or sets the control's full value * * @see {@link IAFullControlValue} * @see {@link value} * * @throws string if the option is invalid for this control or {@link isEditable} is false. */ fullControlValue: IAFullControlValue; /** * Gets the errors currently attached to this control */ readonly errors: IAErrorInfo[]; /** * Returns true if the specified record is selected, otherwise false * @param recordReference - the record to test */ isSelected(recordReference: IARecordRef): boolean; /** * Checks or uncheck an option by adding or removing the option's value from control's value * * Any value change will not be reflected in the model until {@link IAFlowSession.refreshModel} is called. * @param option - the option to check or uncheck * @param checked - true to check the option, otherwise false * * @throws string if the option is invalid for this control. */ checkOption(option: IAOption, checked: boolean): void; /** * Resets this control's value back to the default value, or empty list if no default is configured for this control */ resetValue(): void; } /** * A control that shows some text */ export interface IALabelControl extends IAControlBase { readonly kind: "label"; /** * The style of the label control * @since 23.3.0 */ readonly style: IALabelControlStyle; } /** * An array of {@link IARowArray} that are repeated for each record of a list */ export interface IAListControlBase extends IAControlBase { readonly kind: "recordList" | "recordCollect"; /** * A {@link IARowArray} for each record in the list */ readonly containers: IARowArray[]; } /** * An array of {@link IARowArray} that repeat for each record of a list to show information about those records. * * @remarks * Unlike an {@link IARecordCollectControl} this control does not directly collect a field value */ export interface IARecordListControl extends IAListControlBase { readonly kind: "recordList"; } /** * An array of {@link IARowArray} that are used to created, update and delete records in a Primary Record List. * * The set of currently existing objects in the object list is represented by the {@link IAListControlBase.containers} for this control */ export interface IARecordCollectControl extends IAListControlBase { readonly kind: "recordCollect"; /** * Returns true if this control is read-only, otherwise false */ readonly isReadOnly: boolean; /** * Returns true if this control is required * * @remarks If an IARecordCollect control is required it means it must have at least one record created for it */ readonly isRequired: boolean; /** * Returns true if the control is editable, otherwise false. * * @remarks * An editable control is one which is both visible and not read-only */ readonly isEditable: boolean; /** * The name of the record list being collected */ readonly fieldName: string; /** * The errors currently attached to the control */ readonly errors: IAErrorInfo[]; /** * Adds a new record. * * The newly added record will not be reflected in the model until {@link IAFlowSession.refreshModel} is called. * @returns a reference to the newly created record * * @throws string - when {@link isEditable} is false */ addNewRecord(): IARecordRef; /** * Removes a record * * The record's removal will not be reflected in the model until {@link IAFlowSession.refreshModel} is called. * @param recordReference - the record to remove * * @throws string - when {@link isEditable} is false */ removeRecord(recordReference: IARecordRef): void; /** * Resets the control's value back to the default value or no instances if no default is configured for this control */ resetValue(): void; } /** * An array of {@link IARow} with a {@link IAPage} */ export interface IAGroupControl extends IAControlBase, IARowArray { readonly kind: "group"; } /** * A control that provides an error message when its error condition has been met * * If the control is visible, the error conditions have been met and the error should be displayed. */ export interface IAValidationControl extends IAControlBase { readonly kind: "validation"; } /** * A field value that is part of a list of fields that were relevant for determining the value of a field * * @see {@link IAFlowSession.getSessionValueRelevance} * @since 23.3.0 */ export interface IARelevantField { /** * The reference to the record that the field belongs to */ readonly recordReference: IARecordRef; /** * The name of the field */ readonly fieldName: string; /** * The value of the field */ readonly value: IAFieldValue; }