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

Class 'CacheOnID' incorrectly implements interface 'CacheDirector'. #105

Open
longuniquename opened this issue Oct 11, 2017 · 1 comment
Assignees
Milestone

Comments

@longuniquename
Copy link

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"
@notheotherben
Copy link
Member

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 iridium@8.0.0-alpha.5 (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

@notheotherben notheotherben added this to the Version 8 milestone Oct 11, 2017
@notheotherben notheotherben self-assigned this Oct 11, 2017
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

2 participants