Wrap a handle, reusing the existing wrapper; returns null for the null handle.
Return the cached wrapper for a handle without creating one.
Invalidate and drop the wrapper for a handle, so a later reuse of the handle is clean.
Invalidate and drop every cached wrapper (e.g. when the document is replaced).
A sparse, per-collection cache keyed by wasm handle. HandleCache.wrap lazily builds a wrapper the first time a handle is seen and returns that same instance ever after, so lookups are an array index (not a map hash) and identity is preserved. A null handle maps to
null, which the type system then forces the caller to check.