from typing import Optional
from typing import Union


def int_or_float_type(value: str) -> Optional[Union[int, float]]:
    """
    Converts a string value into an integer or a float value between 0.0 and 1.0 (inclusive).

    Parameters
    ----------
    value : str
        The string value to be converted

    Returns
    -------
    Optional[Union[int, float]]
        If value represents an integer value, an integer is returned. Otherwise a float value is returned,
        if value is convertible into float and the converted float value is between 0.0 and 1.0.
        Else returning None.

    """

    if value.isdigit():
        return int(value)
    try:
        v = float(value)
    except ValueError:
        pass
    else:
        if 0.0 <= v <= 1.0:
            return v