I’d like to declare some kind of local type inside a class, just like this :
class A {
type LocalType = ...
// Class body
}
to make it clear that LocalType belongs to class A and is to be used only in relation with it, with A.LocalType
. I know there’s… well, Typescript’s namespace
‘s, but I find this solution somewhat messy : it makes the intention less clear, and I don’t like the idea of a namespace and a class having the same name :
class A {
// Class body
}
namespace A {
export type LocalType = ...
}
Is there another way to achieve (maybe even roughly) the same behavior ?
Thanks !