Category "typescript"

Argument of type 'HTMLElement | null' is not assignable to parameter of type 'Element'. Type 'null' is not assignable to type 'Element'.ts(2345)

I have index.html <body> <div id="portal"></div> <div id="root"></div> </body> and want to use the component below

How to define types for Cypress task return type?

My objective is to define types for my cypress task, written in typescript. I currently have this when I consume the custom task: cy.task('customTask').then(v =

Why is Graphql data object only available outside the call function

I am new to graphql and react so I can't figure out why the loaded data return object is only available outside the mutation post which produced the data. Could

How to hide background contents of window.open while printing in Angular

I have running Angular 12 application and I am integrating the behavior to print report. I am able to achieve the print on button click which opens a new window

Hiding a mat data table column in angular 4

<ng-container matColumnDef="jan"> <mat-header-cell [hidden]="true" *matHeaderCellDef style="font-size: 65%" class="white-text" fxHide [fxShow.gt-md]=

How to strongly type jest mocks

I would like to strongly type my jest mocks. To a certain extent, I can make it work but when a class has private properties I'm stuck. An additional question,

Unicode characters in Angular binding

There are some answers on how to display Unicode character codes in Angular bindings, but I'm trying to display one dynamically and everything seems to fail. I

How use UseRef to show popover just above the pressed element in React Native?

I am using the Flyerchat library for the chat application. <Popover isVisible={open} onRequestClose={() => setOpen(false)} from={t

ANSI escape codes not moving cursor horizontally

I am trying to make a text editor in the terminal with node and typescript but the ansi escape codes aren't moving the cursor horizontally. THe cursor moves ver

How use UseRef to show popover just above the pressed element in React Native?

I am using the Flyerchat library for the chat application. <Popover isVisible={open} onRequestClose={() => setOpen(false)} from={t

React Native TypeScript Error: Module '"react-native"' has no exported member 'Appearance'

I've recently implemented dark mode into my app, but having an issue with an error when building the npm package with npm build. The code works, but is there a

Beautify Xml with Angular

I'm trying to beautify a xml throught the package avaible in npm repositories (vkbeautify and xml-beautifier) to display into the html but is not working (I tri

nest.js build throwing a lot of errors

I have this Nest.js app running and setup for a while and, out of a sudden, it started reporting this when I run npm run build. node_modules/@nestjs/config/dist

Dynamically update doughnut chart with NG2Charts

I am working on a project where I am making a calculator of macronutrients. I have a form to enter the values and it displays a doughnut chart, with its initial

Type '{ author: Author; }' is not assignable to type 'IntrinsicAttributes & Author'

I am totally new to TS and react and I ran into a problem. I tried searching many places and can't seem to fix it. The whole error message is: Type '{ author: A

js/ts translate internal commands

I am currently trying to translate some text-based console-log processing into JSON format. Console.log commands: give ENTITY.name = "entitytest"; give entity.u

Guard factory in nestJS application

I'm trying to create a guard factory in order to create a guard based on given params and ran into an issue. I built the following factory @Injectable() export

How to create a UUID template literal type in Typescript?

Did anyone suceed in writing a type for UUID in Typescript using the new template literal types? e.g.: const id:UUID = "f172b0f1-ea0a-4116-a12c-fc339cb451b6" T

ESlint complaining about useless constructor

I'm getting ESlint error in this file Bar.ts: class Bar { constructor(public foo: string) {} hello(): string { return this.foo; } } export default B

How do I use the node-tree-sitter module from typescript?

From looking at pull requests & issues I see there are typescript definitions (possibly currently out of date) in the node-tree-sitter module; how do I acce