Last change
on this file since 76712b2 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
526 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | declare function flatten <T> (array: flatten.NestedArray<T>): T[];
|
---|
| 2 |
|
---|
| 3 | declare namespace flatten {
|
---|
| 4 | export interface NestedArray <T> extends ReadonlyArray<T | NestedArray<T>> {}
|
---|
| 5 |
|
---|
| 6 | export interface NestedList <T> {
|
---|
| 7 | [index: number]: T | NestedList<T>;
|
---|
| 8 | length: number;
|
---|
| 9 | }
|
---|
| 10 |
|
---|
| 11 | export function from <T> (array: NestedList<T>): T[];
|
---|
| 12 | export function depth <T> (array: NestedArray<T>, depth: number): NestedArray<T>;
|
---|
| 13 | export function depthFrom <T> (array: NestedList<T>, depth: number): NestedArray<T>;
|
---|
| 14 | }
|
---|
| 15 |
|
---|
| 16 | export = flatten;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.