So, the issue is, each function is an isolated VM. What you declare in one function is not accessible from another.
For now, the easiest way to add definitions is to modify func.d.ts
and add your interfaces e.g adding ...
interface MySubType {
/** The name property of MySubType */
name: string,
/** The age property of MySubType */
age?: number,
/** The married property of MySubType */
married?: boolean
}
interface MyType {
/** Just a number */
id?: number,
/** The subTypeRequired property description */
subTypeRequired: MySubType,
/** The subTypeOptional property description */
subTypeOptional?: MySubType,
/** The text property description */
text?: string|boolean|number
}
you can use it in a function like this...
/** @type {MyType} */ let myType;