From fa38b9b82fff7015698ef5312eb184edbedc4afc Mon Sep 17 00:00:00 2001 From: Isaac Levy Date: Sat, 2 Jan 2021 13:23:23 -0500 Subject: [PATCH] Idea: support deep partials in typing --- index.d.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/index.d.ts b/index.d.ts index 7412fcf..31d98ec 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,5 +1,7 @@ -declare function deepmerge(x: Partial, y: Partial, options?: deepmerge.Options): T; -declare function deepmerge(x: Partial, y: Partial, options?: deepmerge.Options): T1 & T2; +type PartialDeep = {[K in keyof T]?: PartialDeep}; + +declare function deepmerge(x: PartialDeep, y: PartialDeep, options?: deepmerge.Options): T; +declare function deepmerge(x: PartialDeep, y: PartialDeep, options?: deepmerge.Options): T1 & T2; declare namespace deepmerge { export interface Options {