/**
 * Generated by tsnapi — public API snapshot of `@devframes/hub`
 */
// #region Interfaces
export interface ClientScriptEntry {
  importFrom: string;
  importName?: string;
}
export interface CreateHubContextOptions extends CreateHostContextOptions {}
export interface DevframeChildProcessExecuteOptions {
  command: string;
  args: string[];
  cwd?: string;
  env?: Record<string, string>;
}
export interface DevframeChildProcessOutput {
  stdout: string;
  stderr: string;
  exitCode: number | undefined;
}
export interface DevframeChildProcessResult extends PromiseLike<DevframeChildProcessOutput> {
  readonly pid: number | undefined;
  readonly exitCode: number | undefined;
  readonly killed: boolean;
  kill: (_?: NodeJS.Signals | number) => boolean;
}
export interface DevframeChildProcessTerminalSession extends DevframeTerminalSession {
  type: 'child-process';
  executeOptions: DevframeChildProcessExecuteOptions;
  getChildProcess: () => ChildProcess | undefined;
  getResult: () => DevframeChildProcessResult;
  terminate: () => Promise<void>;
  restart: () => Promise<void>;
}
export interface DevframeClientCommand extends DevframeCommandBase {
  source: 'client';
  action?: (..._: any[]) => void | DevframeClientCommand[] | Promise<void | DevframeClientCommand[]>;
  children?: DevframeClientCommand[];
}
export interface DevframeCommandAgentOptions {
  description: string;
  title?: string;
  safety?: 'read' | 'action' | 'destructive';
  tags?: readonly string[];
  args?: readonly StandardSchemaV1[];
}
export interface DevframeCommandBase {
  id: string;
  title: string;
  description?: string;
  icon?: DevframeDockEntryIcon;
  category?: string;
  showInPalette?: boolean | 'without-children';
  when?: string;
  keybindings?: DevframeCommandKeybinding[];
}
export interface DevframeCommandHandle {
  readonly id: string;
  update: (_: Partial<Omit<DevframeServerCommandInput, 'id'>>) => void;
  unregister: () => void;
}
export interface DevframeCommandKeybinding {
  key: string;
}
export interface DevframeCommandShortcutOverrides {
  [commandId: string]: DevframeCommandKeybinding[];
}
export interface DevframeCommandsHost {
  readonly commands: Map<string, DevframeServerCommandInput>;
  readonly events: EventEmitter<DevframeCommandsHostEvents>;
  register: (_: DevframeServerCommandInput) => DevframeCommandHandle;
  unregister: (_: string) => boolean;
  execute: (_: string, ..._: any[]) => Promise<unknown>;
  list: () => DevframeServerCommandEntry[];
}
export interface DevframeCommandsHostEvents {
  'command:registered': (_: DevframeServerCommandEntry) => void;
  'command:unregistered': (_: string) => void;
}
export interface DevframeDockActivation {
  dockId: string;
  params?: Record<string, unknown>;
}
export interface DevframeDockEntryBase {
  id: string;
  title: string;
  icon: DevframeDockEntryIcon;
  defaultOrder?: number;
  category?: DevframeDockEntryCategory;
  when?: string;
  visibility?: string;
  badge?: string;
  groupId?: string;
}
export interface DevframeDockEntryRegistry {
  'iframe': DevframeViewIframe;
  'action': DevframeViewAction;
  'custom-render': DevframeViewCustomRender;
  'launcher': DevframeViewLauncher;
  'group': DevframeViewGroup;
  '~builtin': DevframeViewBuiltin;
}
export interface DevframeDocksActiveState {
  activation: DevframeDockActivation | null;
}
export interface DevframeDocksHost {
  readonly views: Map<string, DevframeDockUserEntry>;
  readonly events: EventEmitter<{
    'dock:entry:updated': (entry: DevframeDockUserEntry) => void;
    'dock:activate': (activation: DevframeDockActivation) => void;
  }>;
  register: <T extends DevframeDockUserEntry>(_: T, _?: boolean) => {
    update: (_: Partial<T>) => void;
  };
  update: (_: DevframeDockUserEntry) => void;
  values: () => DevframeDockEntry[];
  activate: (_: string, _?: Record<string, unknown>) => void;
}
export interface DevframeDocksUserSettings {
  docksHidden: string[];
  docksCategoriesHidden: string[];
  docksPinned: string[];
  docksCustomOrder: Record<string, number>;
  showIframeAddressBar: boolean;
  closeOnOutsideClick: boolean;
  commandShortcuts: DevframeCommandShortcutOverrides;
}
export interface DevframeHubContext extends DevframeNodeContext {
  readonly host: DevframeHost;
  docks: DevframeDocksHost;
  terminals: DevframeTerminalsHost;
  messages: DevframeMessagesHost;
  commands: DevframeCommandsHost;
  createJsonRenderer: (_: JsonRenderSpec) => JsonRenderer;
}
export interface DevframeMessageActivateAction {
  id: string;
  label: string;
  kind: 'activate';
  activate: {
    dockId: string;
    params?: Record<string, unknown>;
  };
}
export interface DevframeMessageElementPosition {
  selector?: string;
  boundingBox?: {
    x: number;
    y: number;
    width: number;
    height: number;
  };
  description?: string;
}
export interface DevframeMessageEntry {
  id: string;
  message: string;
  description?: string;
  level: DevframeMessageLevel;
  stacktrace?: string;
  elementPosition?: DevframeMessageElementPosition;
  filePosition?: DevframeMessageFilePosition;
  notify?: boolean;
  from: DevframeMessageEntryFrom;
  category?: string;
  labels?: string[];
  actions?: DevframeMessageAction[];
  autoDismiss?: number;
  autoDelete?: number;
  timestamp: number;
  status?: 'loading' | 'idle';
}
export interface DevframeMessageFilePosition {
  file: string;
  line?: number;
  column?: number;
}
export interface DevframeMessageHandle {
  readonly entry: DevframeMessageEntry;
  readonly id: string;
  update: (_: Partial<DevframeMessageEntryInput>) => Promise<DevframeMessageEntry | undefined>;
  dismiss: () => Promise<void>;
}
export interface DevframeMessagesClient extends DevframeMessagesLevelShortcuts {
  add: (_: DevframeMessageEntryInput) => Promise<DevframeMessageHandle>;
  remove: (_: string) => Promise<void>;
  clear: () => Promise<void>;
}
export interface DevframeMessagesHost extends DevframeMessagesLevelShortcuts {
  readonly entries: Map<string, DevframeMessageEntry>;
  readonly events: EventEmitter<{
    'message:added': (entry: DevframeMessageEntry) => void;
    'message:updated': (entry: DevframeMessageEntry) => void;
    'message:removed': (id: string) => void;
    'message:cleared': () => void;
  }>;
  add: (_: DevframeMessageEntryInput) => Promise<DevframeMessageHandle>;
  update: (_: string, _: Partial<DevframeMessageEntryInput>) => Promise<DevframeMessageEntry | undefined>;
  remove: (_: string) => Promise<void>;
  clear: () => Promise<void>;
  listSince: (_?: number | null) => DevframeMessagesListDelta;
}
export interface DevframeMessagesLevelShortcuts {
  info: (_: string, _?: DevframeMessageShortcutInput) => Promise<DevframeMessageHandle>;
  warn: (_: string, _?: DevframeMessageShortcutInput) => Promise<DevframeMessageHandle>;
  error: (_: string, _?: DevframeMessageShortcutInput) => Promise<DevframeMessageHandle>;
  success: (_: string, _?: DevframeMessageShortcutInput) => Promise<DevframeMessageHandle>;
  debug: (_: string, _?: DevframeMessageShortcutInput) => Promise<DevframeMessageHandle>;
}
export interface DevframeMessagesListDelta {
  entries: DevframeMessageEntry[];
  removedIds: string[];
  version: number;
  full: boolean;
}
export interface DevframePtyExecuteOptions {
  command: string;
  args?: string[];
  cwd?: string;
  env?: Record<string, string>;
  cols?: number;
  rows?: number;
}
export interface DevframePtyTerminalSession extends DevframeTerminalSession {
  type: 'pty';
  interactive: true;
  executeOptions: DevframePtyExecuteOptions;
  write: (_: string) => void;
  resize: (_: number, _: number) => void;
  getProcessName: () => string | undefined;
  terminate: () => Promise<void>;
  restart: () => Promise<void>;
}
export interface DevframeServerCommandEntry extends DevframeCommandBase {
  source: 'server';
  children?: DevframeServerCommandEntry[];
}
export interface DevframeServerCommandInput extends DevframeCommandBase {
  handler?: (..._: any[]) => any | Promise<any>;
  agent?: DevframeCommandAgentOptions;
  children?: DevframeServerCommandInput[];
}
export interface DevframeTerminalSession extends DevframeTerminalSessionBase {
  buffer?: string[];
  stream?: ReadableStream<string>;
}
export interface DevframeTerminalSessionBase {
  id: string;
  title: string;
  description?: string;
  status: DevframeTerminalStatus;
  icon?: DevframeDockEntryIcon;
  interactive?: boolean;
  restartable?: boolean;
}
export interface DevframeTerminalsHost {
  readonly sessions: Map<string, DevframeTerminalSession>;
  readonly events: EventEmitter<{
    'terminal:session:updated': (session: DevframeTerminalSession) => void;
  }>;
  register: (_: DevframeTerminalSession) => DevframeTerminalSession;
  update: (_: DevframeTerminalSession) => void;
  remove: (_: DevframeTerminalSession) => void;
  startChildProcess: (_: DevframeChildProcessExecuteOptions, _: Omit<DevframeTerminalSessionBase, 'status'>) => Promise<DevframeChildProcessTerminalSession>;
  startPtySession: (_: DevframePtyExecuteOptions, _: Omit<DevframeTerminalSessionBase, 'status'>) => Promise<DevframePtyTerminalSession>;
}
export interface DevframeViewAction extends DevframeDockEntryBase {
  type: 'action';
  action: ClientScriptEntry;
}
export interface DevframeViewBuiltin extends DevframeDockEntryBase {
  type: '~builtin';
  id: string;
}
export interface DevframeViewCustomRender extends DevframeDockEntryBase {
  type: 'custom-render';
  renderer: ClientScriptEntry;
}
export interface DevframeViewGroup extends DevframeDockEntryBase {
  type: 'group';
  defaultChildId?: string;
  categoryOrder?: Record<string, number>;
  accentColor?: string;
}
export interface DevframeViewIframe extends DevframeDockEntryBase {
  type: 'iframe';
  url: string;
  frameId?: string;
  clientScript?: ClientScriptEntry;
  navTarget?: NavTarget;
  subTabs?: FrameSubTabsConfig;
  remote?: boolean | RemoteDockOptions;
}
export interface DevframeViewJsonRender extends DevframeDockEntryBase {
  type: 'json-render';
  ui: JsonRenderer;
}
export interface DevframeViewLauncher extends DevframeDockEntryBase {
  type: 'launcher';
  launcher: {
    icon?: DevframeDockEntryIcon;
    title: string;
    status?: DevframeViewLauncherStatus;
    error?: string;
    description?: string;
    buttonStart?: string;
    buttonLoading?: string;
    command?: string;
    terminalSessionId?: string;
    digest?: string;
    onLaunch?: () => Promise<void>;
  };
}
export interface FrameSubTabsConfig {
  protocol: 'postmessage';
  handshakeTimeoutMs?: number;
}
export interface JsonRenderElement {
  type: string;
  props?: Record<string, unknown>;
  children?: string[];
  on?: Record<string, unknown>;
  visible?: unknown;
  repeat?: unknown;
  [key: string]: unknown;
}
export interface JsonRenderer {
  updateSpec: (_: JsonRenderSpec) => void | Promise<void>;
  updateState: (_: Record<string, unknown>) => void | Promise<void>;
  readonly _stateKey: string;
}
export interface JsonRenderSpec {
  root: string;
  elements: Record<string, JsonRenderElement>;
  state?: Record<string, unknown>;
}
export interface NavTarget {
  path: string;
  query?: Record<string, string | readonly string[]>;
}
export interface RemoteConnectionInfo extends ConnectionMeta {
  backend: 'websocket';
  websocket: string;
  v: 1;
  authToken: string;
  origin: string;
}
export interface RemoteDockOptions {
  transport?: 'fragment' | 'query';
  originLock?: boolean;
}
// #endregion

