using Speckle.Connectors.DUI.Bindings;
namespace Speckle.Connectors.DUI.Bridge;
///
/// Describes a bridge - a wrapper class around a specific browser host. Not needed right now,
/// but if in the future we will have other bridge classes (e.g, ones that wrap around other browsers),
/// it just might be useful.
///
public interface IBrowserBridge
{
// POC: documnetation comments
string FrontendBoundName { get; }
void AssociateWithBinding(IBinding binding);
///
/// This method is called by the Frontend bridge to understand what it can actually call. It should return the method names of the bindings that this bridge wraps around.
///
///
public string[] GetBindingsMethodNames();
///
/// This method is called by the Frontend bridge when invoking any of the wrapped binding's methods.
///
///
///
///
///
public void RunMethod(string methodName, string requestId, string args);
///
/// Bridge was not initialized with a binding
public Task Send(string eventName, CancellationToken cancellationToken = default);
///
/// data to store
///
/// Bridge was not initialized with a binding
public Task Send(string eventName, T data, CancellationToken cancellationToken = default)
where T : class;
public void SendProgress(string eventName, T data)
where T : class;
}