Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export ReplicationOptions type #4606

Merged
merged 1 commit into from
Apr 4, 2023
Merged

Conversation

marceljuenemann
Copy link
Contributor

Thanks for the great library! I just created rxdb-supabase on top of it to replicate to supabase.

The only problem I ran into was that the following types don't seem to be exported:

  • ReplicationOptions
  • ReplicationPullOptions
  • ReplicationPushOptions

Of course, I could just duplicate all the fields in the Options type of my library, which arguably is not a terrible thing. But whenever you add a field to ReplicationOptions, it would require all downstream libraries to pass that field through as well. So I was wondering whether that's a deliberate design decision, or whether you want to add those types to the exports?

NOTE: I'm not saying this PR is the way to solve it, it probably exposes a lot of types that are implementation details. But it would be one way to solve my problem :)

@pubkey
Copy link
Owner

pubkey commented Apr 3, 2023

Can you import them from rxdb/plugins/replication ? This should be possible.

In the future all type will be exported, see https://github.com/pubkey/rxdb/blob/master/src/index.ts#L33

@marceljuenemann
Copy link
Contributor Author

No, that gives me Module '"rxdb/plugins/replication"' declares 'ReplicationOptions' locally, but it is not exported.ts(2459)

I updated the PR to add the specific types to the list in index.ts, which also solves the issue.

@pubkey pubkey merged commit 544335f into pubkey:master Apr 4, 2023
pubkey added a commit that referenced this pull request Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants