refactor: update ComposeCanvas and Editor data handling types

This commit is contained in:
ramvignesh-b
2026-04-14 13:10:18 +05:30
parent bc29306fe2
commit 8f9c0b5430
4 changed files with 41 additions and 12 deletions
+1 -2
View File
@@ -27,7 +27,6 @@ export interface FabricImageJSON extends FabricObjectJSON {
}
export interface CanvasJSON {
version: string;
objects: (FabricObjectJSON | FabricImageJSON)[];
canvasWidth?: number;
canvasHeight?: number;
@@ -266,7 +265,7 @@ export const ComposeCanvas = forwardRef<
});
},
getData: () => {
if (!fabricRef.current) return { version: "", objects: [] };
if (!fabricRef.current) return { objects: [] };
const json = fabricRef.current.toJSON() as CanvasJSON;
json.canvasWidth = BASE_WIDTH;
json.canvasHeight =