Skip to content

Please add TypeScript definitions #49

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
schoening opened this issue Aug 3, 2017 · 4 comments
Open

Please add TypeScript definitions #49

schoening opened this issue Aug 3, 2017 · 4 comments

Comments

@schoening
Copy link

schoening commented Aug 3, 2017

It would be great if this plugin was usable in typescript projects!
Consider adding it so it can be installed via (@)types/vue-progressbar

@richard-edwards
Copy link

Did anyone get this working with Vue & Typescript?

I created a vue-progress.d.ts file in my project and added the following but I'm still getting issues:

import Vue from "vue";

interface ProgressMethods {
  start: void;
  finish: void;
  fail: void;
}

declare module "vue/types/vue" {
  interface Vue {
    $Progress: ProgressMethods;
  }
}

@richard-edwards
Copy link

I played around with it a bit more today and came up with this which seems to have satisfied TypeScript.

vue-progressbar.d.ts

declare module "vue-progressbar" {
  import { PluginFunction } from "vue";

  export const install: PluginFunction<{}>;

  interface ProgressMethods {
    start(): void;
    finish(): void;
    fail(): void;
  }

  module "vue/types/vue" {
    interface Vue {
      $Progress: ProgressMethods;
    }
  }
}

@mseele
Copy link

mseele commented Nov 8, 2019

Any updates here?

@DesKevinMendez
Copy link

run npm install --save @types/nprogress

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants