Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Types of QUploader instance properties are missing #13217

Closed
paya-cz opened this issue Apr 20, 2022 · 6 comments
Closed

Types of QUploader instance properties are missing #13217

paya-cz opened this issue Apr 20, 2022 · 6 comments
Assignees
Labels
area/typescript bug/2-confirmed We have reproduce the problem and confirmed that this is a bug. flavour/quasar-cli-vite kind/bug 🐞 Qv2 🔝 Quasar v2 issues

Comments

@paya-cz
Copy link

paya-cz commented Apr 20, 2022

What happened?

The QUploader scoped param is not fully typescript-ready. I used the official example for QUploader custom header and although some properties are already properly typed, others from the example are missing, notably:

  • files
  • queuedFiles
  • uploadedFiles
  • isUploading
  • canAddFiles
  • canUpload
  • uploadSizeLabel
  • uploadProgressLabel

Screenshot 2022-04-20 at 16 39 17

What did you expect to happen?

The official custom header example (and others) should work as-is with TypeScript. All the properties available on scoped params should be properly typed.

Reproduction URL

https://github.com/paya-cz/quasar-scoped-param-typescript-issue

How to reproduce?

  1. Clone the repo.
  2. Look into src/components/ExampleComponent.vue using Visual Studio Code
  3. Observe TypeScript errors in the <template> section

Notes:

  • I didn't use Codepen / jsFiddle because they are not setup with TypeScript
  • The project is just standard npm init quasar with Quasar v2, TypeScript, CLI+Vite
  • There is just one single commit beyond npm init quasar that you can inspect to see the diff, but it is just a copy/paste of the QUploader example

Flavour

Quasar CLI with Vite (@quasar/cli | @quasar/app-vite)

Areas

TypeScript Support

Platforms/Browsers

No response

Quasar info output

No response

Relevant log output

No response

Additional context

No response

@paya-cz paya-cz added kind/bug 🐞 Qv2 🔝 Quasar v2 issues labels Apr 20, 2022
@github-actions github-actions bot added area/typescript bug/1-hard-to-reproduce A reproduction is available, but it's hard to reproduce, so it has a lower priority. bug/1-repro-available A reproduction is available and needs to be confirmed. flavour/quasar-cli-vite labels Apr 20, 2022
@yusufkandemir yusufkandemir changed the title Scoped slot prarams types for QUploader Types of QUploader instance properties are missing Apr 22, 2022
@yusufkandemir yusufkandemir added bug/2-confirmed We have reproduce the problem and confirmed that this is a bug. and removed bug/1-hard-to-reproduce A reproduction is available, but it's hard to reproduce, so it has a lower priority. bug/1-repro-available A reproduction is available and needs to be confirmed. labels Apr 22, 2022
@yusufkandemir
Copy link
Member

QInput is also missing instance property types #11510. I am linking it here because they are related.

@rstoenescu
Copy link
Member

Fix will be available in Quasar v2.8

@paperisque
Copy link

not fixed 2.8.2!

@yusufkandemir
Copy link
Member

@paperisque it would have been more helpful if you share what's not fixed. But, isUploading seems to be missing, so I added it in #14399. If something else is missing please let us know.

@yusufkandemir
Copy link
Member

yusufkandemir commented Sep 15, 2022

For anyone else that comes across this: Volar doesn't automatically pick up changes to node_modules. So, make sure to restart VS Code or just the Volar extension after installing/upgrading dependencies. With 2.8.2, you will still get an error regarding isUploading, but everything else will work properly. Starting from v2.8.3(not released yet), everything should work fine.

@paperisque
Copy link

sorry, yes I meant "isUploading". I am waiting 2.8.3
for now I'm using:


interface LocalUploader extends QUploader {
       isUploading: () => boolean;
}
...

const isUploading = (scope: QUploader) => {
      return (scope as LocalUploader).isUploading;
};


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/typescript bug/2-confirmed We have reproduce the problem and confirmed that this is a bug. flavour/quasar-cli-vite kind/bug 🐞 Qv2 🔝 Quasar v2 issues
Projects
None yet
Development

No branches or pull requests

4 participants