Category "typescript"

Create MediaStream from Hls.js

I have a HLS stream that I am attaching to an audio element using the Hls.js library. I want to then take that stream and feed it into Wave.js. I want to use th

Function overloading in index.d.ts file

Solved: restarting VS code helped :blush: I have a module written in es6 (not typescript) and I want to add ts declaration file to it. Module export only one f

Pagination and filtering in TypeScript and TypeORM

How can i create an function to pagination and filtering with typeorm? I use queryBuilder() but i don't how to create an function to divide the results into pag

Angular 10: Import using module alias not resolved / Path Mapping not recognised in VSCode

So I updated a project that was in Angular 8.2 (a project template) to version 10 and followed the instructions from https://update.angular.io/ and everything w

Angular serve library

In latest versions of Angular cli, we can use ng g library lib-name command to create library. As mentioned in the Angular docs : ng serve <project> An

'X Is not a function' in CommonJS

I've got the following code I transformed from a Trypescript, ESM-syntax based file to a Javascript, CJS-syntax file. const apiClientFactory = require("@vue-sto

How can I fix scoring for multiple-answer questions in my Angular quiz app?

For the multiple-answer questions, ALL of the correct answers should be selected in order for the score to increase, not just one correct answer. If one correct

How to create a string array in the useState hook and update that same array in TypeScript?

I have a React project where I am trying to create a multi select function where you can select and deselect multiple avatars at once. So far I have this: expor

React(Typescript) onchange event type

In My React Component I have Radio input <input type="radio" onChange={changeData}> and function changeData(e: any) {} How can I speci

TypeScript index signature with promises

What is the correct index signature for the following class? class MyClass { [index: string]: Promise<void> | Promise<MyType>; // not working p

Jest did not exit one second after the test run has completed using express

I'm using JEST for unit testing my express routes. While running the yarn test all my test case are getting passed, but I'm getting an error Jest did not exi

Imports not importing using Jest and Typescript

I am using Jest, Enzyme and Typescript, but for some reason certain imports are not working... they are undefined. For example, I have import ReactMarkdown from

How to toggle boolean state in React and TypeScript?

I am new to React and TypeScript. I want to toggle a boolean state (true/false) with a handler function. I've read other posts about how to do this in ES6 but

Why typescript keep giving me No inputs were found in config file error?

Why typescript keep giving me No inputs were found in config file error? When I use tsconfig.json in vscode, but when I try to build it, it gives me a 'No input

Get value from radio button Angular Material Dialog

I have Angular Material dialog , where I updating table clicking change status. I need to get value from radio button in my dialog Here is full working exampl

CQRS and cross cutting concerns like ABAC for authorization reasons

Let's assume a monolithic web service. The architectural design is based on the DDD and divides the domain into sub-domains. These are structured according to t

Getting error exponentiation operator for BigInt

When i am trying to do (BigInt(Generator) ** this.privateKey) % BigInt(Prime) i am getting error: Exponentiation cannot be performed on 'bigint' values unless

Absolute path not working in Vite project React TS

I'm struggling to get absolute path to work in a Vite react-ts project. Here's how I created the project npm init @vitejs/app npx: installed 6 in 1.883s √

gtag function Typescript definition

I use original Javascript function function gtag(){dataLayer.push(arguments);} then got error: error TS2554: Expected 0 arguments, but got 3. when used like

TypeScript and React - children type?

I have a very simple functional component as follows: import * as React from 'react'; export interface AuxProps { children: React.ReactNode } const a