Category "typescript"

How to create tables in Postgres RDS using CDK?

I created a Postgres RDS database using the CDK. I read the documentation but didn't find a way to create tables through it. The language I'm using is TypeScrip

MUI5 theme aware sx prop and type checking

When using the sx prop and leveraging theme aware properties in TypeScript. Is type checking happening? How can I confirm this?

How can I unit test that a guard is applied on a controller in NestJS?

I've got a controller configured in NestJS and I want to check that the appropriate guards are set - does anyone have an example of how it could be done? This

NullInjectorError: No provider for StateObservable when using ng-packagr

I have an Angular 5 project that uses ngrx/store. The project consists of an application and a shared library that the application uses. Up until today, we had

Firebase Cloud functions: Typescript does not compile to JavaScript

Cloud function on my computer works with Javascript, but when I try it using TypeScript it does not compile to Javascript. It does not event create lib/index.js

Typescript: validate type after using type assertion

Is there a way to allow strict type checking on a value after having used a type assertion? For example, sometimes I need to construct a function type that has

Why doesn't the exports field of npm work in typescript?

Our library @ltonetwork/lto, is written in typescript. We use tsc to compile to javascript in the lib folder. The package contains several sub-packages, which a

Angular 12 Getting Id of Selected Product

I want to get the id value of the selected product in my Angular 12 project, I used NgModule for this, but unfortunately it does not work. What is the reason fo

How to correctly declare static refs in Composition API using Typescript?

I am using the Composition API (with <script setup lang='ts'>) to create a ref, used in my template: const searchRef = ref(null) onMounted(() => { sear

Array<Type> VS Type[] in Typescript

As far as I know a property's type can be defined in two ways when it's an Array. property_name: type where type can be either Array<string>, Array<

How do I pass data to Angular routed components?

In one of my Angular 2 routes's templates (FirstComponent) I have a button first.component.html <div class="button" click="routeWithData()">Pass data an

How to add custom arrow buttons to Alice-Carousel?

I am making a carousel component with alice-carousel (https://github.com/maxmarinich/react-alice-carousel/blob/master/README.md) but having trouble customising

How to extend anonymous type in Typescript

When chaining functionality in typescript with anonymous types for example like this: let array = [{ seed: 2 }, { seed: 3 }]; array .map(i => ({ see

The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type

1 interface Dimensions { 2 width: Number, 3 height: Number 4 } 5 6 function findArea(dimensions: Dimensions): Number { 7 retur

Missing "Go to Definition" from VSCode menu

I am working on Typescript/Javascript project using VSCODE. I use to hover mouse on the method and can see the function definition, cmd + click go the definitio

TypeORM column type dependant on database

I have simple entity @Entity() export class File { @PrimaryGeneratedColumn() id: number; @Column({type: "mediumblob"}) data: Buffer; } Which

Is there something like Lombok for TypeScript?

I'm looking for a way to reduce the boilerplate code of my NodeJS backend. In Lombok there is e.g. the possibility to inject constructors and getter/setter by a

What is the type of the webpack config function when it comes to TypeScript?

I cannot figure out the type of the webpack configuring function when the config is written in TypeScript. Currently I export an object whose type is Configurat

Typescript error (2345) when pushing element to array of elements(React js)

I'm pretty new to Typescript and I was trying to migrate a component I had on Reactjs to typescript. This component is supposed to receive a number from 0-10 as

Typedoc / Typescript Compiler throws error on an imported type

Summary I am attempting to build documentation for a TypeScript project using Typedoc. Unfortunately, Typedoc is yielding errors on an import statement I use in