Category "typescript"

How to map with the help of Automapper (TypeScript) the entries of an array filled with different DTOs?

I'm using the TypeScript library "Automapper" in my NestJS backend to convert an answer of MongoDb/Mongoose to an DTO. That's how the answer looks like: { "

React - Property 'data' does not exist on type 'IntrinsicAttributes & InfoGridProps'

I have a demo here I'm just trying to create a simple app where I pass data to a component and then display that data So I have the data which is an array of ob

How do I delete all unused imports in the active file with one command in VS Code (typescript)?

Previously, I used to be able to do CMD+SHIFT+p > Organize imports and this would both sort and delete unused imports. This functionality seems to have broke

Supplied parameters do not match any signature of call target - angular 4

I'm using ngx-translate in service. Exactly in this function. @Injectable() export class StartService { constructor(private translateService: Trans

Svelte - routing , When I try entering any url I only get "No webpage was found" error

Using "svelte-routing" because I need to load a single page from lots of different urls , with the different urls serving as parameters. For example if a client

React Typescript: Type issue when passing multiple refs to child component

I have a main component that passes down multiple refs to Panels component like so import { useRef } from 'react'; import Panels from './Panels'; export const

Storybook-tailwind. How should I add tailwind to storybook

I want to add tailwind to storybook. So that Stories will render just like it will render on web. I used create-react-app project-name --template typescript to

How to use mocks in tests with Adonis 5 (adonisjs/fold package)?

I have an API built with Adonis 5 (core version 5.4.0). The tests are made with Adonis' own runner, japa (version 3.1.1). As per the Adonis documentation, I bui

Control of flow in Typescript

I am trying to call a function which will retrieve data from a storage object. I need to do this and assign the returned storage value before the next function

Test Suite Failed to run

Error thrown: "Exceeded timeout of 5000 ms for a hook. Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test." 24 | &

how to run map function (async, fetch, promise) every second one after another and not parallel?

I have a map function here, which is supposed to fetch data from an online source. The Problem is, that the API does only allow to fetch once per second. so I t

typescript generics class, method parameter and method return type

I have this function function getCollection<T>(collectionType: T): Collection<T> { return new Collection<T>() } and in Collection class I h

How to create a type for file type `Record<string, File>` in zod

I use input type="file" and instead of saving data in FileData I use just plain object and created a type for it: Record<string, File>. It works well, but

I am trying to create a react app with typescript but I keep getting failed to compile on start

I am trying to create a react app with --template typescript and I keep getting this error: ERROR in Plugin "react" was conflicted between "package.json »

TypeError: Cannot read properties of undefined (reading 'EmailAuthProvider')

Attempting to implement FirebaseUI authorization in a Next.js application following this example https://github.com/easywebsify/next-login-firebase. Getting the

Uploading Attachment on Azure DevOps using Create Attachment WIT

I am working on this task in which I am supposed to take a file from the user, upload it on Azure DevOps, create Release pipeline, and then triggerthe release w

Typescript: object with classes as a values

Let's say I want to build a proxy class from this question's accepted answer. So I need to prepare some object which contains all the classes as values: class C

How can I get React.js TypeScript to accept 'parentElement' on 'event.target' with a onKeyDown event?

I have a special accessible element built with React TypeScript and I am trying to define keys to navigate it and to be able to focus within the table element.

Error Typescript - Uncaught ReferenceError: exports is not defined

I am facing this issue. I created this simple app.ts to learn about promises in Typescript: import {Promise} from 'es6-promise' (() => { console.log('inicio

Nestjs application can not run after bundled with webpack

I have a nestjs app and i use webpack to bundled this entire project to a main.js file. My webpack configure file just flowed by this repo ,but when i run npm r