@llamaindex/ui
Version:
A comprehensive UI component library built with React, TypeScript, and Tailwind CSS for LlamaIndex applications
89 lines (81 loc) • 2.43 kB
TypeScript
import * as react_jsx_runtime from 'react/jsx-runtime';
import * as React from 'react';
interface BoundingBox {
id: string;
x: number;
y: number;
width: number;
height: number;
confidence?: number;
label?: string;
color?: string;
}
interface PageData {
pageNumber: number;
imageUrl: string;
width: number;
height: number;
boundingBoxes: BoundingBox[];
}
interface FileData$1 {
fileName: string;
pages: PageData[];
totalPages: number;
}
interface Highlight {
page: number;
x: number;
y: number;
width: number;
height: number;
}
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;
toolbarClassName?: string;
onRemove?: () => void;
maxPages?: number;
maxPagesWarning?: string;
}) => react_jsx_runtime.JSX.Element | null>;
type PdfToolbarProps = {
currentPage: number;
totalPages: number;
scale: number;
onPageChange: (page: number) => void;
onScaleChange: (scale: number) => void;
onDownload?: () => void;
onReset?: () => void;
onFullscreen: () => void;
};
type PdfNavigatorPropsBase = {
fileName: string;
onRemove?: () => void;
className?: string;
};
type PdfNavigatorPropsLoading = PdfNavigatorPropsBase & {
isLoading: true;
};
type PdfNavigatorPropsLoaded = PdfNavigatorPropsBase & PdfToolbarProps & {
isLoading?: false | undefined;
};
type PdfNavigatorProps = PdfNavigatorPropsLoading | PdfNavigatorPropsLoaded;
declare const PdfNavigator: (props: PdfNavigatorProps) => react_jsx_runtime.JSX.Element;
export { type BoundingBox, type FileData$1 as FileData, FilePreview, type FilePreviewProps, type Highlight, type PageData, PdfNavigator, PdfPreview, useFileData };