From e0ac8b878e25de5c69f91a13998e77f8c46cd2b0 Mon Sep 17 00:00:00 2001 From: Caleb Evans Date: Fri, 31 May 2024 13:52:02 -0700 Subject: [PATCH] Export jCanvas-related entities from core module --- src/jcanvas.d.ts | 5 ++++- src/jcanvas.ts | 8 ++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/jcanvas.d.ts b/src/jcanvas.d.ts index a6659be..23190da 100644 --- a/src/jcanvas.d.ts +++ b/src/jcanvas.d.ts @@ -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"; diff --git a/src/jcanvas.ts b/src/jcanvas.ts index 5e4054e..8f885b7 100644 --- a/src/jcanvas.ts +++ b/src/jcanvas.ts @@ -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 ) { @@ -4612,3 +4614,5 @@ extendObject(jCanvas, { }); $.jCanvas = jCanvas; $.jCanvasObject = jCanvasObject; + +export default jCanvas;