Skip to content

Commit 52368d8

Browse files
matmenclaude
andcommitted
Fix what JSR's type check (Deno's TypeScript) rejects
Deno's TypeScript makes typed arrays generic over their buffer: three variables in the AV1 and AVIF code took a narrower type from their initializer, so deno publish failed to type check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lfv41PqHEGbU7SLg5onpG1
1 parent 82e56cc commit 52368d8

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎src/codecs/av1/ipred.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -327,10 +327,10 @@ function filterIntra(dst: Uint16Array, d: number, stride: number, width: number,
327327
const e = edgeBuffer;
328328
const taps = filter * 56;
329329
// the top row comes from the edge buffer for the first two rows, from the block afterwards
330-
let topArr = e, top = EDGE + 1;
330+
let topArr: Uint16Array = e, top = EDGE + 1;
331331
for (let y = 0; y < height; y += 2) {
332-
let tlArr = e, tl = EDGE - y;
333-
let leftArr = e, left = tl - 1, leftStride = -1;
332+
let tlArr: Uint16Array = e, tl = EDGE - y;
333+
let leftArr: Uint16Array = e, left = tl - 1, leftStride = -1;
334334
for (let x = 0; x < width; x += 4) {
335335
const p0 = tlArr[tl];
336336
const p1 = topArr[top], p2 = topArr[top + 1], p3 = topArr[top + 2], p4 = topArr[top + 3];

‎src/codecs/avif.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ function toRgba(y: Yuv, alpha: Yuv | null, toneMapping: ToneMapping, premultipli
421421
tableY[i] = (i - biasY) / rangeY;
422422
tableUV[i] = identity ? tableY[i] : (i - biasUV) / rangeUV;
423423
}
424-
let out = new Uint8Array(width * height * 4);
424+
let out: Uint8Array = new Uint8Array(width * height * 4);
425425
// HDR (PQ, HLG): the non-linear RGB values, converted to linear light and tone mapped after
426426
const hdr = y.transfer === TRANSFER_PQ || y.transfer === TRANSFER_HLG;
427427
const rgb = hdr ? new Float32Array(width * height * 3) : null;

0 commit comments

Comments
 (0)