collection-decorator Decorator for adding to collection Typical usecase for this library: // HasFoo.tsimport { createCollectionDecorator } from 'collection-decorator'; interface ClassType { foo: number;} const { collection, decorator } = createCollectionDecorator<ClassType>(); export function fooSum() { let sum = 0; for (let value of collection.values()) { sum += value.foo } return sum;} export const HasFoo = decorator; // A.tsimport { HasFoo } from './HasFoo.ts'; @HasFooexport class A { static foo = 1;} // B.tsimport { HasFoo } from './HasFoo.ts'; @HasFoo//^^^^^ TS error because class B has not `foo` propertyexport class B {} // So fix it:@HasFooexport class B { static foo = 2;} // sum.tsimport { fooSum } from './HasFoo.ts'; fooSum() // 3