Module fabric

Index

Variables

Interfaces

Functions

Variables

Canvas: { EMPTY_JSON: string; supports(methodName: string): boolean; prototype: any; new(element: HTMLCanvasElement, options?: fabric.ICanvasOptions): fabric.ICanvas; new(element: string, options?: fabric.ICanvasOptions): fabric.ICanvas; }

constructor(): ICanvas

Returns

ICanvas

constructor(): ICanvas

Returns

ICanvas

public Canvas.EMPTY_JSON: string

public Canvas.prototype: any

public supports(): boolean

Returns

boolean

.methodName.methodName: string

Circle: { ATTRIBUTE_NAMES: string[]; fromElement(element: SVGElement, options: fabric.ICircleOptions): fabric.ICircle; fromObject(object: any): fabric.ICircle; prototype: any; new(options?: fabric.ICircleOptions): fabric.ICircle; }

constructor(): ICircle

Returns

ICircle

public Circle.ATTRIBUTE_NAMES: Array<string>

public Circle.prototype: any

public fromElement(): ICircle

Returns

ICircle

.element.element: SVGElement

.options.options: ICircleOptions

public fromObject(): ICircle

Returns

ICircle

.object.object: any

Group: new(items?: any[], options?: fabric.IObjectOptions) => fabric.IGroup

constructor(): IGroup

Returns

IGroup

Image: { fromURL(url: string): fabric.IImage; fromURL(url: string, callback: (image: fabric.IImage) => any): fabric.IImage; fromURL(url: string, callback: (image: fabric.IImage) => any, objObjects: fabric.IObjectOptions): fabric.IImage; prototype: any; filters: { Grayscale: new() => fabric.IGrayscaleFilter; Brightness: new(options?: { brightness: number; }) => fabric.IBrightnessFilter; RemoveWhite: new(options?: { threshold?: string; distance?: string; }) => fabric.IRemoveWhiteFilter; Invert: new() => fabric.IInvertFilter; Sepia: new() => fabric.ISepiaFilter; Sepia2: new() => fabric.ISepia2Filter; Noise: new(options?: { noise?: number; }) => fabric.INoiseFilter; GradientTransparency: new(options?: { threshold?: number; }) => fabric.IGradientTransparencyFilter; Pixelate: new(options?: { color?: any; }) => fabric.IPixelateFilter; Convolute: new(options?: { matrix: any; }) => fabric.IConvoluteFilter; }; new(element: HTMLImageElement, objObjects: fabric.IObjectOptions): fabric.IImage; }

constructor(): IBrightnessFilter

Returns

IBrightnessFilter

constructor(): IConvoluteFilter

Returns

IConvoluteFilter

constructor(): IGradientTransparencyFilter

Returns

IGradientTransparencyFilter

constructor(): IGrayscaleFilter

Returns

IGrayscaleFilter

constructor(): IImage

Returns

IImage

constructor(): IInvertFilter

Returns

IInvertFilter

constructor(): INoiseFilter

Returns

INoiseFilter

constructor(): IPixelateFilter

Returns

IPixelateFilter

constructor(): IRemoveWhiteFilter

Returns

IRemoveWhiteFilter

constructor(): ISepiaFilter

Returns

ISepiaFilter

constructor(): ISepia2Filter

Returns

ISepia2Filter

public Image.filters: { Grayscale: new() => fabric.IGrayscaleFilter; Brightness: new(options?: { brightness: number; }) => fabric.IBrightnessFilter; RemoveWhite: new(options?: { threshold?: string; distance?: string; }) => fabric.IRemoveWhiteFilter; Invert: new() => fabric.IInvertFilter; Sepia: new() => fabric.ISepiaFilter; Sepia2: new() => fabric.ISepia2Filter; Noise: new(options?: { noise?: number; }) => fabric.INoiseFilter; GradientTransparency: new(options?: { threshold?: number; }) => fabric.IGradientTransparencyFilter; Pixelate: new(options?: { color?: any; }) => fabric.IPixelateFilter; Convolute: new(options?: { matrix: any; }) => fabric.IConvoluteFilter; }

