tshm
tshm copied to clipboard
Namespaces
export declare namespace A {
type X = number;
export type Y = X;
}
export declare type B = A.Y;
Should output (assuming no -a):
namespace A :: {
Y :: number
}
B :: A.Y
This should also encompass supporting the following (not limited to "namespaces" per se):
type A = B.C<D>
type A = B.C D
^ Comes up with asterisk imports in docs-ts for example:
export declare const readFile: (path: string, encoding: string) => TE.TaskEither<Error, string>
N.B. Nested namespaces are supported but seem to have a different generated structure in TS playground:
export namespace A {
export type X = number
export namespace B {
export type Y = string
}
}
// becomes:
export declare namespace A {
type X = number;
namespace B {
type Y = string;
}
}