UNPKG

advanced-cropper

Version:

The core of the advanced cropper libraries family

30 lines (29 loc) 1.9 kB
import { Coordinates, CoreSettings, CropperState, ImageTransform, InitializedCropperState, PostprocessAction, RawAspectRatio, ResizeAnchor, ResizeDirections } from "../../types/index"; import { ResizeOptions } from "../../state/index"; import { BoundingBoxType, FitToImageSettings } from "../../extensions/fit-to-image/index"; import { AbstractCropperInstancePostprocess } from "../../instance/index"; interface ExtendedState extends CropperState { basis?: Coordinates; } interface ExtendedInitializedState extends InitializedCropperState { basis?: Coordinates; } declare function stencilConstraints(rawSettings: unknown, stencilOptions: { boundingBox?: BoundingBoxType; aspectRatio?: (() => RawAspectRatio) | RawAspectRatio; }): { aspectRatio: import("../../types/index").AspectRatio; stencilBoundingBox: BoundingBoxType | undefined; } | { aspectRatio?: undefined; stencilBoundingBox: BoundingBoxType | undefined; }; declare function transformImage(state: ExtendedState, settings: CoreSettings, transform: ImageTransform): CropperState; declare function resizeCoordinates(state: CropperState, settings: CoreSettings & FitToImageSettings, anchor: ResizeAnchor, directions: ResizeDirections, options: ResizeOptions): CropperState; declare function defaultSize(state: CropperState, settings: CoreSettings): { width: number; height: number; }; declare function fitStencilToImage(state: ExtendedState | ExtendedInitializedState, settings: CoreSettings & FitToImageSettings, action: PostprocessAction<AbstractCropperInstancePostprocess>): ExtendedState; declare function zoomStencil(state: ExtendedState | ExtendedInitializedState, settings: CoreSettings & FitToImageSettings, action: PostprocessAction<AbstractCropperInstancePostprocess>): ExtendedState; export { stencilConstraints, transformImage, resizeCoordinates, defaultSize, fitStencilToImage, zoomStencil };