merchi_product_editor
Version:
A React component for editing product images using Fabric.js
12 lines (11 loc) • 581 B
TypeScript
import { fabric } from 'fabric';
/**
* Adds an editable text object to the canvas
* @param canvas - The Fabric.js canvas instance
* @param width - The width of the canvas
* @param height - The height of the canvas
* @param defaultText - Optional default text (defaults to "Text")
* @param fontSize - Optional font size (defaults to 24)
* @param fontFamily - Optional font family (defaults to Arial)
*/
export declare const addText: (canvas: fabric.Canvas, width: number, height: number, defaultText?: string, fontSize?: number, fontFamily?: string) => fabric.IText | null;