aaronhuggins / indexeddb

IndexedDB for Deno
MIT License
15 stars 0 forks source link

Re-export internals types and implementations. #2

Closed make-github-pseudonymous-again closed 2 years ago

make-github-pseudonymous-again commented 2 years ago

It's useful to have access to types and implementations of internals such as IDBKeyRange. Since types are meant to be generic, maybe it would make sense to have a separate package that mirrors the TypeScript lib.dom.ts definitions. For implementations, I think it makes sense to reexport whatever indexeddbshim so that users of this library do not have to know where the implementations come from.

aaronhuggins commented 2 years ago

This is a good idea. I actually copy the IndexedDB types from lib.dom.ts and include them. However, I'm not currently re-exporting the types in pony/polyfills, except minimally.

I'll give some thought to the best way to go about the export.

aaronhuggins commented 2 years ago

The copy of lib.dom.ts is because indexeddbshim does not export it's own types, but instead depends on TypeScript DOM built-ins.

Since DOM types aren't shipped by default by Deno, I cherry-pick the IndexedDB and related types, and I ship them here.

aaronhuggins commented 2 years ago

@make-github-pseudonymous-again Please take a look at branch https://github.com/aaronhuggins/indexeddb/tree/increase-api-surface

I think it does what you are asking for.

make-github-pseudonymous-again commented 2 years ago

Yep!

aaronhuggins commented 2 years ago

Okay, I actually messed around quite a bit so that exports, IDE type hinting, and docs are all aligned.

Here's a link to Deno doc in the current repo: https://doc.deno.land/https://raw.githubusercontent.com/aaronhuggins/indexeddb/main/ponyfill.ts

Let me know what you think. I'll probably cut a release tomorrow.

make-github-pseudonymous-again commented 2 years ago

That look perfect!

aaronhuggins commented 2 years ago

Released version 1.1.0:

https://deno.land/x/indexeddb@v1.1.0

https://doc.deno.land/https://deno.land/x/indexeddb@v1.1.0/ponyfill.ts