mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
40 lines
753 B
TypeScript
40 lines
753 B
TypeScript
// Type definitions for flat
|
|
// Project: https://github.com/hughsk/flat
|
|
// Definitions by: Ilya Mochalov <https://github.com/chrootsu>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
|
|
declare var flatten: FlatTypes.Flatten;
|
|
|
|
export = flatten;
|
|
|
|
declare namespace FlatTypes {
|
|
interface FlattenOptions {
|
|
delimiter?: string;
|
|
safe?: boolean;
|
|
maxDepth?: number;
|
|
}
|
|
|
|
interface Flatten {
|
|
<TTarget, TResult>(
|
|
target: TTarget,
|
|
options?: FlattenOptions
|
|
): TResult;
|
|
|
|
flatten: Flatten;
|
|
unflatten: Unflatten;
|
|
}
|
|
|
|
interface UnflattenOptions {
|
|
delimiter?: string;
|
|
object?: boolean;
|
|
overwrite?: boolean;
|
|
}
|
|
|
|
interface Unflatten {
|
|
<TTarget, TResult>(
|
|
target: TTarget,
|
|
options?: UnflattenOptions
|
|
): TResult;
|
|
}
|
|
}
|