Skip to content

[TS 4.1.x] Invalid .d.ts typings  #1803

Closed
@retyui

Description

@retyui

What happened

yarn tsc                 9.2s  Ср 30 дек 2020 13:02:33
yarn run v1.22.5
$ /home/i/all_work/pandadoc/kolas-editor-monorepo/node_modules/.bin/tsc
../../@types/immutable/index.d.ts:2686:22 - error TS2430: Interface 'Keyed<K, V>' incorrectly extends interface 'Seq<K, V>'.
  The types returned by 'map(...).map(...).flatMap(...).toJS()' are incompatible between these types.
    Type 'Object' is not assignable to type 'unknown[] | { [key: string]: unknown; }'.
      The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
        Type 'Object' is not assignable to type '{ [key: string]: unknown; }'.
          The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
            Index signature is missing in type 'Object'.

2686     export interface Keyed<K, V> extends Seq<K, V>, Collection.Keyed<K, V> {
                          ~~~~~

../../@types/immutable/index.d.ts:3234:22 - error TS2430: Interface 'Keyed<K, V>' incorrectly extends interface 'Collection<K, V>'.
  The types returned by 'toJS()' are incompatible between these types.
    Type 'Object' is not assignable to type 'unknown[] | { [key: string]: unknown; }'.
      The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
        Type 'Object' is not assignable to type '{ [key: string]: unknown; }'.
          The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
            Index signature is missing in type 'Object'.

3234     export interface Keyed<K, V> extends Collection<K, V> {
                          ~~~~~


Found 2 errors.

error Command failed with exit code 2.

How to reproduce

Install yarn add immutable@latest

// tsconfig.json
{
  "compilerOptions": {
    "skipLibCheck": false,
  }
}
// Run type checker
yarn tsc --noEmit

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions