main
Last change
on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
525 bytes
|
Line | |
---|
1 | import { 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 | */
|
---|
17 | export declare type Append<L extends List, A extends any> = [
|
---|
18 | ...L,
|
---|
19 | A
|
---|
20 | ];
|
---|
Note:
See
TracBrowser
for help on using the repository browser.