def METHOD_NAME(app: Sphinx, objtype: str, name: str, obj: Any,
                     options: dict, args: str, retann: str) -> None:
    """Record type hints to env object."""
    if app.config.autodoc_typehints_format == 'short':
        mode = 'smart'
    else:
        mode = 'fully-qualified'
    try:
        if callable(obj):
            annotations = app.env.temp_data.setdefault('annotations', {})
            annotation = annotations.setdefault(name, {})
            sig = inspect.signature(obj, type_aliases=app.config.autodoc_type_aliases)
            for param in sig.parameters.values():
                if param.annotation is not param.empty:
                    annotation[param.name] = stringify_annotation(param.annotation, mode)
            if sig.return_annotation is not sig.empty:
                annotation['return'] = stringify_annotation(sig.return_annotation, mode)
    except (TypeError, ValueError):
        pass