/**
 * Generated by tsnapi — public API snapshot of `@devframes/hub/client`
 */
// #region Interfaces
export interface CommandsContext {
  readonly commands: DevframeCommandEntry[];
  readonly paletteCommands: DevframeCommandEntry[];
  register: (_: DevframeClientCommand | DevframeClientCommand[]) => () => void;
  execute: (_: string, ..._: any[]) => Promise<unknown>;
  getKeybindings: (_: string) => DevframeCommandKeybinding[];
  settings: SharedState<DevframeDocksUserSettings>;
  paletteOpen: boolean;
}
export interface DevframeClientHost {
  context: DevframeClientContext;
  dispose: () => void;
}
export interface DevframeClientHostOptions {
  rpc?: DevframeRpcClient;
  connect?: DevframeRpcClientOptions;
  clientType?: DockClientType;
  loadClientScripts?: boolean;
  renderers?: Record<string, DockRenderer>;
  categoryOrder?: Record<string, number>;
}
export interface DockClientScriptContext extends DocksContext {
  current: DockEntryState;
  messages: DevframeMessagesClient;
}
export interface DockEntryState {
  entryMeta: DevframeDockEntry;
  readonly isActive: boolean;
  domElements: {
    iframe?: HTMLIFrameElement | null;
    panel?: HTMLDivElement | null;
  };
  events: EventEmitter<DockEntryStateEvents>;
}
export interface DockEntryStateEvents {
  'entry:activated': () => void;
  'entry:deactivated': () => void;
  'entry:updated': (_: DevframeDockUserEntry) => void;
  'dom:panel:mounted': (_: HTMLDivElement) => void;
  'dom:iframe:mounted': (_: HTMLIFrameElement) => void;
}
export interface DockPanelStorage {
  mode: 'float' | 'edge';
  width: number;
  height: number;
  top: number;
  left: number;
  position: 'left' | 'right' | 'bottom' | 'top';
  open: boolean;
  inactiveTimeout: number;
}
export interface DockRegistration<T extends DevframeDockEntry = DevframeDockEntry> {
  update: (_: Partial<T>) => void;
  dispose: () => void;
}
export interface DockRendererInstance {
  dispose?: () => void;
}
export interface DockRendererMountOptions {
  entry: DevframeDockEntry;
  container: HTMLElement;
  context: DevframeClientContext;
}
export interface DockRenderersContext {
  register: (_: string, _: DockRenderer) => () => void;
  get: (_: string) => DockRenderer | undefined;
  has: (_: string) => boolean;
  mount: (_: DevframeDockEntry, _: HTMLElement) => Promise<() => void>;
}
export interface DocksConnectionContext {
  readonly status: DevframeConnectionStatus;
  readonly error: Error | null;
  readonly events: EventEmitter<RpcClientEvents$1>;
}
export interface DocksContext extends DevframeRpcContext {
  readonly clientType: 'embedded' | 'standalone';
  readonly panel: DocksPanelContext;
  readonly docks: DocksEntriesContext;
  readonly commands: CommandsContext;
  readonly when: WhenClauseContext;
  readonly connection: DocksConnectionContext;
  readonly renderers: DockRenderersContext;
}
export interface DocksEntriesContext {
  selectedId: string | null;
  readonly selected: DevframeDockEntry | null;
  entries: DevframeDockEntry[];
  entryToStateMap: Map<string, DockEntryState>;
  groupedEntries: DevframeDockEntriesGrouped;
  settings: SharedState<DevframeDocksUserSettings>;
  getStateById: (_: string) => DockEntryState | undefined;
  switchEntry: (_?: string | null) => Promise<boolean>;
  toggleEntry: (_: string) => Promise<boolean>;
  register: <T extends DevframeDockEntry>(_: T, _?: boolean) => DockRegistration<T>;
  update: (_: DevframeDockUserEntry) => void;
}
export interface DocksPanelContext {
  store: DockPanelStorage;
  isDragging: boolean;
  isResizing: boolean;
  readonly isVertical: boolean;
}
export interface FrameNavClient {
  readonly ready: boolean;
  readonly currentTabId: string | null;
  dispose: () => void;
}
export interface FrameNavClientOptions {
  frameId: string;
  anchor: DevframeViewIframe;
  iframe: Pick<HTMLIFrameElement, 'contentWindow' | 'src'>;
  docks: Pick<DocksEntriesContext, 'register' | 'switchEntry' | 'getStateById'>;
  window?: FrameNavListenTarget;
  origin?: string;
  handshakeTimeoutMs?: number;
}
export interface FrameNavEnvelope {
  channel: typeof FRAME_NAV_CHANNEL;
  v: typeof FRAME_NAV_VERSION;
  frameId: string;
  from: 'host' | 'frame';
}
export interface FrameNavListenTarget {
  addEventListener: (_: 'message', _: (_: MessageEvent) => void) => void;
  removeEventListener: (_: 'message', _: (_: MessageEvent) => void) => void;
}
export interface FrameTab {
  id: string;
  title: string;
  icon?: DevframeDockEntryIcon;
  navTarget: NavTarget;
  fallbackUrl?: string;
  badge?: string;
  order?: number;
  category?: string;
  when?: string;
  groupId?: string;
}
export interface MessagesClientOptions {
  defaults?: Partial<DevframeMessageEntryInput>;
}
export interface WhenClauseContext {
  readonly context: WhenContext;
}
// #endregion

