def METHOD_NAME(self, rolename: str, data: bytes) -> bool:
    """Add a delegation to a (offline signed) delegated targets metadata"""
    try:
        logger.debug("Processing new delegation to role %s", rolename)
        keyid, keydict = next(iter(json.loads(data).items()))
        key = Key.from_dict(keyid, keydict)
        # add delegation and key
        role = DelegatedRole(rolename, [], 1, True, [f"{rolename}/*"])
        with self.edit_targets() as targets:
            if targets.delegations is None:
                targets.delegations = Delegations({}, {})
            if targets.delegations.roles is None:
                targets.delegations.roles = {}
            targets.delegations.roles[rolename] = role
            targets.add_key(key, rolename)
    except (RepositoryError, json.JSONDecodeError) as e:
        logger.info("Failed to add delegation for %s: %s", rolename, e)
        return False
    logger.debug("Targets v%d", targets.version)
    # update snapshot, timestamp
    self.do_snapshot()
    self.do_timestamp()
    return True