Skip to content

Commit

Permalink
Add width and height to d.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
raub committed Oct 29, 2023
1 parent 6b7fd05 commit a2f6eab
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 26 deletions.
4 changes: 3 additions & 1 deletion core.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ require('deps-freeimage-raub');

const { getBin } = require('addon-tools-raub');

const core = require(`./${getBin()}/image`);module.exports = core;
const core = require(`./${getBin()}/image`);

module.exports = core;
22 changes: 18 additions & 4 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ declare module "image-raub" {

type EventEmitter = import('node:events').EventEmitter;

/** Image
/**
* Image
*
* It is similar to the web Image.
* Extends EventEmitter to provide event-handling.
*/
Expand All @@ -32,6 +34,12 @@ declare module "image-raub" {
/** An Array, containing width and height. */
readonly wh: [number, number];

/** Image width. */
readonly width: number;

/** Image height. */
readonly height: number;

/** Alias for width. */
readonly naturalWidth: number;

Expand All @@ -44,13 +52,17 @@ declare module "image-raub" {
/** Image URI: local file / URL / data-uri */
src: string;

/** Similar to .on('error', cb).
/**
* Similar to .on('error', cb).
*
* Setter adds a new callback. If passed `null`, removes ALL callbacks.
* Getter returns an Array of currently existing callbacks.
*/
onerror: null | undefined | TEventCb<TEvent> | ReadonlyArray<TEventCb<TEvent>>;

/** Similar to .on('load', cb).
/**
* Similar to .on('load', cb).
*
* Setter adds a new callback. If passed `null`, removes ALL callbacks.
* Getter returns an Array of currently existing callbacks.
*/
Expand All @@ -59,7 +71,9 @@ declare module "image-raub" {
/** Emit an event on behalf of this Image. */
emit(name: string, event: TEvent): boolean;

/** Add event listener.
/**
* Add event listener.
*
* 'error' - something went wrong.
* 'load' - image has been loaded.
*/
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"author": "Luis Blanco <luisblanco1337@gmail.com>",
"name": "image-raub",
"version": "4.2.0",
"version": "4.2.1",
"description": "Native Image loader for Node.js",
"license": "MIT",
"main": "index.js",
Expand Down
18 changes: 0 additions & 18 deletions src/CPPLINT.cfg

This file was deleted.

0 comments on commit a2f6eab

Please sign in to comment.