UNPKG

@pierre/diffs

Version:

45 lines 1.75 kB
import { FileContents, LineAnnotation, SelectedLineRange, VirtualFileMetrics } from "../../types.js"; import { GetHoveredLineResult } from "../../managers/InteractionManager.js"; import { FileEditChangeHandler, FileEditCompleteHandler, FileOptions } from "../../components/File.js"; import { EditorOptions } from "../../editor/editor.js"; //#region src/react/utils/useFileInstance.d.ts interface UseFileInstanceProps<LAnnotation, Caret> { file: FileContents; options: FileOptions<LAnnotation, Caret> | undefined; editorOptions: EditorOptions<'file', LAnnotation, Caret> | undefined; editStateKey: string | undefined; lineAnnotations: LineAnnotation<LAnnotation>[] | undefined; selectedLines: SelectedLineRange | null | undefined; prerenderedHTML: string | undefined; metrics?: VirtualFileMetrics; hasGutterRenderUtility: boolean; hasCustomHeader: boolean; disableWorkerPool: boolean; edit: boolean; onEditChange?: FileEditChangeHandler<LAnnotation, Caret>; onEditComplete?: FileEditCompleteHandler<LAnnotation, Caret>; } interface UseFileInstanceReturn<LAnnotation> { ref(node: HTMLElement | null): void; getHoveredLine(): GetHoveredLineResult<'file'> | undefined; getAnnotationSlotName(annotation: LineAnnotation<LAnnotation>): string; } declare function useFileInstance<LAnnotation, Caret>({ file, options, editorOptions, editStateKey, lineAnnotations, selectedLines, prerenderedHTML, metrics, hasGutterRenderUtility, hasCustomHeader, disableWorkerPool, edit, onEditChange: _onEditChange, onEditComplete: _onEditComplete }: UseFileInstanceProps<LAnnotation, Caret>): UseFileInstanceReturn<LAnnotation>; //#endregion export { useFileInstance }; //# sourceMappingURL=useFileInstance.d.ts.map