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

Support for @namespace marking a variable as a namespace #2055

Closed
jpolo opened this issue Sep 7, 2022 · 2 comments
Closed

Support for @namespace marking a variable as a namespace #2055

jpolo opened this issue Sep 7, 2022 · 2 comments
Labels
enhancement Improved functionality
Milestone

Comments

@jpolo
Copy link

jpolo commented Sep 7, 2022

Search terms

namespace, const, export, object

Question

A snippet is better than a long explanation :

const BaseNamespace = {
  ...
};

export const MyNamespace1 = {
  ...BaseNamespace,
};

export const MyNamespace2 = (function () {
  return. {
     ...BaseNamespace,
  };
}();

// I would like MyNamespace1 and MyNamespace2, to be equivalent to "export namespace MyNamespace1 {}";

How can I do that please ? (@namespace tag does not seem supported)

@jpolo jpolo added the question Question about functionality label Sep 7, 2022
@Gerrit0 Gerrit0 added the enhancement Improved functionality label Sep 8, 2022
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Sep 8, 2022

Not currently supported, variables are always conveyed as variables, functions, or enums.

@Gerrit0 Gerrit0 removed the question Question about functionality label Oct 16, 2022
@Gerrit0 Gerrit0 changed the title How to mark plain object as namespace ? Support for @namespace marking a variable as a namespace Oct 16, 2022
@asportnoy
Copy link

Hi @Gerrit0, this would be a very useful feature in our project. We have a bunch of objects that we want to be treated as namespaces and shown alongside the other actual namespaces. We've tried making them into actual namespaces but it gets really annoying and messy. Thanks!

@TypeStrong TypeStrong deleted a comment from Dayday10 Dec 18, 2022
@TypeStrong TypeStrong deleted a comment from Dayday10 Dec 18, 2022
@Gerrit0 Gerrit0 added this to the v0.24 milestone Mar 25, 2023
@Gerrit0 Gerrit0 mentioned this issue Mar 25, 2023
8 tasks
@Gerrit0 Gerrit0 closed this as completed in e370aab Apr 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improved functionality
Projects
None yet
Development

No branches or pull requests

3 participants