diff --git a/flat/flat.d.ts b/flat/flat.d.ts new file mode 100644 index 000000000..f3698f125 --- /dev/null +++ b/flat/flat.d.ts @@ -0,0 +1,41 @@ +// Type definitions for flat +// Project: https://github.com/hughsk/flat +// Definitions by: Ilya Mochalov +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module FlatTypes { + interface FlattenOptions { + delimiter?: string; + safe?: boolean; + maxDepth?: number; + } + + interface Flatten { + ( + target: TTarget, + options?: FlattenOptions + ): TResult; + + flatten: Flatten; + unflatten: Unflatten; + } + + interface UnflattenOptions { + delimiter?: string; + object?: boolean; + overwrite?: boolean; + } + + interface Unflatten { + ( + target: TTarget, + options?: UnflattenOptions + ): TResult; + } +} + +declare module "flat" { + var flatten: FlatTypes.Flatten; + + export = flatten; +}