import React, { ComponentProps, JSX, ReactNode, ComponentType } from "react"; import { Logger, PdfDocumentObject, PdfFile, PdfDestinationObject, Rotation, PdfEngine, PdfEngineError, PdfInkAnnoObject, PdfPolygonAnnoObject, PdfPolylineAnnoObject, PdfLineAnnoObject, PdfLinkAnnoObject, PdfHighlightAnnoObject, PdfTextAnnoObject, PdfFreeTextAnnoObject, PdfStampAnnoObject, PdfImageObject, PdfFormObject, PdfPathObject, Rect, Position, PdfTransformMatrix, PdfAnnotationObject, PdfPopupAnnoObject, PdfCircleAnnoObject, PdfSquareAnnoObject, PdfSquigglyAnnoObject, PdfUnderlineAnnoObject, PdfCaretAnnoObject, PdfStrikeOutAnnoObject, FormFieldValue, PdfPageObject, PdfWidgetAnnoField, PdfWidgetAnnoObject, Size, PdfAnnotationSubtype, PdfTextRectObject, PdfBookmarkObject, PdfSignatureObject } from "@unionpdf/models"; /** * Strings used in the application */ export interface UIStrings { unknownError: string; rotate0Deg: string; rotate90Deg: string; rotate180Deg: string; rotate270Deg: string; thumbnails: string; bookmarks: string; noBookmarks: string; saveAs: string; print: string; metadata: string; title: string; author: string; subject: string; keywords: string; producer: string; creator: string; creationDate: string; modificationDate: string; search: string; nextMatch: string; previousMatch: string; matchCase: string; matchWholeWord: string; matchConsecutive: string; attchments: string; noAttachments: string; fileName: string; fileSize: string; fileCreationDate: string; download: string; upload: string; signatures: string; noSignatures: string; extract: string; pencil: string; fillForm: string; stamps: string; addTextBox: string; addStamp: string; addImage: string; selection: string; annotation: string; createStamp: string; cancel: string; exit: string; edit: string; open: string; save: string; commit: string; discard: string; uncommittedWarning: string; printing: string; remove: string; noFiles: string; merge: string; merging: string; extractPages: string; extractText: string; } /** * Context contains all the strings */ export const UIStringsContext: React.Context; /** * Properties of UIStringsContextProvider */ export interface UIStringsContextProviderProps { /** * customized ui strings */ strings: UIStrings; children: React.ReactNode; } /** * Provider of ui strings, use this to customize the text in this application * @param props - properties of UIStringsContextProvider * @returns * * @public */ export function UIStringsContextProvider(props: UIStringsContextProviderProps): React.JSX.Element; /** * Hooks for retrieve strings * @returns ui strings * * @public */ export function useUIStrings(): UIStrings; export interface AdaptableComponent { scenario: S | { usage: 'test'; }; } export type DialogScenario = { usage: 'stamp'; } | { usage: 'uncommitted-changes'; } | { usage: 'plugin'; pluginKey: PdfApplicatinPluginKey; }; export interface DialogProps extends Omit, 'open'>, AdaptableComponent { title: string; isOpened: boolean; onClose: () => void; onClosed?: () => void; } export type PanelScenario = { usage: 'plugin'; pluginKey: PdfApplicatinPluginKey; }; export interface PanelProps extends ComponentProps<'div'>, AdaptableComponent { isOpened: boolean; onClose: () => void; onClosed?: () => void; } export type ToolbarScenario = { usage: 'pdf-toolbar-plugin'; }; export interface ToolbarProps extends ComponentProps<'div'>, AdaptableComponent { } export type ToolbarItemGroupScenario = { usage: 'editor-plugin-operation-item-group'; } | { usage: 'editor-plugin-file-item-group'; } | { usage: 'pages-plugin-item-group'; } | { usage: 'plugins-plugin-item-group'; } | { usage: 'plugins-file-item-group'; }; export interface ToolbarItemGroupProps extends ComponentProps<'div'>, AdaptableComponent { } export type LinkScenario = { usage: 'downloader'; }; export interface LinkProps extends ComponentProps<'a'>, AdaptableComponent { } export type ButtonScenario = { usage: 'annotation-resizer'; } | { usage: 'dialog-close'; } | { usage: 'extractor-extract-pages'; } | { usage: 'extractor-extract-text'; } | { usage: 'editor-panel-selection'; } | { usage: 'editor-panel-pencil'; } | { usage: 'start-create-stamp'; } | { usage: 'cancel-create-stamp'; } | { usage: 'confirm-create-stamp'; } | { usage: 'editor-operation-annotation'; } | { usage: 'editor-operation-stamp'; } | { usage: 'editor-operation-fill-form'; } | { usage: 'editor-operation-extract'; } | { usage: 'editor-operation-commit'; } | { usage: 'editor-operation-exit'; } | { usage: 'editor-operation-discard'; } | { usage: 'editor-operation-extract'; } | { usage: 'pdf-content-push-button'; } | { usage: 'merger-start-merge'; } | { usage: 'merger-remove-file'; } | { usage: 'attachment-download'; } | { usage: 'cancel-print'; } | { usage: 'search-previous-match'; } | { usage: 'search-next-match'; } | { usage: 'plugin-toggle'; pluginKey: PdfApplicatinPluginKey; }; export interface ButtonProps extends ComponentProps<'button'>, AdaptableComponent { } export type FormScenario = { usage: 'search'; }; export interface FormProps extends ComponentProps<'form'>, AdaptableComponent { } export type FormFieldScenario = { usage: 'search'; }; export interface FormFieldProps extends ComponentProps<'div'>, AdaptableComponent { } export interface LabelProps extends ComponentProps<'label'> { } export interface TextAreaProps extends ComponentProps<'textarea'> { } export interface InputProps extends ComponentProps<'input'> { } export interface SelectProps extends ComponentProps<'select'> { options: { label: string; value: string; }[]; } export interface CheckboxProps extends ComponentProps<'input'> { } export interface RadioButtonProps extends ComponentProps<'input'> { } export interface IconProps extends ComponentProps<'span'> { name: string; } export type UIComponent

= React.ComponentClass

| React.FunctionComponent

