forked from madonoharu/tsify
-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
The proposal is to add a namespace_path attribute that would accept a syn::Path. The generated type would then be wrapped in the specified namespace (with :: indicating levels of the namespace).
For example:
#[derive(Tsify)]
#[tsify(namespace_path = My::Path)]
struct Foo { a: i32 }would produce
declare namespace My {
declare namespace Path {
interface Foo { a: number }
}
}There should be a corresponding option to use a path as a namespace for a declared type. For example
#[declare]
#[tsify(path_as_namespace)]
type Foo = my::path::X;would produce
export type Foo = my.path.X;This would give a way to handle name collisions, addressing #16
Not sure what the best name for the attrs should be. It also doesn't follow Typescripts convention of using CamelCase to name namespaces, but a compromise needs to be made somewhere...
Metadata
Metadata
Assignees
Labels
No labels