If you are looking to create a function with additional properties, you can utilize this specific pattern.
()
signifies that the object implementing this interface will act as a callable function without any required parameters.
effect
indicates that there is an added property named effect.
A sample code snippet from the documentation:
type DescribableFunction = {
description: string;
(someArg: number): boolean;
};
function doSomething(fn: DescribableFunction) {
console.log(fn.description + " returned " + fn(6));
}
Explore more about call signatures