UNPKG

@ministryofjustice/hmpps-digital-prison-reporting-frontend

Version:

The Digital Prison Reporting Frontend contains templates and code to help display data effectively in UI applications.

43 lines (42 loc) 1.46 kB
import type { Request } from 'express'; import { ActiveReportSessionData } from '../types/ActiveReportSession'; /** * Gets the field value for a specific session key * * @export * @param {Request} req * @param {string} sessionKey * @param {string} field * @return {*} */ export declare function getSessionValue(req: Request, sessionKey: string, field: string): unknown; interface ActiveJourneyKey { id: string; reportId: string; executionId?: string | undefined; tableId?: string | undefined; } export declare function getActiveJourneyValue<F extends keyof ActiveReportSessionData>(req: Request, keyParts: ActiveJourneyKey, // { reportId, id, tableId?, executionId? } field: F): ActiveReportSessionData[F] | undefined; /** * sets the current sort search on the active report session * * @export * @param {Request} req * @param {{ reportId: string; id: string; tableId?: string }} sessionKey * @param {(Record<string, string> | undefined)} sortData */ export declare function setActiveJourneySortSearch(req: Request, sessionKey: { reportId: string; id: string; tableId?: string | undefined; }, sortData: Record<string, string> | undefined): void; /** * Builds the active journey key * * @export * @param {ActiveJourneyKey} { reportId, id, type, executionId, tableId } * @return {*} {string} */ export declare function buildJourneyKey({ reportId, id, executionId, tableId }: ActiveJourneyKey): string; export {};