ink
- Version 6.8.0
- Published
- 490 kB
- 25 dependencies
- MIT license
Install
npm i inkyarn add inkpnpm add inkOverview
React for CLI
Index
Classes
class Ink
class Ink {}constructor
constructor(options: Options);property calculateLayout
calculateLayout: () => void;property getTerminalWidth
getTerminalWidth: () => number;property handleAppExit
handleAppExit: (errorOrResult?: unknown) => void;property isConcurrent
readonly isConcurrent: boolean;Whether this instance is using concurrent rendering mode.
property onRender
onRender: () => void;property rejectExitPromise
rejectExitPromise: (reason?: Error) => void;property resized
resized: () => void;property resolveExitPromise
resolveExitPromise: (result?: unknown) => void;property restoreLastOutput
restoreLastOutput: () => void;property setCursorPosition
setCursorPosition: (position: CursorPosition | undefined) => void;property unsubscribeExit
unsubscribeExit: () => void;method clear
clear: () => void;method patchConsole
patchConsole: () => void;method render
render: (node: ReactNode) => void;method unmount
unmount: (error?: Error | number | null) => void;method waitUntilExit
waitUntilExit: () => Promise<unknown>;method writeToStderr
writeToStderr: (data: string) => void;method writeToStdout
writeToStdout: (data: string) => void;Type Aliases
type Options
type Options = { stdout: NodeJS.WriteStream; stdin: NodeJS.ReadStream; stderr: NodeJS.WriteStream; debug: boolean; exitOnCtrlC: boolean; patchConsole: boolean; onRender?: (metrics: RenderMetrics) => void; isScreenReaderEnabled?: boolean; waitUntilExit?: () => Promise<unknown>; maxFps?: number; incrementalRendering?: boolean; /** Enable React Concurrent Rendering mode.
When enabled: - Suspense boundaries work correctly with async data - `useTransition` and `useDeferredValue` are fully functional - Updates can be interrupted for higher priority work
Note: Concurrent mode changes the timing of renders. Some tests may need to use `act()` to properly await updates. The `concurrent` option only takes effect on the first render for a given stdout. If you need to change the rendering mode, call `unmount()` first.
@default false @experimental */ concurrent?: boolean; kittyKeyboard?: KittyKeyboardOptions;};type RenderMetrics
type RenderMetrics = { /** Time spent rendering in milliseconds. */ renderTime: number;};Performance metrics for a render operation.
Package Files (1)
Dependencies (25)
Dev Dependencies (32)
- @faker-js/faker
- @sindresorhus/tsconfig
- @sinonjs/fake-timers
- @types/ms
- @types/node
- @types/react
- @types/react-reconciler
- @types/scheduler
- @types/signal-exit
- @types/sinon
- @types/stack-utils
- @types/ws
- @vdemedes/prettier-config
- ava
- boxen
- delay
- eslint-config-xo-react
- eslint-plugin-react
- eslint-plugin-react-hooks
- ms
- node-pty
- p-queue
- prettier
- react
- react-devtools
- react-devtools-core
- react-router
- sinon
- strip-ansi
- tsx
- typescript
- xo
Peer Dependencies (3)
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/ink.
- Markdown[](https://www.jsdocs.io/package/ink)
- HTML<a href="https://www.jsdocs.io/package/ink"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 4319 ms. - Missing or incorrect documentation? Open an issue for this package.
