I am looking to create a function that takes a string and another function as arguments and returns a string:
interface Foo {
ConditionalColor(color: string, condition: (arg: any) => boolean): string;
}
I attempted to pass the ConditionalColor method into an implementing class using its constructor:
class FooImpl implements Foo {
ConditionalIconColor(color: string, condition: (arg: any) => boolean): string;
constructor(
ConditionalColor: (color:string, condition: (arg: any) => boolean) => string
) {
this.ConditionalIconColor = ConditionalColor
}
An error is popping up saying:
Function implementation is missing or not immediately following the declaration.
I'm unsure if it's a syntax issue or if the approach I'm taking is invalid. Any advice or ideas would be greatly appreciated!
Thank you!