Skip to content

1.11.9 type declarations break TypeScript 5.6+ (TS2707: bare Iterable/Iterator/AsyncIterable/AsyncIterator) #180

Description

@akshayvinodpunnath

TypeScript version: 5.6+
msgpackr version: 1.11.9 (works fine on 1.11.8)

Error (TS2707):
node_modules/msgpackr/index.d.ts:63 — Generic type 'Iterable<T, TReturn, TNext>' requires between 1 and 3 type arguments
node_modules/msgpackr/index.d.ts:63 — Generic type 'Iterator<T, TReturn, TNext>' requires between 1 and 3 type arguments
node_modules/msgpackr/index.d.ts:63 — Generic type 'AsyncIterable<T, TReturn, TNext>' requires between 1 and 3 type arguments
node_modules/msgpackr/index.d.ts:63 — Generic type 'AsyncIterator<T, TReturn, TNext>' requires between 1 and 3 type arguments
(same for line 64)

Root cause:
TypeScript 5.6 made Iterator, Iterable, AsyncIterator, and AsyncIterable proper generics that require at least one type argument. The new decodeIter and encodeIter declarations added in 1.11.9 use these types without type arguments.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions