nest-couchbase
nest-couchbase copied to clipboard
Further progress
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?
I see, it does implement them all as it's just a wrapper, just the type definitions aren't finished. Thanks!
@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: https://github.com/microsoft/TypeScript/issues/26048
That will update your user.service.ts test to look like this:

No need to force casting to any
@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 :(