import {expectType} from 'tsd'; import type {ArraySlice} from '../index'; expectType>([0, 1, 2, 3]); expectType>({} as [0, 1, 2] | [0, 1, 2, 3]); expectType>({} as [0, 1] | [3, 2]); expectType>([0, 1, 2, 3]); expectType>([1, 2, 3]); expectType>([1]); expectType>([1, 2]); expectType>([]); expectType>([2]); expectType>([0, 1, 2, 3]); expectType>([0, 1, 2, 3]); expectType>([0, 1, 2]); expectType>([0, 1, 2]); expectType>([]); expectType>([0]); expectType>([0]); expectType>([]); expectType>([]); expectType>([]); expectType>([...(null! as string[]), 1, 2]); expectType>([...(null! as string[]), 1, 2]); expectType>([null! as (string | 1 | 2), null! as (string | 1 | 2)]); expectType>([null! as (string | 1 | 2), null! as (string | 1 | 2), null! as (string | 1 | 2)]); expectType>([1, 2, 3, ...(null! as string[])]); expectType>([1, 2, 3, ...(null! as string[])]); expectType>([1, 2, 3]); expectType>([2, 3, null! as string, null! as string]); expectType>([1, 2, 3, ...(null! as string[]), 4, 5]); expectType>([1, 2, 3, ...(null! as string[]), 4, 5]); expectType>([2, 3, null! as (string | 4 | 5), null! as (string | 4 | 5)]); expectType>([1, 2, 3, ...(null! as string[]), 4, 5]); expectType>([2, 3, ...(null! as string[]), 4, 5]); expectType>([...(null! as string[]), 4, 5]); expectType>([...(null! as string[]), 4, 5]);