Category "typescript"

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

How to make some fields in object required

I need an interface for making some fields of other interface as required. For example: I have IUserInterface: interface IUser { name: string; role?: str

I get "Http failure response for (unknown url): 0 Unknown Error" instead of actual error message in Angular

I'm using Angular 4 HttpClient to send requests to external service. It is a very standard setup: this.httpClient.get(url).subscribe(response => { //do so

Vue3 Vuex Persist not saving data appropriately

I'm having a difficult time getting Vuex-Persist to work properly. Basically, not saving the data it should: Secondly, it disappears upon refresh. Which defeat

Angular: Google Material Icons not rendering

In Angular project Google material icons are working fine in chrome but not rendering in chrome incognito mode and firefox . In index.html below lines are used

Angular oriana weather city condition

We had written code for angular Oriana weather condition. in that there is a file / code for weather ts. when compiling getting error. Code is - Search TS impo

@types included in 'typeRoots' but only working if explicitly included

I'm attempting to use the grecaptcha types package (@types/grecaptcha), but even though in my tsconfig, its setup as: "typeRoots": [ "node_modules/@types" ],

Angular: Cannot Get /

I am trying to open, build and run someone else's Angular 4 project but I am not able to view the project when I run it my way. I don't see what is going wrong

TS2307: Cannot find module './images/logo.png'

I'm trying to import a local png image into my ts webpack project, and I get the following error. TS2307: Cannot find module './images/logo.png'. All my othe

How to install typescript + jest with create-react-app?

I want to install typescript and jest in a create-react-app-based app. I feel that since this is such a common installation choice there must be at least one "e

Angular/Jest - Test that the subject has thrown error after setter is called

I have a class that is responsible for setting the theme for my application. I'm trying to test that it throws an error if you give it a theme that it does not

How do I mock AWS S3 GetObjectCommand with jest using the v3 sdk?

Testing an s3 upload? The method to test is export class ProcessData { constructor() {} async process(): Promise<void> { const data = await s3Cl

How do I create a generic factory method that access static members of the class type it's creating

I'm using Typescript to write REST API endpoints as Functions over Firebase, and the methods all follow a similar pattern: check for a request.body, pull the ap

Including / importing .d.ts file exports

Simple question but couldn't find the answer: I have one file example.d.ts and one file example.ts, and I have a export type myType = {a: string} in the .d.ts.

How to import directives in a nestJS graphQLModule?

I need to generate typeScript types for mongoDB using graphql-code-generator and the typescript-mongodb plugin, but I don't understand how to import the directi

TypeScript, Vue, and MirageJS: Problems with TS compile errors

The problem: I am required to use Vue and MirageJS in a TypeScript web app, and in that web app, I get TS compile errors. The code: import { Server, Model } fro