canvacord
Advanced tools
Comparing version 6.0.0-dev.8a9f206.1627863623 to 6.0.0-dev.a2b7d97.1632053349
@@ -59,3 +59,3 @@ "use strict"; | ||
BaseCanvas.prototype.makeCanvas = function (width, height) { | ||
var canvas = canvas_1.createCanvas(width, height); | ||
var canvas = (0, canvas_1.createCanvas)(width, height); | ||
var ctx = canvas.getContext("2d"); | ||
@@ -62,0 +62,0 @@ return { canvas: canvas, ctx: ctx }; |
@@ -17,2 +17,8 @@ "use strict"; | ||
})(); | ||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); | ||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; | ||
return c > 3 && r && Object.defineProperty(target, key, r), r; | ||
}; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
@@ -64,2 +70,3 @@ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
var CanvasBuilder2D_1 = require("./CanvasBuilder2D"); | ||
var Singleton_1 = __importDefault(require("../decorators/Singleton")); | ||
var canvasUtils = new UtilityCanvas_1.UtilityCanvas(); | ||
@@ -625,4 +632,7 @@ var MemeCanvas = /** @class */ (function (_super) { | ||
}; | ||
MemeCanvas = __decorate([ | ||
(0, Singleton_1.default)() | ||
], MemeCanvas); | ||
return MemeCanvas; | ||
}(BaseCanvas_1.BaseCanvas)); | ||
exports.MemeCanvas = MemeCanvas; |
@@ -17,2 +17,8 @@ "use strict"; | ||
})(); | ||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); | ||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; | ||
return c > 3 && r && Object.defineProperty(target, key, r), r; | ||
}; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
@@ -54,5 +60,9 @@ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.UtilityCanvas = void 0; | ||
var BaseCanvas_1 = require("./BaseCanvas"); | ||
var Singleton_1 = __importDefault(require("../decorators/Singleton")); | ||
var UtilityCanvas = /** @class */ (function (_super) { | ||
@@ -236,8 +246,7 @@ __extends(UtilityCanvas, _super); | ||
_a = this.makeCanvas(img.width, img.height), canvas = _a.canvas, ctx = _a.ctx; | ||
ctx.drawImage(img, 0, 0); | ||
ctx.globalCompositeOperation = "destination-in"; | ||
ctx.beginPath(); | ||
ctx.arc(canvas.width / 2, canvas.height / 2, canvas.height / 2, 0, Math.PI * 2); | ||
ctx.closePath(); | ||
ctx.fill(); | ||
ctx.clip(); | ||
ctx.drawImage(img, 0, 0, canvas.width, canvas.height); | ||
return [4 /*yield*/, this.buildImage(canvas)]; | ||
@@ -355,4 +364,7 @@ case 2: return [2 /*return*/, _b.sent()]; | ||
}; | ||
UtilityCanvas = __decorate([ | ||
(0, Singleton_1.default)() | ||
], UtilityCanvas); | ||
return UtilityCanvas; | ||
}(BaseCanvas_1.BaseCanvas)); | ||
exports.UtilityCanvas = UtilityCanvas; |
@@ -136,2 +136,4 @@ /// <reference types="node" /> | ||
export { BaseCanvas, BuilderReadyState, CanvasBuilder2D, MemeCanvas, Util, UtilityCanvas }; | ||
declare const InstanceK: unique symbol; | ||
export { BaseCanvas, BuilderReadyState, CanvasBuilder2D, InstanceK, MemeCanvas, Util, UtilityCanvas }; |
@@ -18,1 +18,2 @@ "use strict"; | ||
__exportStar(require("./Utils/Util"), exports); | ||
__exportStar(require("./decorators/Singleton"), exports); |
@@ -55,3 +55,3 @@ "use strict"; | ||
return [2 /*return*/, createSkImage ? source : source.src]; | ||
if (!(typeof source === "string" && fs_1.existsSync(source))) return [3 /*break*/, 2]; | ||
if (!(typeof source === "string" && (0, fs_1.existsSync)(source))) return [3 /*break*/, 2]; | ||
return [4 /*yield*/, fs_1.promises.readFile(source)]; | ||
@@ -63,3 +63,3 @@ case 1: | ||
if (!(typeof source === "string")) return [3 /*break*/, 5]; | ||
return [4 /*yield*/, node_fetch_1.default(source)]; | ||
return [4 /*yield*/, (0, node_fetch_1.default)(source)]; | ||
case 3: | ||
@@ -66,0 +66,0 @@ res = _a.sent(); |
@@ -55,3 +55,3 @@ "use strict"; | ||
Util.createImage = function (src) { | ||
loadImage_1.createImage(src); | ||
(0, loadImage_1.createImage)(src); | ||
}; | ||
@@ -69,3 +69,3 @@ /** | ||
// @ts-ignore | ||
return emoji_parser_1.fillTextWithTwemoji(ctx, message, x, y); | ||
return (0, emoji_parser_1.fillTextWithTwemoji)(ctx, message, x, y); | ||
}; | ||
@@ -137,3 +137,3 @@ /** | ||
Util.cleanText = function (text) { | ||
return weird_to_normal_chars_1.weirdToNormalChars(text); | ||
return (0, weird_to_normal_chars_1.weirdToNormalChars)(text); | ||
}; | ||
@@ -140,0 +140,0 @@ // eslint-disable-next-line @typescript-eslint/no-explicit-any |
{ | ||
"name": "canvacord", | ||
"version": "6.0.0-dev.8a9f206.1627863623", | ||
"version": "6.0.0-dev.a2b7d97.1632053349", | ||
"description": "Simple & easy to use image manipulation module for beginners.", | ||
@@ -63,20 +63,20 @@ "main": "dist/index.js", | ||
"@canvacord/gif": "^1.0.2", | ||
"@napi-rs/canvas": "^0.0.12", | ||
"@napi-rs/canvas": "^0.1.5", | ||
"gifencoder": "^2.0.1", | ||
"node-fetch": "^2.6.1", | ||
"weird-to-normal-chars": "^1.5.1" | ||
"weird-to-normal-chars": "^1.6.0" | ||
}, | ||
"devDependencies": { | ||
"@babel/preset-env": "^7.14.8", | ||
"@babel/preset-typescript": "^7.14.5", | ||
"@babel/preset-env": "^7.15.0", | ||
"@babel/preset-typescript": "^7.15.0", | ||
"@devsnowflake/docgen": "DevSnowflake/docgen#ts-patch", | ||
"@favware/rollup-type-bundler": "^1.0.3", | ||
"@types/gifencoder": "^2.0.1", | ||
"@types/jest": "^26.0.24", | ||
"@types/node": "^16.4.1", | ||
"@types/jest": "^27.0.1", | ||
"@types/node": "^16.7.1", | ||
"@types/node-fetch": "^2.5.12", | ||
"@typescript-eslint/eslint-plugin": "^4.28.4", | ||
"@typescript-eslint/parser": "^4.28.4", | ||
"eslint": "^7.31.0", | ||
"file-type": "^16.5.2", | ||
"@typescript-eslint/eslint-plugin": "^4.29.2", | ||
"@typescript-eslint/parser": "^4.29.2", | ||
"eslint": "^7.32.0", | ||
"file-type": "^16.5.3", | ||
"gen-esm-wrapper": "^1.1.2", | ||
@@ -87,3 +87,3 @@ "husky": "^7.0.1", | ||
"rimraf": "^3.0.2", | ||
"ts-node": "^10.1.0", | ||
"ts-node": "^10.2.1", | ||
"typescript": "^4.3.5" | ||
@@ -90,0 +90,0 @@ }, |
Sorry, the diff of this file is not supported yet
122785
14
1689
+ Added@napi-rs/canvas@0.1.66(transitive)
+ Added@napi-rs/canvas-android-arm64@0.1.66(transitive)
+ Added@napi-rs/canvas-darwin-arm64@0.1.66(transitive)
+ Added@napi-rs/canvas-darwin-x64@0.1.66(transitive)
+ Added@napi-rs/canvas-linux-arm-gnueabihf@0.1.66(transitive)
+ Added@napi-rs/canvas-linux-arm64-gnu@0.1.66(transitive)
+ Added@napi-rs/canvas-linux-arm64-musl@0.1.66(transitive)
+ Added@napi-rs/canvas-linux-riscv64-gnu@0.1.66(transitive)
+ Added@napi-rs/canvas-linux-x64-gnu@0.1.66(transitive)
+ Added@napi-rs/canvas-linux-x64-musl@0.1.66(transitive)
+ Added@napi-rs/canvas-win32-x64-msvc@0.1.66(transitive)
- Removed@napi-rs/canvas@0.0.12(transitive)
- Removed@napi-rs/canvas-android-arm64@0.0.12(transitive)
- Removed@napi-rs/canvas-darwin-arm64@0.0.12(transitive)
- Removed@napi-rs/canvas-darwin-x64@0.0.12(transitive)
- Removed@napi-rs/canvas-linux-arm-gnueabihf@0.0.12(transitive)
- Removed@napi-rs/canvas-linux-arm64-gnu@0.0.12(transitive)
- Removed@napi-rs/canvas-linux-arm64-musl@0.0.12(transitive)
- Removed@napi-rs/canvas-linux-x64-gnu@0.0.12(transitive)
- Removed@napi-rs/canvas-linux-x64-musl@0.0.12(transitive)
- Removed@napi-rs/canvas-win32-x64-msvc@0.0.12(transitive)
- Removed@napi-rs/triples@1.2.0(transitive)
- Removed@node-rs/helper@1.6.0(transitive)
Updated@napi-rs/canvas@^0.1.5
Updatedweird-to-normal-chars@^1.6.0