type Constructor = new (...args: any[]) => T type Wrapper = { new (): T & any; prototype: T } type DecoratorOptions = { name: string } type ApiSchemaDecorator = ( options: DecoratorOptions ) => (constructor: T) => Wrapper export const ApiSchema: ApiSchemaDecorator = ({ name }) => { return constructor => { const wrapper = class extends constructor {} Object.defineProperty(wrapper, 'name', { value: name, writable: false, }) return wrapper } }