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.

39 lines (36 loc) 1.22 kB
import { RequestHandler } from 'express'; import { Environment } from 'nunjucks'; import { Services } from '../types/Services.d.js'; import { DprConfig } from '../types/DprConfig.js'; /** * Middleware helper to populate all locals configuration * to enable DPR lib to operate correctly within a service. * * @param {Services} services * @param {string} layoutPath * @param {Environment} env * @param {DprConfig} [config] * @return {*} {RequestHandler} */ declare const setupResources: (services: Services, layoutPath: string, env: Environment, config?: DprConfig) => RequestHandler; /** * Checks if the get definition endpoint should be run * * @export * @param {{ lastDefinitionsCheck?: number }} session * @param {DprConfig} [config] * @return {*} {boolean} */ declare function shouldRunDefinitionsCheck(session: { lastDefinitionsCheck?: number; }, config?: DprConfig): boolean; /** * Records the last run into the session * * @export * @param {{ lastDefinitionsCheck?: number }} session */ declare function recordDefinitionsCheck(session: { lastDefinitionsCheck?: number; }): void; export { setupResources as default, recordDefinitionsCheck, setupResources, shouldRunDefinitionsCheck };