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

Namespace support #74

Closed
alexey-pelykh opened this issue Mar 9, 2017 · 4 comments
Closed

Namespace support #74

alexey-pelykh opened this issue Mar 9, 2017 · 4 comments

Comments

@alexey-pelykh
Copy link
Contributor

As it turns out, following won't work:

export interface TestModel extends Model {
//...
  modelsObjectIndirectNS: TestSubModelContainerNamespace.TestSubModelContainer;
  modelsObjectIndirectNS2: TestSubModelContainerNamespace.TestSubModelContainer2;
  modelsObjectIndirectNS_Alias: TestSubModelContainerNamespace_TestSubModelContainer;
  modelsObjectIndirectNS2_Alias: TestSubModelContainerNamespace_TestSubModelContainer2;
//...
}

export namespace TestSubModelContainerNamespace {
  export interface TestSubModelContainer {
    [key: string]: TestSubModel2;
  }

  export interface TestSubModelContainer2 {
    [key: string]: TestSubModel2;
  }
}
export type TestSubModelContainerNamespace_TestSubModelContainer = TestSubModelContainerNamespace.TestSubModelContainer;
export type TestSubModelContainerNamespace_TestSubModelContainer2 = TestSubModelContainerNamespace.TestSubModelContainer2;

Hopefully, I'll be able to address that with PR, yet if anyone willing to give a hint, that would be great

@alexey-pelykh
Copy link
Contributor Author

alexey-pelykh commented Mar 9, 2017

A note to myself: type-alias does work, yet [key: string]: TestSubModel2; does not. At the same time, type-alias to a type in a namespace doesn't work either, I guess.

@alexey-pelykh
Copy link
Contributor Author

Hope this will is going to be useful not only to me.

@alexey-pelykh
Copy link
Contributor Author

A related PR - #77

@lukeautry
Copy link
Owner

Merged #75

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants