```js
type Item<T> = {
  func: (prop: T) => void;
};
type WrappedItem<T> = {
  item: Item<T>;
  config: T;
};
type Collection<T = Record<string, unknown>> = {
  wrappedItems: WrappedItem<T>[];
};
type Foo = {
  str: string;
  num: number;
};
const foo: Foo = {
  str: 'abc',
  num: 123,
};
const myItem: Item<Foo> = {
  func: (foo: Foo) => {
    console.log(foo);
  },
};
const myCollection: Collection = {
  wrappedItems: [{ item: myItem, config: foo }], //ERROR: 'Item<Foo>' is not assignable to type 'Item<Record<string, unknown>>'
};

```

I would like to be able to specify the collection type such that the requirement is just that I have an array of valid wrappedItems. I don’t care what the generic type T is for each of those wrapped items. They could all be different. I just want to ensure they are all valid (so that the T for item matches the type of config).

The above implementation gets a type error because `Record<string, unknown>` is not compatible with `Foo`.

```
Type 'Item<Foo>' is not assignable to type 'Item<Record<string, unknown>>'.
  Type 'Record<string, unknown>' is missing the following properties from type 'Foo': str, num

```

if i switch the default type to `any` , it loses type safety and the config value does not need to match the item.

and setting it to `unknown` also doesn't work, as `unknown` is not assignable to `Foo`

while I can be explicit about the Foo generic type of the collection, it seems to run into issues if I have more than one type (and I’d rather not have to be explicit anyway)

```js
type Bar = {
  blah: string;
};
const bar: Bar = {
  str: 'abc',
  num: 123,
};
const myItem2: Item<Bar> = {
  func: (bar: Bar) => {
    console.log(bar);
  },
};
const myCollection: Collection<Foo | Bar> = {
  wrappedItems: [
    { item: myItem, config: foo },
    { item: myItem2, config: bar },
  ],
};

```

that has issues

```
Type 'Item<Foo>' is not assignable to type 'Item<Foo | Bar>'.

```

Is there a way to get this working? really I’d like Collection to not even be a generic. I don’t care about the types it has, just that they are valid.