UNPKG

@nutui/nutui-react

Version:

京东风格的轻量级移动端 React 组件库,支持一套代码生成 H5 和小程序

48 lines (47 loc) 1.4 kB
import { default as React, FunctionComponent } from 'react'; import { BasicComponent } from '../../utils/typings'; export type AvatarCropperToolbarPosition = 'top' | 'bottom'; export type AvatarCropperShape = 'square' | 'round'; export interface AvatarCropperProps extends BasicComponent { /** * 最大缩放倍数 * @default 3 */ maxZoom: number /** * 裁剪区域两边预留的间隙 * @default 10 */ space: number /** * 自定义裁剪区域工具栏 * @default [<Button type="danger" key="cancel">取消</Button>, <Button type="info" key="reset">重置</Button>,<Button type="warning" key="rotate">旋转</Button>,<Button type="success" key="confirm">确认</Button>] */ toolbar: React.ReactNode[] /** * 裁剪区域工具栏位置,可选值为:top bottom * @default bottom */ toolbarPosition: AvatarCropperToolbarPosition /** * 中间的文字内容 * @default 编辑 */ editText: React.ReactNode | string /** * 裁剪形状,可选值为:square round * @default square */ shape: AvatarCropperShape /** * 裁剪后点击确认触发 * @default - */ onConfirm: (e: string) => void /** * 点击取消触发 * @default - */ onCancel: () => void } export declare const AvatarCropper: FunctionComponent<Partial<AvatarCropperProps>>;