Questions tagged [typescript]
TypeScript is a typed superset of JavaScript that transpiles to plain JavaScript. It adds optional types to JavaScript. This tag is for questions specific to TypeScript. It is not used for general JavaScript questions.
typescript
53
questions
0
votes
0
answers
13
views
Unable to process the type of data structure returned by Supabase database
I am using Edge Functions written in Typescript fetch data from my table in Supabase database. Unable to understand how I am supposed to process the returned request. Coding in VS Code, I have no idea ...
0
votes
1
answer
28
views
How to extend methods from two classes in Object Oriented (Java)Typescript?
I currently have two classes with the same methods. I would like to have a class that inherits both of them, but in which methods are extended to perform the operations in both methods.
Here is an ...
0
votes
1
answer
21
views
How to store the new Date().getTime() Method using Zustand and update the timer without re-rendering the component every second?
The stopwatch works perfectly with useState Hook, but I need to store the time using global state management. I'm using Zustand in my application and I have had no problems so far storing and updating ...
0
votes
0
answers
12
views
@iFrame-resizer/react implementation error - Uncaught SyntaxError: Unexpected token 's', "scroll-to-top" is not valid JSON
I am using the latest version of iframe-resizer/react for automatically adjusting the height and width of the iframe.
Whenever I'm reacting the content, I'm getting a runtime error stating -
VM2860:1 ...
0
votes
0
answers
11
views
Getting the Editor Content based on the Cursor Position in a Vs Code Extension
1Are there some available ways for getting the entire function based on the current cursor position in the Vs code Editor ,
For Eg. Refer This Image here my cursor is at a line inside the function , ...
3
votes
1
answer
30
views
Typescript: Variable inside Express RequestHandler becomes possibly undefined despite being checked in an if statement [duplicate]
I am creating a way to dynamically create routes before the server fully starts (meaning I'm not creating a route via a request lol that would be crazy), and I stumbled upon this interesting quirk.
...
0
votes
0
answers
4
views
Is there any way i can move my character by mouse click in Cocos Creator
Im new to Cocos. Im trying to make a game where my character (the Twinkle) move to the Circle and get Score. I 've been searching thruough internet, but all i can do is make my charater teleport to ...
0
votes
1
answer
49
views
I get the error that there is nothing available
I get the following error in the project I developed using React and Typescript.
export 'useTableProps' (reexported as 'useTableProps') was not found in './useTable' (possible exports: useTable)
It ...
0
votes
0
answers
13
views
axios - I can't intercept the response
I'm trying to debug why my request isn't sent or is has wrong data, but I'm not able to check the response. I tried 'axios-debug-log' and it shows that request is sent, but no data about response code....
0
votes
1
answer
18
views
how to return generic object that extends class in typescript method?
I am trying to understand how to use generic in typescript.
I have the following code
foo<T extends X>(a:A,b:B): T{
// some logic
const c: C = doSomthing(a,b)
if (c!= null){
...
1
vote
1
answer
33
views
How do you type a function that returns a function with different parameters
I have an outer function that takes a string as an argument that then returns a function that uses that string. The return function takes either a string or an array of strings as an argument. If it ...
0
votes
0
answers
7
views
How do I make valibot properly check constructor/function arguments?
Consider the following, note that a negative argument is checked:
use strictures;
use Moops;
use Data::Dx;
library MyTypes declares NonNegativeInt {
# let's pretend
# <http://p3rl.org/...
0
votes
1
answer
15
views
TypeScript loses type constraint on keyof through multiple levels of generic types
This is stretching my knowledge of TypeScrip and with an answer, I'd also appreciate a suggestion for a better question title.
I have a problem that when I introduce multiple levels of generic types, ...
-1
votes
0
answers
14
views
Is there a way to import an cdn file that has no npm package to react/vite? [closed]
I would like to install a library for animation winds into react. I already installed leaflet which is not meant for React but this one has an npm package and I kinda did it but this windy.com lib is ...
0
votes
0
answers
14
views
Zod allow all keys matching regex
I'm using zod to validate some data, and I want to allow certain attributes, as well as any attribute with key matching /metadata_hash_.*/.
I cannot simply use a record because I am using mixed types, ...