You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Writing browser code, when I create an actual ArrayBuffer, its instead returned as an ArrayBufferLike, which doesn't perfectly align with an ArrayBuffer causes linting errors:
exportinterfaceMapID{mapID: string}exportinterfaceWorkerMessageBaseextendsMapID{tileID: bigintsourceName: string}exportinterfaceLineDataextendsWorkerMessageBase{type: 'line'vertexBuffer: ArrayBufferlengthSoFarBuffer: ArrayBufferfeatureGuideBuffer: ArrayBuffer}// Upon building the batches, convert to buffers and ship.constvertexBuffer=newFloat32Array(vertices).bufferconstlengthSoFarBuffer=newFloat32Array(lengthSoFar).bufferconstfeatureGuideBuffer=newFloat32Array(featureGuide).buffer// ship the vector data.constdata: LineData={
mapID,type: 'line',
sourceName,
tileID,
vertexBuffer,
lengthSoFarBuffer,
featureGuideBuffer
}postMessage(data,[vertexBuffer,featureGuideBuffer])
The linting error for LineData:
Type 'ArrayBufferLike' is not assignable to type 'ArrayBuffer'.
Property 'resize' is missing in type 'SharedArrayBuffer' but required in type 'ArrayBuffer'.ts(2322)
globals.d.ts(1549, 5): 'resize' is declared here.
worker.spec.ts(416, 3): The expected type comes from property 'vertexBuffer' which is declared here on type 'LineData'
(property) LineData.vertexBuffer: ArrayBuffer
The linting error for postMessage:
No overload matches this call.
The last overload gave the following error.
Type 'ArrayBufferLike[]' has no properties in common with type 'WindowPostMessageOptions'.ts(2769)
lib.dom.d.ts(27400, 18): The last overload is declared here.
const vertexBuffer: ArrayBufferLike
Obviously fixable by just saying const vertexBuffer = new Float32Array(vertices).buffer as ArrayBuffer for now, but I figured this should be reported.
What is the expected behavior?
No response
What do you see instead?
No response
Additional information
No response
The text was updated successfully, but these errors were encountered:
What version of Bun is running?
1.0.29+a146856d1
What platform is your computer?
Darwin 23.1.0 arm64 arm
What steps can reproduce the bug?
Writing browser code, when I create an actual
ArrayBuffer
, its instead returned as anArrayBufferLike
, which doesn't perfectly align with an ArrayBuffer causes linting errors:The linting error for LineData:
The linting error for postMessage:
Obviously fixable by just saying
const vertexBuffer = new Float32Array(vertices).buffer as ArrayBuffer
for now, but I figured this should be reported.What is the expected behavior?
No response
What do you see instead?
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: