nats-io / nats.ws

WebSocket NATS
Apache License 2.0
329 stars 29 forks source link

Can't import the ObjectStoreImpl #234

Closed sheldygg closed 6 months ago

sheldygg commented 6 months ago

Observed behavior

TS2307: Cannot find module nats.ws/lib/jetstream/objectstore or its corresponding type declarations

Expected behavior

I expect that I can import and use ObjectStoreImpl

Server and client version

nats.ws 1.23.0 server 2.10.10

Host environment

Windows 10 Typescript

Steps to reproduce

Just try import the ObjectStoreImpl

aricart commented 6 months ago

ObjectStoreImpl is the implementation and it is not exposed. You can import ObjectStore and that interface is the public API of what you can use.

sheldygg commented 6 months ago

image How i can use?

sheldygg commented 6 months ago

ObjectStore just interface, how i must use it?

Lancetnik commented 6 months ago

@aricart can you please show any reproducable usage example? I just got an arror trying to use this interface or import an implementation

aricart commented 6 months ago

I updated the other issue, that @sheldygg created - https://github.com/nats-io/nats.ws/issues/236

And of course there's always the tests, https://github.com/nats-io/nats.ws/blob/main/test/jetstream.js#L338 - note that this repo has few tests, because the nbc (nats-base-client) is shared between all the runtimes - The nats.deno repo has extensive tests for all functionality.

aricart commented 6 months ago

And one more, there's full JSDoc for the client, you can get it by going to https://github.com/nats-io/nats.ws?tab=readme-ov-file#documentation, and then clicking the JSDoc link:

https://github.com/nats-io/nats.deno?tab=readme-ov-file#documentation