using System;
using System.Threading.Tasks;
namespace Prise.Proxy
{
public interface IResultConverter : IDisposable
{
///
/// This method should convert a remote value into a local one.
/// This method will be called in case the remote type is not a Task.
///
/// The return type of the host
/// The return type of the remote
/// The value from the remote, this can be different from the remoteType if the remote uses an old contract, in this case, convert to correct type.
/// A converted local instance
object ConvertToLocalType(Type localType, Type remoteType, object value);
///
/// This method should convert a remote value into a local one.
/// This method will be called in case the remote type is a Task.
///
/// The return type of the host, Task
/// The return type of the remote, Task
/// The Task that holds the value from the remote, this can be different from the remoteType if the remote uses an old contract, in this case, convert to correct type.
/// A Task containing the local type with the remote value
object ConvertToLocalTypeAsync(Type localType, Type remoteType, Task task);
}
}