πŸ“„ File detail

ink/events/terminal-focus-event.ts

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

🎯 Use case

This file lives under β€œink/”, which covers Ink terminal UI (layouts, TTY IO, keyboard, renderer components). On the API surface it exposes TerminalFocusEventType and TerminalFocusEvent β€” mainly types, interfaces, or factory objects. It composes internal code from event (relative imports).

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

🧠 Inline summary

import { Event } from './event.js' export type TerminalFocusEventType = 'terminalfocus' | 'terminalblur' /**

πŸ“€ Exports (heuristic)

  • TerminalFocusEventType
  • TerminalFocusEvent

πŸ–₯️ Source preview

import { Event } from './event.js'

export type TerminalFocusEventType = 'terminalfocus' | 'terminalblur'

/**
 * Event fired when the terminal window gains or loses focus.
 *
 * Uses DECSET 1004 focus reporting - the terminal sends:
 * - CSI I (\x1b[I) when the terminal gains focus
 * - CSI O (\x1b[O) when the terminal loses focus
 */
export class TerminalFocusEvent extends Event {
  readonly type: TerminalFocusEventType

  constructor(type: TerminalFocusEventType) {
    super()
    this.type = type
  }
}