declare namespace TASK_CREATE {
    interface DefaultChangeProps<T> {
        onChange?: (value?: T) => void;
        value?: T;
    }
    interface DefaultProps {
        visible?: boolean;
        onClose?: () => void;
    }
    type BookPlatFormProps = { platformName: string, id: number, platformKey: string }
    type BookListProps = { id: number, bookName: string, platformId: number }
    interface DispatchTaskCreate {
        settings: TASK_CREATE.SettingsProps
        setSettings: React.Dispatch<React.SetStateAction<TASK_CREATE.SettingsProps>>
        bookPlatForm: BookPlatFormProps[]
        bookList: BookListProps[]
        msgJobTypeList: {
            value: string;
            label: string;
        }[]
        onPreviewReset: () => void
        isEditSc: boolean
    }
    interface previewDataProps {
        welcome?: any[];
        userInherit?: any[];
        massSending?: any[];
        highMassSending?: any[];
        friends?: any[];
    }
    interface WelcomeProps<T> extends DefaultProps, DefaultChangeProps<T> {
        value?: { [x: string]: any };
        isEditSc?: boolean
    }
    interface MassSendingProps<T> extends DefaultProps, DefaultChangeProps<T> {
        bookCityList: { label: string, value: string }[]
        value?: {
            massSendingStrategy?: { [x: string]: any };
            massSendingContent?: { massSendingContentDTO: any };
        };
        onChange?: (value?: { [x: string]: any }, type?: string) => void;
        createType?: 'STRATEGY' | 'CONTENT';
        isEditSc?: boolean
    }
    interface HighMassSendingProps<T> extends DefaultProps, DefaultChangeProps<T> {
        value?: {
            highMassSendingStrategy?: { [x: string]: any };
            highMassSendingContent?: { massSendingContentDTO: any };
        };
        onChange?: (value?: { [x: string]: any }, type?: string) => void;
        createType?: 'STRATEGY' | 'CONTENT'
    }
    interface FriendsProps<T> extends DefaultProps, DefaultChangeProps<T> {
        value?: {
            friendsStrategy?: { [x: string]: any };
            friendsContent?: { friendsContentDTO: any };
        };
        onChange?: (value?: { [x: string]: any }, type?: string) => void;
        createType?: 'STRATEGY' | 'CONTENT'
    }
    interface UserInheritProps<T> extends DefaultProps, DefaultChangeProps<T> {
        value?: { [x: string]: any };
    }
    interface corpUsersProps {
        corpUserId: string,
        name: string,
        corpName: string,
        corpId: string,
        welcomeMsgContent?: any[],
        groupMsgContent?: any[],
        highGroupMsgContent?: any[],
        externalUserTransferContent?: any[],
        externalUserList?: any[]
        friendsTagContent?: any[],
        friendsMsgContent?: any[],
    }
    type CorpUserProps = { corpUserId: string, name: string, corpName: string, corpId: string, id: string, mpAccountId?: number, mpAccountName?: string }
    type CorpUserGroupProps = { 
        corpUsers: CorpUserProps[],
        welcomeMsgContent?: any[],
        groupMsgContent?: any[],
        externalUserTransferContent?: any[]
    }
    // 配置保存字段
    interface SettingsProps {
        corpUsers?: corpUsersProps[]; // 企微号列表
        corpUserGroups?: CorpUserGroupProps[];
        bizType?: string; // 业务类型
        platform?: number; // 书城
        channel?: string;   // 渠道
        templateProductId?: string; // 适用产品
        welcomeMsgTemplateDTO?: { [x: string]: any };
        massSendingStrategy?: { [x: string]: any };
        massSendingContent?: { massSendingContentDTO: any };
        highMassSendingStrategy?: { [x: string]: any };
        highMassSendingContent?: { massSendingContentDTO: any };
        userInherit?: { [x: string]: any };
        friendsStrategy?: { [x: string]: any };
        friendsContent?: { friendsContentDTO: any };
    }
    // 群发策略
    interface StrategyProps {
        onChange?: (value?: { [x: string]: any }, type: string) => void;
        value?: { [x: string]: any };
    }
    // 群发内容
    interface ContentProps {
        massSendingStrategy: { [x: string]: any };
        bookCityList?: { label: string, value: string }[]
        onChange?: (value?: { [x: string]: any }, type: string) => void;
        value?: { massSendingContentDTO: any };
        isEditSc?: boolean
    }
    interface FriendsContentProps {
        friendsStrategy: { [x: string]: any };
        onChange?: (value?: { [x: string]: any }, type: string) => void;
        value?: { friendsContentDTO: any };
    }
    interface ContentDTOProps {
        attachmentList?: Attachment[],
        text?: {
            content: string
        }
    }
    interface AddUpdateProps {
        taskName: string,
        contentDTO: ContentDTOProps
        corpId: string,          // 企业 id
        corpUserIds: string[],  // 企微号id列表
        startTime: string,
        endTime: string,
        timeRepeatType: TimeType
        sendTime: {
            hour: number
            minute: number
            nano: number
            second: number
        }
        sendDay: string  // 发送日期
        groupId: number
        sendGroup: boolean,   // 发送客户是群 true 其它 false
        externalUserFilterCondition?: ConditionDTO
        externalUserRemoveCondition?: ConditionDTO
        groupChatFilterCondition?: ConditionDTO
        groupChatRemoveCondition?: ConditionDTO
        repeatArray?: any[]
        id?: number
    }
    interface Attachment {
        file?: {
            fileUrl: string
        }
        image?: {
            picUrl: string
        }
        link?: {
            desc: string,
            picUrl: string,
            title: string,
            url: string
        }
        miniprogram?: {
            appId: string,
            page: string,
            picUrl: string,
            title: string
        }
        video?: {
            videoUrl: string
        }
        text?: {
            content: string
        }
        msgType: MsgType
    }
    interface MediaContentProps {
        fileUrl?: string
        fileName?: string,
        // fileSize?: string,
        id?: number
        imageUrl?: string
        linkDesc?: string
        linkPicurl?: string
        linkTitle?: string
        linkUrl?: string
        mediaType?: MediaTypeProps
        miniprogramAppid?: string
        miniprogramPage?: string
        miniprogramPicurl?: string
        miniprogramTitle?: string
        textContent?: string
        videoUrl?: string
        voiceUrl?: string

        mediaFormat?: string,
        mediaSize?: string,
        mediaPlayTime?: string,
        mediaWidth?: string,
        mediaHeight?: string
    }
    type CorpListProps = {
        corpId: string, corpName: string, weList: { corpUserId: string, name: string }[]
    }

    interface DispatchTaskDetails {
        bookPlatForm: BookPlatFormProps[]
        bookList: BookListProps[]
    }
    interface SetContentProps {
        msg: { [x: string]: string },
        index: number[],
        type: 'welcome' | 'massSending' | 'userInherit'
    }
}