UNPKG

advanced-cropper

Version:

The core of the advanced cropper libraries family

28 lines (27 loc) 1.51 kB
import { BivarianceConstraint, CoreSettings, CropperState, PostprocessAction, RawAspectRatio, Size } from "../../types/index"; type StencilSize<Settings = CoreSettings> = Size | BivarianceConstraint<(state: CropperState, props: Settings) => Size>; interface FixedStencilSettings extends CoreSettings { stencilSize: StencilSize<this>; } declare function fixedStencilConstraints(rawSettings: { stencilSize: StencilSize<FixedStencilSettings>; }, stencilOptions: { aspectRatio?: (() => RawAspectRatio) | RawAspectRatio; }): { stencilSize(state: CropperState, settings: FixedStencilSettings): Size; }; declare function getStencilSize(state: CropperState, settings: FixedStencilSettings): Size; declare function sizeRestrictions(state: CropperState, settings: FixedStencilSettings): { maxWidth: number; maxHeight: number; minWidth: number; minHeight: number; }; declare function defaultSize(state: CropperState, settings: FixedStencilSettings): Size; declare function aspectRatio(state: CropperState, settings: FixedStencilSettings): { minimum: number; maximum: number; }; declare function fixedStencilAlgorithm(state: CropperState, settings: FixedStencilSettings): CropperState; declare function fixedStencil(state: CropperState, settings: FixedStencilSettings, action?: PostprocessAction): CropperState; export { StencilSize, FixedStencilSettings, fixedStencilConstraints, getStencilSize, sizeRestrictions, defaultSize, aspectRatio, fixedStencilAlgorithm, fixedStencil };