Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly include TSDoc comments of TypeScript overloads #6

Open
JulesBlm opened this issue Jul 1, 2021 · 0 comments
Open

Properly include TSDoc comments of TypeScript overloads #6

JulesBlm opened this issue Jul 1, 2021 · 0 comments

Comments

@JulesBlm
Copy link
Collaborator

JulesBlm commented Jul 1, 2021

All method overloads are typed and include a short TSDoc comment, these are not included correctly in the compiled bundle and therefore don't show up when hovering over them in VS Code.

It works ok when the method is directly set

  /**
   * Generates and return an array containing axis label objects. Each axis label object contains the following properties.
   * - `position`: an array of [x,y] coords
   * - `labelAngle`: the rotation of the axis label
   * - `label`: The axis label
   *
   * Takes an optional configuration object that specifies whether axis labels should be placed at the center of the axis, the default is `false`.
   */
  ternaryPlot.axisLabels = function ({ center = false } = {}) {

When there are multiple function overloads and the function is defined before and then set as a method later like this

  /**
 * Returns the current domains, which defaults to `[[0, 1], [0, 1], [0, 1]]`.
 */
function domainsFunc(): Domains;
/**
 * Sets the domains of the ternary plot to the specified domains in order `[A, B, C]` and checks if the supplied domains are reversed.
 * If this is the case, [`reverseVertices()`](#ternaryPlotReverseVertices) is called. The scale and translation offset associated with
 * the domains are [applied](#ternaryPlotTransformDoc) to correctly scale and translate the plot. At last it returns the ternaryPlot.
 */
function domainsFunc(domains: Domains): TernaryPlot;
function domainsFunc(domains?: Domains) {
 // function body
}

ternaryPlot.domains = domainsFunc;

the overloads are not included in the compiled file. Anyone with deeper knowledge of TypeScript and TSDoc is welcome to help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant