@pierre/diffs
Version:
50 lines • 1.98 kB
TypeScript
import { DiffLineAnnotation, FileContents, FileDiffMetadata, SelectedLineRange, VirtualFileMetrics } from "../../types.js";
import { GetHoveredLineResult } from "../../managers/InteractionManager.js";
import { FileDiffEditChangeHandler, FileDiffEditCompleteHandler, FileDiffOptions } from "../../components/FileDiff.js";
import { EditorOptions } from "../../editor/editor.js";
//#region src/react/utils/useFileDiffInstance.d.ts
interface UseFileDiffInstanceProps<LAnnotation, Caret> {
fileDiff?: FileDiffMetadata;
oldFile?: FileContents | null;
newFile?: FileContents | null;
options: FileDiffOptions<LAnnotation, Caret> | undefined;
editorOptions: EditorOptions<'file-diff', LAnnotation, Caret> | undefined;
editStateKey: string | undefined;
lineAnnotations: DiffLineAnnotation<LAnnotation>[] | undefined;
selectedLines: SelectedLineRange | null | undefined;
prerenderedHTML: string | undefined;
metrics?: VirtualFileMetrics;
hasGutterRenderUtility: boolean;
hasCustomHeader: boolean;
disableWorkerPool: boolean;
edit: boolean;
onEditChange?: FileDiffEditChangeHandler<LAnnotation, Caret>;
onEditComplete?: FileDiffEditCompleteHandler<LAnnotation, Caret>;
}
interface UseFileDiffInstanceReturn<LAnnotation> {
fileDiff: FileDiffMetadata;
ref(node: HTMLElement | null): void;
getHoveredLine(): GetHoveredLineResult<'diff'> | undefined;
getAnnotationSlotName(annotation: DiffLineAnnotation<LAnnotation>): string;
}
declare function useFileDiffInstance<LAnnotation, Caret>({
fileDiff,
oldFile,
newFile,
options,
editorOptions,
editStateKey,
lineAnnotations,
selectedLines,
prerenderedHTML,
metrics,
hasGutterRenderUtility,
hasCustomHeader,
disableWorkerPool,
edit,
onEditChange: _onEditChange,
onEditComplete: _onEditComplete
}: UseFileDiffInstanceProps<LAnnotation, Caret>): UseFileDiffInstanceReturn<LAnnotation>;
//#endregion
export { useFileDiffInstance };
//# sourceMappingURL=useFileDiffInstance.d.ts.map