Skip to content
This repository was archived by the owner on Dec 1, 2024. It is now read-only.
This repository was archived by the owner on Dec 1, 2024. It is now read-only.

Typescript Errors #500

Closed
Closed

Description

@gpresland

Attempting to use levelup with leveldown results in a screen full of type errors.

Installed with:

npm install --save levelup leveldown

and

npm install --save-dev @types/levelup @types/leveldown

When run with node_modules/.bin/tsc you get:

node_modules/@types/levelup/index.d.ts(76,20): error TS2694: Namespace '"node_modules/leveldown/leveldown"' has no exported member 'Constructor'.
node_modules/leveldown/leveldown.d.ts(66,3): error TS7010: 'seek', which lacks return-type annotation, implicitly has an 'any' return type.
node_modules/leveldown/node_modules/abstract-leveldown/index.d.ts(2,3): error TS7010: 'open', which lacks return-type annotation, implicitly has an 'any' return type.
node_modules/leveldown/node_modules/abstract-leveldown/index.d.ts(3,3): error TS7010: 'open', which lacks return-type annotation, implicitly has an 'any' return type.
node_modules/leveldown/node_modules/abstract-leveldown/index.d.ts(5,3): error TS7010: 'close', which lacks return-type annotation, implicitly has an 'any' return type.
node_modules/leveldown/node_modules/abstract-leveldown/index.d.ts(7,3): error TS7010: 'get', which lacks return-type annotation, implicitly has an 'any' return type.
node_modules/leveldown/node_modules/abstract-leveldown/index.d.ts(7,26): error TS7006: Parameter 'err' implicitly has an 'any' type.
node_modules/leveldown/node_modules/abstract-leveldown/index.d.ts(8,3): error TS7010: 'get', which lacks return-type annotation, implicitly has an 'any' return type.
node_modules/leveldown/node_modules/abstract-leveldown/index.d.ts(8,39): error TS7006: Parameter 'err' implicitly has an 'any' type.
node_modules/leveldown/node_modules/abstract-leveldown/index.d.ts(10,3): error TS7010: 'put', which lacks return-type annotation, implicitly has an 'any' return type.
node_modules/leveldown/node_modules/abstract-leveldown/index.d.ts(11,3): error TS7010: 'put', which lacks return-type annotation, implicitly has an 'any' return type.
node_modules/leveldown/node_modules/abstract-leveldown/index.d.ts(13,3): error TS7010: 'del', which lacks return-type annotation, implicitly has an 'any' return type.
node_modules/leveldown/node_modules/abstract-leveldown/index.d.ts(14,3): error TS7010: 'del', which lacks return-type annotation, implicitly has an 'any' return type.
node_modules/leveldown/node_modules/abstract-leveldown/index.d.ts(17,3): error TS7010: 'batch', which lacks return-type annotation, implicitly has an 'any' return type.
node_modules/leveldown/node_modules/abstract-leveldown/index.d.ts(18,3): error TS7010: 'batch', which lacks return-type annotation, implicitly has an 'any' return type.

Activity

  1. vweevers commented on Oct 4, 2017

    @vweevers
    Member

    We are actively working on improving the typings, they will be included in levelup itself. Stay tuned!

    cc @MeirionHughes @zixia

  2. MeirionHughes commented on Oct 4, 2017

    @MeirionHughes
    Member

    leveldown, memdown, encoding-leveldown come with their own types that are different and breaking to the defiantly typed ones. we're in the process of updating the typings for levelup too.

  3. huan commented on Oct 4, 2017

    @huan
    Contributor

    @gpresland I believe this issue will be solved after the levelup v2.0 package is published on NPM with the latest typings.

    Before that, I suggest you try npm i levelup@2.0.0-rc2, which is the only version with the right(almost) typings currently.

    You can have a look at this TypeScript repository which has a workable levelup at:
    https://github.com/zixia/flash-store/blob/31a8ab6f3ddd79a5a55b97ed868ad719d7cc5cd4/package.json#L36-L38

  4. earslap commented on Oct 21, 2017

    @earslap

    Any updates on this issue? I believe the v2.0.0 is released on npm, and leveldown has their typings bundled but levelup has no d.ts files. The type declerations under definitelytyped are 6-7 months old so I don't know where I'm supposed to get the latest ones...

  5. huan commented on Oct 24, 2017

    @huan
    Contributor

    I have a workaround as the following combination:

        "encoding-down": "^2.3.1",
        "leveldown": "^2.0.0",
        "levelup": "github:MeirionHughes/levelup",

    Then the typing system works.

  6. sqwk commented on Dec 5, 2017

    @sqwk

    This hasn't made it into 2.0.1, has it?

  7. vweevers commented on Dec 5, 2017

    @vweevers
    Member

    Correct. You can follow #499 for progress.

  8. peternoyes commented on Jan 11, 2018

    @peternoyes

    @zixia What types are using that works with the github version of levelup?

    I am trying:
    "@types/leveldown": "^1.7.0",
    "@types/levelup": "0.0.30",

    And still seeing errors

  9. huan commented on Feb 2, 2018

    @huan
    Contributor

    @peternoyes Please have a look at https://github.com/zixia/flash-store to get it work.

    I use levelup with typing in that project.

  10. vweevers commented on May 22, 2018

    @vweevers
    Member

    Please see Level/community#16.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions