SME-Web/src/utlity/types.tsx

213 lines
3.6 KiB
TypeScript

import { JSX } from "react";
export interface DroppedItemOld {
id?: string;
icon: JSX.Element;
focusElementIndx?: number;
label?: string;
type: string;
subType?: string;
dimensions: {
left: number;
top: number;
width: number;
height: number;
}
recipientId: number;
// mask?: {
// type: string;
// character: string;
// }
maskType?: string;
maskCharacter?: string;
required?: boolean;
format?: string;
radioGroups?: DroppedItem[];
// documentIndex: number;
documentId: string;
pageIndex: number;
options?: string[]
selectedValue?: string | null;
radioPosition?: {
topMin: number;
topMax: number;
leftMin: number;
leftMax: number;
width?: number;
height?: number
};
value?: string | number;
validation?: {
minLength: number;
maxLength: number;
error: string;
regex: string[];
};
isDeleted: boolean;
}
export interface DroppedItemsObj {
[key: string]: DroppedItem[]
}
export enum OpenType {
TYPED,
DRAW,
UPLOADED
}
// types/account.ts
export enum UserRole {
OWNER = "OWNER",
ADMIN = "ADMIN",
EDITOR = "EDITOR",
VIEWER = "VIEWER",
}
export enum AccountStatus {
ACTIVE = "ACTIVE",
REJECTED = "REJECTED",
INVITED = "INVITED",
}
export interface AccountData {
accountId: number;
accountName: string;
role: UserRole;
status: AccountStatus;
}
export interface TagsProperties {
"editable": boolean;
"required": boolean;
"navigationOrder": number;
"type": string;
"lastName"?: boolean;
"firstName"?: boolean;
"maxLength"?: number;
"minLength"?: number;
"readOnly"?: boolean;
"multiLine"?: boolean;
"regex"?: string[];
"format"?: string;
"dateFormat"?: string;
"currentTimeStamp"?: boolean;
"decimalPlace"?: number;
"multiSelect"?: boolean;
"isCurrency"?: boolean;
}
export enum TagsTypes {
TEXT = "text",
SIGNATURE = "signature",
INITIALS = "initials",
TEMPORAL = "temporal",
NUMBER = "number",
IMAGE = "image",
STAMP = "stamp",
CHECKBOX = "checkbox",
SELECT = "select",
FILE = "file",
ATTACHMENT = "attachment",
RADIO = "radio",
EMAIL = "email",
NAME = "name",
COMPANY = "company",
}
export enum SignTypeEnum {
selfSign = "self_sign",
multipleSign = "multi_sign"
}
export interface StylesInterface {
font: string,
italic: boolean,
bold: boolean,
underline: boolean,
color: string,
textSize: number
}
export interface TagOptionAttrType{
label: string;
value: string;
pageIndex?: number;
selected?: boolean;
readOnly?: boolean;
dimensions?: Record<string, any>;
}
export interface DroppedItem {
id?: string;
icon: JSX.Element;
label?: string;
type: string;
// TagsProperties - Other Properties depend on tag type - START
navigationOrder: number;
editable: boolean;
lastName?: boolean;
firstName?: boolean;
maxLength?: number;
minLength?: number;
dateFormat?: string;
format?: string;
currentTimeStamp?: boolean;
decimalPlace?: number;
isCurrency?: boolean;
multiLine?: boolean;
maskType?: string;
maskCharacter?: string;
multiSelect?: boolean;
options?: TagOptionAttrType[];
readOnly?: boolean;
error: string;
regex?: string[];
// TagsProperties - Other Properties depend on tag type - END
dimensions: {
left: number;
top: number;
width: number;
height: number;
}
styles?: StylesInterface;
recipientId: number;
documentId: string;
pageIndex: number;
allowSenderToEdit: true;
allowSenderToDelete: true;
required?: boolean;
selectedValue?: string | null;
radioGroups?: DroppedItem[];
focusElementIndx?: number;
value?: string | number;
isDeleted: boolean;
}