@turnix-co/konva-editor 2.0.43 → 2.0.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -816,6 +816,67 @@ declare const getCompressionStats: (original: number[], simplified: number[]) =>
816
816
  reduction: string;
817
817
  };
818
818
 
819
+ /**
820
+ * Prepared image element with buffer data
821
+ */
822
+ type PreparedImageElement = Omit<ImageElement, 'src' | 'audioData'> & {
823
+ buffer: ArrayBuffer;
824
+ mimeType: string;
825
+ audioBuffer?: ArrayBuffer;
826
+ audioMimeType?: string;
827
+ };
828
+ /**
829
+ * Prepared video element with buffer data
830
+ */
831
+ type PreparedVideoElement = Omit<VideoElement, 'objectUrl' | 'videoData' | 'videoBlob' | 'audioData'> & {
832
+ buffer: ArrayBuffer;
833
+ mimeType: string;
834
+ audioBuffer?: ArrayBuffer;
835
+ audioMimeType?: string;
836
+ };
837
+ /**
838
+ * Prepared photo frame element with buffer data
839
+ */
840
+ type PreparedPhotoFrameElement = Omit<PhotoFrameElement, 'capturedImageUrl' | 'audioData'> & {
841
+ buffer?: ArrayBuffer;
842
+ mimeType?: string;
843
+ audioBuffer?: ArrayBuffer;
844
+ audioMimeType?: string;
845
+ };
846
+ /**
847
+ * Prepared slide data ready for publishing with buffers
848
+ */
849
+ type PreparedSlide = Omit<Slide, 'images' | 'videos' | 'photoFrames'> & {
850
+ images: PreparedImageElement[];
851
+ videos: PreparedVideoElement[];
852
+ photoFrames: PreparedPhotoFrameElement[];
853
+ };
854
+ /**
855
+ * Result of preparing slides for publishing
856
+ */
857
+ type PublishPayload = {
858
+ slides: PreparedSlide[];
859
+ totalSize: number;
860
+ };
861
+ /**
862
+ * Prepare slides for publishing by converting media to buffers embedded in slides
863
+ */
864
+ declare const prepareSlidesForPublishing: (slides: Slide[], options?: {
865
+ optimizeImages?: boolean;
866
+ maxImageWidth?: number;
867
+ maxImageHeight?: number;
868
+ imageQuality?: number;
869
+ }) => Promise<PublishPayload>;
870
+ /**
871
+ * Convert ArrayBuffer to Base64 string (for JSON transmission)
872
+ */
873
+ declare const arrayBufferToBase64: (buffer: ArrayBuffer) => string;
874
+ /**
875
+ * Prepare FormData for multipart/form-data transmission
876
+ * This is more efficient than base64 encoding
877
+ */
878
+ declare const prepareFormData: (payload: PublishPayload) => FormData;
879
+
819
880
  declare const useDispatch: () => redux_thunk.ThunkDispatch<{
820
881
  toolbar: ToolbarState;
821
882
  canvas: {
@@ -833,4 +894,4 @@ declare const useSelector: <T>(selector: (state: RootState) => T) => T;
833
894
 
834
895
  declare const useSlidesPersistence: () => void;
835
896
 
836
- export { type ActionType, type ActivityType, type AppDispatch, BASIC_EDITOR_TOOLBAR_CONFIG, BottomToolbar, type BottomToolbarProps, Canvas, type CanvasProps, type ContextMenuConfig, DEFAULT_CONTEXT_MENU_CONFIG, DEFAULT_TOOLBAR_CONFIG, EditorRoot, type EditorRootProps, type ExportOptions, type FillInTheBlanks, type FlashcardElement, type ImageElement, type Line$1 as Line, type LongAnswer, type MediaType, type MultipleChoice, type PhotoFrameElement, PublishButton, type PublishButtonProps, type PublishProgress, type PublishResponse, type RootState, ScreenRecorder, type Shape, type ShapeType, type ShortAnswer, type Slide, SlideNavigation, type TextElement, type ToolType, Toolbar, type ToolbarActionsConfig, type ToolbarConfig, type ToolbarProps, type ToolbarToolsConfig, TopNavBar, type TopNavBarProps, type TrueFalse, VIEWER_TOOLBAR_CONFIG, type VideoElement, addFillInTheBlanks, addFlashcard, addImage, addImageAnnotation, addLine, addLongAnswer, addMultipleChoice, addPhotoFrame, addPhotoFrameAnnotation, addShape, addShortAnswer, addSlide, addText, addTrueFalse, addVideo, bringToFront, clearCanvas, clearImageAnnotations, clearPhotoFrameAnnotations, deleteFillInTheBlanks, deleteFlashcard, deleteImage, deleteLineById, deleteLongAnswer, deleteMultipleChoice, deletePhotoFrame, deleteShape, deleteShortAnswer, deleteSlide, deleteText, deleteTrueFalse, deleteVideo, duplicateFillInTheBlanks, duplicateFlashcard, duplicateImage, duplicateLine, duplicateLongAnswer, duplicateMultipleChoice, duplicatePhotoFrame, duplicateShape, duplicateShortAnswer, duplicateSlide, duplicateText, duplicateTrueFalse, duplicateVideo, editFlashcard, editMultipleChoice, exportSlideAsBlob, exportSlideAsImage, finalizeDrawing, getCompressionStats, getSlideDataURL, loadSlides, mergeToolbarConfig, nextFlashcard, previousFlashcard, redo, removeLine, reorderSlides, saveToHistory, selectAllSlides, selectCanAddSlide, selectCurrentSlide, selectCurrentSlideId, selectSlideById, sendToBack, setActivityType, setAltText, setAudioData, setBackgroundColor, setCurrentSlide, setEditingActivity, setEditingTextId, setLines, setLink, setPenColor, setShowFlashcardForm, setShowMcqForm, setSketchMode, setStrokeWidth, setTool, simplifyFlatPoints, simplifyLine, simplifyLines, store, toggleImageDrawingMode, toggleLock, togglePhotoFrameDrawingMode, toggleSketchMode, toggleVideoPlaying, undo, updateElementOrder, updateFillInTheBlanks, updateFlashcard, updateImage, updateImageAnnotation, updateLastLine, updateLinePosition, updateLineTransform, updateLongAnswer, updateMultipleChoice, updatePhotoFrame, updatePhotoFrameAnnotation, updateShape, updateShortAnswer, updateSlideThumbnail, updateText, updateTrueFalse, updateVideo, useDispatch, useSelector, useSlidesPersistence };
897
+ export { type ActionType, type ActivityType, type AppDispatch, BASIC_EDITOR_TOOLBAR_CONFIG, BottomToolbar, type BottomToolbarProps, Canvas, type CanvasProps, type ContextMenuConfig, DEFAULT_CONTEXT_MENU_CONFIG, DEFAULT_TOOLBAR_CONFIG, EditorRoot, type EditorRootProps, type ExportOptions, type FillInTheBlanks, type FlashcardElement, type ImageElement, type Line$1 as Line, type LongAnswer, type MediaType, type MultipleChoice, type PhotoFrameElement, type PreparedImageElement, type PreparedPhotoFrameElement, type PreparedSlide, type PreparedVideoElement, PublishButton, type PublishButtonProps, type PublishPayload, type PublishProgress, type PublishResponse, type RootState, ScreenRecorder, type Shape, type ShapeType, type ShortAnswer, type Slide, SlideNavigation, type TextElement, type ToolType, Toolbar, type ToolbarActionsConfig, type ToolbarConfig, type ToolbarProps, type ToolbarToolsConfig, TopNavBar, type TopNavBarProps, type TrueFalse, VIEWER_TOOLBAR_CONFIG, type VideoElement, addFillInTheBlanks, addFlashcard, addImage, addImageAnnotation, addLine, addLongAnswer, addMultipleChoice, addPhotoFrame, addPhotoFrameAnnotation, addShape, addShortAnswer, addSlide, addText, addTrueFalse, addVideo, arrayBufferToBase64, bringToFront, clearCanvas, clearImageAnnotations, clearPhotoFrameAnnotations, deleteFillInTheBlanks, deleteFlashcard, deleteImage, deleteLineById, deleteLongAnswer, deleteMultipleChoice, deletePhotoFrame, deleteShape, deleteShortAnswer, deleteSlide, deleteText, deleteTrueFalse, deleteVideo, duplicateFillInTheBlanks, duplicateFlashcard, duplicateImage, duplicateLine, duplicateLongAnswer, duplicateMultipleChoice, duplicatePhotoFrame, duplicateShape, duplicateShortAnswer, duplicateSlide, duplicateText, duplicateTrueFalse, duplicateVideo, editFlashcard, editMultipleChoice, exportSlideAsBlob, exportSlideAsImage, finalizeDrawing, getCompressionStats, getSlideDataURL, loadSlides, mergeToolbarConfig, nextFlashcard, prepareFormData, prepareSlidesForPublishing, previousFlashcard, redo, removeLine, reorderSlides, saveToHistory, selectAllSlides, selectCanAddSlide, selectCurrentSlide, selectCurrentSlideId, selectSlideById, sendToBack, setActivityType, setAltText, setAudioData, setBackgroundColor, setCurrentSlide, setEditingActivity, setEditingTextId, setLines, setLink, setPenColor, setShowFlashcardForm, setShowMcqForm, setSketchMode, setStrokeWidth, setTool, simplifyFlatPoints, simplifyLine, simplifyLines, store, toggleImageDrawingMode, toggleLock, togglePhotoFrameDrawingMode, toggleSketchMode, toggleVideoPlaying, undo, updateElementOrder, updateFillInTheBlanks, updateFlashcard, updateImage, updateImageAnnotation, updateLastLine, updateLinePosition, updateLineTransform, updateLongAnswer, updateMultipleChoice, updatePhotoFrame, updatePhotoFrameAnnotation, updateShape, updateShortAnswer, updateSlideThumbnail, updateText, updateTrueFalse, updateVideo, useDispatch, useSelector, useSlidesPersistence };