import { i as NodmixConfig } from "./types.nodmix-B9QJSty6.js";
import { a as StatefulBindingTargetDescriptor, i as ConfiguredBindingResolution } from "./binding-types-CEJKffb0.js";

//#region src/channels/plugins/stateful-target-drivers.d.ts
type StatefulBindingTargetReadyResult = {
  ok: true;
} | {
  ok: false;
  error: string;
};
type StatefulBindingTargetSessionResult = {
  ok: true;
  sessionKey: string;
} | {
  ok: false;
  sessionKey: string;
  error: string;
};
type StatefulBindingTargetResetResult = {
  ok: true;
} | {
  ok: false;
  skipped?: boolean;
  error?: string;
};
type StatefulBindingTargetDriver = {
  id: string;
  ensureReady: (params: {
    cfg: NodmixConfig;
    bindingResolution: ConfiguredBindingResolution;
  }) => Promise<StatefulBindingTargetReadyResult>;
  ensureSession: (params: {
    cfg: NodmixConfig;
    bindingResolution: ConfiguredBindingResolution;
  }) => Promise<StatefulBindingTargetSessionResult>;
  resolveTargetBySessionKey?: (params: {
    cfg: NodmixConfig;
    sessionKey: string;
  }) => StatefulBindingTargetDescriptor | null;
  resetInPlace?: (params: {
    cfg: NodmixConfig;
    sessionKey: string;
    bindingTarget: StatefulBindingTargetDescriptor;
    reason: "new" | "reset";
    commandSource?: string;
  }) => Promise<StatefulBindingTargetResetResult>;
};
//#endregion
export { StatefulBindingTargetSessionResult as i, StatefulBindingTargetReadyResult as n, StatefulBindingTargetResetResult as r, StatefulBindingTargetDriver as t };