From 0379f825907e53a36775e574c293c84cea8ea229 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Fri, 6 Mar 2020 09:21:10 -0800 Subject: [PATCH] make @wordpress/block-editor types stricter (#42898) Typescript@next is stricter about type parameters constrained to any; they are default to unknown instead of any during inference for consistency with other type parameters. This means that the easiest workaround is to give a type parameter constrained to `any` a default of `any` so that they once again default to `any`. That's what this PR does; it also has to give the subsequent type parameter a default as well. --- .../components/color-palette/with-color-context.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/wordpress__block-editor/components/color-palette/with-color-context.d.ts b/types/wordpress__block-editor/components/color-palette/with-color-context.d.ts index 4012eba331..d22231c188 100644 --- a/types/wordpress__block-editor/components/color-palette/with-color-context.d.ts +++ b/types/wordpress__block-editor/components/color-palette/with-color-context.d.ts @@ -14,8 +14,8 @@ declare namespace withColorContext { // prettier-ignore declare function withColorContext< ProvidedProps extends Partial, - OwnProps extends any, - T extends ComponentType + OwnProps extends any = any, + T extends ComponentType = ComponentType >(component: T): T extends ComponentType ? ComponentType< Omit &