Download src/ink/components/AppContext.ts from chenbhao/codev: direct link, hf CLI and curl.
- Browser
- Download file 523 Bytes
-
https://huggingface.co/chenbhao/codev/resolve/afbc7edaae4e6bb0102ba024b49ce8be89d2264c/src/ink/components/AppContext.ts
- Command line
-
hf download hf://chenbhao/codev@afbc7edaae4e6bb0102ba024b49ce8be89d2264c/src/ink/components/AppContext.ts
-
curl -L -o AppContext.ts https://huggingface.co/chenbhao/codev/resolve/afbc7edaae4e6bb0102ba024b49ce8be89d2264c/src/ink/components/AppContext.ts
523 Bytes
| 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 | |