namespace ZB.MOM.WW.OtOpcUa.Commons.Browsing;
///
/// Universal fallback browser: captures any discovery-capable driver's DiscoverAsync
/// output and serves it as a browse session. Resolved by BrowserSessionService only
/// when no bespoke IDriverBrowser matches the driver type (bespoke-first). A separate
/// interface — NOT an IDriverBrowser — because BrowserSessionService indexes those
/// ToDictionary-by-DriverType and the universal browser has no single type.
///
public interface IUniversalDriverBrowser
{
/// Cheap gate (construct + inspect, no connect): can this driver type + config be
/// browsed? Never throws. Drives the picker's Browse-button visibility.
/// The driver type name.
/// The authoring DriverConfig JSON (may be mid-edit / malformed).
/// True when a discovery-capable driver can be constructed for this type + config.
bool CanBrowse(string driverType, string configJson);
/// Construct the driver (with the per-type browse patch), connect, capture one
/// full discovery pass (with UntilStable settle), shut the driver down (bounded), and
/// return a session over the captured snapshot. Throws on failure — the caller
/// (BrowserSessionService) converts to BrowseOpenResult.
/// The driver type name.
/// The DriverConfig JSON to connect with.
/// Cancellation token for the caller's open request.
/// A browse session over the captured discovery snapshot.
Task OpenAsync(string driverType, string configJson, CancellationToken ct);
}