Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Type 'typeof Book' does not satisfy the constraint 'typeof AnyModel'. #631

Open
@hanayashiki

Description

@hanayashiki

Hi, I just want to make sure if this library works well with typescript.
I tried copyingredux-orm-tests.ts to my project, but got the following error from vscode:

Type 'typeof Book' does not satisfy the constraint 'typeof AnyModel'.  Types of property 'reducer' are incompatible.    Type '(action: RootAction, book: typeof Book) => void' is not assignable to type '(action: any, modelType: ModelType<any>, session: Pick<Pick<Session<any>, never> & Pick<{ [x: string]: ModelType<any>; }, never> & Pick<{ [x: string]: ModelType<any>; }, string | ... 1 more ... | symbol>, string | ... 1 more ... | symbol>) => void'.      Types of parameters 'book' and 'modelType' are incompatible.        Type 'ModelType<any>' is missing the following properties from type 'typeof Book': prototype, reducer, idAttribute, querySetClass, and 4 more.ts(2344)

My tsconfig.json is here:

{    "compilerOptions": {        "module": "commonjs",        "esModuleInterop": true,        "target": "es6",        "moduleResolution": "node",        "sourceMap": true,        "outDir": "dist",        "resolveJsonModule": true,        "declaration": true,        "preserveSymlinks": true    },    "include": [        "**/*"    ],    "exclude": [        "node_modules"    ],    "lib": [        "es6"    ]}

typescript version:

typescript@^4.1.2:  version "4.1.2"

vscode version:

code --version1.51.1e5a624b788d92b8d34d1392e4c4d9789406efe8fx64

Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp