Category "typescript"

Rollup & Typescript type declarations with absolute imports

I'm making React component library. Project structure is something like: src/ components/ utils/ hooks/ Now I'm trying to generate types (.d.ts.) file

Argument of type (key: string, id: string, pagination: number) => Promise<void> is not assignable to parameter of type Boolean

Not sure what is the matter here, but I am trying to follow this documentation: https://swr.vercel.app/ with this setup of my own: import React, { useEffect } f

How can I pass routes in Next.js?

I'm trying to pass routes to my Next.js app but it's returning an error, I've looked everywhere but I can't find the answer. _App.tsx import Routes from './

How to debug TypeScript in Visual Studio Code

Installing ts-node and typescript locally √  Add a launch.json file √ { "name": "Current TS Tests File", "type": "node", "request":

Typescript Build Fails When Adding Angular into Monorepo (Clashing of Jasmine and Jest Types)

Gist I have a Monorepo with solely Typescript packages. When I run tsc --build all packages will be compiled to Javascript. This worked fine until I added a pa

FormGroup is deprecated

I've already seen some related question & answers, but unfortunately those didn't help me much. ngOnInit(): void { this.form = this.fb.group({ new

Injected nestjs service in to CQRS is undefined

I have a service to import in CQRS but in runTime, I got an error for the service method the service declared in constroctor and using it in excute methode @Com

ESLint error "'svelte' is not defined" when using svelte.JSX.MouseEventHandler

In a SvelteKit project, I have included the a svelte type. My problem is that my linting (ESLint) throws an error saying that 'svelte' is not defined. My code i

How to update atoms (state) in Recoil.js outside components ? (React)

I'm new to Recoil.js, I have the following atom and selector for the signed-in user in the app: const signedInUserAtom = atom<SignedInUser | null>({ k

cannot initiate expo bare workflow with typescript

I`m trying to initiate expo bare workflow with typescirpt. But after I type "expo init [project name]" in command window, I cannot find minimal(typescirpt) opti

Prevent multiple identical http calls from Angular service

I've a service to get the data from an API in my angular app. The service is used in different components - and the same http request is send multiple times. To

Omit undefined values when creating object literal

Say the interface has an optional property: interface Foo { foo: string; bar: string|undefined; } We have a value that might be undefined: makeFoo(bar: str

React Three Fiber OBJLoader conflicts witth @types/three

I am following the official React Three Fiber Docs here. I am trying to load .obj files into my scene, using this article: react-three-fiber docs: loading obj m

How to get rid of the warning .ts file is part of the TypeScript compilation but it's unused

I Just updated angular to latest 9.0.0-next.4. I am not using routing but suddenly after updating I keep seeing this warning. How Do I remove this warning W

What To Do Failed Compiling?

I am getting an error while running the command npm start. The file is created in PancakeSwap Frontend and I've been trying to fix this for a while, thanks for

Phaser 3: Update Sprite object from canvas texture

I have created 3 canvas textures: this.textures1 = this.textures.createCanvas('canvastextures1', 450, 170) this.textures2 = this.textures.createCanvas('

Get Only Values from a Map to an array

I want to get values of a map and store inside a string array in typescript. myMap= [0:'Mohit',1:'Balesh',2:'Jatin']; arr[]; Expected Result arr['Mohit','Bal

jest unit test and retry-axios node.js

I have been trying to use the retry-axios library and assert the number of times in a "get" has been called without any luck. Here is my setup: axios.config.ts

angular 7: Server Side Pagination Using Angular Material

I am using Angular 7 and Angular Material as server-side pagination. I got problem with this matter. The problem is the pagination become like this. I want t

How does Typescript references interact with builds and Docker?

I have a projectA that references a common package that my other Nodejs services will reference as well. The issue is how do I pack this up in a Docker file? Id