Files
speckle-sharp-connectors/DUI3/Speckle.Connectors.DUI/Bridge/IBrowserBridge.cs
T
Adam Hathcock 4e85a6cccc feat(Revit 2026) Add projects and fixes for Revit 2026 usage (#736)
* add base revit 26 projects

* fix up cef replacement

* fix up revit 2026 events

* add revit events

* fixes for revit 26

* use right version of DI for Revit26

* add Revit26 to local

* fmt

* use visual studio to fix slns

* Add revit to installer constants

* move webview stuff to 2026 specific area to avoid build issues

* update locks

* Revit 2026 wants to invoke scripts with RevitTask.  Abstract RevitTask

* fmt

* fix project copying

* use 3.2 SDK

* fix build

* Revit 2025 is now CEF vulnerable

* add SendProgress to not overload revit context

* update Revit 26 lock files

* update locks

---------

Co-authored-by: Oğuzhan Koral <45078678+oguzhankoral@users.noreply.github.com>
2025-05-14 12:55:00 +03:00

46 lines
1.8 KiB
C#

using Speckle.Connectors.DUI.Bindings;
namespace Speckle.Connectors.DUI.Bridge;
/// <summary>
/// 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.
/// </summary>
public interface IBrowserBridge
{
// POC: documnetation comments
string FrontendBoundName { get; }
void AssociateWithBinding(IBinding binding);
/// <summary>
/// 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.
/// </summary>
/// <returns></returns>
public string[] GetBindingsMethodNames();
/// <summary>
/// This method is called by the Frontend bridge when invoking any of the wrapped binding's methods.
/// </summary>
/// <param name="methodName"></param>
/// <param name="requestId"></param>
/// <param name="args"></param>
/// <returns></returns>
public void RunMethod(string methodName, string requestId, string args);
/// <param name="eventName"></param>
/// <exception cref="InvalidOperationException">Bridge was not initialized with a binding</exception>
public Task Send(string eventName, CancellationToken cancellationToken = default);
/// <inheritdoc cref="Send(string, CancellationToken)"/>
/// <param name="data">data to store</param>
/// <typeparam name="T"></typeparam>
/// <exception cref="InvalidOperationException">Bridge was not initialized with a binding</exception>
public Task Send<T>(string eventName, T data, CancellationToken cancellationToken = default)
where T : class;
public void SendProgress<T>(string eventName, T data)
where T : class;
}