isaacscript-common
Version:
Helper functions and features for IsaacScript mods.
10 lines • 393 B
TypeScript
import type { IRange } from "./IRange";
/**
* Helper type that validates that a tuple does not have a length greater than N.
*
* For example, `TupleWithMaxLength<string, 3>` will allow string tuples of size 0, 1, 2, or 3.
*/
export type TupleWithMaxLength<T, MaxLength extends number> = readonly T[] & {
length: IRange<0, MaxLength>;
};
//# sourceMappingURL=TupleWithMaxLength.d.ts.map