UNPKG

1.1 kBTypeScriptView Raw
1type NestedReadonlyNumberRecordOrArray<T> = Readonly<Record<number, T | readonly unknown[]>>;
2
3declare function FlattenIntoArray<T>(
4 target: Record<number, T>,
5 source: Readonly<Record<number, T | readonly unknown[]>>,
6 sourceLen: number,
7 start: number,
8 depth: number,
9): number;
10declare function FlattenIntoArray<T, S, THIS_ARG, AS extends NestedReadonlyNumberRecordOrArray<S>>(
11 target: Record<number, T>,
12 source: AS,
13 sourceLen: number,
14 start: number,
15 depth: number,
16 mapperFunction: (
17 this: THIS_ARG,
18 element: S | readonly unknown[],
19 sourceIndex: number,
20 source: AS,
21 ) => T | ReadonlyArray<S | readonly unknown[]>,
22 thisArg: THIS_ARG,
23): number;
24declare function FlattenIntoArray<T, S, THIS_ARG, AS extends NestedReadonlyNumberRecordOrArray<S>, U>(
25 target: Record<number, T>,
26 source: AS,
27 sourceLen: number,
28 start: number,
29 depth: number,
30 mapperFunction: (this: THIS_ARG, element: S | U, sourceIndex: number, source: AS) => T | U,
31 thisArg: THIS_ARG,
32): number;
33export = FlattenIntoArray;