@llamaindex/ui
Version:
A comprehensive UI component library built with React, TypeScript, and Tailwind CSS for LlamaIndex applications
75 lines (69 loc) • 2.59 kB
TypeScript
import * as react_jsx_runtime from 'react/jsx-runtime';
import { B as BoundingBox, H as Highlight, b as FileToolbarProps } from '../file-tool-bar-D_a1dBnH.js';
export { a as FileData, P as PageData } from '../file-tool-bar-D_a1dBnH.js';
import * as React from 'react';
interface FileData {
url?: string;
name?: string;
type?: string;
}
declare function useFileData(fileId: string, mockData?: FileData): {
data: FileData | null;
loading: boolean;
error: string | null;
};
interface FilePreviewProps {
onBoundingBoxClick?: (box: BoundingBox, pageNumber?: number) => void;
fileId: string;
highlight?: Highlight;
mockData?: FileData;
}
declare function FilePreview({ onBoundingBoxClick, highlight, fileId, mockData, }: FilePreviewProps): react_jsx_runtime.JSX.Element | null;
declare const PdfPreview: React.MemoExoticComponent<({ url, highlights, fileName, toolbarClassName, onRemove, maxPages, maxPagesWarning, }: {
url: string;
highlights?: Highlight[];
fileName?: string | null;
toolbarClassName?: string;
onRemove?: () => void;
maxPages?: number;
maxPagesWarning?: string;
}) => react_jsx_runtime.JSX.Element | null>;
type PdfNavigatorPropsBase = {
fileName: string;
onRemove?: () => void;
className?: string;
};
type PdfNavigatorPropsLoading = PdfNavigatorPropsBase & {
isLoading: true;
};
type PdfNavigatorPropsLoaded = PdfNavigatorPropsBase & FileToolbarProps & {
isLoading?: false | undefined;
};
/**
* @deprecated Use `FileToolbar` from `@llamaindex/ui/document-preview` directly instead.
* This component is kept for backward compatibility and will be removed in a future version.
*
* PdfNavigator is now a wrapper around FileToolbar. For new code, use FileToolbar directly:
*
* ```tsx
* import { FileToolbar } from "@llamaindex/ui/document-preview";
*
* <FileToolbar
* fileName="document.pdf"
* currentPage={1}
* totalPages={10}
* scale={1.0}
* onPageChange={handlePageChange}
* onScaleChange={handleScaleChange}
* onFullscreen={handleFullscreen}
* onRemove={handleRemove}
* />
* ```
*/
type PdfNavigatorProps = PdfNavigatorPropsLoading | PdfNavigatorPropsLoaded;
/**
* @deprecated Use `FileToolbar` from `@llamaindex/ui/document-preview` directly instead.
* This component is kept for backward compatibility and will be removed in a future version.
*/
declare const PdfNavigator: (props: PdfNavigatorProps) => react_jsx_runtime.JSX.Element;
export { BoundingBox, FilePreview, type FilePreviewProps, Highlight, PdfNavigator, PdfPreview, useFileData };