From 2101c7bc3da892ed15e6d760bbc0fbc40439efef Mon Sep 17 00:00:00 2001 From: Oliver Klemencic Date: Sat, 29 Dec 2012 12:11:00 -0800 Subject: [PATCH] Adapted to latest fabric.js changes (dynamic_origin support) --- fabricjs/fabricjs.d.ts | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/fabricjs/fabricjs.d.ts b/fabricjs/fabricjs.d.ts index 30b9606c1e..ec4559e945 100644 --- a/fabricjs/fabricjs.d.ts +++ b/fabricjs/fabricjs.d.ts @@ -6,7 +6,6 @@ USAGE /// */ - declare module fabric { function createCanvasForNode(width: number, height: number): ICanvas; @@ -72,6 +71,8 @@ declare module fabric { lockUniScaling?: bool; lockRotation?: bool; opacity?: number; + originX?: string; + originY?: string; overlayFill?: string; padding?: number; perPixelTargetFind?: bool; @@ -233,6 +234,9 @@ declare module fabric { getCurrentWidth(): number; getCurrentHeight(): number; + originX: string; + originY: string; + angle: number; getAngle(): number; setAngle(value: number): IObject; @@ -371,7 +375,7 @@ declare module fabric { transform(ctx: CanvasRenderingContext2D); } - export interface IGroup { + export interface IGroup extends IObject { type: string; activateAllObjects(): IGroup; @@ -538,8 +542,8 @@ declare module fabric { setHeight(height: number): ICanvas; setOverlayImage(url: string, callback: () => any, options): ICanvas; setWidth(width: number): ICanvas; - toDatalessJSON(propertiesToInclude: any[]): string; - toDatalessObject(propertiesToInclude: any[]): string; + toDatalessJSON(propertiesToInclude?: any[]): string; + toDatalessObject(propertiesToInclude?: any[]): string; toDataURL(format: string, quality?: number): string; toDataURLWithMultiplier(propertiesToInclude: any[]): string; toGrayscale(propertiesToInclude: any[]): string; @@ -555,6 +559,8 @@ declare module fabric { (element: HTMLCanvasElement): ICanvas; (element: string): ICanvas; + _objects: IObject[]; + // fields containerClass: string; defaultCursor: string; @@ -587,6 +593,9 @@ declare module fabric { getSelectionElement(): HTMLCanvasElement; setActiveGroup(group: IGroup): ICanvas; setActiveObject(object: IObject, e?): ICanvas; + + loadFromJSON(json, callback: () => void): void; + loadFromDatalessJSON(json, callback: () => void): void; } export interface IBrightnessFilter { @@ -670,6 +679,15 @@ declare module fabric { prototype: any; } + declare var StaticCanvas: { + new (element: HTMLCanvasElement, options?: ICanvasOptions): ICanvas; + new (element: string, options?: ICanvasOptions): ICanvas; + + EMPTY_JSON: string; + supports(methodName: string): bool; + prototype: any; + } + declare var Circle: { ATTRIBUTE_NAMES: string[]; fromElement(element: SVGElement, options: ICircleOptions): ICircle; @@ -678,6 +696,10 @@ declare module fabric { prototype: any; } + declare var Group: { + new (items?: any[], options?: IObjectOptions): IGroup; + } + declare var Line: { ATTRIBUTE_NAMES: string[]; fromElement(element: SVGElement, options): ILine; @@ -822,4 +844,5 @@ declare module fabric { toFixed(number, fractionDigits); wrapElement(element: HTMLElement, wrapper, attributes); } -}; \ No newline at end of file +}; +