mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-22 20:37:58 +08:00
30 lines
1.1 KiB
TypeScript
30 lines
1.1 KiB
TypeScript
// Type definitions for deepmerge 2.1
|
|
// Project: https://github.com/KyleAMathews/deepmerge
|
|
// Definitions by: marvinscharle <https://github.com/marvinscharle>
|
|
// syy1125 <https://github.com/syy1125>
|
|
// AppLover69 <https://github.com/AppLover69>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
// TypeScript Version: 2.2
|
|
|
|
export = deepmerge;
|
|
|
|
declare function deepmerge<T>(x: Partial<T>, y: Partial<T>, options?: deepmerge.Options): T;
|
|
declare function deepmerge<T1, T2>(x: T1, y: T2, options?: deepmerge.Options): T1 & T2;
|
|
|
|
declare namespace deepmerge {
|
|
interface Options {
|
|
clone?: boolean;
|
|
arrayMerge?(destination: any[], source: any[], options?: Options): any[];
|
|
isMergeableObject?(value: object): boolean;
|
|
}
|
|
|
|
function all<T>(objects: Array<Partial<T>>, options?: Options): T;
|
|
}
|
|
|
|
declare global {
|
|
interface Window {
|
|
deepmerge<T>(x: Partial<T>, y: Partial<T>, options?: deepmerge.Options): T;
|
|
deepmerge<T1, T2>(x: T1, y: T2, options?: deepmerge.Options): T1 & T2;
|
|
}
|
|
}
|