Skip to content

Importing types into a type definition #17

@gfogle

Description

@gfogle

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
   }
})

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions