typedoc icon indicating copy to clipboard operation
typedoc copied to clipboard

How to mark plain object as namespace ?

Open jpolo opened this issue 3 years ago • 1 comments

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 avatar Sep 07 '22 17:09 jpolo

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

Gerrit0 avatar Sep 08 '22 03:09 Gerrit0

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!

asportnoy avatar Dec 18 '22 21:12 asportnoy