Skip to content

Commit

Permalink
Properly type internal 'css' mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
caleb531 committed May 30, 2024
1 parent e650475 commit cacf6b1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
5 changes: 5 additions & 0 deletions src/jcanvas.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,11 @@ interface JCanvasBaseTransforms {
masks: JCanvasObject[];
}

interface JCanvasCss {
props: (keyof JCanvasObject)[];
propsObj: Record<string, boolean>;
}

interface JCanvasPx {
r: number;
g: number;
Expand Down
8 changes: 3 additions & 5 deletions src/jcanvas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import $ from "jquery";
import "./jcanvas.d";

// Define local aliases to frequently used properties
// Define local aliases t o frequently used properties
const extendObject = Object.assign,
inArray = $.inArray,
typeOf = function (operand: any) {
Expand Down Expand Up @@ -74,12 +74,10 @@ const extendObject = Object.assign,
// Store all previous masks
masks: [],
},
css = {
css: JCanvasCss = {
// Define properties used in both CSS and jCanvas
props: ["width", "height", "opacity", "lineHeight"],
// List of CSS3 cursors that need to be prefixed
cursors: ["grab", "grabbing", "zoom-in", "zoom-out"],
propsObj: {} as Record<string, boolean>,
propsObj: {},
},
tangibleEvents: (
| JCanvasMouseEventName
Expand Down

0 comments on commit cacf6b1

Please sign in to comment.