declare namespace TASK_MINI_PAGE_CREATE {
    interface ActiveType {
        comptActive?: boolean
    }

    interface Padding {
        paddingTop: number,//边距 顶部轮播不存在
        paddingBottom: number,//边距 顶部轮播不存在
    }

    interface DispatchMiniPageCreate {
        dragging: string,
        setDragging: React.Dispatch<React.SetStateAction<string>>
        draggingCon: string,
        setDraggingCon: React.Dispatch<React.SetStateAction<string>>
        pageSpecs: TASK_MINI_PAGE_CREATE.PageSpecsProps
        setPageSpecs: React.Dispatch<React.SetStateAction<TASK_MINI_PAGE_CREATE.PageSpecsProps>>
        installActive: (e: React.MouseEvent<HTMLDivElement, MouseEvent>, index: number) => void
        setTopUrl: (url: string) => void
        setCompt: (key: string, value: any) => void,
        setGlobal: (key: string, value: any) => void,
        setTopShortVideoUrl: (url: string, videoInfo: {
            width: number;
            height: number;
            videoLength: number;
        }, index: number) => void
        isNewAdd: boolean
    }

    interface Text extends ActiveType, Padding {
        text: string,
        fontSize: 14 | 15 | 16 | 18 | 20 | 24 | 36,
        color: string,
        textAlign: 'left' | 'center' | 'right' | 'justify',  // 取值 0: left, 1: middle, 2: right. 默认 0
        fontWeight: 'normal' | 'bold',  // 0: 常规, 1: 加粗. 默认 0
        elementType: 'TEXT'
    }

    interface TopImage extends ActiveType {
        url: string,
        elementType: 'TOP_IMAGE'
    }

    interface TopVideo extends ActiveType {
        url: string,
        elementType: 'TOP_VIDEO'
    }

    interface TopShortVideo extends ActiveType {
        data: {
            url: string,
            duration: number
        }[],
        url: string,
        tipText: string,
        elementType: 'TOP_SHORT_VIDEO'
    }

    interface Image extends ActiveType, Padding {
        url: string,
        elementType: 'IMAGE'
    }

    interface QrCode extends ActiveType, Padding {
        id: number
        imageList: string[],
        elementType: 'QR_CODE',
        paddingLeft: number,
        paddingRight: number,
    }

    type Empty = {
        elementType: 'empty'
    }

    interface FloatButton extends ActiveType {
        title: string,
        qrCodeFloatList: string[],
        elementType: 'FLOAT_BUTTON',
        id: number
    }
    type PageElementsSpecListProps = Array<TopImage | TopVideo | TopShortVideo | Image | Text | QrCode | Empty>
    type GlobalElementsSpecListProps = Array<FloatButton>

    interface PageSpecsProps {
        bgColor: string,
        pageType: 'VIDEO' | 'LANDING_PAGE',
        pageElementsSpecList: PageElementsSpecListProps
        globalElementsSpecList?: GlobalElementsSpecListProps
    }

    type ComptItem = Image | Text | QrCode
}