Commit edad492
authored
Document zarrita entry and open module in JSDoc (#405)
* Decompose withRangeBatching into withRangeCoalescing + withCaching
Drop withRangeBatching entirely. Split it into two primitives:
- withRangeCoalescing: microtask-tick batcher with no cache state.
Emits onFlush callbacks with immutable FlushReport objects for
observability instead of a top-level .stats getter.
- withCaching: byte cache keyed by a user-supplied CacheKey policy
function. Returns undefined to skip caching, a string to store
under. Ships cacheKeys.getsOnly (default), getsAndRanges, and
getsAndShardIndices as built-in policies.
Add a minimal ByteCache interface (has / get / set). Plain Map
satisfies it and is the default when no cache option is supplied;
users who want bounded eviction can drop in any ByteCache-compatible
container.
All APIs were unreleased, so no deprecation shims.
* Document zarrita entry and open module in JSDoc
Adopt Deno std library's JSDoc conventions on the zarrita public API,
starting with the package entry point and the `open` module. The goal is
hover-driven discoverability in editors: a user landing on `zarr.open`
in VS Code should see a summary, a runnable example, and links to
related symbols without leaving the tooltip.
Both files gain `@module` blocks with a short pitch and an end-to-end
example lifted from the cookbook. `open`, `open.v2`, and `open.v3` get
full JSDoc with `@example Usage` blocks, `@param`/`@returns`, `@throws`
for the two errors the fallback path actually surfaces, and `@category
Read` so future TypeDoc output can group symbols. Symbol references use
`{@linkcode}` to render monospace in hovers; URL references stay on
`{@link}`.
Overload signatures each carry a short doc stub with `@category` rather
than a single doc on the implementation. VS Code resolves hovers
per-matched overload, so a stub on each one is the cheapest way to keep
all three call forms documented without duplicating the full block three
times.
This is the first of several passes — remaining core modules (`create`,
`hierarchy`, indexing, extensions, errors, codecs, typedarray) and the
`@zarrita/storage` entry files will follow the same conventions in later
commits.1 parent 306460e commit edad492
2 files changed
+120
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
1 | 27 | | |
2 | 28 | | |
3 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
1 | 23 | | |
2 | 24 | | |
3 | 25 | | |
| |||
208 | 230 | | |
209 | 231 | | |
210 | 232 | | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
211 | 270 | | |
212 | 271 | | |
213 | 272 | | |
214 | 273 | | |
215 | | - | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
216 | 278 | | |
217 | 279 | | |
218 | 280 | | |
219 | 281 | | |
220 | | - | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
221 | 286 | | |
222 | 287 | | |
223 | 288 | | |
| |||
240 | 305 | | |
241 | 306 | | |
242 | 307 | | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
243 | 321 | | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
244 | 336 | | |
0 commit comments