Repository navigation
Conversation
…nst` in NC_CONSTANTS
|
pretty much in favour of deleting code (but some could remain as placeholders in the meantime, only if, needed and planned). Is this good to go? |
| 15: "enum", | ||
| 16: "compound", | ||
| }; | ||
| // export const TYPE_NAMES: { [key: number]: string } = { |
There was a problem hiding this comment.
I think I wanna to use these somewhere else, but forgot, plus knowing what each meant was useful for debugging. So, maybe delete? if they are really not used.
| HEAPF64: Float64Array; | ||
| HEAP64: BigInt64Array; | ||
| HEAP32: Int32Array; | ||
| HEAP8: Int8Array; | ||
| HEAPF32: Float32Array; | ||
| HEAPU8: Uint8Array; | ||
| HEAP16: Int16Array; | ||
| HEAPU16: Uint16Array; | ||
| HEAPU32: Uint32Array; | ||
| HEAPU64: BigUint64Array; |
There was a problem hiding this comment.
Surprised it passed Linting without these.
There was a problem hiding this comment.
They are not (entirely) gone. They are part of the new dependency "@types/emscripten". Hence the
export interface EmscriptenModule extends globalThis.EmscriptenModule {
which is also the reason why the linting worked.
I thought it might make sense to reuse something already existing and just to extend it with the bits we need.
I am going to respond slower this week due to events in my company.
There was a problem hiding this comment.
Was feeling dumb cause this didn't make sense. But the global EmscriptenModule is declared in node_modules,. So this is solid
Mostly a typing cleanup. Behaviour should stay the same except for the fixes listed below. This is the first iteration of stricter types. The goal is to replace all occurrences of
anyin the end. This is not really a breaking change, but one could argue it is, as some of the types are now enforced.Changes
cpx2,rimraf) and added@types/emscripten. The hand-writtenanytypes for the Emscripten module and FS are replaced with the official types.toError()helper inerrors.ts, with tests. Allcatch (err: any)blocks now useunknownplustoError().AnyTypedArraymoved intotypes.tsand replaces the long typed-array unions it duplicated.NC_CONSTANTSis nowas const.FILE_MODEStable, with derivedFileMode/OpenMode/CreateModetypes.modeinDataset()and thefrom*factories, including the public wrappers inindex.ts, is nowFileModeinstead ofstring.NC_LONGLONG/NC_ULONGLONGentries from the getter maps. They are aliases ofNC_INT64/NC_UINT64and only became visible as errors afteras const.Fixes found along the way
number. Emscripten returns them asBigInt, which the old types hid.open()handles the worker path and the regular read path in one branch. Creating files works as before.Notes
TYPE_NAMESis commented out, since nothing used it.