UNPKG

994 BTypeScriptView Raw
1// Type definitions for deepmerge 1.3
2// Project: https://github.com/KyleAMathews/deepmerge
3// Definitions by: marvinscharle <https://github.com/marvinscharle>
4// syy1125 <https://github.com/syy1125>
5// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
6// TypeScript Version: 2.1
7
8export = deepmerge;
9
10declare function deepmerge<T>(x: Partial<T>, y: Partial<T>, options?: deepmerge.Options): T;
11declare function deepmerge<T1, T2>(x: T1, y: T2, options?: deepmerge.Options): T1 & T2;
12
13declare namespace deepmerge {
14 interface Options {
15 clone?: boolean;
16 arrayMerge?(destination: any[], source: any[], options?: Options): any[];
17 }
18
19 function all<T>(objects: Array<Partial<T>>, options?: Options): T;
20}
21
22declare global {
23 interface Window {
24 deepmerge<T>(x: Partial<T>, y: Partial<T>, options?: deepmerge.Options): T;
25 deepmerge<T1, T2>(x: T1, y: T2, options?: deepmerge.Options): T1 & T2;
26 }
27}