1

For example, I have a function:

/**
 * Function returns null
 */
const myFunction = () => {
  return null
}

And an object like this:

const internals = {
  myFunction: myFunction,
}

So I want to see this description: "Function returns null" at internals.myFunction in VScode.

But with notations like @inheritDoc, @link and such I just see them as is: {@inheritDoc myFunction}

I want to generate a solid d.ts with all necessary docs

Is it possible?

1 Answers1

0

So I had a glance at React sources and there is the way:

Let assume the function is in a file my-function.ts:

/**
 * Function returns null
 */
export const myFunction = () => {
  return null
}

then I reexport all my functions like this:

functions.ts:

import {myFunction} from './my-function'
import {myFunction2} from './my-function2'
// and other imports

export {
  myFunction,
  myFunction2,
}

And finally:

internals.ts

import * as functions from './functions'

const internals = {
  functions,
}

So by this way I finally can see "Function returns null" at

internals.functions.myFunction

So check my codesandbox for the example