Skip to content

Conversation

gfx
Copy link

@gfx gfx commented May 4, 2021

index.d.ts declares buffer is Uint8Array, but in fact it can be Array<number> or any kind of array-like object (ArrayLike<number> in TypeScript), so I've tweaked those declarations in index.d.ts and add tests to use Array as well as Buffer.

@gfx gfx force-pushed the make-sure-arraylike-works branch from 5d628d7 to 7f8be4d Compare May 4, 2021 03:41
@WasabiThumb
Copy link

The type could at least be defined as Uint8Array | Uint8ClampedArray, at the current moment having to do clampedArray as unknown as Uint8Array when using TS is not the best

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants