```ts
export function flatten(items: readonly unknown[], depth: number = Infinity): unknown[] {
  if (depth < 0) throw new Error('Depth must be a non-negative integer or Infinity');
  
  const result: unknown[] = [];
  
  const flattenItem = (item: unknown, currentDepth: number): void => {
    if (Array.isArray(item) && currentDepth > 0) {
      item.forEach(subItem => flattenItem(subItem, currentDepth - 1));
    } else if (typeof item !== 'string') {
      result.push(item);
    }
  };
  
  items.forEach(item => flattenItem(item, depth));
  
  return result;
}
```