import type { Constructable } from '../decorator/type/constructable.ts'; import { copyMetadataOfClasses, copyPropertiesOfClasses } from './utils.ts'; export function PickClass(classRef: Constructable, keys: K[]): Constructable> { abstract class TargetClass {} copyMetadataOfClasses(TargetClass.prototype, [classRef.prototype], (rules, key) => { if (keys.includes(key)) { return rules[key]; } }); copyPropertiesOfClasses(TargetClass as any, [classRef], key => { return keys.includes(key); }); return TargetClass as any; }