Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class MyTableClass {
- // list the propeties here, ONLY WRITTEN ONCE
- constructor(
- readonly id?: string,
- readonly title?: string,
- readonly isDeleted?: boolean,
- ) {}
- }
- // This is the pure interface version, to be used/exported
- interface IMyTable extends MyTableClass { };
- type MyTablePropsArray = Array<keyof IMyTable>;
- console.log(Object.keys(new MyTableClass())); // prints out ["id", "title", "isDeleted"]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement