How do you define an interface in TypeScript so that this type can be called continuously in the form of a function?

topic description

how to improve the declaration of Calculator.

sources of topics and their own ideas

online search for one of the TypeScript interview questions, but I don"t know how to end it.

related codes

interface Calculator {
    ...
}
 
let calcu: Calculator;
calcu(2).multiply(5).add(1)

what result do you expect? What is the error message actually seen?

ask for answers!

Jan.08,2022

interface Calculator {
  (num: number): Calculator;
  multiply(num: number): Calculator;
  add(num: number): Calculator;
}
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e5b18d-440de.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e5b18d-440de.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?