question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Missing TypeScript types?

See original GitHub issue

Is your feature request related to a problem? Please describe.

// https://next.quasar.dev/vue-components/infinite-scroll#usage
onLoad (index, done) {
  ..
}

https://next.quasar.dev/vue-components/select#filtering-and-autocomplete
filterFn (val, update) {
 ..
}

Describe the solution you’d like

// https://next.quasar.dev/vue-components/infinite-scroll#usage
onLoad (index : number, done: SomeInterface) {
  ..
}

// https://next.quasar.dev/vue-components/select#filtering-and-autocomplete
filterFn (val: string, update: SomeInterface, abort: SomeInterface) {
  ..
}

Don’t think these are good examples either, I found out the QSelect interface seems to offer some typing, but abort() wasn’t included?

Describe alternatives you’ve considered

// eslint-disable-next-line @typescript-eslint/ban-types
filterFn (val: string, update: Function, abort: Function) {
  ..
}

Additional context I’m kinda new to Typescript, sorry if this should be fixed in a different way. 😃

Many thanks!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

5reactions
IlCallocommented, Apr 27, 2021

We plan to setup a system to make it easier for the community to contribute with types when missing, but it will probably be in June, after testing AE support for Qv2/Vue3

Closing has the seached types has been found

1reaction
GoodLuccommented, Nov 14, 2022

I couldn’t find the type for the ‘update’ function parameter on quasar’s filterFn anywhere else, but in case someone else is looking to type this, it can be done like this:

const filterFn = (val: string, update: (fn: () => void) => void) => { update((): void => { const needle = val.toLowerCase(); timezoneOptions.value = timezones.filter( (v) => v.toLowerCase().indexOf(needle) > -1 ); }); };

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Declare Missing Types for External Libraries -- newline
If DefinitelyTyped doesn't have type declarations for a library you can declare types yourself.
Read more >
How to include missing type definition files in typescript ...
I would suggest switching to types from typeRoots and using an include pattern rather than files . { "compilerOptions": { "lib": ["dom" ...
Read more >
Missing typescript types in the generated type definition file (d ...
The missing types in the generated type declaration file (d.ts) are causing typing errors when I try to use them in other projects...
Read more >
Install Missing TypeScript Typings With TypeSync
TypeSync is a tool that allows you to install missing TypeScript typings. When you execute the command, it will automatically add a typing ......
Read more >
How to add missing types to a library. : r/typescript - Reddit
I'm having trouble adding types to a library. The specific library itself is Shippo's node client. It comes with type definitions however ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found