import type {
TsRecursionTracker,
TsRecursionStart,
TsRecurse,
TsTooMuchRecursion,
} from '@augment-vir/common';
export type SomeType<Depth extends TsRecursionTracker = TsRecursionStart> =
Depth extends TsTooMuchRecursion
? 'Error: recursive object depth is too deep.'
: SomeType<TsRecurse<Depth>>;
This is used as the baseline type for TypeScript recursion tracking indexes. Use this to manually abort a type's recursion to prevent it from going too deep and throwing an error in TypeScript's language server.