UNPKG

1.15 kBTypeScriptView Raw
1// Type definitions for flat 5.0.0
2// Project: https://github.com/hughsk/flat
3// Definitions by: Ilya Mochalov <https://github.com/chrootsu>
4// Oz Weiss <https://github.com/thewizarodofoz>
5// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
6
7declare var flatten: FlatTypes.Flatten;
8
9export = flatten;
10
11declare namespace FlatTypes {
12 interface FlattenOptions {
13 delimiter?: string | undefined;
14 safe?: boolean | undefined;
15 maxDepth?: number | undefined;
16 transformKey?: ((key: string) => string) | undefined;
17 }
18
19 interface Flatten {
20 <TTarget, TResult>(
21 target: TTarget,
22 options?: FlattenOptions
23 ): TResult;
24
25 flatten: Flatten;
26 unflatten: Unflatten;
27 }
28
29 interface UnflattenOptions {
30 delimiter?: string | undefined;
31 object?: boolean | undefined;
32 overwrite?: boolean | undefined;
33 transformKey?: ((key: string) => string) | undefined;
34 }
35
36 interface Unflatten {
37 <TTarget, TResult>(
38 target: TTarget,
39 options?: UnflattenOptions
40 ): TResult;
41 }
42}
43
\No newline at end of file