cat-bookmarker/assets/node_modules/array-flatten/array-flatten.d.ts

17 lines
526 B
TypeScript
Raw Permalink Normal View History

2024-03-10 18:52:04 +00:00
declare function flatten <T> (array: flatten.NestedArray<T>): T[];
declare namespace flatten {
export interface NestedArray <T> extends ReadonlyArray<T | NestedArray<T>> {}
export interface NestedList <T> {
[index: number]: T | NestedList<T>;
length: number;
}
export function from <T> (array: NestedList<T>): T[];
export function depth <T> (array: NestedArray<T>, depth: number): NestedArray<T>;
export function depthFrom <T> (array: NestedList<T>, depth: number): NestedArray<T>;
}
export = flatten;