@orca-fe/pdf-viewer
Version:
PDF Viewer
45 lines (44 loc) • 1.62 kB
TypeScript
import React from 'react';
import type { PainterRef, ShapeDataType, ShapeType } from '@orca-fe/painter';
export type { PainterRef, ShapeDataType, ShapeType };
export type PDFPainterPluginHandle = {
/** 开始绘图 */
drawMark: (shapeType: ShapeType, attr: Record<string, any>) => void;
/** 取消绘图 */
cancelDraw: () => void;
};
/**
* PDFPainterPlugin 绘图插件属性
*/
export interface PDFPainterPluginProps {
/** 默认选中的区域 */
defaultChecked?: [number, number];
/** 选中的区域 */
checked?: [number, number];
/** 选中区域变化时的回调函数 */
onCheck?: (checked: [number, number]) => void;
/** 默认的绘图数据 */
defaultData?: ShapeDataType[][];
/** 绘图数据 */
data?: ShapeDataType[][];
/** 绘图数据变化时的回调函数 */
onDataChange?: (data: ShapeDataType[][], action: 'add' | 'change' | 'delete', pageIndex: number, index: number) => void;
/** 是否禁用按钮 */
disabledButton?: boolean;
/** 是否自动选中 */
autoCheck?: boolean;
/** 开始绘图时的回调函数 */
onChangeStart?: (pageIndex: number, index: number) => void;
/** 是否展示绘图下拉弹出窗 */
popupVisible?: boolean;
/** 是否展示绘图按钮 */
drawingVisible?: boolean;
/** 插件实例ID */
drawingPluginId?: string;
buttonName?: string;
}
/**
* PDFPainterPlugin 绘图插件
*/
declare const PDFPainterPlugin: React.ForwardRefExoticComponent<PDFPainterPluginProps & React.RefAttributes<PDFPainterPluginHandle>>;
export default PDFPainterPlugin;