UNPKG

525 BTypeScriptView Raw
1import { List } from './List';
2/**
3 * Add an element `A` at the end of `L`.
4 * @param L to append to
5 * @param A to be added to
6 * @returns [[List]]
7 * @example
8 * ```ts
9 * import {L} from 'ts-toolbelt'
10 *
11 * type test0 = L.Append<[1, 2, 3], 4> // [1, 2, 3, 4]
12 * type test1 = L.Append<[], 'a'> // ['a']
13 * type test2 = L.Append<readonly ['a', 'b'], 'c'> // ['a', 'b', 'c']
14 * type test3 = L.Append<[1, 2], [3, 4]> // [1, 2, [3, 4]]
15 * ```
16 */
17export declare type Append<L extends List, A extends any> = [
18 ...L,
19 A
20];