import { EntityEnum, IRowActions, LeaveActionEnum, LeaveStatusEnum, WorkFromHomeActionEnum, WorkFromHomeStatusEnum } from "../entities"; import { FlowConfig } from "../entities/flow-configs/flow-config.type"; export type LeaveStatusActionPair = { status: LeaveStatusEnum | WorkFromHomeStatusEnum; action: LeaveActionEnum | WorkFromHomeActionEnum; }; export type StatusActionPair = { status: S; action: A; }; /** * Gets available actions for a leave based on current status and user permissions * @param entityFlowConfig - The flow configuration for the entity * @param currentStatus - The current status of the leave * @param userPermissions - Array of permissions the user has * @param combineActions - Array of action values to combine into a single action * @param actionLabels - Object mapping actions to custom labels * @param data - Optional function to provide additional visibility conditions * @returns Array of available actions with labels and values */ export declare function getPermittedActionsOld(entityFlowConfig: { [key in T["status"]]?: { actions: { [key in T["action"]]?: { permissions: string[]; next: () => T["status"]; }; }; }; }, currentStatus: T["status"] | null, userPermissions: string[], combineActions?: T["action"][], actionLabels?: { [key in T["action"]]?: string; }, data?: (a: E) => { [permissionName: string]: () => boolean; }): { label: string; value: T["action"] | string; }[]; /** * Combines permitted action values into grouped actions where applicable. * If all actions in a combine group are present, they are replaced by a single combined key. * Combined actions use the provided custom label. * Remaining individual actions are preserved with default Title Case labels. * Does not introduce new actions beyond the permitted set. * Returns a map of action keys (enum values or combined string keys) to labels. */ export declare function combinePermittedActions(permittedActions: readonly T[], combinedActions: Record): Map; /** * Applies custom labels to existing action entries in the result map. * Only updates labels for enum-based action keys present in the map. * Combined action keys (string-only keys) are not affected. * Does not add or remove any actions from the map. * Falls back to existing labels when no custom label is provided. * Returns the same map instance with updated labels applied. */ export declare function applyActionLabels(result: Map, customLabels?: Partial>): Map; /** * Returns raw permitted action values for the given status and user permissions. * This function performs permission and visibility filtering only. * It does not apply action combination or labeling. */ export declare function getPermittedActions(entityFlowConfig: { [key in T["status"]]?: { actions: { [key in T["action"]]?: { permissions: string[]; next: () => T["status"]; }; }; }; }, currentStatus: T["status"] | null, userPermissions: string[], data?: (a: E) => { [key: string]: () => boolean; }): T["action"][]; export declare class EntityActionFlowResolver { getPermittedActions(entityFlowConfig: { [key in STATUS_ENUM_TYPE]?: { actions: { [key in ACTION_ENUM_TYPE]?: { permissions: string[]; next: (data: CONTEXT_DATA_TYPE) => STATUS_ENUM_TYPE; }; }; }; }, currentStatus: STATUS_ENUM_TYPE | null, userPermissions: string[], data?: (a: E) => { [key: string]: () => boolean; }): ACTION_ENUM_TYPE[]; _getPermittedActions(actionConfig: { [key in ACTION_ENUM_TYPE]?: { permissions: string[]; next: (data: CONTEXT_DATA_TYPE) => STATUS_ENUM_TYPE; }; }, userPermissions: string[], data: (a: E) => { [key: string]: () => boolean; }): (ACTION_ENUM_TYPE | string)[]; combinePermittedActions(permittedActions: readonly ACTION_ENUM_TYPE[], combinedActions?: Record): Map; applyActionLabels(result: Map, customLabels?: Partial>): Map; getAvailableActionsLabelValue(availableActionsFromModel: Map): { label: string; value: string; }[]; getAvailableActionsData(params: { flowConfig: FlowConfig; currentStatus: STATUS_ENUM_TYPE | null; userPermissions: string[]; visibilityData?: (e: E) => { [key: string]: () => boolean; }; combinedActions?: Record; customLabels?: Partial>; }): IRowActions[]; } export declare class EntityActionFlowResolverV2 { static getPermittedActions(entityFlowConfig: { [key in STATUS_ENUM_TYPE]?: { actions: { [key in ACTION_ENUM_TYPE]?: { permissions: string[]; next: (data: CONTEXT_DATA_TYPE) => STATUS_ENUM_TYPE; }; }; }; }, currentStatus: STATUS_ENUM_TYPE | null, userPermissions: string[], data?: (a: E) => { [key: string]: () => boolean; }): ACTION_ENUM_TYPE[]; static _getPermittedActions(actionConfig: { [key in ACTION_ENUM_TYPE]?: { permissions: string[]; next: (data: CONTEXT_DATA_TYPE) => STATUS_ENUM_TYPE; }; }, userPermissions: string[], data: (a: E) => { [permissionName: string]: () => boolean; }): (ACTION_ENUM_TYPE | string)[]; static combinePermittedActions(permittedActions: readonly ACTION_ENUM_TYPE[], combinedActions?: Record): Map; static applyActionLabels(result: Map, customLabels?: Partial>): Map; static getAvailableActionsLabelValue(availableActionsFromModel: Map): { label: string; value: string; }[]; static getAvailableActionsData(params: { flowConfig: FlowConfig; currentStatus: STATUS_ENUM_TYPE | null; userPermissions: string[]; visibilityData?: (e: E) => { [key: string]: () => boolean; }; combinedActions?: Record; customLabels?: Partial>; }): IRowActions[]; }