@ministryofjustice/hmpps-digital-prison-reporting-frontend
Version:
The Digital Prison Reporting Frontend contains templates and code to help display data effectively in UI applications.
51 lines (50 loc) • 2.22 kB
TypeScript
import { Services } from 'src/dpr/types/Services';
import { RecentlyViewedReport, RequestedReport } from 'src/dpr/types/UserReports';
interface GetRemoveMyReportData {
reportId?: string | undefined;
id?: string | undefined;
executionId?: string | undefined;
tableId?: string | undefined;
}
/**
* Get a single report from My reports
* - validates the report and removes if invalid
*
* @param {GetRemoveMyReportData} reportData
* @param {('requested' | 'viewed')} type
* @param {Services} services
* @param {string} userId
* @return {*} {(Promise<RequestedReport | RecentlyViewedReport | undefined>)}
*/
export declare const getMyReport: (reportData: GetRemoveMyReportData, type: "requestedReports" | "recentlyViewedReports", services: Services, userId: string) => Promise<RequestedReport | RecentlyViewedReport | undefined>;
/**
* Gets all My Reports for a particular type
* - validats the list and removes invalid ones
*
* @param {('requested' | 'viewed')} type
* @param {Services} services
* @param {string} userId
* @return {*} {(Promise<(RequestedReport | RecentlyViewedReport)[]>)}
*/
export declare const getAllMyReports: (type: "requestedReports" | "recentlyViewedReports" | "subscriptions", services: Services, userId: string) => Promise<(RequestedReport | RecentlyViewedReport)[]>;
/**
* Add a report to my report
* - validates the incoming report data before addition
*
* @param {('requested' | 'viewed')} type
* @param {(RequestedReport | RecentlyViewedReport)} reportData
* @param {Services} services
* @param {string} userId
*/
export declare const addMyReport: (type: "requestedReports" | "recentlyViewedReports" | "subscriptions", reportData: RequestedReport | RecentlyViewedReport, services: Services, userId: string) => Promise<void>;
/**
* Removes a report from My Reports
*
* @param {('requested' | 'viewed')} type
* @param {GetRemoveMyReportData} reportData
* @param {Services} services
* @param {string} userId
* @return {*} {Promise<void>}
*/
export declare const removeMyReport: (type: "requestedReports" | "recentlyViewedReports" | "subscriptions", reportData: GetRemoveMyReportData, services: Services, userId: string) => Promise<void>;
export {};