lch
lch

Reputation: 4941

How to declare a type for a default export in Node.js

export const func1: Function = (): boolean => true;

In the above line, func1 is Function. If I want to use a default export like below, How to declare the default export as Function??

export default (): boolean => true;

Upvotes: 1

Views: 120

Answers (1)

Cerberus
Cerberus

Reputation: 10247

You can simply un-inline the value:

const func1: Function = (): boolean => true;
export default func1;

Upvotes: 1

Related Questions