How to define Placeholder's type in Ramda in typescript?

Viewed 364
const greet = R.replace('{name}', R.__, 'Hello, {name}!');
greet('Alice'); //=> 'Hello, Alice!'

The above code is copy from Ramda's documment, when a pate it in typescript environment, typescript complains:

Argument of type 'Placeholder' is not assignable to parameter of type 'string | ((match: string, ...args: readonly any[]) => string)'.   Type 'Placeholder' is not assignable to type '(match: string, ...args: readonly any[]) => string'.     Type 'Placeholder' provides no match for the signature '(match: string, ...args: readonly any[]): string'.

How to solve this complaint?

0 Answers
Related