microsoft / microsoft/TypeScript

Consider adding a module level visibility modifier.

未關閉
#321 25 則留言 116 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

Needs Proposal Suggestion
主要語言
Go
星號
111k
分支
14.3k
平均合併
2 天 4 小時
30 天內合併 PR
132

描述

Currently to protect integrity of data one can only use classes with private or protected fields. Classes are harder to work with compared to object literals. Being able to specify that certain fields are invisible to outside modules would be a valuable addition to support programming in functional style in TypeScript.

So what I am suggesting is to be able to specify whether a field of an interface is exported from a module or not. This also means that the instance of such interface can only be created within the module it is declared.

The similar features can be found in:

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

首先檢視提議的模組層級可見性行為,以及所參照的 F# 簽章檔案和 Haskell 匯出清單。確定預期的介面語法、模組邊界,以及可以如何建立執行個體。當設計已獲得解決,且行為已充分規格化以供實作和測試時,即表示完成。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
typescript
領域
compilers
Issue 類型
功能
難度
5/5
預估耗時
一週以上
活躍度
停滯
描述清晰度
基本清楚
新手友好度
25/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。