Skip to content

Export ReplicationOptions type#4606

Merged
pubkey merged 1 commit into
pubkey:masterfrom
marceljuenemann:patch-1
Apr 4, 2023
Merged

Export ReplicationOptions type#4606
pubkey merged 1 commit into
pubkey:masterfrom
marceljuenemann:patch-1

Conversation

@marceljuenemann

Copy link
Copy Markdown
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

pubkey commented Apr 3, 2023

Copy link
Copy Markdown
Owner

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
Copy Markdown
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.

2 participants