In JavaScript, functions are objects. In TypeScript, an interface can include a call signature and extra properties. This lets you create a callable object with fields.
You will build a function that returns a callable formatter with a label property.
interface ToText {
(n: number): string;
label: string;
}
Build a factory that returns a callable formatter with a label.