@mescius/dspdfviewer
Version:
Document Solutions PDF Viewer
205 lines (203 loc) • 5.84 kB
TypeScript
//@ts-ignore
import React, { Component } from 'react';
import { SignToolDialogProps, SignToolDialogModel, SignToolType } from "./types";
import GcPdfViewer from "..";
/// <reference path="../vendor/i18next.d.ts" />
//@ts-ignore
import { i18n } from 'i18next';
import { SignToolSettings } from '../ViewerOptions';
import { SignToolStorage } from './SignToolStorage';
export declare const DEFAULT_CANVAS_WIDTH = 500;
export declare const DEFAULT_CANVAS_HEIGHT = 200;
/**
* 'Form Filler' dialog box.
* */
export declare class SignToolDialog extends Component<SignToolDialogProps, SignToolDialogModel> {
private _hidePromise?;
private _resolve?;
private _viewer;
_mounted: boolean;
private _currentCanvasSize;
private _shown;
constructor(props: any, state: any);
state: {
enabled: boolean;
showModal: boolean;
isChanged: boolean;
selectedTab: undefined;
modalPosition: undefined;
};
private _DrawTool;
private _TypeTool;
private _openImageFlag;
private _ImageTool;
private _signToolStorage;
private _preferredSettings;
componentDidMount(): void;
componentWillUnmount(): void;
onShow(): Promise<void>;
onHide(): void;
/**
* Indicates whether the signature data must be saved into browser's local storage for later use.
* @default false
**/
get saveSignature(): boolean;
/**
* Indicates whether the signature data must be saved into browser's local storage for later use.
* @default false
**/
set saveSignature(saveSignature: boolean);
/**
* Available tabs.
**/
get tabs(): ('Type' | 'Draw' | 'Image')[];
/**
* Available tabs.
**/
set tabs(tabs: ('Type' | 'Draw' | 'Image')[]);
/**
* Gets the selected tab type.
**/
get selectedTab(): SignToolType;
/**
* Sets the selected tab type.
**/
set selectedTab(selectedTab: SignToolType);
/**
* Get dialog title.
**/
get title(): string;
/**
* Set dialog title.
**/
set title(title: string);
/**
* Convert the result stamp to content.
* @default false
**/
get convertToContent(): boolean;
/**
* Convert the result stamp to content.
* @default false
**/
set convertToContent(convertToContent: boolean);
/**
* Get result annotation subject.
**/
get subject(): string;
/**
* Set result annotation subject.
**/
set subject(subject: string);
/**
* Specifies whether to hide the "Save signature" button.
* @default false
**/
get hideSaveSignature(): boolean;
/**
* Specifies whether to hide the "Save signature" button.
**/
set hideSaveSignature(value: boolean);
/**
* Destination page index.
* @default The default is the visible page index.
**/
get pageIndex(): number;
/**
* Destination page index.
**/
set pageIndex(pageIndex: number);
/**
* The size of the canvas in pixels.
* @default {width: 500; height: 200}
**/
get canvasSize(): {
width: number;
height: number;
};
/**
* The size of the canvas in pixels.
* @default {width: 500; height: 200}
**/
set canvasSize(canvasSize: {
width: number;
height: number;
});
/**
* Automatically adjust the canvas size so that it shrinks to fit the window when the window size is small.
* @default true
**/
get autoResizeCanvas(): boolean;
/**
* Automatically adjust the canvas size so that it shrinks to fit the window when the window size is small.
**/
set autoResizeCanvas(autoResizeCanvas: boolean);
/**
* Auto-generated image file name.
**/
get imageFileName(): string;
/**
* Gets signature tool settings.
**/
get settings(): SignToolSettings;
/**
* Shows the 'share document' dialog box.
* @param viewer
*/
show(viewer: GcPdfViewer, preferredSettings?: SignToolSettings): Promise<void>;
/**
* Set individual setting.
* @param settingName
* @param value
*/
setSetting(settingName: string, value: any): void;
/**
* Get individual setting.
* @param settingName
* @param value
*/
private getSetting;
getAdjustedCanvasSize(): {
width: number;
height: number;
};
get destinationScale(): number;
get destinationSize(): {
width: number;
height: number;
};
/**
* The result location of the annotation on the page.
* Note, when you specify the exact location (using {x, y} values), the origin is at the bottom left corner.
* @default 'BottomRight'
**/
get location(): 'Center' | 'Top' | 'Right' | 'Bottom' | 'Left' | 'TopLeft' | 'TopRight' | 'BottomRight' | 'BottomLeft' | {
x: number;
y: number;
};
set location(location: 'Center' | 'Top' | 'Right' | 'Bottom' | 'Left' | 'TopLeft' | 'TopRight' | 'BottomRight' | 'BottomLeft' | {
x: number;
y: number;
});
/**
* The exact position of the annotation on the page depends on the @see: location property.
**/
get exactDestinationLocation(): {
x: number;
y: number;
};
/**
* Apply changes and hide dialog.
* */
onApply(): Promise<void>;
get isVisible(): boolean;
/**
* Hides the dialog
* */
hide(): void;
//@ts-ignore
//@ts-ignore
render(): React.JSX.Element | null;
get signToolStorage(): SignToolStorage;
private _resolveHidePromise;
get in17n(): i18n;
}