import type { Subtract } from '../math/subtract'; import type { UnknownArray } from '../unknown-array'; /** * Removes the first `N` elements from a tuple type. Does not return the removed types. * * @remarks Its worth noting `Pop`, `Push`, `Shift`, and `Unshift` are inspired by JS; however, the types are not 1:1 for design reasons. More information can be found in [README]( * @example * ``` * declare const tuple: ['d', 'a', 'v', 'i', 'd'] * type Tuple = ShiftN // ['v', 'i', 'd'] * ``` */ export type ShiftBy = T extends [ any, ...infer U ] ? N extends 0 ? T : ShiftBy> : T extends readonly [any, ...infer U] ? N extends 0 ? T : ShiftBy> : T;