I can't see (vs code/whisper) id of my property when I am using mixins.
My code is:
class User {
// @ts-ignore
id: number;
}
function Parent<TBase>(Base: TBase) {
return class ParentChild {
_object: TBase;
constructor (o: TBase) {
this._object = o;
}
dump(): void {
console.log(this._object);
}
};
}
class Test extends Parent(User) {
}
const o = {id: 2} as any;
const i = new Test(o);
// problem
console.log(i._object.id);
Problem is on console.log(i._object.id); line. I am getting an error: Property 'id' does not exist on type 'typeof User'.
What is wrong and how can I fix it?