Typescript support
This is awesome project indeed. Is it possible to add definition file for Typescript since vue 2.5 have greatly improved on it.
I am not a TS user, and have no idea on how to implement this. contributions are very welcome :smile:
I get this error when using typescript, "TS7016: Could not find a declaration file for module 'uiv'" Is it planned to add declaration files?
There are so many libs without updated definitions in typescript. Use ambient declarations : declare module "uiv" { }
For it to work properly following the project documentation with import * as uiv, I had to create declarations like this:
declare module 'uiv' {
const uiv: any;
export = uiv;
}
declare module 'uiv/src/locale/lang/pt-BR' {
const locale: any;
export default locale;
}
I'm not an expert with type declarations, otherwise I would happily contribute to the project...
I use it as follows: First import the components with requiere
const uiv = require( "uiv" );
const Dropdown = uiv.Dropdown;
const DatePicker = uiv.DatePicker;
const TimePicker = uiv.TimePicker;
Then, register them as components
new Vue( {
components: {
Dropdown,
DatePicker,
TimePicker
}
} )
Hopefully this can help you