π File detail
ink/components/AppContext.ts
π§© .tsπ 22 linesπΎ 523 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 Props β mainly functions, hooks, or classes. Dependencies touch React UI.
Generated from folder role, exports, dependency roots, and inline comments β not hand-reviewed for every path.
π§ Inline summary
import { createContext } from 'react' export type Props = { /** * Exit (unmount) the whole Ink app.
π€ Exports (heuristic)
Propsdefault
π External import roots
Package roots from from "β¦" (relative paths omitted).
react
π₯οΈ Source preview
import { createContext } from 'react'
export type Props = {
/**
* Exit (unmount) the whole Ink app.
*/
readonly exit: (error?: Error) => void
}
/**
* `AppContext` is a React context, which exposes a method to manually exit the app (unmount).
*/
// eslint-disable-next-line @typescript-eslint/naming-convention
const AppContext = createContext<Props>({
exit() {},
})
// eslint-disable-next-line custom-rules/no-top-level-side-effects
AppContext.displayName = 'InternalAppContext'
export default AppContext