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

Typescript: missing model property #88

Open
alfonsodev opened this issue Sep 30, 2021 · 0 comments
Open

Typescript: missing model property #88

alfonsodev opened this issue Sep 30, 2021 · 0 comments

Comments

@alfonsodev
Copy link

alfonsodev commented Sep 30, 2021

Thanks for this useful package,
One feature request,
it would be nice to have model property typed, instead it falls into [propName: string]: any;

[propName: string]: any;

Example:

type BlockTreeObject = Readonly<{
  id: string;
  parent?: string;
  content?: string;
  children?: ReadonlySet<BlockTreeObject>;
}>;
  
  constructor(data: TreeModel.Model<BlockTreeObject>) {
    this.tree = new TreeModel();
    this.rootNode = this.tree.parse(data);
    this.rootNode.model.id = "this should fail as model is typed read only";
  }
  

Would it be easy to add ?
thanks you!

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

1 participant