import { buildProps } from '@kankan-components/utils'
import type { ExtractPropTypes, PropType } from 'vue'
import type cropper from './cropper.vue'

export const cropperProps = buildProps({
    fixedNumber: {
        type: Array as PropType<number[]>,
        default: () => [1, 1],
    },
    img: { type: String },
    cb: {
        type: Function as PropType<(text?: string, data?: any) => void>,
    },
    showSize: {
        type: Boolean,
        default: false,
    },
    noText: {
        type: String,
        default: '取消',
    },
    okText: {
        type: String,
        default: '确认',
    },
    title: {
        type: String,
        default: '裁剪',
    },
    longSize: {
        type: String,
        default: '长型',
    },
    squareSize: {
        type: String,
        default: '方型',
    },
})

export type CropperProps = ExtractPropTypes<typeof cropperProps>

export type CropperInstance = InstanceType<typeof cropper>
