diff --git a/src/types.ts b/src/types.ts index e1ad2cd..57041ba 100644 --- a/src/types.ts +++ b/src/types.ts @@ -190,3 +190,8 @@ type _Tuple = R['length'] exte * Creates a tuple of T with length N */ export type Tuple = _Tuple; + +/** + * Makes all members of the tuple T optional + */ +export type OptionalTuple = T extends [infer Head, ...infer Tail] ? [Head?, ...OptionalTuple] : T;