Skip to content

Instantly share code, notes, and snippets.

@TyrealGray
Created August 8, 2018 14:24
Show Gist options
  • Save TyrealGray/7cf394903da51599f3667cc43f2af946 to your computer and use it in GitHub Desktop.
Save TyrealGray/7cf394903da51599f3667cc43f2af946 to your computer and use it in GitHub Desktop.
declare module '*.json';

declare module 'fabric' {

	interface StaticCanvas {
		new (name: string): StaticCanvas;
		setHeight(height: number): void;
		setWidth(width: number): void;
		loadFromJSON(image: any, callback: ()=> any): void;
	}

	interface IImage {
		filters:{
			Sepia: IBaseFilterConstructor;
			Sepia2: IBaseFilterConstructor;
			Invert: IBaseFilterConstructor;
			Grayscale: IBaseFilterConstructor;
			BaseFilter: IBaseFilterConstructor;
		};
	}

	interface IBaseFilterConstructor {
		new (): any;
	}

	export interface fabric {
		StaticCanvas: StaticCanvas;
		Image: IImage;
	}

	export var fabric: fabric;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment