File size: 2,101 Bytes
7e3630c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/**
 * ink-picture - Better image component for Ink CLI/TUIs
 *
 * This library provides components for rendering images in terminal applications
 * built with Ink. It supports multiple rendering protocols with automatic fallback:
 * Kitty, iTerm2, Sixel, Half-Block, Braille, and ASCII.
 *
 * @example
 * ```tsx
 * import React from 'react';
 * import { Box } from 'ink';
 * import Image, { InkPictureProvider } from 'ink-picture';
 *
 * function App() {
 *   return (
 *     <InkPictureProvider>
 *       <Box flexDirection="column">
 *         <Image
 *           src="https://example.com/image.jpg"
 *           width={40}
 *           height={20}
 *           alt="Example image"
 *         />
 *       </Box>
 *     </InkPictureProvider>
 *   );
 * }
 * ```
 *
 * The Image component must be used within an InkPictureProvider.
 * This ensures terminal capabilities and configuration are detected and provided.
 */

export { default as AsciiImage } from "./components/image/Ascii.js";
export { default as BrailleImage } from "./components/image/Braille.js";
export { default as HalfBlockImage } from "./components/image/HalfBlock.js";
export { default as ITerm2Image } from "./components/image/ITerm2.js";
export type {
  ImageProtocolHint,
  ImageProtocolName,
} from "./components/image/index.js";
export { default } from "./components/image/index.js";
export { default as KittyImage } from "./components/image/Kitty.js";
export type { ImageProps, ImageProtocol } from "./components/image/protocol.js";
export { default as SixelImage } from "./components/image/Sixel.js";

export { default as usePosition } from "./hooks/usePosition.js";
export type {
  GetVisibility,
  Visibility,
  VisibilityInfo,
} from "./hooks/useVisibility.js";
export { useVisibility } from "./hooks/useVisibility.js";

export {
  defaultConfig as defaultInkPictureConfig,
  defaultTerminalInfo,
  type InkPictureConfig,
  InkPictureProvider,
  type TerminalInfo,
  TerminalInfoContext,
  TerminalInfoProvider,
  useImageCache,
  useInkPictureConfig,
  useOnRender,
  useTerminalInfo,
} from "./InkPictureProvider.js";