Skip to content

Commit a8b209b

Browse files
committed
improve type for images
1 parent c38fd49 commit a8b209b

File tree

5 files changed

+5
-13
lines changed

5 files changed

+5
-13
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "litecanvas",
3-
"version": "0.92.1",
3+
"version": "0.92.2",
44
"description": "Lightweight HTML5 canvas 2D game engine suitable for small projects and creative coding. Inspired by PICO-8 and P5/Processing.",
55
"license": "MIT",
66
"author": "Luiz Bills <luizbills@pm.me>",

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@ export default function litecanvas(settings = {}) {
718718
*
719719
* @param {number} x
720720
* @param {number} y
721-
* @param {OffscreenCanvas|HTMLImageElement|HTMLCanvasElement} source
721+
* @param {CanvasImageSource} source
722722
*/
723723
image(x, y, source) {
724724
DEV: assert(isNumber(x), '[litecanvas] image() 1st param must be a number')

src/version.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

types/global.d.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -364,11 +364,7 @@ declare global {
364364
* @param y
365365
* @param source
366366
*/
367-
function image(
368-
x: number,
369-
y: number,
370-
source: OffscreenCanvas | HTMLImageElement | HTMLCanvasElement
371-
): void
367+
function image(x: number, y: number, source: CanvasImageSource): void
372368
/**
373369
* Draw in an OffscreenCanvas and returns its image.
374370
*

types/types.d.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -358,11 +358,7 @@ type LitecanvasInstance = {
358358
* @param y
359359
* @param source
360360
*/
361-
image(
362-
x: number,
363-
y: number,
364-
source: OffscreenCanvas | HTMLImageElement | HTMLCanvasElement
365-
): void
361+
image(x: number, y: number, source: CanvasImageSource): void
366362
/**
367363
* Draw in an OffscreenCanvas and returns its image.
368364
*

0 commit comments

Comments
 (0)