Skip to content

TypeScript definitions inconsistent #503

@endel

Description

@endel

Hey there,

I've tried to use v6.0.0 with TypeScript and unfortunately some of the definitions are inconsistent :(

Here's the errors I'm having:

node_modules/protobufjs/types/protobuf.js.d.ts(1138,10): error TS2415: Class 'BufferReader' incorrectly extends base class 'Reader'.
  Types of property 'finish' are incompatible.
    Type '(buffer?: Buffer) => Buffer' is not assignable to type '(buffer?: number[]) => number[]'.
      Types of parameters 'buffer' and 'buffer' are incompatible.
        Type 'number[]' is not assignable to type 'Buffer'.
          Property 'write' is missing in type 'number[]'.
node_modules/protobufjs/types/protobuf.js.d.ts(1792,61): error TS2314: Generic type 'Array<T>' requires 1 type argument(s).
node_modules/protobufjs/types/protobuf.js.d.ts(2050,10): error TS2415: Class 'BufferWriter' incorrectly extends base class 'Writer'.
  Types of property 'float' are incompatible.
    Type '(value: number) => BufferWriter' is not assignable to type '(value: number) => Writer'.
      Type 'BufferWriter' is not assignable to type 'Writer'.
        Types of property 'bytes' are incompatible.
          Type '(value: Buffer) => BufferWriter' is not assignable to type '(value: number[]) => Writer'.
            Types of parameters 'value' and 'value' are incompatible.
              Type 'number[]' is not assignable to type 'Buffer'.
src/index.ts(2,27): error TS2306: File 'xxx/node_modules/protobufjs/types/protobuf.js.d.ts' is not a module.

Cheers!

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