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

Importing types into a type definition #17

Open
gfogle opened this issue Jul 23, 2017 · 0 comments
Open

Importing types into a type definition #17

gfogle opened this issue Jul 23, 2017 · 0 comments

Comments

@gfogle
Copy link
Owner

gfogle commented Jul 23, 2017

Suppose i had this:

const Todo = Typesafe.defineClass({
  properties: {
    done: Boolean,
    author: {
      properties: {
        name: {
          properties: {
            first: String,
            last: String
          }
        },
        age: Number
      },
      functions: {
        getFullName: function() {
          return this.name.first + ' ' + this.name.last;
        }
      }
    }
  },
  functions: {
    isDone: function() {
      return this.done === true;
    }
  }
});
let instance = new Todo();

I should be able to do something like this:

const Notes = Typesafe.defineClass({
   properties: {
      todo: Todo,
      notes: Array
   }
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant