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

Further progress #9

Open
atjeff opened this issue Jan 15, 2020 · 3 comments
Open

Further progress #9

atjeff opened this issue Jan 15, 2020 · 3 comments
Labels
good first issue Good for newcomers

Comments

@atjeff
Copy link

atjeff commented Jan 15, 2020

Thanks for creating this project! I've been looking for nice typescript support for couchbase. I have your library up and running, but don't see many methods. Are you planning on adding some insert methods?

@atjeff
Copy link
Author

atjeff commented Jan 15, 2020

I see, it does implement them all as it's just a wrapper, just the type definitions aren't finished. Thanks!

@atjeff
Copy link
Author

atjeff commented Jan 15, 2020

@zMotivat0r How do you feel about changing repository.interface.ts to include something like this? It would keep you from having to manually add each method

export type Promisify<T> = {
  [K in keyof T]: T[K] extends (req: infer U, b: any, c: any, callback: (e: any, r: infer V) => void) => any
    ? (r: U) => Promise<V>
    : never
};

export interface Repository<T> extends Promisify<Bucket> {

I found that type here: microsoft/TypeScript#26048

That will update your user.service.ts test to look like this:

image

No need to force casting to any

@michaelyali
Copy link
Contributor

@atjeff hey! Thanks a lot for your interest!
I would love to see a PR because honestly, I'm not sure when I could find a time to update it :(

@michaelyali michaelyali added the good first issue Good for newcomers label Jan 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants