import * as PdfJs from "pdfjs-dist"; import { DocumentInitParameters } from "pdfjs-dist/types/src/display/api"; import { CSSProperties, FunctionComponent, MouseEvent as MouseEvent$1, PropsWithChildren, ReactNode } from "react"; //#region lib/background-source.d.ts type Source = string | Blob | URL; type RenderProps = { state: 'LOADING'; } | { state: 'ERROR'; error: { code: string; details?: Error; }; } | { state: 'LOADED'; url: string; width: number; height: number; }; type RenderPropFunc = (source: RenderProps) => ReactNode; type Props$19 = { source: Source; documentInitParameters?: Omit; page?: number; hqPdf?: boolean; children: RenderPropFunc; fetcher?: (url: string) => Promise; pdfjs: () => Promise; }; declare const BackgroundSource: FunctionComponent; //#endregion //#region lib/editor/index.d.ts type Crop$2 = { x: number; y: number; height: number; width: number; }; type Props$18 = PropsWithChildren<{ backgroundUrl: string; width: number; height: number; crop?: Crop$2; zoom: number; translateX: number; translateY: number; rotate: 0 | 90 | 180 | 270; onZoom: (newZoom: number) => void; minZoom?: number; maxZoom?: number; allowDrag: boolean; onDragStart?: () => void; onDragEnd?: () => void; onDrag: (x: number, y: number) => void; canvasStyle?: CSSProperties; canvasClassName?: string; drawMode?: string | null; heightRatio?: number; }>; declare const PixelRatioContext: import("react").Context; declare const Editor: FunctionComponent; //#endregion //#region lib/editor/utils/svg-point.d.ts type Coords = { x: number; y: number; }; //#endregion //#region lib/editor/drawables/types.d.ts type ResizeHandleX = 'left' | 'right'; type ResizeHandleY = 'top' | 'bottom'; type DrawableMouseHandler = []> = (e: MouseEvent$1, id: string, ...args: TArgs) => void; type DrawableResizeArgs = [handleX: ResizeHandleX, handleY: ResizeHandleY, newX: number, newY: number]; type DrawableResizeStartArgs = [handleX: ResizeHandleX, handleY: ResizeHandleY]; type DrawableSelectHandler = DrawableMouseHandler; type DrawableDragStartHandler = DrawableMouseHandler; type DrawableTranslateHandler = (id: string, x: number, y: number) => void; type DrawableResizeStartHandler = DrawableMouseHandler; type DrawableResizeHandler = DrawableMouseHandler; type DragIndicatorMouseDownHandler = (e: MouseEvent$1) => void; type DragIndicatorResizeHandleMouseDown = (e: MouseEvent$1) => void; type DrawableType = 'rect' | 'text' | 'ellipse' | 'line' | 'path'; type DrawableBase = { type: TType; id: string; }; type StrokeShape = { strokeWidth: number; stroke: string; }; type FillShape = { fill: string; }; type XYPosition = { x: number; y: number; }; type Size = { width: number; height: number; }; type RectDrawable$1 = DrawableBase<'rect'> & XYPosition & Size & StrokeShape & FillShape; type TextDrawable$1 = DrawableBase<'text'> & XYPosition & FillShape & { text: ReadonlyArray; fontSize: number; }; type EllipseDrawable$1 = DrawableBase<'ellipse'> & StrokeShape & FillShape & { cx: number; cy: number; rx: number; ry: number; }; type LineDrawable$1 = DrawableBase<'line'> & StrokeShape & { x1: number; y1: number; x2: number; y2: number; }; type PathDrawable$1 = DrawableBase<'path'> & StrokeShape & { points: Array; }; type Drawable = RectDrawable$1 | TextDrawable$1 | EllipseDrawable$1 | LineDrawable$1 | PathDrawable$1; type DrawableShapeProps = Omit, 'type'>; type RectDrawableShapeProps = DrawableShapeProps<'rect'>; type TextDrawableShapeProps = DrawableShapeProps<'text'>; type EllipseDrawableShapeProps = DrawableShapeProps<'ellipse'>; type LineDrawableShapeProps = DrawableShapeProps<'line'>; type PathDrawableShapeProps = DrawableShapeProps<'path'>; type DrawableSelectableProps = { selected: boolean; onSelect: DrawableSelectHandler; onDragIndicatorMouseDown: DrawableDragStartHandler; dragIndicatorStrokeWidth: number; canSelectDrawable: boolean; }; type DrawableResizableProps = DrawableSelectableProps & { onResizeHandleMouseDown: DrawableResizeStartHandler; }; type DragIndicatorBoundsProps = { diX: number; diY: number; diWidth: number; diHeight: number; diStrokeWidth: number; }; type DragIndicatorBoundsOverrideProps = { diLeft?: number; diRight?: number; diTop?: number; diBottom?: number; }; type DragIndicatorResizeHandlesProps = { onResizeHandleTopLeftMouseDown?: DragIndicatorResizeHandleMouseDown; onResizeHandleTopRightMouseDown?: DragIndicatorResizeHandleMouseDown; onResizeHandleBottomLeftMouseDown?: DragIndicatorResizeHandleMouseDown; onResizeHandleBottomRightMouseDown?: DragIndicatorResizeHandleMouseDown; }; type DragIndicatorCursorProps = { inverseCursorHorizontal?: boolean; inverseCursorVertical?: boolean; }; //#endregion //#region lib/editor/drawables/index.d.ts type Props$17 = { canSelectDrawable?: boolean; selectedDrawable?: string; onSelectDrawable: (id?: string) => void; onDrawableTranslate: DrawableTranslateHandler; onDrawableTranslateEnd?: DrawableTranslateHandler; onRemoveDrawable?: (id: string) => void; onResizeDrawable: DrawableResizeHandler; onResizeDrawableEnd?: DrawableResizeHandler; drawables: ReadonlyArray; diStrokeWidth: number; width: number; height: number; }; declare const DrawableComp: FunctionComponent; //#endregion //#region lib/editor/artboard/types.d.ts type ArtboardCanvasProps = { width: number; height: number; }; type ArtboardDrawCallbacksProps = { onDrawEnd: (drawable: Drawable) => void; onDrawStart: () => void; }; type ArtboardStrokeProps = { drawingStroke: string; drawingStrokeWidth: number; }; type ArtboardFillProps = { drawingFill: string; }; type ArtboardMinSizeProps = { minWidth: number; minHeight: number; }; type ArtboardTextProps = { fontSize: number; text: ReadonlyArray; }; type DragStart = { start: Coords; }; type DragCurrent = { start: Coords; current: Coords; }; type BoundsInput = { startCoord?: Coords; currentCoord?: Coords; }; //#endregion //#region lib/editor/artboard/crop.d.ts type Crop$1 = { x: number; y: number; width: number; height: number; }; type Props$16 = PropsWithChildren void; onCropStart: () => void; }>; declare const ArtboardCrop: FunctionComponent; //#endregion //#region lib/editor/artboard/index.d.ts type Props$15 = PropsWithChildren<{ drawMode: null | 'pen' | 'rect' | 'ellipse' | 'line' | 'crop' | 'text'; height: number; width: number; onCropEnd: (crop: Crop$1) => void; onDrawEnd: (drawable: Drawable) => void; onDrawStart: () => void; onCropStart: () => void; drawingStroke: string; drawingStrokeWidth: number; drawingFill: string; minHeight: number; minWidth: number; fontSize: number; text: ReadonlyArray; }>; declare const ArtboardComponent: FunctionComponent; //#endregion //#region lib/editor/artboard/base.d.ts type Props$14 = PropsWithChildren<{ width: number; height: number; onMouseDown: (payload: DragStart, event: MouseEvent$1) => void; onMouseMove: (payload: DragCurrent, event: MouseEvent) => void; onMouseUp: (payload: DragCurrent, event: MouseEvent) => void; }>; declare const ArtboardBase: FunctionComponent; //#endregion //#region lib/editor/artboard/ellipse.d.ts type Props$13 = PropsWithChildren; declare const ArtboardEllipse: FunctionComponent; //#endregion //#region lib/editor/artboard/line.d.ts type Props$12 = PropsWithChildren; declare const ArtboardLine: FunctionComponent; //#endregion //#region lib/editor/artboard/pen.d.ts type Props$11 = PropsWithChildren; declare const ArtboardPen: FunctionComponent; //#endregion //#region lib/editor/artboard/rect.d.ts type Props$10 = PropsWithChildren; declare const ArtboardRect: FunctionComponent; //#endregion //#region lib/editor/artboard/text.d.ts type Props$9 = PropsWithChildren; declare const ArtboardText: FunctionComponent; //#endregion //#region lib/editor/cropables/types.d.ts type Crop = { x: number; y: number; height: number; width: number; }; type CropTranslateHandler = (x: number, y: number) => void; type CropResizeHandler = (handleX: ResizeHandleX, handleY: ResizeHandleY, newX: number, newY: number) => void; type CropResizeStartHandler = (e: MouseEvent$1, handleX: ResizeHandleX, handleY: ResizeHandleY) => void; type CropBoxProps = { id: string; x: number; y: number; width: number; height: number; }; type CropInteractionProps = { onDragIndicatorMouseDown: (e: MouseEvent$1) => void; onResizeHandleMouseDown: CropResizeStartHandler; diStrokeWidth: number; }; //#endregion //#region lib/editor/cropables/index.d.ts type Props$8 = { height: number; width: number; canTransformCrop: boolean; onCropTranslate: CropTranslateHandler; onCropTranslateEnd?: CropTranslateHandler; onRemoveCrop?: () => void; onResizeCrop: CropResizeHandler; onResizeCropEnd?: CropResizeHandler; onConfirmCrop?: () => void; crop?: Crop; diStrokeWidth: number; }; declare const Cropables: FunctionComponent; //#endregion //#region lib/editor/cropables/square.d.ts type Props$7 = CropBoxProps & CropInteractionProps; declare const RectCrop: FunctionComponent; //#endregion //#region lib/editor/drawables/drag-indicator.d.ts type Props$6 = DragIndicatorBoundsProps & DragIndicatorBoundsOverrideProps & DragIndicatorResizeHandlesProps & DragIndicatorCursorProps & { id: string; onDragIndicatorMouseDown: DragIndicatorMouseDownHandler; selected: boolean; animation?: boolean; }; declare const DragIndicator: FunctionComponent; //#endregion //#region lib/editor/drawables/ellipse.d.ts type Props$5 = EllipseDrawableShapeProps & DrawableResizableProps; declare const EllipseDrawable: FunctionComponent; //#endregion //#region lib/editor/drawables/line.d.ts type Props$4 = LineDrawableShapeProps & DrawableResizableProps; declare const LineDrawable: FunctionComponent; //#endregion //#region lib/editor/drawables/path.d.ts type Props$3 = PathDrawableShapeProps & DrawableSelectableProps; declare const PathDrawable: FunctionComponent; //#endregion //#region lib/editor/drawables/rect.d.ts type Props$2 = RectDrawableShapeProps & DrawableResizableProps; declare const RectDrawable: FunctionComponent; //#endregion //#region lib/editor/drawables/resize.d.ts declare function resizeDrawable(drawable: T, handleX: ResizeHandleX, handleY: ResizeHandleY, newX: number, newY: number): T; //#endregion //#region lib/editor/drawables/text.d.ts type Props$1 = TextDrawableShapeProps & DrawableSelectableProps; declare const TextDrawable: FunctionComponent; //#endregion //#region lib/editor/drawables/translate.d.ts declare function translateDrawable(drawable: T, x: number, y: number): T; //#endregion //#region lib/editor/uncontrolled.d.ts type Props = Omit & { initialZoom?: number; initialTranslateX?: number; initialTranslateY?: number; onZoom?: (zoom: number) => void; }; declare const UncontrolledEditor: FunctionComponent; //#endregion export { ArtboardComponent as Artboard, ArtboardBase, type ArtboardCanvasProps, ArtboardCrop, type ArtboardDrawCallbacksProps, ArtboardEllipse, type ArtboardFillProps, ArtboardLine, type ArtboardMinSizeProps, ArtboardPen, ArtboardRect, type ArtboardStrokeProps, ArtboardText, type ArtboardTextProps, BackgroundSource, type BoundsInput, type Crop, type CropBoxProps, type CropInteractionProps, type CropResizeHandler, type CropResizeStartHandler, type CropTranslateHandler, RectCrop as CropableSquare, Cropables, type DragCurrent, DragIndicator, type DragIndicatorBoundsOverrideProps, type DragIndicatorBoundsProps, type DragIndicatorCursorProps, type DragIndicatorMouseDownHandler, type DragIndicatorResizeHandleMouseDown, type DragIndicatorResizeHandlesProps, type DragStart, type Drawable, type DrawableDragStartHandler, EllipseDrawable as DrawableEllipse, LineDrawable as DrawableLine, PathDrawable as DrawablePath, RectDrawable as DrawableRect, type DrawableResizableProps, type DrawableResizeHandler, type DrawableResizeStartHandler, type DrawableSelectHandler, type DrawableSelectableProps, TextDrawable as DrawableText, type DrawableTranslateHandler, DrawableComp as Drawables, Editor, type EllipseDrawableShapeProps, type LineDrawableShapeProps, type PathDrawableShapeProps, PixelRatioContext, type RectDrawableShapeProps, type RenderProps, type ResizeHandleX, type ResizeHandleY, type TextDrawableShapeProps, UncontrolledEditor, resizeDrawable, translateDrawable }; //# sourceMappingURL=index.d.cts.map