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

Some important TYPES should be exported by the Client #45

Open
rjborba opened this issue Oct 7, 2024 · 0 comments
Open

Some important TYPES should be exported by the Client #45

rjborba opened this issue Oct 7, 2024 · 0 comments

Comments

@rjborba
Copy link
Contributor

rjborba commented Oct 7, 2024

I've noticed that some TYPES should be exported by the client so whoever is using it, can leverage it without having to redefine them.

Form example:
public async search(query: ClientSearchParams, config?: SearchConfig): Promise<Nullable<Results<AnyDocument>>> ...

Should be:

export type OramaResults = Promise<Nullable<Results<AnyDocument>>>

public async search(query: ClientSearchParams, config?: SearchConfig): OramaResults ...

So people can do:

import { OramaResults } from "@orama/orama"

const anotherFunction = (results: OramaResults) => {
....
}

....

const results = await client.search(...)

anotherFunction(results)

I've mentioned OramaResults type here, but it should be applied by all exposed functions that returns something that is a non-primitives type

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

No branches or pull requests

1 participant