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

179
Views
What method(s) does the ts Function interface declare

I recently started learning typescript & angular and then, I came across a short code like this interface transform extends Function{ (param:string):string; }

So I'm wondering, what kind of methods or return types the transform interface inherited from the Function interface? Again if I decide to have a method that returns transform like so: coordinate ():transform { }, what are the types expected of coordinate to return aside string?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

extends Function adds Function methods like call apply etc... and also the Function behavior, but it's redundant as you have a function definition inside the interface:

interface ExtendedFunction extends Function { }

declare const extendedFunction: ExtendedFunction;

extendedFunction.apply // Works
extendedFunction('bla', 1, true); // Works

interface Transform {
  (param: string): string;
}

declare const transform: Transform;

transform.apply // Works
transform('bla', 1, true) // Fails
transform('bla') // Works

TypeScript playground

about 4 years ago · Juan Pablo Isaza Report
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!