Just dipping my toes into Typescript and I've encountered a bit of a challenge. I have a generic class that looks like this:
export class Sample {
a: number;
b: number;
doSomething(): any {
// return something
}
}
My issue arises when I try to create a default constant object. I'm getting stuck because I haven't defined the 'doSomething' method. Shouldn't 'defaultSample' automatically inherit the base functionality of 'doSomething', or am I overlooking something?
export const defaultSample: Sample {
a: 1,
b: 2
}