vuejs / devtools-v6

⚙️ Browser devtools extension for debugging Vue.js applications.
https://devtools-v6.vuejs.org/
MIT License
24.65k stars 4.15k forks source link

[Typescript] add type definitions #779

Open championswimmer opened 6 years ago

championswimmer commented 6 years ago

What problem does this feature solve?

stops typescript from complaining of absent type declarations

What does the proposed API look like?

A very simple

declare module '@vue/devtools' {
  const connect(host: string, port: string): void
}

will do. only required so that we can do

import devtools from '@vue/devtools'
devtools.connect()
karanisverma commented 5 years ago

Hey @Akryum can I pick this up?

Akryum commented 5 years ago

Of course! :)

karanisverma commented 5 years ago

Thanks @Akryum, Looking into this

championswimmer commented 5 years ago

I think both host and port are optional, so my given example is not 100% correct. So it should be host?: string, port?: string in the arguments

karanisverma commented 5 years ago

Hi @Akryum I have created a PR please have a look, @championswimmer this is 1st time around when i am creating type definition. Please let me know if I have done some mistake. Thanks in advance :)