Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

152
Views
Override variable type from external library

I am using a third party library for my react application. There are some incorrect/outdated types.

Let's say the library has the following type declarations:

declare const Hello: (name: string) => void

export interface SomeInterface {
  property1: string
  property2: number
}

Let's assume both of these types are incorrect and I need to override them:

import 'external-lib'

declare module 'external-lib'{
  export interface SomeInterface {
    property1: boolean
    property2: boolean
  }

  export declare const Hello: (name: string, age: number) => void
}

So I redeclared the interface to have boolean properties and Hello function to accept the age parameter. (This is correct implementation of the library).

My problem is, that while interface Someinterface is overridden by me properly, the function Hello still uses the internal library type.

Is there a way to override function type declaration from external library?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!