Skip to content

Commit

Permalink
Export jCanvas-related entities from core module
Browse files Browse the repository at this point in the history
  • Loading branch information
caleb531 committed May 31, 2024
1 parent 6848502 commit e0ac8b8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/jcanvas.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
* Released under the MIT license
*/

declare module "jcanvas";
declare module "jcanvas" {
let jCanvas: JCanvas;
export = jCanvas;
}
declare module "jcanvas/dist/umd/jcanvas.min.js";
declare module "jcanvas/dist/umd/jcanvas-crescents.min.js";
declare module "jcanvas/dist/umd/jcanvas-donuts.min.js";
Expand Down
8 changes: 6 additions & 2 deletions src/jcanvas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,13 +218,15 @@ class jCanvasDefaults implements JCanvasDefaults {
const defaults = new jCanvasDefaults();

// Constructor for creating objects that inherit from jCanvas preferences and defaults
const jCanvasObject: JCanvasObjectFunction = function jCanvasObject(args) {
export const jCanvasObject: JCanvasObjectFunction = function jCanvasObject(
args
) {
return extendObject(this, args);
} as JCanvasObjectFunction;
jCanvasObject.prototype = defaults;

// Constructor for creating a fully-qualified jCanvas layer
const jCanvasLayer: JCanvasLayerFunction = function jCanvasLayer(
export const jCanvasLayer: JCanvasLayerFunction = function jCanvasLayer(
canvas,
params
) {
Expand Down Expand Up @@ -4612,3 +4614,5 @@ extendObject(jCanvas, {
});
$.jCanvas = jCanvas;
$.jCanvasObject = jCanvasObject;

export default jCanvas;

0 comments on commit e0ac8b8

Please sign in to comment.