Can I import the EnqueuedTask class?
wancup opened this issue · comments
On v0.29.0, EnqueuedTask class is not exported from meilisearch-js package.
import type { EnqueuedTask } from "meilisearch";
↓
$ tsc
TS2614: Module '"meilisearch"' has no exported member 'EnqueuedTask'. Did you mean to use 'import EnqueuedTask from "meilisearch"' instead?
Currently(v 0.28.0), I import and use the EnqueuedTask type in my modules. So, this change is a bit inconvenient.
There is a plan to export EnqueuedTask class? Or should I not reuse the class in my files?
@bidoubiwa Thanks for the reply!
And sorry, my example was wrong. But, without the type
word, I get the same result.
https://codesandbox.io/s/staging-dust-7e1x97?file=/src/index.ts
I think the reason why is EnqueuedTask
class (in enqueued-task.ts) is not exported in src/index.ts.
https://github.com/meilisearch/meilisearch-js/blob/main/src/index.ts
Because I wrap some sdk methods in my modules, I want to return the same type of sdk's return values. So I want to use EnqueuedTask
class instead of EnqueuedTaskObject
.
Like;
import { EnqueuedTask } from "meilisearch";
export async function deleteX(): Promise<EnqueuedTask> {
return client.index("xxx").deleteDocument("id");
}
Am I still misunderstanding something?
Fixed and released in v0.29.1.
Could you confirm it fixes your issue?
It's fixed! Thank you so much! @bidoubiwa