@promptbook/remote-server
Version:
Promptbook: Create persistent AI agents that turn your company's scattered knowledge into action
41 lines (40 loc) • 1.82 kB
TypeScript
import type { editor } from 'monaco-editor';
import { type ChangeEvent, type ClipboardEvent, type DragEvent, type RefObject, type TouchEvent } from 'react';
/**
* Type describing the file handler used by Monaco upload interactions.
*/
type HandleFiles = (files: File[]) => Promise<void>;
/**
* Props for use book editor monaco interactions.
*/
type UseBookEditorMonacoInteractionsProps = {
readonly editor: editor.IStandaloneCodeEditor | null;
readonly handleFiles: HandleFiles;
};
/**
* Result of use book editor monaco interactions.
*/
type UseBookEditorMonacoInteractionsResult = {
readonly isDragOver: boolean;
readonly fileUploadInputRef: RefObject<HTMLInputElement | null>;
readonly cameraInputRef: RefObject<HTMLInputElement | null>;
readonly handleDrop: (event: DragEvent<HTMLDivElement>) => Promise<void>;
readonly handlePaste: (event: ClipboardEvent<HTMLDivElement>) => Promise<void>;
readonly handleUploadDocument: () => void;
readonly handleTakePhoto: () => void;
readonly handleFileInputChange: (event: ChangeEvent<HTMLInputElement>) => void;
readonly handleDragOver: (event: DragEvent<HTMLDivElement>) => void;
readonly handleDragEnter: (event: DragEvent<HTMLDivElement>) => void;
readonly handleDragLeave: (event: DragEvent<HTMLDivElement>) => void;
readonly focusOverlayTouchHandlers: {
readonly onTouchStart: (event: TouchEvent<HTMLDivElement>) => void;
readonly onTouchEnd: (event: TouchEvent<HTMLDivElement>) => void;
};
};
/**
* Manages drag, paste and file input interactions for `BookEditorMonaco`.
*
* @private function of BookEditorMonaco
*/
export declare function useBookEditorMonacoInteractions({ editor, handleFiles, }: UseBookEditorMonacoInteractionsProps): UseBookEditorMonacoInteractionsResult;
export {};