lusaxweb / vuesax

New Framework Components for Vue.js 2
https://lusaxweb.github.io/vuesax/
MIT License
5.64k stars 741 forks source link

No TypeScript Declaration File #34

Open OzairP opened 6 years ago

OzairP commented 6 years ago

A .d.tsdeclaration file would be awesome for TypeScript users:)

Rickgg commented 6 years ago

Been reading up on this... Apparently, we would have to use ts-loader with Webpack and compile the templates before distribution... I haven't found any other way yet. @luisDanielRoviraContreras you okay with that?

luisDanielRoviraContreras commented 6 years ago

Well if that is the solution to give it! Can you make a PR on this?

OzairP commented 6 years ago

@Rickgg ts-loader is only needed if you're actually using TypeScript within the project. However if you're not you can simply define index.d.ts without any compilation to type the method signatures. This won't be packaged with WebPack

See: https://github.com/ElemeFE/element/tree/dev/types

Rickgg commented 6 years ago

Will check that out, thanks.

bluelovers commented 5 years ago

hope can support typescript

at vue cli 3 there has many error

84:20 Property 'colorAlert' does not exist on type 'Vue'.
    82 |     acceptAlert(){
    83 |       this.$vs.notify({
  > 84 |         color:this.colorAlert,
       |                    ^
    85 |         title:'Accept Selected',
    86 |         text:'Lorem ipsum dolor sit amet, consectetur'
    87 |       })
davidrock commented 5 years ago

Any update on that? A @types/vuesax would be great! I would like to start a new project using this template but we need to build it with typescript

sjmcdowall commented 5 years ago

Anything? I am in need of this as well (or would like it anyway) :)

CanadianBeaver commented 5 years ago

Any updates? I am looking for a solution... Please add the types.

danijelh commented 5 years ago

Also here because of TypeScript support. On larger projects, especially the one like Vuesax Admin, TypeScript can be very helpful.

@bluelovers you can resolve errors like that by creating declaration file. EX: src/types/declarations/vue-instance-types.ts

import Vue from "vue";

declare module "vue/types/vue" {
  interface Vue {
    $vs: any; // vuesax custom plugin
  }
}

Also don't forget to reload VS Code.

rashadrivera commented 4 years ago

Any updates? I am looking for a solution... Please add the types.

Does anyone know a work around? My project is dead in the water without TS support.

luisDanielRoviraContreras commented 4 years ago

@rashadrivera in the new version we are working with ts and it will have its respective file

rashadrivera commented 4 years ago

ts and it will have its respective file

luisDanielRoviraContreras,

That is great. Is that version in your Git repo? I'm not seeing it. Also, if I could help speed that along, please let me know. I'm basically stuck until this gets released. Unfortunetelly, I've invested in a template that uses Vuesax, but my project is built in Vue/TypeScript.

RonaldCast commented 4 years ago

Also here because of TypeScript support. On larger projects, especially the one like Vuesax Admin, TypeScript can be very helpful.

@bluelovers you can resolve errors like that by creating declaration file. EX: src/types/declarations/vue-instance-types.ts

import Vue from "vue";

declare module "vue/types/vue" {
  interface Vue {
    $vs: any; // vuesax custom plugin
  }
}

Also don't forget to reload VS Code.

This is a excellent soluction, very good

bluelovers commented 4 years ago

im not need this file, i mean the .d.ts for vuesax

sadeq-qafari commented 4 years ago

@rashadrivera in the new version we are working with ts and it will have its respective file

any news on that subject?

nicolidin commented 4 years ago

Need .d.ts file too..

sadeq-qafari commented 4 years ago

any news?

armanivvv commented 4 years ago

Really need .d.ts file

Arcaster42 commented 4 years ago

Two years and no declaration file? If that's the case, guessing this is abandoned.

khatthaphone commented 4 years ago

Still waiting...

TuxGamer commented 3 years ago

Also waiting.

So glad I didn't yet purchase the premium variant

MannyDiera commented 3 years ago

Not sure if this is correct but after adding the interface from above, I still received errors. My solution in addition to the above was to create a .d.ts file and declare the module.

// src/vuesax.d.ts
declare module 'vuesax';
GenaroHV commented 3 years ago

Acabo de intentar con las soluciones anteriores, pero hasta el momento me sigue generando dicho error. Quiero importar Vuesax a un proyecto en Ionic (Vue|Typescript)😔

dorosch commented 2 years ago

Still waiting...

shtse8 commented 2 years ago

Still waiting...

MoskalenkoM commented 1 year ago

Still waiting... But no, it's not working with Vue3 + TypeScript...

fatfatcocofat commented 4 months ago
declare module 'vuesax' {
  import { PluginFunction } from 'vue'
  const Vuesax: { install: PluginFunction<any> }
  export default Vuesax
}