UNPKG

@docuseal/react

Version:

DocuSeal React components to integrate documents signing process into apps. ✍️

172 lines (171 loc) 5.26 kB
import React from 'react'; export type DocusealFormField = { name: string; title?: string; description?: string; type?: string; position?: number; required?: boolean; readonly?: boolean; validation?: { pattern?: string; message?: 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; currency?: "USD" | "EUR" | "GBP" | "CAD" | "AUD"; }; }; export type DocusealFormLoadData = { sandbox: boolean; template: { id: number; name: string; shared_link: boolean; }; submission: { id: number; name: string | null; } | null; submitter: { id: number; email: string; slug: string; name: string | null; phone: string | null; values: Record<string, unknown>; uuid: string; external_id: string | null; preferences: Record<string, unknown>; } | null; values: Record<string, unknown>; logo: { url: string; metadata: Record<string, unknown>; } | null; completed_submitter: { id: number; submission_id: number; email: string; name: string | null; completed_at: string; } | null; expired_submitter: { id: number; submission_id: number; declined_at: string | null; expire_at: string; } | null; }; type DocusealFormSubmitterData = { id: number; submission_id: number; email: string; phone: string | null; name: string | null; ua: string; ip: string; sent_at: string | null; opened_at: string | null; completed_at: string | null; declined_at: string | null; created_at: string; updated_at: string; external_id: string | null; metadata: Record<string, unknown>; status: 'completed' | 'declined' | 'expired' | 'pending'; decline_reason: string | null; role: string; preferences: Record<string, unknown>; values: Array<{ field: string; value: unknown; }>; submission_url: string; template: { id: number; name: string; external_id: string | null; created_at: string; updated_at: string; folder_name: string | null; }; submission: { id: number; audit_log_url: string | null; combined_document_url: string | null; status: 'completed' | 'declined' | 'expired' | 'pending'; url: string; variables: Record<string, unknown>; created_at: string; }; }; export type DocusealFormCompleteData = DocusealFormSubmitterData; export type DocusealFormDeclineData = DocusealFormSubmitterData; export type DocusealFormProps = { src?: string; token?: string; host?: string; role?: string; submitter?: string; expand?: boolean; minimize?: boolean; orderAsOnPage?: boolean; preview?: boolean; dryRun?: boolean; email?: string; name?: string; applicationKey?: string; externalId?: string; backgroundColor?: string; logo?: string; language?: string; completedMessage?: { title?: string; body?: string; }; completedRedirectUrl?: string; completedButton?: { title: string; url: string; }; goToLast?: boolean; skipFields?: boolean; autoscrollFields?: boolean; withTitle?: boolean; withDecline?: boolean; withFieldNames?: boolean; withFieldPlaceholder?: boolean; sendCopyEmail?: boolean; withDownloadButton?: boolean; withSendCopyButton?: boolean; withCompleteButton?: boolean; onlyRequiredFields?: boolean; allowToResubmit?: boolean; allowTypedSignature?: boolean; signature?: string; rememberSignature?: boolean; reuseSignature?: boolean; values?: object; metadata?: object; i18n?: object; fields?: DocusealFormField[]; readonlyFields?: string[]; onComplete?: (data: DocusealFormCompleteData) => void; onInit?: () => void; onDecline?: (data: DocusealFormDeclineData) => void; onLoad?: (data: DocusealFormLoadData) => void; className?: string; customCss?: string; style?: React.CSSProperties; }; declare const DocusealForm: ({ src, token, host, role, submitter, preview, dryRun, expand, minimize, orderAsOnPage, email, name, backgroundColor, sendCopyEmail, applicationKey, externalId, logo, language, completedRedirectUrl, completedButton, completedMessage, goToLast, skipFields, autoscrollFields, withTitle, withDecline, withFieldNames, withFieldPlaceholder, withDownloadButton, onlyRequiredFields, allowToResubmit, allowTypedSignature, signature, rememberSignature, reuseSignature, withSendCopyButton, withCompleteButton, values, metadata, i18n, fields, readonlyFields, onComplete, onInit, onDecline, onLoad, className, customCss, style }: DocusealFormProps) => JSX.Element; export default DocusealForm;