Microsoft/TypeScript

Find all references for ambient module

開放

#9,077 建立於 2016年6月10日

 (1 則留言) (0 個反應) (0 位負責人)TypeScript (13,395 個分叉)batch import
Domain: APIHelp WantedSuggestion

倉庫指標

星標
 (108,860 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

// declarations.d.ts
declare module "x" {
    export const x: number;
}

// index.ts
import {x} from "x";

Goto-declaration for "x" in index.ts works, but find-all-references for "x" in declarations.d.ts finds only itself.

In this case one can simply look through each of export in the module's body and find all of their references; but for shorthand ambient modules (declare module "x";) that won't work, as there is no module body.

貢獻者指南