Category "typescript"

Is it possible to validate that one of 2 parameters are present using class-validator?

Using class-validator along with NestJS I want to validate that a user provides either propertyA or a propertyB but they don't need to provide both. Currently,

How to get file contents from ipfs-http-client

I am using ipfs-http-client to read the contents of a file form infura, how do i use the "cat" funtionality to correctly get the data in a string/json format?

Eslint not working with the TypeScript syntax

I am trying to configure eslint for my REACT-TypeScript project. It was previously using tslint which is going to deprecate soon. I have gone through the web an

Anyone has experience using NightWatch with TypeScript?

I am using NightWatch for my e2e testing and want to move towards ES6 way of writing tests. I was able to do it with Babel and it worked fine but I want to use

Getting "Types of property 'accessibilityRole' are incompatible" error

Am getting typescript error when i extend th TextProps from react-native and pass it to the Text component created by styled-component Overload 1 of 2, '(prop

How do I import Pixi.js into a TypeScript project?

I'm new to Pixi.js but I have some past experience with TypeScript. I'm really struggling to import Pixi.js into my project. I got a small Pixi.js project runni

Nodejs + typescript how to use class models?

I am trying to learn how to use class models in nodejs and I will give you an example of what I am trying to achieve. For example I have user.ts model : expo

How to get the version from the package.json in Typescript?

I have found this Q&A. I have tried to get the version from the package.json using: import { version } from './package.json'; but it results in: packag

UseDapp - useCall - How to get return value from Solidity function?

I am still quite new with react and solidity and don't know where to start. I can update a String and want to print it out after I changed it. But I want the St

Background image in tailwindcss using dynamic url (React.js)

I have an image url fetched from an API and I want to display it as a background image. Is there any way I can implement this with tailwindcss or should I use s

Understanding type definition files in Node JS and TypeScript

I'm trying to understand how TypeScript projects resolve the import of modules installed via npm and their type definition files. As far as I know (and followi

AngularFireFunctionsModule from AngularFire Causes build errors

I've run into a bit of a snag when adding in the AngularFireFunctionsModule. For some reason, despite having successfully included AngularFireModule, AngularFir

Amplify ID for a @belongTo (to one) relationship not in the generated Typescript model

I have an error message from VSCode when using the "foreign key" property for storing an object. I've implemented the exact example from their documentation: ht

Cannot find module 'ts-node/register'

I want to use mocha to test my TypeScript/Angular2 project. I tried to use ts-node as described here: npm install -g ts-node but when running mocha --r

no-use-before-define typescript interfaces

I have 2 typescript interfaces that have a member that is of the type of the other interface (circular reference). My linter complains that I cannot use an inte

TypeScript TS7015: Element implicitly has an 'any' type because index expression is not of type 'number'

Im getting this compilation error in my Angular 2 app: TS7015: Element implicitly has an 'any' type because index expression is not of type 'number'. The piec

Where are the TypeScript type declarations for Sign in With Google (GSI) library?

I'm implementing "Sign in with Google" using the Google "GSI" library. My application uses Next.js and TypeScript, so I'm looking for: An npm package including

EAS build can't find aws-exports

I have an Expo project with AWS Amplify. I'm currently using EAS from Expo to deploy on mobile. Pretty often I run on this error: ❌ Metro encountered an

How to specify (optional) default props with TypeScript for stateless, functional React components?

I'm trying to create a stateless React component with optional props and defaultProps in Typescript (for a React Native project). This is trivial with vanilla J

How to test ng-web-apis/geolocation Observable in angular 8?

I'm trying to test a simple angular 8 service that gets user location using GeoLocation Service from Web APIs for Angular public enableGPS() { if (!this.lo