UNPKG

react-sketch-ruler

Version:

> In using react, the zoom operation used for page presentation

77 lines (69 loc) 2.05 kB
import { default as default_2 } from 'react'; import { PanzoomEventDetail } from 'simple-panzoom'; import { PanzoomObject } from 'simple-panzoom'; import { PanzoomOptions } from 'simple-panzoom'; import { RefObject } from 'react'; declare interface LineType { h: number[]; v: number[]; } declare interface PaletteType { bgColor?: string; longfgColor?: string; fontColor?: string; fontShadowColor?: string; shadowColor?: string; lineColor?: string; lineType?: string; lockLineColor?: string; borderColor?: string; hoverBg?: string; hoverColor?: string; cornerActiveColor?: string; } declare interface ShadowType { x: number; y: number; width: number; height: number; } declare const SketchRule: default_2.ForwardRefExoticComponent<SketchRulerProps & default_2.RefAttributes<SketchRulerMethods>>; export default SketchRule; export declare interface SketchRulerMethods { reset: () => void; zoomIn: () => void; zoomOut: () => void; initPanzoom: () => void; panzoomInstance: RefObject<PanzoomObject | null>; } export declare interface SketchRulerProps { showRuler?: boolean; eyeIcon?: string; closeEyeIcon?: string; scale?: number; rate?: number; thick?: number; palette?: PaletteType; width?: number; height?: number; paddingRatio?: number; autoCenter?: boolean; shadow?: ShadowType; showShadowText?: boolean; lines?: LineType; isShowReferLine?: boolean; canvasWidth?: number; canvasHeight?: number; snapsObj?: LineType; snapThreshold?: number; gridRatio?: number; lockLine?: boolean; selfHandle?: boolean; panzoomOption?: Partial<PanzoomOptions>; children: React.ReactNode; updateScale?: (props: number) => void; onZoomChange?: (props: PanzoomEventDetail) => void; onHandleCornerClick?: (props: boolean) => void; handleLine?: (props: LineType) => void; } export { }