///
import { TDocumentDefinitions } from 'pdfmake/interfaces';
export type TPDFPageSize = {
width: number;
height: number;
margins: [number, number, number, number];
};
export type TMaxImageSize = {
width: number;
height: number;
};
export type TCompressedBase64Image = {
base64Image: string;
width: number;
height: number;
};
export type TSetStartingPage = {
name: string;
page: number;
};
export type TPdfResultBlob = {
data: Blob;
filename: string;
};
export type TPdfResultBuffer = {
data: Buffer;
filename: string;
};
export type TPdfResultBase64 = {
data: string;
filename: string;
};
export type TPdfInputParams = {
json: IInputJsonData;
pdfMakeDefinition: (json: IInputJsonData) => Promise;
};
export interface IInputJsonData {
title: string;
description: string;
header: IHeader;
sets: ISet[];
history?: any;
}
export interface IHeader {
flags: IHeaderContent[];
elements: IHeaderContent[];
}
export interface IHeaderContent {
label: string;
value: string;
type: string;
}
export interface ISet {
views: IViewContent[];
sections: ISection[];
signatures: ISignature[];
}
export interface ISection {
inputs: IInputContent[];
views: IViewContent[];
sections: ISection[];
customIndex?: number | string;
}
export interface ISignature {
label: string | null;
authGroups: string[];
capaGroups: string[];
hint: string;
critical: string | boolean | null;
sequence: boolean;
applicable: boolean;
required: boolean;
elevatable: boolean;
responsible: ISignatureResponsible[];
}
export interface ISignatureResponsible {
userId: string;
timeStamp: string;
label: string;
notApplicable: boolean;
upgraded: boolean;
}
export interface IViewContent {
type: string;
value: string | null;
}
export interface IInputContent {
type: string;
label?: string;
unit?: string | null;
value?: string | boolean;
ref?: string;
isNote?: boolean;
min?: any;
max?: any;
note?: {
userId?: string;
userName?: string;
timestamp?: Date;
isSaved?: boolean;
};
}