public Image.prototype: any

public filters.Brightness: new(options?: { brightness: number; }) => fabric.IBrightnessFilter

public filters.Convolute: new(options?: { matrix: any; }) => fabric.IConvoluteFilter

public filters.GradientTransparency: new(options?: { threshold?: number; }) => fabric.IGradientTransparencyFilter

public filters.Grayscale: new() => fabric.IGrayscaleFilter

public filters.Invert: new() => fabric.IInvertFilter

public filters.Noise: new(options?: { noise?: number; }) => fabric.INoiseFilter

public filters.Pixelate: new(options?: { color?: any; }) => fabric.IPixelateFilter

public filters.RemoveWhite: new(options?: { threshold?: string; distance?: string; }) => fabric.IRemoveWhiteFilter

public filters.Sepia: new() => fabric.ISepiaFilter

public filters.Sepia2: new() => fabric.ISepia2Filter

public fromURL(): IImage

Returns

IImage

.callback.callback: (image: fabric.IImage) => any

.objObjects.objObjects: IObjectOptions

.url.url: string

public fromURL(): IImage

Returns

IImage

.callback.callback: (image: fabric.IImage) => any

.url.url: string

public fromURL(): IImage

Returns

IImage

.url.url: string

Intersection: { intersectLineLine(a1: any, a2: any, b1: any, b2: any): any; intersectLinePolygon(a1: any, a2: any, points: any): any; intersectPolygonPolygon(points1: any, points2: any): any; intersectPolygonRectangle(points: any, r1: any, r2: any): any; }

public intersectLineLine(): any

Returns

any

.a1.a1: any

.a2.a2: any

.b1.b1: any

.b2.b2: any

public intersectLinePolygon(): any

Returns

any

.a1.a1: any

.a2.a2: any

.points.points: any

public intersectPolygonPolygon(): any

Returns

any

.points1.points1: any

.points2.points2: any

public intersectPolygonRectangle(): any

Returns

any

.points.points: any

.r1.r1: any

.r2.r2: any

Line: { ATTRIBUTE_NAMES: string[]; fromElement(element: SVGElement, options: any): fabric.ILine; fromObject(object: any): fabric.ILine; prototype: any; new(points: number[], objObjects?: fabric.IObjectOptions): fabric.ILine; }

constructor(): ILine

Returns

ILine

public Line.ATTRIBUTE_NAMES: Array<string>

public Line.prototype: any

public fromElement(): ILine

Returns

ILine

.element.element: SVGElement

.options.options: any

public fromObject(): ILine

Returns

ILine

.object.object: any

Object: { prototype: any; }

public Object.prototype: any

Path: { fromElement(element: SVGElement, options: any): fabric.IPath; fromObject(object: any): fabric.IPath; new(): fabric.IPath; }

constructor(): IPath

Returns

IPath

public fromElement(): IPath

Returns

IPath

.element.element: SVGElement

.options.options: any

public fromObject(): IPath

Returns

IPath

.object.object: any

PathGroup: { fromObject(object: any): fabric.IPathGroup; prototype: any; new(): fabric.IPathGroup; }

constructor(): IPathGroup

Returns

IPathGroup

public PathGroup.prototype: any

public fromObject(): IPathGroup

Returns

IPathGroup

.object.object: any

Point: { prototype: any; new(x: any, y: any): fabric.IPoint; }

constructor(): IPoint

Returns

IPoint

public Point.prototype: any

Polygon: { fromObject(object: any): fabric.IPolygon; fromElement(element: SVGElement, options: any): fabric.IPolygon; prototype: any; new(): fabric.IPolygon; }

constructor(): IPolygon

Returns

IPolygon

public Polygon.prototype: any

public fromElement(): IPolygon

Returns

IPolygon

.element.element: SVGElement

.options.options: any

public fromObject(): IPolygon

Returns

IPolygon

.object.object: any

