microsoft / microsoft/TypeScript

@template is lost when importing method

Open
#36,477 0 comments 1 reaction 1 assignee View on GitHub

@minestarks is already working on this.

Since Feb 26, 2020.

Needs Investigation
Dominant language
Go
Stars
111k
Forks
14.3k
Avg merge
2d 4h
Merged PRs (30d)
132

Description

TypeScript Version: 3.6.3

Search Terms:
template

Code

const $indicatrix = require('./indicatrix')

/**
 * Will print the loading text and refresh the CLI line to show the ellipsis while the promise is loading.
 * @param {string} text The text to display in the CLI.
 * @param {!Promise<T>|function(...*): !Promise<T>} promise The promise or an async function that returns the promise.
 * @return {Promise<T>}
 * @template T
 */
function indicatrix(text, promise, options) {
  return $indicatrix(text, promise, options)
}

module.exports = indicatrix

import this from another file

/**
 * @type {_indicatrix.indicatrix}
 */
async function $indicatrix(text, promise, options = {}) {
  // implementation ...
}

/**
 * @suppress {nonStandardJsDocs}
 * @typedef {import('..')} _indicatrix.indicatrix
 */

Expected behavior:

supposed to be like in the original location

image

Actual behavior:

the template bit is lost

image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.