def METHOD_NAME(self, device_id: str, file_name: str, kwargs: Mapping[str, str]) -> None:
    """Request that the current selection is written to the output device.
    The output device to write with will be selected based on the device_id.
    A file format is chosen from the list of available file formats by the
    output device.
    :param device_id: The handle of the device to write to.
    :param file_name: A suggestion for the file name to write
    to. Can be freely ignored if providing a file name makes no sense.
    :param kwargs: Keyword arguments:
        limit_mimetypes: Limit the possible mimetypes to use for writing to these types.
    """
    if not Selection.hasSelection():
        return
    limit_mimetypes = kwargs.get("limit_mimetypes", False)
    preferred_mimetypes = kwargs.get("preferred_mimetypes", None)
    # On Windows, calling requestWrite() on LocalFileOutputDevice crashes when called from a signal
    # handler attached to a QML MenuItem. So instead, defer the call to the next run of the event
    # loop, since that does work.
    Application.getInstance().callLater(self._writeToDevice, Selection.getAllSelectedObjects(), device_id, file_name, limit_mimetypes, preferred_mimetypes = preferred_mimetypes)