electric-sql / pglite

Lightweight WASM Postgres with real-time, reactive bindings.
https://pglite.dev
Apache License 2.0
9.46k stars 204 forks source link

Added more explicit typing to the Extension type and all related types. #359

Closed FindAPattern closed 1 week ago

FindAPattern commented 1 month ago

The Extension type currently exposes namespaceObj as an any type. This PR changes Extension to a generic interface that adds explicit typing to the namespaceObj type.

These changes should not affect any existing code, since the generic parameters fallback to the current types.

The motivation for making this change was to have intellisense on instances of PGlite that were created with extensions. PGlite.create(...) already included typing for extensions, so this change is redundant, aside from reducing the number of any types in the codebase.