@docuseal/react
Version:
DocuSeal React components to integrate documents signing process into apps. ✍️
90 lines (89 loc) • 3 kB
TypeScript
import React from 'react';
export type DocusealBuilderField = {
name: string;
type?: string;
role?: string;
title?: string;
description?: string;
required?: boolean;
readonly?: boolean;
default_value?: string;
width?: number;
height?: number;
options?: string[];
preferences?: {
font_size?: number;
font_type?: "bold" | "italic" | "bold_italic";
mask?: boolean | number;
font?: "Times" | "Helvetica" | "Courier";
color?: "black" | "white" | "blue";
align?: "left" | "center" | "right";
valign?: "top" | "center" | "bottom";
format?: string;
price?: number;
with_signature_id?: boolean;
currency?: "USD" | "EUR" | "GBP" | "CAD" | "AUD";
};
validation?: {
pattern?: string;
message?: string;
min?: number | string;
max?: number | string;
step?: number;
};
};
export type DocusealBuilderSubmitter = {
email?: string;
role?: string;
name?: string;
phone?: string;
};
export type DocusealBuilderProps = {
token: string;
host?: string;
withRecipientsButton?: boolean;
withSendButton?: boolean;
withTitle?: boolean;
withDocumentsList?: boolean;
withFieldsList?: boolean;
withFieldsDetection?: boolean;
withFieldPlaceholder?: boolean;
onlyDefinedFields?: boolean;
preview?: boolean;
previewMode?: boolean;
inputMode?: boolean;
language?: string;
autosave?: boolean;
roles?: string[];
fieldTypes?: string[];
drawFieldType?: string;
fields?: DocusealBuilderField[];
submitters?: DocusealBuilderSubmitter[];
requiredFields?: DocusealBuilderField[];
i18n?: object;
withSignYourselfButton?: boolean;
withUploadButton?: boolean;
withSignatureId?: boolean;
withAddPageButton?: boolean;
onLoad?: (detail: any) => void;
onUpload?: (detail: any) => void;
onSend?: (detail: any) => void;
onSave?: (detail: any) => void;
onChange?: (detail: any) => void;
customButton?: {
title: string;
url: string;
};
emailMessage?: {
subject: string;
body: string;
};
backgroundColor?: string;
saveButtonText?: string;
sendButtonText?: string;
className?: string;
customCss?: string;
style?: React.CSSProperties;
};
declare const DocusealBuilder: ({ token, host, language, preview, previewMode, inputMode, autosave, withRecipientsButton, withDocumentsList, withFieldsList, withFieldsDetection, withFieldPlaceholder, withSendButton, withTitle, onlyDefinedFields, withSignYourselfButton, withUploadButton, withAddPageButton, withSignatureId, roles, fields, submitters, requiredFields, i18n, fieldTypes, drawFieldType, customButton, emailMessage, backgroundColor, onLoad, onUpload, onSend, onSave, onChange, className, sendButtonText, saveButtonText, customCss, style }: DocusealBuilderProps) => JSX.Element;
export default DocusealBuilder;