declare namespace WechatMiniprogram {
    type BaseEvent<
        Mark extends IAnyObject = IAnyObject,
        CurrentTargetDataset extends IAnyObject = IAnyObject,
        TargetDataset extends IAnyObject = CurrentTargetDataset
    > = Event & {
        mark?: Mark;
        currentTarget: Event["currentTarget"] & {
            dataset: CurrentTargetDataset;
        };
        target: Event["target"] & {
            dataset: TargetDataset;
        };
    };

    type CustomEvent<
        Detail extends IAnyObject = IAnyObject,
        Mark extends IAnyObject = IAnyObject,
        CurrentTargetDataset extends IAnyObject = IAnyObject,
        TargetDataset extends IAnyObject = CurrentTargetDataset
    > = BaseEvent<Mark, CurrentTargetDataset, TargetDataset> & {
        detail: Detail;
    };

    type TouchEvent<
        Detail extends IAnyObject = IAnyObject,
        Mark extends IAnyObject = IAnyObject,
        CurrentTargetDataset extends IAnyObject = IAnyObject,
        TargetDataset extends IAnyObject = CurrentTargetDataset
    > = CustomEvent<Detail, Mark, CurrentTargetDataset, TargetDataset> & {
        touches: Touch[];
        changedTouches: Touch[];
    };

    type VideoTimeUpdate = CustomEvent<{
        currentTime: number;
        duration: number;
    }>;

    type VideoError = CustomEvent<GeneralCallbackResult & {
        errMsg?: string;
    }>;

    type RadioGroupChange<
        Mark extends IAnyObject = IAnyObject,
        TargetDataset extends IAnyObject = IAnyObject
    > = CustomEvent<{
        value: string;
    }, Mark, TargetDataset>;

    type CheckboxGroupChange<
        Mark extends IAnyObject = IAnyObject,
        TargetDataset extends IAnyObject = IAnyObject
    > = CustomEvent<{
        value: string[];
    }, Mark, TargetDataset>;
}
