import type { BaseFilter } from '../../filters/BaseFilter'; import { TSize } from '../../typedefs'; import { TOptions } from '../../typedefs'; import type { FabricObjectProps, SerializedObjectProps } from '../Object/types'; import type { ObjectEvents } from '../../EventTypeDefs'; import { WidgetImageInterface } from './type/widget.entity.image'; import { FabricImage } from '../Image'; import { WidgetType } from './type/widget.type'; import { FileObject } from './type/file'; export type ImageSource = HTMLImageElement | HTMLVideoElement | HTMLCanvasElement; interface UniqueImageProps { srcFromAttribute: boolean; minimumScaleTrigger: number; cropX: number; cropY: number; imageSmoothing: boolean; crossOrigin: string | null; filters: BaseFilter[]; resizeFilter?: BaseFilter; } export declare const imageDefaultValues: Partial & Partial; export interface SerializedImageProps extends SerializedObjectProps { src: string; crossOrigin: string | null; filters: any[]; resizeFilter?: any; cropX: number; cropY: number; } export interface ImageProps extends FabricObjectProps, UniqueImageProps { } /** * @tutorial {@link http://fabricjs.com/fabric-intro-part-1#images} */ export declare class XImage = Partial, SProps extends SerializedImageProps = SerializedImageProps, EventSpec extends ObjectEvents = ObjectEvents> extends FabricImage implements WidgetImageInterface { cropWidth: number; cropHeight: number; previewImage: FileObject; imageSrc: FileObject; version: string; updatedAt: number; createdAt: number; createdBy: string; boardId: string; objType: WidgetType; userId: string; zIndex: number; static type: WidgetType; static objType: WidgetType; constructor(image: any, options: any); updatedBy: string; updatedByName: string; markdownText: string; createdByName: string; getObject(): Record; /** * Renders the image on the canvas context, correctly handling scaling and cropping. * @private * @param {CanvasRenderingContext2D} ctx Context to render on */ _renderFill(ctx: CanvasRenderingContext2D): void; /** * Decide if the object should cache or not. Create its own cache level * needsItsOwnCache should be used when the object drawing method requires * a cache step. None of the fabric classes requires it. * Generally you do not cache objects in groups because the group outside is cached. * This is the special image version where we would like to avoid caching where possible. * Essentially images do not benefit from caching. They may require caching, and in that * case we do it. Also caching an image usually ends in a loss of details. * A full performance audit should be done. * @return {Boolean} */ shouldCache(): boolean; /** * needed to check if image needs resize * @private */ _needsResize(): boolean; /** * @private * @deprecated unused */ _resetWidthHeight(): void; /** * @private * Set the width and the height of the image object, using the element or the * options. */ _setWidthHeight({ width, height }?: Partial): void; /** * Calculate offset for center and scale factor for the image in order to respect * the preserveAspectRatio attribute * @private */ parsePreserveAspectRatioAttribute(): { width: number; height: number; scaleX: number; scaleY: number; offsetLeft: number; offsetTop: number; cropX: number; cropY: number; }; /** * Default CSS class name for canvas * @static * @type String * @default */ static CSS_CANVAS: string; /** * List of attribute names to account for when parsing SVG element (used by {@link Image.fromElement}) * @static * @see {@link http://www.w3.org/TR/SVG/struct.html#ImageElement} */ static ATTRIBUTE_NAMES: string[]; _stopEvent(e: any): void; cloneWidget(): Pick & import("../../typedefs").TClassProperties, keyof import("../Image").SerializedImageProps>, never> & import("../Image").SerializedImageProps; } export {}; //# sourceMappingURL=XImage.d.ts.map