export interface ExtensibleFunction

{ new (func: (...args: P) => R): ((...args: P) => R) & this (...args: P): R; } export class ExtensibleFunction { constructor(f: (...args: P) => R) { return Object.setPrototypeOf(f, this.constructor.prototype); } }