If I have a class and method like below, I would like to know if there is a way I can easily declare an extra property on the f1
method?
export class Something {
f1(): string { ... }
}
When not in a class context I can do it this way:
function f1(): string {
// Simple example.
if ( ... ) {
f1.found = true;
} else {
f1.found = false;
}
}
namespace f1 {
export let found = false;
}
And this will not present with an error because of the namespace merging with the function definition.