refactor: improve type safety for canvas data objects and remove unused FabricObject import

This commit is contained in:
Your Name
2026-04-12 05:26:47 +05:30
parent 998ad848b0
commit 75a9222f19
2 changed files with 10 additions and 5 deletions
+3 -1
View File
@@ -3,9 +3,11 @@ import { forwardRef, useEffect, useImperativeHandle, useRef } from "react";
const PAD = 36;
type CanvasJSON = ReturnType<fabric.Canvas["toJSON"]>;
export type CanvasTools = {
addImage: (url: string, file: File) => void;
getData: () => { objects: any[] };
getData: () => { objects: CanvasJSON["objects"] }; // no-any hack :/
getJsonData: () => string;
getImages: () => { src: string; file: File }[];
};