export access modifiers
<!-- π¨ STOP π¨ π¦π§π’π£ π¨ πΊπ»πΆπ· π¨ Half of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker. Please help us by doing the following steps before logging an issue: * Search: https://github.com/Microsoft/TypeScript/search?type=Issues * Read the FAQ, especially the "Common Feature Requests" section: https://github.com/Microsoft/TypeScript/wiki/FAQ --> ## Search Terms <!-- List of keywords you searched for before creating this issue. Write them down here so that others can find this suggestion more easily --> export access modifiers public protected private Related: #321 ## Suggestion <!-- A summary of what you'd like to see added or changed --> Allow adding `public`, `protected` and `private` access modifiers to export statements. This would limit where the data can be imported from. ### Access Modifiers #### `private` Other file in the same directory scope have access to the export. #### `protected` Other file in the same directory scope or a nested scope have access to the export. #### `public` (default) Current behavior - Can be access from anywhere. ## Use Cases Most useful for large projects - allows modules to limit where things they expose are used. ## Examples Given the following director structure: ```txt . βββ module β βββ submodule β β βββ index.ts β βββ file.ts β βββ index.ts βββ index.ts ``` ```ts // module/file.ts public export const foo = "hello"; protected export const bar = "
Posted by RebeccaStevens on Oct 29, 2020, 1:27 AM
Tags
Related issues
- [BUG] Cowork (Windows): all Plan9 shares fail with "Plan9 mount failed: invalid argument" after Windows update KB5124008 (26200.9445) β uninstalling the KB fixe
- Feature Request: Auto-resume CLI session when usage limit resets
- Please deobfuscate the Python
- [Bug] MLX version of Gemma 4 26B fails to load: "Model type gemma4 not supported" (macOS)
- # 233 Developers Discussed Abandoning the Office Add-in Platform β An Open Letter on the Office.js Stability, Security & Trust Crisis
- [FEATURE] Allow users to configure which shell the Bash tool uses or inherit initial shell
Raise real-world problems, find people facing the same issue, and discuss solutions.3,000 issues0 comments
reliability (Software)
[BUG] Cowork (Windows): all Plan9 shares fail with "Plan9 mount failed: invalid argument" after Windows update KB5124008 (26200.9445) β uninstalling the KB fixe
Feature Request: Auto-resume CLI session when usage limit resets
Please deobfuscate the Python
[Bug] MLX version of Gemma 4 26B fails to load: "Model type gemma4 not supported" (macOS)
# 233 Developers Discussed Abandoning the Office Add-in Platform β An Open Letter on the Office.js Stability, Security & Trust Crisis
[FEATURE] Allow users to configure which shell the Bash tool uses or inherit initial shell
Admin Materials and Surfaces
AMD Support
export access modifiers
<!-- π¨ STOP π¨ π¦π§π’π£ π¨ πΊπ»πΆπ· π¨ Half of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker. Please help us by doing the following steps before logging an issue: * Search: https://github.com/Microsoft/TypeScript/search?type=Issues * Read the FAQ, especially the "Common Feature Requests" section: https://github.com/Microsoft/TypeScript/wiki/FAQ --> ## Search Terms <!-- List of keywords you searched for before creating this issue. Write them down here so that others can find this suggestion more easily --> export access modifiers public protected private Related: #321 ## Suggestion <!-- A summary of what you'd like to see added or changed --> Allow adding `public`, `protected` and `private` access modifiers to export statements. This would limit where the data can be imported from. ### Access Modifiers #### `private` Other file in the same directory scope have access to the export. #### `protected` Other file in the same directory scope or a nested scope have access to the export. #### `public` (default) Current behavior - Can be access from anywhere. ## Use Cases Most useful for large projects - allows modules to limit where things they expose are used. ## Examples Given the following director structure: ```txt . βββ module β βββ submodule β β βββ index.ts β βββ file.ts β βββ index.ts βββ index.ts ``` ```ts // module/file.ts public export const foo = "hello"; protected export const bar = "
Comments (0)
No comments yet. Start the discussion.