// #region Types
export type DevframeCommandEntry = DevframeServerCommandEntry | DevframeClientCommand;
export type DevframeDockEntriesGrouped = [category: string, entries: DevframeDockEntry[]][];
export type DevframeDockEntry = DevframeDockUserEntry;
export type DevframeDockEntryCategory = 'framework' | 'app' | 'ui' | 'data' | 'web' | 'performance' | 'advanced' | 'docs' | 'default' | '~builtin' | (string & {});
export type DevframeDockEntryIcon = string | {
  light: string;
  dark: string;
};
export type DevframeDockUserEntry = DevframeDockEntryRegistry[keyof DevframeDockEntryRegistry];
export type DevframeMessageAction = DevframeMessageActivateAction;
export type DevframeMessageEntryFrom = 'server' | 'browser';
export type DevframeMessageEntryInput = Omit<DevframeMessageEntry, 'id' | 'timestamp' | 'from'> & {
  id?: string;
  timestamp?: number;
};
export type DevframeMessageLevel = 'info' | 'warn' | 'error' | 'success' | 'debug';
export type DevframeMessageShortcutInput = Omit<DevframeMessageEntryInput, 'message' | 'level'>;
export type DevframeTerminalStatus = 'running' | 'stopped' | 'error';
export type DevframeViewLauncherStatus = 'idle' | 'loading' | 'success' | 'error';
// #endregion

