πŸ“„ File detail

utils/commandLifecycle.ts

🧩 .tsπŸ“ 22 linesπŸ’Ύ 440 bytesπŸ“ text
← Back to All Files

🎯 Use case

This file lives under β€œutils/”, which covers cross-cutting helpers (shell, tempfiles, settings, messages, process input, …). On the API surface it exposes setCommandLifecycleListener and notifyCommandLifecycle β€” mainly functions, hooks, or classes.

Generated from folder role, exports, dependency roots, and inline comments β€” not hand-reviewed for every path.

🧠 Inline summary

type CommandLifecycleState = 'started' | 'completed' type CommandLifecycleListener = ( uuid: string, state: CommandLifecycleState,

πŸ“€ Exports (heuristic)

  • setCommandLifecycleListener
  • notifyCommandLifecycle

πŸ–₯️ Source preview

type CommandLifecycleState = 'started' | 'completed'

type CommandLifecycleListener = (
  uuid: string,
  state: CommandLifecycleState,
) => void

let listener: CommandLifecycleListener | null = null

export function setCommandLifecycleListener(
  cb: CommandLifecycleListener | null,
): void {
  listener = cb
}

export function notifyCommandLifecycle(
  uuid: string,
  state: CommandLifecycleState,
): void {
  listener?.(uuid, state)
}