UNPKG

1.8 kBMarkdownView Raw
1# Installation
2> `npm install --save @types/flat`
3
4# Summary
5This package contains type definitions for flat (https://github.com/hughsk/flat).
6
7# Details
8Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/flat.
9## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/flat/index.d.ts)
10````ts
11// Type definitions for flat 5.0.0
12// Project: https://github.com/hughsk/flat
13// Definitions by: Ilya Mochalov <https://github.com/chrootsu>
14// Oz Weiss <https://github.com/thewizarodofoz>
15// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
16
17declare var flatten: FlatTypes.Flatten;
18
19export = flatten;
20
21declare namespace FlatTypes {
22 interface FlattenOptions {
23 delimiter?: string | undefined;
24 safe?: boolean | undefined;
25 maxDepth?: number | undefined;
26 transformKey?: ((key: string) => string) | undefined;
27 }
28
29 interface Flatten {
30 <TTarget, TResult>(
31 target: TTarget,
32 options?: FlattenOptions
33 ): TResult;
34
35 flatten: Flatten;
36 unflatten: Unflatten;
37 }
38
39 interface UnflattenOptions {
40 delimiter?: string | undefined;
41 object?: boolean | undefined;
42 overwrite?: boolean | undefined;
43 transformKey?: ((key: string) => string) | undefined;
44 }
45
46 interface Unflatten {
47 <TTarget, TResult>(
48 target: TTarget,
49 options?: UnflattenOptions
50 ): TResult;
51 }
52}
53
54````
55
56### Additional Details
57 * Last updated: Tue, 06 Jul 2021 20:32:59 GMT
58 * Dependencies: none
59 * Global values: none
60
61# Credits
62These definitions were written by [ Ilya Mochalov](https://github.com/chrootsu), and [Oz Weiss](https://github.com/thewizarodofoz).
63
\No newline at end of file