dpu-onlyoffice-react
Version:
React component for OnlyOffice Document Server integration with version history support
32 lines • 1.59 kB
TypeScript
import { VersionHistoryResponse } from '../types';
/**
* Custom hook for managing OnlyOffice editor state and operations
*/
export declare const useOnlyOfficeEditor: () => {
isLoading: boolean;
error: Error | null;
setError: import("react").Dispatch<import("react").SetStateAction<Error | null>>;
getEditorInstance: (editorKey?: string | number) => any;
setEditorInstance: (instance: any, editorKey?: string | number) => void;
refreshHistory: (history: VersionHistoryResponse, message?: string, editorKey?: string | number) => void;
setHistoryData: (data: any, editorKey?: string | number) => void;
requestClose: (editorKey?: string | number) => void;
destroyEditor: (editorKey?: string | number) => void;
createEventHandlers: (options?: {
onHistoryRequest?: (fileId: string) => Promise<VersionHistoryResponse>;
onHistoryDataRequest?: (fileId: string, version: string) => Promise<any>;
onHistoryClose?: () => void;
onClose?: () => void;
onRestore?: (fileId: string, version: string) => Promise<VersionHistoryResponse>;
fileId?: string;
}) => {
onDocumentReady: (event: any) => void;
onRequestHistory: (event: any) => Promise<void>;
onRequestHistoryData: (event: any) => Promise<void>;
onRequestHistoryClose: (event: any) => void;
onRequestClose: () => void;
onRequestRestore: (event: any) => Promise<void>;
onLoadComponentError: (errorCode: number, errorDescription: string) => void;
};
};
//# sourceMappingURL=useOnlyOfficeEditor.d.ts.map