; /** * components used in the application */ export interface UIComponents { Panel: UIComponent; Dialog: UIComponent; Toolbar: UIComponent; ToolbarItemGroup: UIComponent; Link: UIComponent; Button: UIComponent; Icon: UIComponent; Form: UIComponent; FormField: UIComponent; Label: UIComponent; TextArea: UIComponent; Input: UIComponent; Select: UIComponent; Checkbox: UIComponent; RadioButton: UIComponent; } /** * Context contains all the components */ export const UIComponentsContext: React.Context; /** * Properties of UIComponentsContextProvider */ export interface UIComponentsContextProviderProps { /** * customized ui components */ components: UIComponents; children: React.ReactNode; } /** * Provider of ui components, use this to customize the text in this application * @param props - properties of UIComponentsContextProvider * @returns * * @beta */ export function UIComponentsContextProvider(props: UIComponentsContextProviderProps): React.JSX.Element; /** * Hooks for retrieve components * @returns ui components * * @public */ export function useUIComponents(): UIComponents; export const strings: UIStrings; export function Icon(props: IconProps): JSX.Element; export function Button(props: ButtonProps): JSX.Element; export function Link(props: LinkProps): JSX.Element; export function Toolbar(props: ToolbarProps): JSX.Element; export function ToolbarItemGroup(props: ToolbarItemGroupProps): JSX.Element; export function Select(props: SelectProps): JSX.Element; export function Input(props: InputProps): JSX.Element; export function TextArea(props: TextAreaProps): JSX.Element; export function Checkbox(props: CheckboxProps): JSX.Element; export function RadioButton(props: RadioButtonProps): JSX.Element; export function Label(props: LabelProps): JSX.Element; export function Form(props: FormProps): JSX.Element; export function FormField(props: FormFieldProps): JSX.Element; export function Dialog(props: DialogProps): JSX.Element; export interface PanelMountPointContextValue { domElem: HTMLElement | null; } export const PanelMountPointContext: React.Context; export interface PanelMountPointContextProviderProps { domElem: HTMLElement | null; children: React.ReactNode; } export function PanelMountPointContextProvider(props: PanelMountPointContextProviderProps): JSX.Element; export function Panel(props: PanelProps): React.ReactPortal | null; export const components: UIComponents; export interface PdfNativeAdapterProviderProps { strings?: UIStrings; components?: UIComponents; children: ReactNode; } export function PdfNativeAdapterProvider(props: PdfNativeAdapterProviderProps): React.JSX.Element; /** * Properties of common error boundary component */ export interface ErrorBoundaryProps { /** * Log source */ source: string; /** * Logger instance */ logger: Logger; /** * children nodes */ children: React.ReactNode; } /** * State of common error boundary component */ export interface ErrorBoundaryState { /** * catched error */ error?: Error | undefined; } /** * Error boundary component */ export class ErrorBoundary extends React.Component { constructor(props: ErrorBoundaryProps); static getDerivedStateFromError(error: Error): { error: Error; }; componentDidCatch(error: Error, errorInfo: any): void; render(): string | number | bigint | boolean | Iterable | Promise> | Iterable | null | undefined> | React.JSX.Element | null | undefined; } /** * Value of IntersectionObserverContext */ export interface IntersectionObserverContextValue { observer: IntersectionObserver | null; visibleEntryIds: Set; } export const IntersectionObserverContext: React.Context; /** * Properties of IntersectionObserverContextProvider */ export interface IntersectionObserverContextProviderProps extends IntersectionObserverInit, ComponentProps<'div'> { asRoot?: boolean; children: ReactNode; } /** * Provider component for IntersectionObserverContext * this component will use IntersectionObserver to track visiblities * of entries in this component * @param props - properties of IntersectionObserverContextProvider * @returns * * @public */ export function IntersectionObserverContextProvider(props: IntersectionObserverContextProviderProps): React.JSX.Element; /** * Retrieve observer and visible entry ids * @returns IntersectionObserver and visible entry ids * * @public */ export function useIntersectionObserver(): IntersectionObserverContextValue; /** * Properties of IntersectionObserverEntry */ export interface IntersectionObserverEntryProps extends ComponentProps<'div'> { /** * Id of this entry */ entryId: string; } /** * Entry component for IntersectionObserver * this component will use IntersectionObserver to track visiblities of itself * @param props - properties of IntersectionObserverEntryProvider * @returns * * @public */ export function IntersectionObserverEntry(props: IntersectionObserverEntryProps): React.JSX.Element; /** * Type of value in document context */ export interface PdfDocumentContextValue { /** * File version */ version: number; /** * Set the version of file, use this to trigger rerender after editing file * @param version - new file version * @returns */ setVersion: (version: number) => void; /** * Pdf document */ doc: PdfDocumentObject | null; /** * Pdf file */ file: PdfFile | null; } /** * Pdf document context */ export const PdfDocumentContext: React.Context; export interface PdfDocumentContextProviderProps extends PdfDocumentContextValue { children: ReactNode; } /** * Function componnent, inject properties into document context * @param props - component properties * @returns new pdf application component */ export function PdfDocumentContextProvider(props: PdfDocumentContextProviderProps): React.JSX.Element; /** * Retrieve document configuration * @returns document configuration in context * * @public */ export function usePdfDocument(): PdfDocumentContextValue; export const LoggerContext: React.Context; /** * Properties of LoggerContextProvider */ export interface LoggerContextProviderProps { /** * Logger instance */ logger: Logger; /** * Children nodes */ children: ReactNode; } /** * Provider of LoggerContext * @param props - properties * @returns * * @public */ export function LoggerContextProvider(props: LoggerContextProviderProps): React.JSX.Element; /** * Hooks to retrieve logger instance * @returns Logger instance */ export function useLogger(): Logger; /** * Event for goto specific pdf page */ export interface PdfNavigatorGotoPageEvent { /** * event kind */ kind: 'GotoPage'; /** * event data */ data: { /** * destination of navigation */ destination: PdfDestinationObject; }; } /** * Navigation event */ export type PdfNavigatorEvent = PdfNavigatorGotoPageEvent; /** * Listerer of navigation event, source needs to be unique */ export type PdfNavigatorListener = { /** * event source of the listner */ source: string; /** * handler of navigation event * @param event - navigation event * @param source - event source * @returns */ handler: (event: PdfNavigatorEvent, source: string) => void; }; /** * Pdf navigator, can used to navigation inside of pdf document */ export interface PdfNavigator { /** * current page index */ currPageIndex: number; /** * Goto specific page by sending navigation event * @param evt - navigation event * @param source - event source */ gotoPage(evt: PdfNavigatorGotoPageEvent['data'], source: string): void; /** * add event listener * @param source - event source * @param handler - event handler */ addEventListener(source: string, handler: PdfNavigatorListener['handler']): void; /** * remove event listener * @param source - event source * @param handler - event handler */ removeEventListener(source: string, handler: PdfNavigatorListener['handler']): void; } /** * context for maintaing pdf navigator */ export const PdfNavigatorContext: React.Context; /** * Properties of PdfNavigatorContextProvider */ export interface PdfNavigatorContextProviderProps { children: ReactNode; } /** * Provider component to provide pdf navigator * @param props - properties of PdfNavigatorContextProvider * @returns */ export function PdfNavigatorContextProvider(props: PdfNavigatorContextProviderProps): React.JSX.Element; /** * Retrieve pdf navigator in context * @returns pdf navigator * * @public */ export function usePdfNavigator(): PdfNavigator; /** * Application mode * * @public */ export enum PdfApplicationMode { /** * Used for viewing pdf files */ View = 0, /** * Used for editing pdf files */ Edit = 1 } /** * Plugin configuration * * @public */ export interface PdfApplicatinPluginConfiguration { /** * Whether plugin is enabled */ isEnabled: boolean; /** * Whether plugin is visible */ isVisible: boolean; } /** * Key for application plugin * * @public */ export enum PdfApplicatinPluginKey { Attachments = 0, Bookmarks = 1, Downloader = 2, Editor = 3, Metadata = 4, Pages = 5, Printer = 6, Search = 7, Signatures = 8, Thumbnails = 9, Toolbar = 10, Uploader = 11 } export const ALL_PDF_APPLICATION_PLUGIN_KEYS: PdfApplicatinPluginKey[]; /** * Default configuration for plugins * * @public */ export const DEFAULT_PLUGIN_CONFIGURATIONS: Record; /** * Configuration of pdf application * * @public */ export interface PdfApplicationConfiguration { /** * Rotation angle of pdf pages */ rotation: Rotation; /** * Scaling factor of pdf pages */ scaleFactor: number; /** * Configuration of plugins */ plugins: Record; } /** * Configuration provider is used to read/save application configuration * * @public */ export interface PdfApplicationConfigurationProvider { /** * Get application configuration * @returns applicaton configuration */ get: () => PdfApplicationConfiguration; /** * Set rotation angle * @param rotation - rotation angle * @returns */ setRotation: (rotation: Rotation) => void; /** * Set scaling factor * @param scaleFactor * @returns */ setScaleFactor: (scaleFactor: number) => void; /** * show plugin specificed by pluginKey * @param pluginKey * @returns */ showPlugin: (pluginKey: PdfApplicatinPluginKey) => void; /** * hide plugin specificed by pluginKey * @param pluginKey * @returns */ hidePlugin: (pluginKey: PdfApplicatinPluginKey) => void; /** * toggle plugin specificed by pluginKey * @param pluginKey * @returns */ togglePlugin: (pluginKey: PdfApplicatinPluginKey) => void; /** * Subscribe to the configuration changes * @param callback * @returns */ subscribe: (callback: (configuration: PdfApplicationConfiguration) => void) => void; /** * Unsubscribe from the configuration changes * @param callback * @returns */ unsubscribe: (callback: (configuration: PdfApplicationConfiguration) => void) => void; } /** * Base class for configuration provider * * @public */ export class PdfApplicationConfigurationProviderBase implements PdfApplicationConfigurationProvider { protected rotation: Rotation; protected scaleFactor: number; protected plugins: Record; /** * Callbacks that subscribed to the configuration change event * * @private */ callbacks: Array<(configuratin: PdfApplicationConfiguration) => void>; /** * Create an instance of PdfApplicationConfigurationProviderBase * @param rotation - rotation angle * @param scaleFactor - scale factor * @param plugins - plugins configurations */ constructor(rotation?: Rotation, scaleFactor?: number, plugins?: Record); /** * broadcast configuration changes event to subscribers * * @protected */ broadcast(): void; /** @inheritDoc PdfApplicationConfigurationProvider.subscribe */ subscribe(callback: (configuration: PdfApplicationConfiguration) => void): void; /** @inheritDoc PdfApplicationConfigurationProvider.unsubscribe */ unsubscribe(callback: (configuration: PdfApplicationConfiguration) => void): void; /** @inheritDoc PdfApplicationConfigurationProvider.get */ get(): PdfApplicationConfiguration; /** @inheritDoc PdfApplicationConfigurationProvider.setRotation */ setRotation(rotation: Rotation): void; /** @inheritDoc PdfApplicationConfigurationProvider.setScaleFactor */ setScaleFactor(scaleFactor: number): void; /** @inheritDoc PdfApplicationConfigurationProvider.showPlugin */ showPlugin(pluginKey: PdfApplicatinPluginKey): void; /** @inheritDoc PdfApplicationConfigurationProvider.hidePlugin */ hidePlugin(pluginKey: PdfApplicatinPluginKey): void; /** @inheritDoc PdfApplicationConfigurationProvider.togglePlugin */ togglePlugin(pluginKey: PdfApplicatinPluginKey): void; } /** * Configuration provider that maintains configuration with variables in memory */ export class MemoryPdfApplicationConfigurationProvider extends PdfApplicationConfigurationProviderBase implements PdfApplicationConfigurationProvider { } /** * Configuration provider that maintains configuration with variables in storage */ export class StoragePdfApplicationConfigurationProvider extends PdfApplicationConfigurationProviderBase implements PdfApplicationConfigurationProvider { protected rotation: Rotation; protected scaleFactor: number; protected plugins: Record; /** * Create an instance of StoragePdfApplicationConfigurationProvider * @param storage - storaged used for saving configuration * @param key - key for searching configuration in storage * @param rotation - rotation angle * @param scaleFactor - scaling factor * @param plugins - plugins configurations */ constructor(storage: Storage, key: string, rotation?: Rotation, scaleFactor?: number, plugins?: Record); /** * init provider * * @private */ init(): void; /** * save configuration * * @private */ save(): void; /** * @inheritdoc PdfApplicationConfigurationProviderBase.broadcast */ broadcast(): void; } /** * Type of value in pdf application context */ export interface PdfApplicationContextValue extends PdfApplicationConfiguration { /** * Application mode */ mode: PdfApplicationMode; /** * Set scaling factor * @param scaleFactor - scaling factor * @returns */ setScaleFactor: (scaleFactor: number) => void; /** * Set rotation * @param rotation - rotation angle * @returns */ setRotation: (rotation: Rotation) => void; /** * Show application plugin * @param pluginKey - key of plugin * @returns */ showPlugin: (pluginKey: PdfApplicatinPluginKey) => void; /** * Hide application plugin * @param pluginKey - key of plugin * @returns */ hidePlugin: (pluginKey: PdfApplicatinPluginKey) => void; /** * Toggle application plugin * @param pluginKey - key of plugin * @returns */ togglePlugin: (pluginKey: PdfApplicatinPluginKey) => void; } /** * Pdf application context */ export const PdfApplicationContext: React.Context; /** * Property of application context provider */ export interface PdfApplicationContextProviderProps { children: ReactNode; /** * application configuration provider */ provider: PdfApplicationConfigurationProvider; } /** * Application context provider * @param props - properties * @returns new application context provider component */ export function PdfApplicationContextProvider(props: PdfApplicationContextProviderProps): React.JSX.Element; /** * Retrieve application configuration * @returns application configuration in context * * @public */ export function usePdfApplication(): PdfApplicationContextValue; /** * Pdf application component properties */ export interface PdfApplicationProps extends ComponentProps<'div'> { } /** * Function componnent, use {@link PdfApplicationContextProvider} to configure * @param props - component properties * @returns new pdf application component */ export function PdfApplication(props: PdfApplicationProps): React.JSX.Element; export const PdfEngineContext: React.Context; /** * Properties of PdfEngineContextProvider * * @public */ export interface PdfEngineContextProviderProps { /** * Instance of pdf engine */ engine: PdfEngine; children: ReactNode; } /** * Component for providing pdf engine in PdfEngineContext * @param props * @returns * * @public */ export function PdfEngineContextProvider(props: PdfEngineContextProviderProps): React.JSX.Element; /** * Retrieve pdf engine from PdfEngineContext * @returns pdf engine * * @public */ export function usePdfEngine(): PdfEngine | null; /** * Theme, you can put anything in it */ export interface Theme extends Record { } /** * default theme */ export const defaultTheme: Theme; export const ThemeContext: React.Context; /** * Properties of ThemeContextProvider */ export interface ThemeContextProviderProps { /** * Application theme */ theme: Theme; children: JSX.Element; } /** * Provider component for providing theme * @param props - properties of ThemeContextProvider * @returns */ export function ThemeContextProvider(props: ThemeContextProviderProps): JSX.Element; /** * Hooks for retrieve theme * @returns theme in context */ export function useTheme(): Theme; /** * Properties of component PdfDocument */ export interface PdfDocumentProps extends ComponentProps<'div'> { /** * Pdf file */ file: PdfFile | null; /** * password for pdf file */ password: string; /** * callback when file is opened successfully * @param pdf - opened pdf document * @returns */ onOpenSuccess?: (pdf: PdfDocumentObject) => void; /** * callback when file can not be opened * @param pdf - opened pdf document * @returns */ onOpenFailure?: (error: PdfEngineError) => void; } /** * Function component PdfDocument, this component is responsible for * opening pdf file and providing the opend document with PdfDocumentContext */ export function PdfDocument(props: PdfDocumentProps): React.JSX.Element; /** * Properties of PdfPlugin */ export interface PdfPluginProps extends ComponentProps<'div'> { /** * key of plugin */ pluginKey: PdfApplicatinPluginKey; } /** * Pdf plugin wrapper, it will use configuration in PdfApplicationContext to * maintain visiblity of plugin content * @param props - properties of PdfPlugin * @returns * * @public */ export function PdfPlugin(props: PdfPluginProps): React.JSX.Element | null; /** * Properties of PdfPluginDialog */ export interface PdfPluginDialogProps extends ComponentProps<'div'> { /** * key of plugin */ pluginKey: PdfApplicatinPluginKey; /** * title of dialog */ title: string; } /** * Pdf plugin dialog, it will use configuration in PdfApplicationContext to * maintain visiblity of plugin content * @param props - properties of PdfPluginDialog * @returns * * @public */ export function PdfPluginDialog(props: PdfPluginDialogProps): React.JSX.Element; /** * Properties of PdfPluginDialog */ export interface PdfPluginPanelProps extends ComponentProps<'div'> { /** * key of plugin */ pluginKey: PdfApplicatinPluginKey; } /** * Pdf plugin panel, it will use configuration in PdfApplicationContext to * maintain visiblity of plugin content * @param props - properties of PdfPluginDialog * @returns * * @public */ export function PdfPluginPanel(props: PdfPluginPanelProps): React.JSX.Element; /** * Properties of PdfPageInkAnnotation */ export interface PdfPageInkAnnotationProps extends PdfPageAnnotationProps { /** * Pdf ink annotation object */ annotation: PdfInkAnnoObject; } /** * Pdf ink annotation component * @param props - properties of PdfPageInkAnnotation * @returns * * @public */ export function PdfPageInkAnnotation(props: PdfPageInkAnnotationProps): React.JSX.Element; /** * Properties of PdfPagePolygoneAnnotation */ export interface PdfPagePolygonAnnotationProps extends PdfPageAnnotationProps { /** * Pdf caret annotation object */ annotation: PdfPolygonAnnoObject; } /** * Pdf caret annotation component * @param props - properties of PdfPagePolygoneAnnotation * @returns * * @public */ export function PdfPagePolygonAnnotation(props: PdfPagePolygonAnnotationProps): React.JSX.Element; /** * Properties of PdfPagePolylineAnnotation */ export interface PdfPagePolylineAnnotationProps extends PdfPageAnnotationProps { /** * Pdf polyline annotation object */ annotation: PdfPolylineAnnoObject; } /** * Pdf polyline annotation component * @param props - properties of PdfPagePolylineAnnotation * @returns * * @public */ export function PdfPagePolylineAnnotation(props: PdfPagePolylineAnnotationProps): React.JSX.Element; /** * Properties of PdfPageLineAnnotation */ export interface PdfPageLineAnnotationProps extends PdfPageAnnotationProps { /** * Pdf line annotation object */ annotation: PdfLineAnnoObject; } /** * Pdf line annotation component * @param props - properties of PdfPageLineAnnotation * @returns * * @public */ export function PdfPageLineAnnotation(props: PdfPageLineAnnotationProps): React.JSX.Element; export interface PdfLinkAnnoContextValue { onClick?: (evt: React.MouseEvent, link: PdfLinkAnnoObject) => void; } export const PdfLinkAnnoContext: React.Context; export interface PdfLinkAnnoContextProviderProps extends PdfLinkAnnoContextValue { children: ReactNode; } export function PdfLinkAnnoContextProvider(props: PdfLinkAnnoContextProviderProps): React.JSX.Element; export function usePdfLinkAnnoContext(): PdfLinkAnnoContextValue; /** * Properties of PdfPageLinkAnnotation */ export interface PdfPageLinkAnnotationProps extends PdfPageAnnotationProps { /** * Pdf link annotation object */ annotation: PdfLinkAnnoObject; } /** * Pdf link annotation component * @param props - properties of PdfPageLinkAnnotation * @returns * * @public */ export function PdfPageLinkAnnotation(props: PdfPageLinkAnnotationProps): React.JSX.Element; /** * Properties of PdfPageHighlightAnnotation */ export interface PdfPageHighlightAnnotationProps extends PdfPageAnnotationProps { /** * Pdf highlight annotation object */ annotation: PdfHighlightAnnoObject; } /** * Pdf highlight annotation component * @param props - properties of PdfPageHighlightAnnotation * @returns * * @public */ export function PdfPageHighlightAnnotation(props: PdfPageHighlightAnnotationProps): React.JSX.Element; /** * Properties of PdfPageTextAnnotation */ export interface PdfPageTextAnnotationProps extends PdfPageAnnotationProps { /** * Pdf text annotation object */ annotation: PdfTextAnnoObject; } /** * Pdf text annotation component * @param props - properties of PdfPageTextAnnotation * @returns * * @public */ export function PdfPageTextAnnotation(props: PdfPageTextAnnotationProps): React.JSX.Element; /** * Properties of PdfPageFreeTextAnnotation */ export interface PdfPageFreeTextAnnotationProps extends PdfPageAnnotationProps { /** * Pdf freetext annotation object */ annotation: PdfFreeTextAnnoObject; } /** * Pdf freetext annotation component * @param props - properties of PdfPageFreeTextAnnotation * @returns * * @public */ export function PdfPageFreeTextAnnotation(props: PdfPageFreeTextAnnotationProps): React.JSX.Element; /** * Properties of PdfPageStampAnnotation */ export interface PdfPageStampAnnotationProps extends PdfPageAnnotationProps { /** * Pdf stamp annotation object */ annotation: PdfStampAnnoObject; } /** * Pdf stamp annotation component * @param props - properties of PdfPageStampAnnotation * @returns * * @public */ export function PdfPageStampAnnotation(props: PdfPageStampAnnotationProps): React.JSX.Element; export function renderObject(ctx: CanvasRenderingContext2D, object: PdfImageObject | PdfFormObject | PdfPathObject, rect: Rect): void; export function transform(point: Position, matrix: PdfTransformMatrix, rect: Rect): { x: number; y: number; }; /** * Properties of PdfPagePopupAnnotation */ export interface PdfPagePopupAnnotationProps extends PdfPageAnnotationProps { parent: PdfAnnotationObject; /** * Pdf popup annotation object */ annotation: PdfPopupAnnoObject; } /** * Pdf popup annotation component * @param props - properties of PdfPagePopupAnnotation * @returns * * @public */ export function PdfPagePopupAnnotation(props: PdfPagePopupAnnotationProps): React.JSX.Element; /** * Properties of PdfPageCircleAnnotation */ export interface PdfPageCircleAnnotationProps extends PdfPageAnnotationProps { /** * Pdf circle annotation object */ annotation: PdfCircleAnnoObject; } /** * Pdf circle annotation component * @param props - properties of PdfPageCircleAnnotation * @returns * * @public */ export function PdfPageCircleAnnotation(props: PdfPageCircleAnnotationProps): React.JSX.Element; /** * Properties of PdfPageSqureAnnotation */ export interface PdfPageSquareAnnotationProps extends PdfPageAnnotationProps { /** * Pdf squre annotation object */ annotation: PdfSquareAnnoObject; } /** * Pdf squre annotation component * @param props - properties of PdfPageSqureAnnotation * @returns * * @public */ export function PdfPageSquareAnnotation(props: PdfPageSquareAnnotationProps): React.JSX.Element; /** * Properties of PdfPageSqugglyAnnotation */ export interface PdfPageSquigglyAnnotationProps extends PdfPageAnnotationProps { /** * Pdf squggly annotation object */ annotation: PdfSquigglyAnnoObject; } /** * Pdf squggly annotation component * @param props - properties of PdfPageSqugglyAnnotation * @returns * * @public */ export function PdfPageSquigglyAnnotation(props: PdfPageSquigglyAnnotationProps): React.JSX.Element; /** * Properties of PdfPageUnderlineAnnotation */ export interface PdfPageUnderlineAnnotationProps extends PdfPageAnnotationProps { /** * Pdf underline annotation object */ annotation: PdfUnderlineAnnoObject; } /** * Pdf underline annotation component * @param props - properties of PdfPageUnderlineAnnotation * @returns * * @public */ export function PdfPageUnderlineAnnotation(props: PdfPageUnderlineAnnotationProps): React.JSX.Element; /** * Properties of PdfPageCaretAnnotation */ export interface PdfPageCaretAnnotationProps extends PdfPageAnnotationProps { /** * Pdf caret annotation object */ annotation: PdfCaretAnnoObject; } /** * Pdf caret annotation component * @param props - properties of PdfPageCaretAnnotation * @returns * * @public */ export function PdfPageCaretAnnotation(props: PdfPageCaretAnnotationProps): React.JSX.Element; /** * Properties of PdfPageStrokeOutAnnotation */ export interface PdfPageStrikeOutAnnotationProps extends PdfPageAnnotationProps { /** * Pdf strokeout annotation object */ annotation: PdfStrikeOutAnnoObject; } /** * Pdf strokeout annotation component * @param props - properties of PdfPageStrokeOutAnnotation * @returns * * @public */ export function PdfPageStrikeOutAnnotation(props: PdfPageStrikeOutAnnotationProps): React.JSX.Element; export interface FieldCommonProps extends ComponentProps<'div'> { /** * page object that annotation is belonged to */ page: PdfPageObject; /** * pdf annotation object */ annotation: PdfAnnotationObject; /** * Field info */ field: PdfWidgetAnnoField; /** * Whether this field is editable */ isEditable: boolean; /** * config */ config?: PdfFormFieldConfig; /** * callback for value change */ onChangeValues?: (values: FormFieldValue[]) => void; } export interface FieldProps extends FieldCommonProps { } /** * * @param props - properties of Field * @returns Field component */ export function Field(props: FieldProps): React.JSX.Element; /** * Pdf form fied */ export interface PdfFormFieldConfig { values: FormFieldValue[]; } /** * Properties of PdfPageWidgetAnnotation */ export interface PdfPageWidgetAnnotationProps extends PdfPageAnnotationProps { /** * Pdf widget annotation object */ annotation: PdfWidgetAnnoObject; /** * Whether this field is editable */ isEditable?: boolean; /** * Field settings */ config?: PdfFormFieldConfig; /** * callback for value change */ onChangeValues?: (values: FormFieldValue[]) => void; } /** * Pdf widget annotation component * @param props - properties of PdfPageWidgetAnnotation * @returns * * @public */ export function PdfPageWidgetAnnotation(props: PdfPageWidgetAnnotationProps): React.JSX.Element; export const EDITOR_CONTEXT_LOG_SOURCE = "PdfEditorContext"; /** * Tool of pdf editor */ export enum PdfEditorTool { /** * Create/Edit Annotation */ Annotation = 0, /** * Fill form */ FillForm = 1, /** * Extract Page or Text */ Extract = 2, /** * Create/Add stamp */ Stamp = 3 } /** * Annotation tool */ export enum PdfAnnotationTool { /** * Select annotation for move or resize */ Selection = 0, /** * Drawing path */ Pencil = 1 } /** * Operation for annotations */ export type Operation = { id: string; action: 'create' | 'remove'; page: PdfPageObject; annotation: PdfAnnotationObject; } | { id: string; action: 'transform'; page: PdfPageObject; annotation: PdfAnnotationObject; params: { offset: Position; scale: Size; }; } | { id: string; action: 'set-form-field'; page: PdfPageObject; annotation: PdfWidgetAnnoObject; params: PdfFormFieldConfig; }; /** * Stack to track all operations on pdf document */ export interface PdfEditorStacks { /** * Undo stack, it contains all the uncommitted operations */ undo: Operation[]; /** * Redo stack, it contains all the cancelled operations */ redo: Operation[]; /** * Track operations by pages */ pages: Record; } /** * Status of operation stack */ export enum StackStatus { /** * No operations */ Empty = 0, /** * Has pending operations, need to dicard or commit */ Pending = 1 } /** * Flags for track pdf annotation */ export enum PdfAnnotationMarker { /** * current dragging annotation */ Dragging = 0 } /** * Value in PdfEditorContext */ export interface PdfEditorContextValue { /** * Current editor tool */ tool: PdfEditorTool; /** * Set editor tool * @param tool - target tool * @returns */ setTool: (tool: PdfEditorTool) => void; /** * Toggle editor tool * @param tool - target tool * @returns */ toggleTool: (tool: PdfEditorTool) => void; /** * Current annotation tool */ annotationTool: PdfAnnotationTool; /** * Set current annotation tool * @param tool - target annotation tool * @returns */ setAnnotationTool: (tool: PdfAnnotationTool) => void; /** * Form fields */ form: Record; /** * Set field settings */ setFormField: (page: PdfPageObject, annotation: PdfWidgetAnnoObject, config: PdfFormFieldConfig) => void; /** * Set field settings */ getFormField: (page: PdfPageObject, annotation: PdfWidgetAnnoObject) => PdfFormFieldConfig | undefined; /** * Query current stack status * @returns stack status */ queryStatus: () => StackStatus; /** * Query operations on specific pdf page * @param pageIndex - index of pdf page * @returns operations on pdf page */ queryByPageIndex: (pageIndex: number) => Operation[]; /** * Execute editing operation * @param operation - editing operation * @returns */ exec: (operation: Operation) => void; /** * Undo last operation if exist * @returns */ undo: () => void; /** * Redo last operation if exist * @returns */ redo: () => void; /** * commit operations */ commit: () => void; /** * discard operations * @returns di */ discard: () => void; /** * Copy annotation * @param annotation - target annotation * @returns */ copy: (annotation: PdfAnnotationObject) => void; /** * Paste annotation to pdf page * @param page - target pdf page * @returns */ paste: (page: PdfPageObject) => void; } export const PdfEditorContext: React.Context; /** * Properties of PdfEditorContextProvider */ export interface PdfEditorContextProviderProps { /** * Children nodes */ children: ReactNode; } /** * Provider of PdfEditorContext, used to maintaining editor status and data * @param props - properties of PdfEditorContextProvider * @returns * * @public */ export function PdfEditorContextProvider(props: PdfEditorContextProviderProps): React.JSX.Element; export function usePdfEditor(): PdfEditorContextValue; export interface PdfDraggableMoverOption { type: 'mover'; } /** * position of annotation resizer */ export enum ResizerPosition { TopLeft = 0, TopRight = 1, BottomRight = 2, BottomLeft = 3 } export interface PdfDraggableResizerOption { type: 'resizer'; position: ResizerPosition; } export type DraggableOption = PdfDraggableMoverOption | PdfDraggableResizerOption; export interface DraggableData { annotation: PdfAnnotationObject; option: DraggableOption; } export interface AnnotationsContextValue { onPointerDown: (evt: React.PointerEvent, annotation: PdfAnnotationObject, option: DraggableOption) => void; onPointerUp: (evt: React.PointerEvent) => void; onPointerCancel: (evt: React.PointerEvent) => void; } export const AnnotationsContext: React.Context; export function useAnnotationsContext(): AnnotationsContextValue; /** * path in drawable component */ export interface DrawablePath { /** * points in path */ points: Position[]; } /** * Handle of drawable component */ export interface DrawableHandle { /** * clear canvas */ clearCanvas: () => void; /** * get all paths in drawable component * @returns all path */ queryPaths: () => DrawablePath[]; /** * get all images in drawable component * @returns image data */ queryImage: () => ImageData | undefined; } /** * Properties of drawable component */ export interface DrawableProps extends ComponentProps<'canvas'> { /** * Reference of handle */ componentRef?: React.MutableRefObject; /** * callback that will be called when adding new patch * @param path - added path * @returns */ onAddPath: (path: DrawablePath) => void; } /** * Drawable component for drawaing paths * @param props - properties of drawable component * @returns * * @public */ export function Drawable(props: DrawableProps): React.JSX.Element; /** * Properties of PdfPageAnnotation */ export interface PdfPageAnnotationProps extends ComponentProps<'div'> { /** * page object that annotation is belonged to */ page: PdfPageObject; /** * pdf annotation object */ annotation: PdfAnnotationObject; /** * scaling factor */ scaleFactor: number; /** * Rotation angle */ rotation: Rotation; } /** * Base component for annotation, it will handle the positioning * @param props - properties of PdfPageAnnotation * @returns * * @public */ export function PdfPageAnnotation(props: PdfPageAnnotationProps): React.JSX.Element; /** * Properties of PdfPageAnnotationComponent, it will be passed to customized annotation * component */ export interface PdfPageAnnotationComponentProps extends ComponentProps<'div'> { /** * page object that annotation is belonged to */ page: PdfPageObject; /** * pdf annotation object */ annotation: PdfAnnotationObject; /** * scaling factor */ scaleFactor: number; /** * Rotation angle */ rotation: Rotation; } /** * Type of pdf annotation component */ export type PdfPageAnnotationComponent = ComponentType; /** * contenxt of pdf annotation component */ export const PdfPageAnnotationComponentContext: React.Context; /** * Properties of PdfPageAnnotationComponentContextProvider */ export interface PdfPageAnnotationComponentContexProviderProps extends ComponentProps<'div'> { /** * Customized annotation component */ component: PdfPageAnnotationComponent; } /** * Provider for page annotation component context * @param props - properties of PdfPageAnnotationComponentContextProvider * @returns */ export function PdfPageAnnotationComponentContextProvider(props: PdfPageAnnotationComponentContexProviderProps): React.JSX.Element; /** * Retrieve pdf annotation component in context * @returns pdf annotation component */ export function usePdfPageAnnotationComponent(): PdfPageAnnotationComponent; /** * Default annotation component, it's used in view mode. It will render content * of 3 kinds of annotation * * Text - to support text selection * Link - to support navigation * Widgt - to support form filling * * @param props - properties for default annotation * @returns * * @public */ export function PdfPageDefaultAnnotation(props: PdfPageAnnotationComponentProps): React.JSX.Element; /** * Properties of PdfPageAnnotations */ export interface PdfPageAnnotationsProps { /** * page object that annotation is belonged to */ page: PdfPageObject; /** * pdf annotations on the pdf page */ annotations: PdfAnnotationObject[]; /** * scaling factor */ scaleFactor: number; /** * Rotation angle */ rotation: Rotation; } /** * Page annotations components, used for rendering all annotations on pdf page * @param props - properties of PdfPageAnnotations * @returns * * @public */ export function PdfPageAnnotations(props: PdfPageAnnotationsProps): React.JSX.Element; /** * Hooks for using generated URL from arraybuffer * @param buffer - data buffer * @returns - url * * @public */ export function userUrl(buffer: ArrayBuffer | null): string; /** * Properties of downloader component */ export interface DownloaderProps { /** * File name */ name: string; /** * File content */ content: ArrayBuffer; } /** * File downloader component, it will render a link for download files * @param props - properties of downloader component * @returns * * @public */ export function Downloader(props: DownloaderProps): React.JSX.Element; /** * Properties of PdfToolbarEditorOperationItemGroup */ export interface PdfToolbarEditorOperationItemGroupProps extends ComponentProps<'div'> { } /** * Toolbar items for pdf editor, for edit operations * @param props - properties of PdfToolbarEditorOperationItemGroup * @returns */ export function PdfToolbarEditorOperationItemGroup(props: PdfToolbarEditorOperationItemGroupProps): React.JSX.Element; /** * Properties of PdfToolbarEditorFileItemGroup */ export interface PdfToolbarEditorFileItemGroupProps extends ComponentProps<'div'> { } /** * Toolbar items for pdf editor, for file operations * @param props - properties of PdfToolbarEditorFileItemGroup * @returns */ export function PdfToolbarEditorFileItemGroup(props: PdfToolbarEditorFileItemGroupProps): React.JSX.Element; /** * Annotations that supports moving */ export const ResizablePdfAnnotationSubTypes: PdfAnnotationSubtype[]; /** * Properties of PdfPageEditorAnnotation */ export interface PdfPageEditorAnnotationProps { /** * page object that annotation is belonged to */ page: PdfPageObject; /** * pdf annotation object */ annotation: PdfAnnotationObject; /** * scaling factor */ scaleFactor: number; /** * Rotation angle */ rotation: Rotation; } /** * Component for editable annotation * @param props - properties of PdfPageAnnotation * @returns * * @public */ export function PdfPageEditorAnnotation(props: PdfPageEditorAnnotationProps): React.JSX.Element; /** * Properties of PdfPageEditorAnnotationMover */ export interface PdfPageAnnotationMoverProps extends ComponentProps<'div'> { /** * page object that annotation is belonged to */ page: PdfPageObject; /** * pdf annotation object */ annotation: PdfAnnotationObject; /** * scaling factor */ scaleFactor: number; /** * Rotation angle */ rotation: Rotation; } /** * Component for moving annotation * @param props - properties of PdfPageAnnotationMover * @returns */ export function PdfPageAnnotationMover(props: PdfPageAnnotationMoverProps): React.JSX.Element; /** * Properties of PdfPageEditorAnnotationResizer */ export interface PdfPageAnnotationResizerProps extends ComponentProps<'button'> { /** * page object that annotation is belonged to */ page: PdfPageObject; /** * pdf annotation object */ annotation: PdfAnnotationObject; /** * scaling factor */ scaleFactor: number; /** * Rotation angle */ rotation: Rotation; /** * position of resizer */ position: ResizerPosition; } export const ResizerPositionClassName: { 0: string; 1: string; 2: string; 3: string; }; /** * Component for resizing annotation * @param props - properties of PdfPageAnnotationResizer * @returns */ export function PdfPageAnnotationResizer(props: PdfPageAnnotationResizerProps): React.JSX.Element; /** * Value of PdfEditorStampsContext */ export interface PdfEditorStampsContextValue { /** * All stamps */ stamps: Stamp[]; /** * Add new stamp * @param stamp - new stamp * @returns */ onAddStamp: (stamp: Stamp) => void; /** * Remove stamp * @param stamp - removed stamp * @returns */ onRemoveStamp: (stamp: Stamp) => void; } export const PdfEditorStampsContext: React.Context; /** * Properties of PdfEditorStampsContextProvider */ export interface PdfEditorStampsContextProviderProps extends PdfEditorStampsContextValue { children: JSX.Element; } /** * * @param props - properties of PdfEditorStampsContextProvider * @returns */ export function PdfEditorStampsContextProvider(props: PdfEditorStampsContextProviderProps): JSX.Element; /** * Retrieve stamps in context * @returns stamps */ export function usePdfEditorStamps(): PdfEditorStampsContextValue; export interface PdfEidtorStampsProps { } /** * Pdf editor stamps, used to render all stamps * @returns */ export function PdfEditorStamps(): React.JSX.Element; /** * Data when dragging stamp */ export interface DraggableStampData { type: 'stamp'; index: number; cursorPosition: Position; } /** * Stamp data */ export interface Stamp { source: ImageData; } /** * Properties of pdf editor stamp */ export interface PdfEditorStampProps { index: number; stamp: Stamp; } /** * Stamp component * @param props - properties of PdfEditorStamp * @returns */ export function PdfEditorStamp(props: PdfEditorStampProps): React.JSX.Element; export const EDITOR_ANNOTATIONS_LOG_SOURCE = "PdfEditorAnnotations"; /** * Properties of PdfPageEditorAnnotations */ export interface PdfPageEditorAnnotationsProps { /** * page object that annotation is belonged to */ page: PdfPageObject; /** * pdf annotations on the pdf page */ annotations: PdfAnnotationObject[]; /** * scaling factor */ scaleFactor: number; /** * Rotation angle */ rotation: Rotation; } /** * Page annotations components, used for rendering all annotations on pdf page * @param props - properties of PdfPageEditorAnnotations * @returns * * @public */ export function PdfPageEditorAnnotations(props: PdfPageEditorAnnotationsProps): React.JSX.Element; export interface PdfPageEditableAnnotationsProps { page: PdfPageObject; annotations: PdfAnnotationObject[]; scaleFactor: number; rotation: Rotation; extraOperations: Operation[]; } export function PdfPageEditableAnnotations(props: PdfPageEditableAnnotationsProps): React.JSX.Element; /** * Properties of PdfEditorCanvas */ export interface PdfPageEditorCanvasProps { /** * page object that annotation is belonged to */ page: PdfPageObject; /** * scaling factor */ scaleFactor: number; /** * Rotation angle */ rotation: Rotation; } /** * Pdf editor canvas for pdf page, used for drawing path on pdf page * @param props - properties of PdfEditorCanvas * @returns * * @public */ export function PdfPageEditorCanvas(props: PdfPageEditorCanvasProps): React.JSX.Element; /** * Properties of PdfEditorPanel */ export interface PdfEditorPanelProps { } /** * Editor panel, used to switch different annotation tool * @param props - properties of PdfEditorPanel * @returns */ export function PdfEditorPanel(props: PdfEditorPanelProps): React.JSX.Element | null; /** * Thumbnail layout direction */ export type Direction = 'horizontal' | 'vertical'; /** * Thumbnail layout */ export interface Layout { /** * direction of layout */ direction: Direction; /** * items count */ itemsCount: number; } /** * Properties of PdfThumbnail */ export interface PdfThumbnailsProps { layout?: Layout; size: Size; scaleFactor?: number; rotation?: Rotation; enableCheckbox?: boolean; selectedIndexes?: number[]; onClickCheckbox?: (page: PdfPageObject) => void; } export const PDF_NAVIGATOR_SOURCE_THUMBNAILS = "PdfThumbnails"; /** * Plugin used to viewing thumbnails * @param props - properties of PdfThumbnail * @returns */ export function PdfThumbnails(props: PdfThumbnailsProps): React.JSX.Element; /** * Content of PdfThumbnail * @param props - properties of PdfThumbnailContent * @returns * * @public */ export function PdfThumbnailsContent(props: PdfThumbnailsProps): React.JSX.Element; export interface PdfThumbnailsGridProps extends ComponentProps<'div'> { doc: PdfDocumentObject | null; currPageIndex: number; scaleFactor: number; rotation: Rotation; gotoPage: (page: PdfPageObject) => void; enableCheckbox: boolean; selectedIndexes: number[]; onClickThumbnail?: (page: PdfPageObject) => void; } export function PdfThumbnailsGrid(props: PdfThumbnailsGridProps): React.JSX.Element; export interface PdfThumbnailProps { page: PdfPageObject; scaleFactor: number; rotation: Rotation; isVisible: boolean; isCurrent: boolean; isSelected: boolean; onClick: (page: PdfPageObject) => void; enableCheckbox: boolean; onClickCheckbox?: (page: PdfPageObject) => void; } export function PdfThumbnail(props: PdfThumbnailProps): React.JSX.Element; /** * Pdf extractor component, used to extract pages and text from pdf document * @returns */ export function PdfEditorExtractor(): React.JSX.Element; /** * Properties of page layer component */ export interface PdfPageLayerComponentProps { /** * Whether page is current page */ isCurrent: boolean; /** * Whether page is visible */ isVisible: boolean; /** * Whether page is in visible range */ inVisibleRange: boolean; /** * Whether page is in cache range */ inCacheRange: boolean; /** * Pdf page object */ page: PdfPageObject; /** * Current scaling factor */ scaleFactor: number; /** * Current rotation angle */ rotation: Rotation; /** * Gap between pages */ pageGap: number; } /** * Type of pdf page layer component */ export type PdfPageLayerComponent = ComponentType; /** * Properties of PdfPageCanvasLayer */ export interface PdfPageCanvasLayerProps extends PdfPageLayerComponentProps { } /** * Page layer used to render page content * @param props - properties of PdfPageCanvasLayer * @returns */ export function PdfPageCanvasLayer(props: PdfPageCanvasLayerProps): React.JSX.Element | null; /** * Properties of PdfPageTextLayer */ export interface PdfPageTextLayerProps extends PdfPageLayerComponentProps { } /** * Page layer used to render page text * @param props - properties of PdfPageTextLayer * @returns */ export function PdfPageTextLayer(props: PdfPageTextLayerProps): React.JSX.Element; export interface PdfPageTextRectProps { page: PdfPageObject; textRect: PdfTextRectObject; rotation: Rotation; scaleFactor: number; } export function PdfPageTextRect(props: PdfPageTextRectProps): React.JSX.Element; /** * Page layer used to render annotations * @param props - properties of PdfPageAnnotationsLayer * @returns */ export function PdfPageAnnotationsLayer(props: PdfPageLayerComponentProps): React.JSX.Element; /** * Properties of PdfPageEditorLayer */ export interface PdfPageEditorLayerProps extends PdfPageLayerComponentProps { } /** * Page layer used to render page editor * @param props - properties of PdfPageEditorLayer * @returns */ export function PdfPageEditorLayer(props: PdfPageEditorLayerProps): React.JSX.Element | null; /** * Properties of PdfPageTextLayer */ export interface PdfPageDecorationsLayerProps extends PdfPageLayerComponentProps { } /** * Page layer used to render decorations on pages, note those decorations is for runtime behaviour * it won't save to pdf file directly. * @param props - properties of PdfPageDecorationsLayer * @returns */ export function PdfPageDecorationsLayer(props: PdfPageDecorationsLayerProps): React.JSX.Element; /** * Properties of PdfEditor */ export interface PdfEditorProps { } /** * Plugin used to edit pdf file * @param props - properties of PdfEditor * @returns */ export function PdfEditor(props: PdfEditorProps): React.JSX.Element; /** * Content of PdfEditor * @param props - properties of PdfEditorContent * @returns * * @public */ export function PdfEditorContent(props: PdfEditorProps): React.JSX.Element | null; export const PDF_NAVIGATOR_SOURCE_PAGES_TOOLBAR = "PdfToolbarPagesItemGroup"; export interface PdfToolbarPagesItemGroupProps extends ComponentProps<'div'> { } /** * Toolbar for pdf pages, used for navigation, rotation and scaling * @param props - properties of PdfToolbarPagesItemGroup * @returns */ export function PdfToolbarPagesItemGroup(props: PdfToolbarPagesItemGroupProps): React.JSX.Element; /** * Properties of PdfToolbar */ export interface PdfToolbarProps extends ComponentProps<'div'> { /** * Toolbar items for plugins */ pluginItems?: React.ReactNode; /** * Toolbar items for pdf files */ fileItems?: React.ReactNode; } /** * Plugin to display toolbar * @param props - properties of PdfToolbar * @returns */ export function PdfToolbar(props: PdfToolbarProps): React.JSX.Element; /** * Properties of PdfToolbarPluginItemGroup */ export interface PdfToolbarPluginItemGroupProps extends ComponentProps<'div'> { } /** * Component for showing toolbar item for plugins * @param props - properties of PdfToolbarPluginItemGroup * @returns */ export function PdfToolbarPluginItemGroup(props: PdfToolbarPluginItemGroupProps): React.JSX.Element; /** * Properties of PdfToolbarPluginItem */ export interface PdfToolbarPluginItemProps { /** * Text of toolbar item */ text: string; /** * Key for relevant plugin */ pluginKey: PdfApplicatinPluginKey; } /** * Component for showing toolbar item for plugin * @param props - properties of PdfToolbarFileItem * @returns */ export function PdfToolbarPluginItem(props: PdfToolbarPluginItemProps): React.JSX.Element | null; /** * Properties of PdfToolbarFileItemGroup */ export interface PdfToolbarFileItemGroupProps extends ComponentProps<'div'> { } /** * Component for showing toolbar item for plugins * @param props - properties of PdfToolbarFileItemGroup * @returns */ export function PdfToolbarFileItemGroup(props: PdfToolbarFileItemGroupProps): React.JSX.Element; /** * Properties of PdfMetadata */ export interface PdfMetadataProps extends ComponentProps<'div'> { } /** * Plugin used to view pdf metadata * @param props - properties of PdfMetadata * @returns */ export function PdfMetadata(props: PdfMetadataProps): React.JSX.Element; /** * Content of PdfMetadata * @param props - properties of PdfMetadataContent * @returns * * @public */ export function PdfMetadataContent(props: PdfMetadataProps): React.JSX.Element; export const PDF_NAVIGATOR_SOURCE_BOOKMARKS = "PdfBookmarks"; /** * Properties of PdfBookmarks */ export interface PdfBookmarksProps { } /** * pdf bookmarks content * @param props - properties of PdfBookmarksContent * @returns */ export function PdfBookmarks(props: PdfBookmarksProps): React.JSX.Element; /** * pdf bookmarks content * @param props - properties of PdfBookmarksContent * @returns */ export function PdfBookmarksContent(props: PdfBookmarksProps): React.JSX.Element; /** * Properties of PdfBookmarkEntry */ export interface PdfBookmarkEntryProps { /** * Current page index, used to highlight bookmark */ currPageIndex: number; /** * bookmark entry */ bookmark: PdfBookmarkObject; /** * Callback when clicking bookmark * @param entry - clicked bookmark entry * @returns */ onClick: (entry: PdfBookmarkObject) => void; } /** * Component to render pdf bookmark * @param props - properties of PdfBookmarkEntry * @returns * * @public */ export function PdfBookmarkEntry(props: PdfBookmarkEntryProps): React.JSX.Element; /** * Properties of PdfSearch */ export interface PdfSearchProps extends ComponentProps<'div'> { } export const PDF_NAVIGATOR_SOURCE_SEARCH = "PdfSearch"; export const PDF_PAGE_DECORATION_TYPE_SEARCH = "highlight"; /** * Plugin used to searching in pdf * @param props - properties of PdfSearch * @returns */ export function PdfSearch(props: PdfSearchProps): React.JSX.Element; /** * Content of PdfSearch * @param props - properties of PdfSearchContent * @returns * * @public */ export function PdfSearchContent(props: PdfSearchProps): React.JSX.Element; /** * Properties of PdfAttachments */ export interface PdfAttachmentsProps extends ComponentProps<'div'> { } export const PDF_NAVIGATOR_ATTACHMENTS_PANEL = "PdfAttachments"; /** * Plugin for viewing pdf attachments * @param props - properties of PdfAttachments * @returns */ export function PdfAttachments(props: PdfAttachmentsProps): React.JSX.Element; /** * pdf attachments content * @param props - properties of PdfAttachmentsContent * @returns */ export function PdfAttachmentsContent(props: PdfAttachmentsProps): React.JSX.Element; export const PDF_NAVIGATOR_SOURCE_PAGES = "PdfPages"; export const PAGES_LOG_SOURCE = "PdfPages"; export const PDF_PAGE_DEFAULT_GAP = 8; /** * Properties of PdfPages */ export interface PdfPagesProps { /** * Gap between pages */ pageGap?: number; /** * Prerender range, pages in the range will be rendered though it's not in viewport yet */ prerenderRange?: [number, number]; /** * Cache range, content in the range will be cached when it's out of viewport */ cacheRange?: [number, number]; /** * scaling factor */ scaleFactor?: number; /** * rotation angle */ rotation?: Rotation; /** * Layer components on every page */ pageLayers: PdfPageLayerComponent[]; } /** * Plugin for viewing pdf pages * @param props - properties of PdfPages * @returns */ export function PdfPages(props: PdfPagesProps): React.JSX.Element; /** * Pdf page for rendering */ export interface PdfPage extends PdfPageObject { /** * offset in the parent container */ offset: number; } /** * Properties of PdfPagesContent */ export interface PdfPagesContentProps extends Required { /** * Pdf pages */ pages: PdfPage[]; } /** * Component for viewing pdf page content * @param props - properties of PdfPagesContent * @returns */ export function PdfPagesContent(props: PdfPagesContentProps): React.JSX.Element; export interface PdfPageProps extends ComponentProps<'div'> { /** * Gap between pages */ pageGap: number; /** * scaling factor */ scaleFactor: number; /** * rotation angle */ rotation: Rotation; /** * Pdf page object */ page: PdfPageObject; /** * Whether is current page */ isCurrent: boolean; /** * Whether page is visible */ isVisible: boolean; /** * Whether page is in visible range */ inVisibleRange: boolean; /** * Whether page is in cache range */ inCacheRange: boolean; } export function PdfPage(props: PdfPageProps): React.JSX.Element; /** * Properties of PdfSignature */ export interface PdfSignaturesProps extends ComponentProps<'div'> { onSignaturesLoaded?: (signatures: PdfSignatureObject[]) => void; } export const PDF_NAVIGATOR_SIGNATURES_PANEL = "PdfSignatures"; /** * Plugin used to viewing signature * @param props - properties of PdfSignature * @returns */ export function PdfSignatures(props: PdfSignaturesProps): React.JSX.Element; /** * Content of PdfSignature * @param props - properties of PdfSignatureContent * @returns * * @public */ export function PdfSignaturesContent(props: PdfSignaturesProps): React.JSX.Element; /** * Properties of PdfDownloader */ export interface PdfDownloaderProps { } /** * Plugin used to download pdf file * @param props - properties of PdfDownloader * @returns */ export function PdfDownloader(props: PdfDownloaderProps): React.JSX.Element; /** * Content of PdfDownloader * @param props - properties of PdfDownloaderContent * @returns * * @public */ export function PdfDownloaderContent(props: PdfDownloaderProps): React.JSX.Element | null; /** * Method used for printing */ export enum PrinterMethod { Iframe = 0 } /** * Properties of PdfPrinter */ export interface PdfPrinterProps { /** * method used for printing */ method: PrinterMethod; } /** * Plugin used to printing pdf * @param props - properties of PdfPrinter * @returns */ export function PdfPrinter(props: PdfPrinterProps): React.JSX.Element; /** * Content of PdfPrinter * @param props - properties of PdfPrinterContent * @returns * * @public */ export function PdfPrinterContent(props: PdfPrinterProps): React.JSX.Element; /** * Step for pdf merging */ export enum MergeStep { /** * Used for file selection */ Prepare = 0, /** * Merging files */ Merging = 1, /** * Merging is succeed */ Succeed = 2, /** * Merging is failed */ Failed = 3 } /** * Properties of PdfMerger */ export interface PdfMergerProps { files: PdfFile[]; onRemoveFile: (file: PdfFile) => void; onMerged: (file: PdfFile) => void; } /** * Pdf merger, used to merge multiple files * @param props - Properties of PdfMerger * @returns * * @public */ export function PdfMerger(props: PdfMergerProps): React.JSX.Element; /** * Properties of PdfMergeTask */ export interface PdfMergeTaskProps { /** * Pdf files */ files: PdfFile[]; /** * Callback when files are merged * @param file - merged file * @returns */ onMerged: (file: PdfFile) => void; /** * Callback when files can't be merged * @param error - error instance * @returns */ onFailed: (error: PdfEngineError) => void; } /** * Component for performing file merge * @param props - properties of PdfMergeTask * @returns */ export function PdfMergeTask(props: PdfMergeTaskProps): React.JSX.Element; //# sourceMappingURL=index.d.ts.map