import { CodeViewItem, CodeViewScrollTarget, DiffLineAnnotation, DiffsEditor, FileContents, LineAnnotation } from "../types.js"; import { GetHoveredLineResult } from "../managers/InteractionManager.js"; import { CodeView as CodeView$1, CodeViewLineSelection, CodeViewOptions } from "../components/CodeView.js"; import { EditorOptions } from "../editor/editor.js"; import { CSSProperties, ReactNode, Ref } from "react"; //#region src/react/CodeView.d.ts type CodeViewGutterUtilityGetter = (() => GetHoveredLineResult<'file'> | undefined) | (() => GetHoveredLineResult<'diff'> | undefined); type CodeViewReactOptions = Omit, 'controlledSelection' | 'createEditor' | 'onSelectedLinesChange'>; interface CodeViewBaseProps { options?: CodeViewReactOptions; /** * Creation-time options passed to the nearest EditProvider factory. * CodeView supplies its item-specific change callback. */ editorOptions?: Omit, 'onChange'>; className?: string; style?: CSSProperties; containerRef?: Ref; disableWorkerPool?: boolean; selectedLines?: CodeViewLineSelection | null; onSelectedLinesChange?(selection: CodeViewLineSelection | null): void; onScroll?(scrollTop: number, viewer: CodeView$1): void; /** Render a non-virtualized node at the very start of the scroll content, * before the first item. Always rendered; scrolls with the content. */ renderCodeViewHeader?(): ReactNode; /** Render a non-virtualized node at the very end of the scroll content, after * the last item. Always rendered; scrolls with the content. */ renderCodeViewFooter?(): ReactNode; /** Called with the owning item on every edited-document change. */ onItemEditChange?(item: CodeViewItem, file: FileContents, lineAnnotations?: LineAnnotation[] | DiffLineAnnotation[]): void; /** * Called once with the final contents when an item's edit session ends * (edit turned off, item removed or collapsed). Not called for sessions * that produced no changes. Committing is user-space: make one combined * item write carrying the new file/fileDiff (with a fresh `cacheKey`, * since the contents changed) along with `edit: false`. */ onItemEditComplete?(item: CodeViewItem, file: FileContents, lineAnnotations?: LineAnnotation[] | DiffLineAnnotation[]): void; renderCustomHeader?(item: CodeViewItem): ReactNode; renderHeaderPrefix?(item: CodeViewItem): ReactNode; renderHeaderFilenameSuffix?(item: CodeViewItem): ReactNode; renderHeaderMetadata?(item: CodeViewItem): ReactNode; renderAnnotation?(annotation: LineAnnotation | DiffLineAnnotation, item: CodeViewItem): ReactNode; renderGutterUtility?(getHoveredLine: CodeViewGutterUtilityGetter, item: CodeViewItem): ReactNode; } interface ControlledCodeViewProps extends CodeViewBaseProps { items: readonly CodeViewItem[]; initialItems?: never; } interface UncontrolledCodeViewProps extends CodeViewBaseProps { initialItems?: readonly CodeViewItem[]; items?: never; } type CodeViewProps = ControlledCodeViewProps | UncontrolledCodeViewProps; interface CodeViewHandle { addItems(items: readonly CodeViewItem[]): void; getItem(id: string): CodeViewItem | undefined; removeItem(id: string): boolean; updateItem(item: CodeViewItem): boolean; updateItemId(oldId: string, newId: string): boolean; scrollTo(target: CodeViewScrollTarget): void; setSelectedLines(selection: CodeViewLineSelection | null): void; getSelectedLines(): CodeViewLineSelection | null; clearSelectedLines(): void; getEditor(id: string): DiffsEditor | undefined; getInstance(): CodeView$1 | undefined; } type CodeViewComponent = (props: CodeViewProps & { ref?: React.Ref>; }) => React.JSX.Element; declare const CodeView: CodeViewComponent; //#endregion export { CodeView, CodeViewHandle, CodeViewProps, CodeViewReactOptions, ControlledCodeViewProps, UncontrolledCodeViewProps }; //# sourceMappingURL=CodeView.d.ts.map