Created
March 15, 2019 05:57
-
-
Save idkiller/18b5f5d64ffee6337ee6d1fef6b91d6e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import {fabric} from 'fabric'; | |
| declare module 'fabric' { | |
| namespace fabric { | |
| interface Object { | |
| id: string; | |
| depth?: number; | |
| formulaX?: string; | |
| formulaY?: string; | |
| formulaWidth?: string; | |
| formulaHeight?: string; | |
| formulaRotation?: string; | |
| syncWithVariable?: string; | |
| } | |
| interface IObjectOptions { | |
| canvas?: fabric.Canvas | |
| } | |
| } | |
| } | |
| let foobar: fabric.Object = ...; | |
| foo.id = 'blarblar'; // OK | |
| const left = foo.get('left'); // OK |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <template> | |
| ... | |
| </template> | |
| <script lang="ts"> | |
| import {fabric} from 'fabric'; | |
| import canvasManager from "../CanvasManager"; | |
| let xxx: fabric.Object = ...; | |
| xxx.id = 'xxxxxxx'; // OK | |
| const left = xxx.get('left'); // Error fabric.Object is from canvasMaanger... not fabric | |
| </script> | |
| <css> | |
| </css> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment