image-raub
Advanced tools
Comparing version 4.1.2 to 4.1.3
@@ -1,3 +0,1 @@ | ||
import { EventEmitter } from 'events'; | ||
declare module "image-raub" { | ||
@@ -7,3 +5,3 @@ namespace image { | ||
type TImage = TSize & Readonly<{ | ||
type TImageData = TSize & Readonly<{ | ||
data: Buffer; | ||
@@ -20,2 +18,4 @@ noflip?: boolean; | ||
type EventEmitter = import('node:events').EventEmitter; | ||
/** Image | ||
@@ -25,3 +25,3 @@ * It is similar to the web Image. | ||
*/ | ||
class Image extends EventEmitter { | ||
class ImageJs implements EventEmitter { | ||
constructor(src?: string | null); | ||
@@ -33,3 +33,3 @@ | ||
/** Raw image data */ | ||
readonly data: TImage; | ||
readonly data: TImageData; | ||
@@ -88,3 +88,3 @@ /** An Array, containing width and height. */ | ||
drawImage( | ||
image: TImage, | ||
image: TImageData, | ||
sx: number, | ||
@@ -100,4 +100,22 @@ sy: number, | ||
static fromPixels(width: number, height: number, bpp: number, pixels: Buffer): Image; | ||
static loadAsync(src: string): Promise<Image>; | ||
static fromPixels(width: number, height: number, bpp: number, pixels: Buffer): ImageJs; | ||
static loadAsync(src: string): Promise<ImageJs>; | ||
// ------ implements EventEmitter | ||
addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; | ||
on(eventName: string | symbol, listener: (...args: any[]) => void): this; | ||
once(eventName: string | symbol, listener: (...args: any[]) => void): this; | ||
removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; | ||
off(eventName: string | symbol, listener: (...args: any[]) => void): this; | ||
removeAllListeners(event?: string | symbol): this; | ||
setMaxListeners(n: number): this; | ||
getMaxListeners(): number; | ||
listeners(eventName: string | symbol): Function[]; | ||
rawListeners(eventName: string | symbol): Function[]; | ||
emit(eventName: string | symbol, ...args: any[]): boolean; | ||
listenerCount(eventName: string | symbol, listener?: Function): number; | ||
prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; | ||
prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; | ||
eventNames(): Array<string | symbol>; | ||
} | ||
@@ -107,3 +125,3 @@ | ||
export = image; | ||
export = image.ImageJs; | ||
} |
{ | ||
"author": "Luis Blanco <luisblanco1337@gmail.com>", | ||
"name": "image-raub", | ||
"version": "4.1.2", | ||
"version": "4.1.3", | ||
"description": "Native Image loader for Node.js", | ||
@@ -42,3 +42,3 @@ "license": "MIT", | ||
"dependencies": { | ||
"addon-tools-raub": "^7.3.0", | ||
"addon-tools-raub": "^7.4.0", | ||
"deps-freeimage-raub": "^4.1.1", | ||
@@ -48,4 +48,5 @@ "segfault-raub": "^2.1.2" | ||
"devDependencies": { | ||
"@types/node": "^20.8.3", | ||
"eslint": "^8.51.0", | ||
"eslint-plugin-node": "^11.1.0", | ||
"eslint": "^8.51.0", | ||
"node-addon-api": "^7.0.0", | ||
@@ -52,0 +53,0 @@ "typescript": "^5.2.2" |
@@ -8,4 +8,5 @@ # Image for Node.js | ||
[![Test](https://github.com/node-3d/image-raub/actions/workflows/test.yml/badge.svg)](https://github.com/node-3d/image-raub/actions/workflows/test.yml) | ||
[![Cpplint](https://github.com/node-3d/image-raub/actions/workflows/cpplint.yml/badge.svg)](https://github.com/node-3d/image-raub/actions/workflows/cpplint.yml) | ||
``` | ||
```console | ||
npm i -s image-raub | ||
@@ -12,0 +13,0 @@ ``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13813
271
92
5
Updatedaddon-tools-raub@^7.4.0