Iridium
Iridium copied to clipboard
Class 'CacheOnID' incorrectly implements interface 'CacheDirector'.
Hi! Have an error:
Error at node_modules/iridium/dist/lib/cacheControllers/IDDirector.d.ts:8:22: Class 'CacheOnID' incorrectly implements interface 'CacheDirector'.
Types of property 'valid' are incompatible.
Type '(object: { [prop: string]: any; _id: any; }) => boolean' is not assignable to type '<T>(object: T) => boolean'.
Types of parameters 'object' and 'object' are incompatible.
Type 'T' is not assignable to type '{ [prop: string]: any; _id: any; }'.
Error at node_modules/iridium/dist/lib/caches/NoOpCache.d.ts:11:22: Class 'NoOpCache' incorrectly implements interface 'Cache'.
Types of property 'get' are incompatible.
Type '<T>(key: string) => Bluebird<void>' is not assignable to type '<T>(key: string) => PromiseLike<T>'.
Type 'Bluebird<void>' is not assignable to type 'PromiseLike<T>'.
Types of property 'then' are incompatible.
Type '{ <U>(onFulfill?: (value: void) => U | PromiseLike<U>, onReject?: (error: any) => U | PromiseLike...' is not assignable to type '<TResult1 = T, TResult2 = never>(onfulfilled?: (value: T) => TResult1 | PromiseLike<TResult1>, on...'.
Types of parameters 'onFulfill' and 'onfulfilled' are incompatible.
Types of parameters 'value' and 'value' are incompatible.
Type 'void' is not assignable to type 'T'.
Versions:
"iridium": "7.2.5",
"typescript": "2.5.3"
Hi Dmytro,
I'm sorry that you've bumped into this issue, it's caused by v2.4 of TypeScript if I remember right and has been addressed on the v8.x release branch (which is still in alpha with plans for some further refactoring prior to release).
My suggestion right now is to consider updating to [email protected] (also aliased as iridium@next) or alternatively return to using TypeScript 2.3 until the v8.x branch is released under a stable tag.
At the moment there are no planned API changes on the v8.x branch for the generally used API methods - with the only intended changes occurring for people implementing custom validators. If you don't fall into that (small) group, then the 8.0.0-alpha.5 should work perfectly for you.
Please let me know if there is anything else I can help with, Benjamin