// #region Types
export type ConnectRemoteDevframeOptions = Omit<DevframeRpcClientOptions, 'connectionMeta' | 'authToken'>;
export type DevframeClientContext = DocksContext;
export type DockClientType = 'embedded' | 'standalone';
export type DockRenderer = (_: DockRendererMountOptions) => DockRendererInstance | Promise<DockRendererInstance>;
export type FrameNavFrameMessage = FrameNavEnvelope & {
  from: 'frame';
} & ({
  type: 'ready';
  tabs: FrameTab[];
  current?: string;
} | {
  type: 'manifest';
  tabs: FrameTab[];
  current?: string;
} | {
  type: 'navigated';
  tabId?: string;
  navTarget?: NavTarget;
});
export type FrameNavHostMessage = FrameNavEnvelope & {
  from: 'host';
} & FrameNavHostPayload;
export type FrameNavHostPayload = {
  type: 'hello';
} | {
  type: 'navigate';
  tabId: string;
  navTarget: NavTarget;
};
// #endregion

// #region Functions
export declare function attachFrameNavClient(_: FrameNavClientOptions): FrameNavClient;
export declare function buildRemoteDevframeUrl(_: string, _: DevframeConnection): string;
export declare function connectRemoteDevframe(_?: ConnectRemoteDevframeOptions): Promise<DevframeRpcClient>;
export declare function createDevframeClientHost(_?: DevframeClientHostOptions): Promise<DevframeClientHost>;
export declare function createMessagesClient(_: DevframeRpcClient, _?: MessagesClientOptions): DevframeMessagesClient;
export declare function getDevframeClientContext(): DevframeClientContext | undefined;
export declare function parseRemoteConnection(_?: string): RemoteConnectionInfo | null;
export declare function resolveDockIcon(_: DevframeDockEntryIcon, _: DevframeConnection): DevframeDockEntryIcon;
export declare function resolveDockUrl(_: string, _: DevframeConnection): string;
export declare function setDevframeClientContext(_: DevframeClientContext | undefined): void;
export declare function stripRemoteConnectionFromUrl(_: string): string;
// #endregion

// #region Variables
export declare const CLIENT_CONTEXT_KEY: string;
export declare const FRAME_NAV_CHANNEL: string;
export declare const FRAME_NAV_VERSION: number;
// #endregion

// #region Re-exports
export * from "devframe/client";
// #endregion

// #region Other
export { DEFAULT_CATEGORIES_ORDER }
export { DevframeClientRpcHost }
export { RpcClientEvents }
// #endregion