// #region Functions
export declare function defineCommand<const W extends string = ''>(_: Omit<DevframeServerCommandInput, 'when'> & {
  when?: WhenExpression<WhenContext, W>;
}): DevframeServerCommandInput;
export declare function defineDockEntry<const T extends DevframeDockUserEntry, const W extends string = '', const V extends string = ''>(_: Omit<T, 'when' | 'visibility'> & {
  when?: WhenExpression<WhenContext, W>;
  visibility?: WhenExpression<WhenContext, V>;
}): T;
/** @deprecated */
export declare function defineJsonRenderSpec(_: JsonRenderSpec): JsonRenderSpec;
// #endregion

// #region Variables
export declare const DEFAULT_CATEGORIES_ORDER: Record<string, number>;
export declare const defineHubRpcFunction: <NAME extends string, TYPE extends import("devframe/rpc").RpcFunctionType, ARGS extends any[], RETURN = void, const AS extends import("devframe/rpc").RpcArgsSchema | undefined = undefined, const RS extends import("devframe/rpc").RpcReturnSchema | undefined = undefined>(definition: import("devframe/rpc").RpcFunctionDefinition<NAME, TYPE, ARGS, RETURN, AS, RS, DevframeHubContext>) => import("devframe/rpc").RpcFunctionDefinition<NAME, TYPE, ARGS, RETURN, AS, RS, DevframeHubContext>;
// #endregion

// #region Other
export { ConnectionMeta }
export { DevframeCapabilities }
export { DevframeDiagnosticsDefinition }
export { DevframeDiagnosticsHost }
export { DevframeDiagnosticsLogger }
export { DevframeHost }
export { DevframeNodeRpcSession }
export { DevframeRpcClientFunctions }
export { DevframeRpcServerFunctions }
export { DevframeRpcSharedStates }
export { DevframeViewHost }
export { EntriesToObject }
export { EventEmitter }
export { EventsMap }
export { EventUnsubscribe }
export { PartialWithoutId }
export { RpcBroadcastOptions }
export { RpcDefinitionsFilter }
export { RpcDefinitionsToFunctions }
export { RpcFunctionsHost }
export { RpcSharedStateGetOptions }
export { RpcSharedStateHost }
export { RpcStreamingChannel }
export { RpcStreamingChannelOptions }
export { RpcStreamingHost }
export { Thenable }
// #endregion