Open
Description
I think that in Readme should be present a section for using this plugin in typescript.
To add the property "wait" to new Vue({wait: new VueWait()})
you need to define a type definitions like the one attached, otherwise will be raised an error because the property does not exist.
vue-wait-property.d.ts.zip
Activity
[-]Vue Wait with Typescript in Readme[/-][+]Vue Wait with Typescript[/+]fraparisi commentedon Dec 21, 2018
Or better is possible to include it directly in the library itself.
Like vue-axios does.
antoniogiroz commentedon Mar 10, 2019
Hi @fraparisi!
I've used the your .d.ts file, but Vue components (typescript class style) don't recognise
this.$wait
How do you use
$wait
and others methods aswaitFor
?Thanks!
fraparisi commentedon Mar 11, 2019
Hi @algil, for fix some error in ts compiler you can try using my solution for typings as here #64.
For $wait, u can place the file attached into your src and then in your main.ts use like this
new Vue({ wait : new VueWait({ useVuex: true, }), render: (h) => h(App), }).$mount('#app');
antoniogiroz commentedon Mar 16, 2019
@fraparisi are you using a project generated with Vue Cli 3?
fraparisi commentedon Mar 17, 2019
DavidLambauer commentedon Apr 4, 2019
Any update here? I would like to use the lib in my typescript classes to fix the missing async getter issue that typescript has.
Therefore I import waitFor like so
Currently this import statement produces a typescript syntax error.
fraparisi commentedon Apr 4, 2019
yoyoys commentedon Apr 5, 2019
@DavidLambauer For a workaround, you can install 1.3.2 version, and copy .d.ts file to your project. (I’ve put it on
@/types/declare
)p.s. you need restart dev server to load your own declare file.
antoniogiroz commentedon Apr 6, 2019
Ok, @fraparisi, but then I have 2 d.ts files:
With these files
wait
can be used innew Vue
as a property:But not in a vue component:
DavidLambauer commentedon Apr 11, 2019
@yoyoys adding an additional definitions file is not what I want 🙄. I suppressed the warning for the moment. Hopefully, this can be fixed soon? Unfortunately, I don't feel that I could fix it on my own.
f commentedon Apr 11, 2019
I am not very into the TypeScript definition files, can someone add a section to the README or update the
index.d.ts
file? I can immediately release a new version.fraparisi commentedon Apr 12, 2019
I've no problem using this.$wait, PhpStorm does not emit any error. Can u show me your tsconfig.json?
fraparisi commentedon Apr 12, 2019
I've already fix Type Description e fix the conflict in my Merge request, u can use that file.
antoniogiroz commentedon Apr 13, 2019
@fraparisi These are my tsconfig files (I'm using a monorepo)
In the roor folder:
In my Vue app:
10 remaining items