You've already forked Nitro_Render_V3
mirror of
https://github.com/duckietm/Nitro_Render_V3.git
synced 2026-06-20 07:26:18 +00:00
TS 5.7+ ArrayBuffer drift: cast where ArrayBufferLike leaked
TypeScript 5.7 split ArrayBuffer / SharedArrayBuffer at the type level (ArrayBuffer now exposes resizable/transfer/detached etc; SharedArrayBuffer doesn't), and parametrized the typed-array constructors so plain Uint8Array became Uint8Array<ArrayBufferLike>. The renderer never uses SharedArrayBuffer, so this is type-level only — narrowing back to ArrayBuffer at the boundaries: - BinaryReader.readBytes() / .toArrayBuffer() return the underlying DataView buffer; cast to ArrayBuffer. - BinaryWriter.getBuffer() same shape. - WsSessionCrypto.randomNonce() now returns Uint8Array<ArrayBuffer> (it's always backed by a plain ArrayBuffer); aesGcmEncrypt/Decrypt nonce parameter retyped accordingly so SubtleCrypto.encrypt accepts it as BufferSource. - ArrayBufferToBase64 now accepts Uint8Array | ArrayBufferLike directly (pako/inflate hands back Uint8Array<ArrayBuffer> which the old ArrayBuffer-only signature rejected).
This commit is contained in:
@@ -89,7 +89,7 @@ export class BinaryWriter implements IBinaryWriter
|
||||
|
||||
public getBuffer(): ArrayBuffer
|
||||
{
|
||||
return this._buffer.buffer;
|
||||
return this._buffer.buffer as ArrayBuffer;
|
||||
}
|
||||
|
||||
public get position(): number
|
||||
|
||||
Reference in New Issue
Block a user