neo-blessed icon indicating copy to clipboard operation
neo-blessed copied to clipboard

TypeScript definitions?

Open danikaze opened this issue 5 years ago • 7 comments

Is there any way to use @types/blessed with neo-blessed?

danikaze avatar Jan 10 '20 17:01 danikaze

If using webpack, this can be done leaving

import * as blessed from 'blessed';

and then in webpack use the resolve.alias:

resolve: {
  alias: {
    blessed$: 'neo-blessed',
  },
},

but still... shouldn't this project have it's own definitions? since not everyone is using webpack, and if the library evolves, some new types might be needed...

danikaze avatar Jan 10 '20 20:01 danikaze

Hello,

I'm using JetBrains IntelliJ to code, and I can't find any way to use blessed's typings for neo-blessed so the autocompletion feature is down.

So, +1 for this.

Thanks

KaKi87 avatar May 09 '20 22:05 KaKi87

i've copied blessed's typings and swapped declare module "blessed" with declare module "neo-blessed"--works for now. would like to get them into this repo tho

cdaringe avatar Jun 06 '20 20:06 cdaringe

I robocopy'ed blessed to neo-blessed in @types and just updated package.json. Since this is a drop-in replacement simply copying @types/blessed to @types/neo-blessed should work but I don't have the confidence to do an official install but since it's simple, I'd encourage others to do so.

BobFrankston avatar Jun 18 '21 02:06 BobFrankston

Hope this gets resolved.

dustinlacewell avatar Jul 08 '21 04:07 dustinlacewell

Is any update for this issue?

I have a local resolution for that.

  • First, install @types/blessed
  • Next, create this file in root: types/neo-blessed/index.d.ts
  • Finally, put declare like below:
    declare module 'neo-blessed' {
      export * from 'blessed';
    }
    

moonrailgun avatar Nov 23 '21 03:11 moonrailgun

Yes, although it won't contain any change that neo-blessed could have made that doesn't match blessed.

However, after doing a quick look on Useful Forks, I see that @zach-is-my-name is merging other forks, and may be trying to create a super-fork ?

KaKi87 avatar Nov 26 '21 17:11 KaKi87