Polyline: { fromObject(object: any): fabric.IPolyline; fromElement(element: SVGElement, options: any): fabric.IPolyline; prototype: any; new(): fabric.IPolyline; }

constructor(): IPolyline

Returns

IPolyline

public Polyline.prototype: any

public fromElement(): IPolyline

Returns

IPolyline

.element.element: SVGElement

.options.options: any

public fromObject(): IPolyline

Returns

IPolyline

.object.object: any

Rect: { fromElement(element: SVGElement, options: fabric.IRectOptions): fabric.IRect; fromObject(object: any): fabric.IRect; prototype: any; new(options?: fabric.IRectOptions): fabric.IRect; }

constructor(): IRect

Returns

IRect

public Rect.prototype: any

public fromElement(): IRect

Returns

IRect

.element.element: SVGElement

.options.options: IRectOptions

public fromObject(): IRect

Returns

IRect

.object.object: any

StaticCanvas: { EMPTY_JSON: string; supports(methodName: string): boolean; prototype: any; new(element: HTMLCanvasElement, options?: fabric.ICanvasOptions): fabric.ICanvas; new(element: string, options?: fabric.ICanvasOptions): fabric.ICanvas; }

constructor(): ICanvas

Returns

ICanvas

constructor(): ICanvas

Returns

ICanvas

public StaticCanvas.EMPTY_JSON: string

public StaticCanvas.prototype: any

public supports(): boolean

Returns

boolean

.methodName.methodName: string

Text: new(text: string, options?: fabric.ITextOptions) => fabric.IText

constructor(): IText

Returns

IText

Triangle: new(options?: fabric.ITriangleOptions) => fabric.ITriangle

constructor(): ITriangle

Returns

ITriangle

isLikelyNode: boolean

isTouchSupported: boolean

util: { addClass(element: HTMLElement, className: string): any; addListener(element: any, eventName: string, handler: any): any; animate(options: { onChange?: (value: number) => void; onComplete?: () => void; startValue?: number; endValue?: number; byValue?: number; easing?: (currentTime: any, startValue: any, byValue: any, duration: any) => number; duration?: number; }): any; createClass(parent: any, properties: any): any; degreesToRadians(degrees: number): number; falseFunction(): () => boolean; getById(id: HTMLElement): HTMLElement; getById(id: string): HTMLElement; getElementOffset(element: any): { left: number; top: number; }; getPointer(event: Event): any; getRandomInt(min: number, max: number): any; getScript(url: string, callback: any): any; groupSVGElements(elements: any[], options: any, path?: string): any; loadImage(url: any, callback: any, context: any): any; makeElement(tagName: string, attributes: any): any; makeElementSelectable(element: HTMLElement): any; makeElementUnselectable(element: HTMLElement): any; populateWithProperties(source: any, destination: any, properties: any): any[]; radiansToDegrees(radians: number): number; removeFromArray(array: any[], value: any): any; removeListener(element: HTMLElement, eventName: any, handler: any): any; request(url: any, options: any): any; requestAnimFrame(callback: any, element: any): any; setStyle(element: HTMLElement, styles: any): any; toArray(arrayLike: any): any[]; toFixed(number: any, fractionDigits: any): any; wrapElement(element: HTMLElement, wrapper: any, attributes: any): any; }

public addClass(): any

Returns

any

.className.className: string

.element.element: HTMLElement

public addListener(): any

Returns

any

.element.element: any

.eventName.eventName: string

.handler.handler: any

public animate(): any

Returns

any

.options.options: { onChange?: (value: number) => void; onComplete?: () => void; startValue?: number; endValue?: number; byValue?: number; easing?: (currentTime: any, startValue: any, byValue: any, duration: any) => number; duration?: number; }

optional public options.byValue?: number

optional public options.duration?: number

optional public options.easing?: (currentTime: any, startValue: any, byValue: any, duration: any) => number

optional public options.endValue?: number

optional public options.onChange?: (value: number) => void

optional public options.onComplete?: () => void

optional public options.startValue?: number

public createClass(): any

Returns

any

.parent.parent: any

.properties.properties: any

public degreesToRadians(): number

Returns

number

.degrees.degrees: number

public falseFunction(): () => boolean

Returns

() => boolean

public getById(): HTMLElement

Returns

HTMLElement

.id.id: string

public getById(): HTMLElement

Returns

HTMLElement

.id.id: HTMLElement

public getElementOffset(): { left: number; top: number; }

Returns

{ left: number; top: number; }

.element.element: any

public getPointer(): any

Returns

any

.event.event: Event

public getRandomInt(): any

Returns

any

.max.max: number

.min.min: number

public getScript(): any

Returns

any

.callback.callback: any

.url.url: string

public groupSVGElements(): any

Returns

any

.elements.elements: Array<any>

.options.options: any

optional .path.path?: string

public loadImage(): any

Returns

any

.callback.callback: any

.context.context: any

.url.url: any

public makeElement(): any

Returns

any

.attributes.attributes: any

.tagName.tagName: string

public makeElementSelectable(): any

Returns

any

.element.element: HTMLElement

public makeElementUnselectable(): any

Returns

any

.element.element: HTMLElement

public populateWithProperties(): Array<any>

Returns

Array<any>

.destination.destination: any

.properties.properties: any

.source.source: any

public radiansToDegrees(): number

Returns

number

.radians.radians: number

public removeFromArray(): any

Returns

any

.array.array: Array<any>

.value.value: any

public removeListener(): any

Returns

any

.element.element: HTMLElement

.eventName.eventName: any

.handler.handler: any

public request(): any

Returns

any

.options.options: any

.url.url: any

public requestAnimFrame(): any

Returns

any

.callback.callback: any

.element.element: any

public setStyle(): any

Returns

any

.element.element: HTMLElement

.styles.styles: any

public toArray(): Array<any>

Returns

Array<any>

.arrayLike.arrayLike: any

public toFixed(): any

Returns

any

.fractionDigits.fractionDigits: any

.number.number: any

public wrapElement(): any

Returns

any

.attributes.attributes: any

.element.element: HTMLElement

.wrapper.wrapper: any

Functions

createCanvasForNode(width: number, height: number): ICanvas

Parameters

  • width: number
  • height: number

Returns

ICanvas

getCSSRules(doc: SVGElement): any

Parameters

  • doc: SVGElement

Returns

any

getGradientDefs(doc: SVGElement): any

Parameters

  • doc: SVGElement

Returns

any

loadSVGFromString(text: string, callback: (results: fabric.IObject[], options: any) => void, reviver?: (el: any, obj: any) => void): any

Parameters

  • text: string
  • callback: (results: fabric.IObject[], options: any) => void
  • reviver?: (el: any, obj: any) => void optional

Returns

any

loadSVGFromURL(url: any, callback: (results: fabric.IObject[], options: any) => void, reviver?: (el: any, obj: any) => void): any

Parameters

  • url: any
  • callback: (results: fabric.IObject[], options: any) => void
  • reviver?: (el: any, obj: any) => void optional

Returns

any

log(values: any): any

Parameters

  • values: any

Returns

any

parseAttributes(element: any, attributes: Array<any>): any

Parameters

  • element: any
  • attributes: Array<any>

Returns

any

parseElements(elements: Array<any>, callback: any, options: any, reviver: any): any

Parameters

  • elements: Array<any>
  • callback: any
  • options: any
  • reviver: any

Returns

any

parsePointsAttribute(points: string): Array<any>

Parameters

  • points: string

Returns

Array<any>

parseSVGDocument(doc: SVGElement, callback: (results: any, options: any) => void, reviver?: (el: any, obj: any) => void): any

Parameters

  • doc: SVGElement
  • callback: (results: any, options: any) => void
  • reviver?: (el: any, obj: any) => void optional

Returns

any

parseStyleAttribute(element: SVGElement): any

Parameters

  • element: SVGElement

Returns

any

parseTransformAttribute(attributeValue: string): any

Parameters

  • attributeValue: string

Returns

any

warn(values: any): any

Parameters

  • values: any

Returns

any