ts-type-forge
    Preparing search index...

    Type Alias Concat<A, B>

    Concat: Readonly<[...A, ...B]>

    Concatenates two readonly tuples A and B. General (non-tuple) arrays are also supported; concatenating two general arrays yields a general readonly array of the union of the element types.

    Type Parameters

    • A extends readonly unknown[]

      The first readonly tuple.

    • B extends readonly unknown[]

      The second readonly tuple.

    A new readonly tuple type representing the concatenation of A and B.

    type C1 = Tuple.Concat<[1, 2], [3, 4]>; // readonly [1, 2, 3, 4]
    type C2 = Tuple.Concat<[], [1]>; // readonly [1]
    type C3 = Tuple.Concat<[1], []>; // readonly [1]
    type C4 = Tuple.Concat<readonly number[], readonly string[]>; // readonly (number | string)[]
    type C5 = Tuple.Concat<[1], readonly number[]>; // readonly [1, ...number[]]