import { ApprovalTypes } from '@oneblink/types'; /** * Inputs a form approval flow instance and set of form submission approvals and * returns a flattened array of nodes/steps with inlcuded metadata. * * #### Example * * ```js * const formApprovalFlowInstance = { * steps: [ * { * type: 'STANDARD', * group: 'oneblink:administrator', * isSkipped: false, * label: 'Manager Approval', * approvalFormId: '1234', * }, * { * type: 'CONCURRENT', * nodes: [ * { * label: 'HR Review', * group: 'oneblink:administrator', * isSkipped: false, * approvalFormId: '1234', * }, * { * label: 'Finance Review', * group: 'oneblink:administrator', * isSkipped: false, * approvalFormId: '1234', * }, * ], * }, * ], * } * * const formSubmissionApprovals = [ * { * id: 'approval1', * stepLabel: 'Manager Approval', * status: 'APPROVED', * createdAt: '2024-03-20T10:00:00Z', * updatedAt: '2024-03-20T10:00:00Z', * updatedBy: 'fake@fake.com', * group: 'oneblink:administrator', * approvalFormId: '1234', * }, * ] * * const nodesWithMeta = getFlowInstanceNodesWithMeta( * formApprovalFlowInstance, * formSubmissionApprovals, * ) * ``` * * Concurrent nodes are ordered as actioned (by the time they were actioned), * then the currently viewed pending approval if * `currentlyViewingFormSubmissionApprovalId` is provided, then remaining * unactioned nodes in definition order. Sequential steps around a concurrent * group are not reordered. * * @param formApprovalFlowInstance * @param formSubmissionApprovals * @param currentlyViewingFormSubmissionApprovalId The id of the approval * currently being viewed, used to keep that pending concurrent step next to * already actioned siblings. * @returns ApprovalTypes.FlowInstanceNodeWithMeta[] */ export declare function getFlowInstanceNodesWithMeta(formApprovalFlowInstance: ApprovalTypes.FormApprovalFlowInstance, formSubmissionApprovals: ApprovalTypes.FormSubmissionApproval[], currentlyViewingFormSubmissionApprovalId?: string): ApprovalTypes.FlowInstanceNodeWithMeta[];