MCPcopy Index your code
hub / github.com/codeaashu/claude-code / renderSync

Function renderSync

src/ink/root.ts:76–105  ·  view source on GitHub ↗
(
  node: ReactNode,
  options?: NodeJS.WriteStream | RenderOptions,
)

Source from the content-addressed store, hash-verified

74 * Mount a component and render the output.
75 */
76export const renderSync = (
77 node: ReactNode,
78 options?: NodeJS.WriteStream | RenderOptions,
79): Instance => {
80 const opts = getOptions(options)
81 const inkOptions: InkOptions = {
82 stdout: process.stdout,
83 stdin: process.stdin,
84 stderr: process.stderr,
85 exitOnCtrlC: true,
86 patchConsole: true,
87 ...opts,
88 }
89
90 const instance: Ink = getInstance(
91 inkOptions.stdout,
92 () => new Ink(inkOptions),
93 )
94
95 instance.render(node)
96
97 return {
98 rerender: instance.render,
99 unmount() {
100 instance.unmount()
101 },
102 waitUntilExit: instance.waitUntilExit,
103 cleanup: () => instances.delete(inkOptions.stdout),
104 }
105}
106
107const wrappedRender = async (
108 node: ReactNode,

Callers 1

wrappedRenderFunction · 0.85

Calls 4

getOptionsFunction · 0.85
getInstanceFunction · 0.85
deleteMethod · 0.65
renderMethod · 0.45

Tested by

no test coverage detected