Skip to content

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

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

Closed
retyui opened this issue Dec 30, 2020 · 1 comment
Closed

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

retyui opened this issue Dec 30, 2020 · 1 comment

Comments

@retyui
Copy link

retyui commented Dec 30, 2020

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
@Methuselah96
Copy link
Contributor

Resolved in #1827.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants