5

Per this answer I know how to type an overloaded error function:

type IOverload = {
    (param:number):number[];
    (param:object):object[];
}

const overloadedArrowFunc:IOverload = (param:any) => {
    return [param,param];
}

let val = overloadedArrowFunc(4);

But how do I document it using TSDoc? I've tried adding documentation blocks above the individual typings in the type, but no dice.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.