From efc2a3118712473f2bfbd2e8ad9d12b9eedd1768 Mon Sep 17 00:00:00 2001 From: mitchellhamilton Date: Wed, 7 Jul 2021 10:09:29 +1000 Subject: [PATCH] Fix TypeScript errors --- .changeset/chatty-bulldogs-dream.md | 6 ++++++ design-system/packages/core/package.json | 1 + packages-next/types/src/legacy-filters.ts | 14 +++++++------- yarn.lock | 2 +- 4 files changed, 15 insertions(+), 8 deletions(-) create mode 100644 .changeset/chatty-bulldogs-dream.md diff --git a/.changeset/chatty-bulldogs-dream.md b/.changeset/chatty-bulldogs-dream.md new file mode 100644 index 00000000000..39837912d86 --- /dev/null +++ b/.changeset/chatty-bulldogs-dream.md @@ -0,0 +1,6 @@ +--- +'@keystone-ui/core': patch +'@keystone-next/types': patch +--- + +Fixed TypeScript errors in declarations diff --git a/design-system/packages/core/package.json b/design-system/packages/core/package.json index 0de101afa03..e9af010635d 100644 --- a/design-system/packages/core/package.json +++ b/design-system/packages/core/package.json @@ -17,6 +17,7 @@ "dependencies": { "@babel/runtime": "^7.14.6", "@emotion/react": "^11.4.0", + "@types/facepaint": "1.2.1", "facepaint": "^1.2.1" }, "engines": { diff --git a/packages-next/types/src/legacy-filters.ts b/packages-next/types/src/legacy-filters.ts index 3cdd73840c0..7706f5f2d1e 100644 --- a/packages-next/types/src/legacy-filters.ts +++ b/packages-next/types/src/legacy-filters.ts @@ -3,7 +3,7 @@ import { schema } from '.'; const identity = (x: any) => x; export const impls = { - equalityConditions(fieldKey: string, f: (a: any) => any = identity) { + equalityConditions(fieldKey: string, f: (a: any) => any = identity): any { return { [fieldKey]: (value: T) => ({ [fieldKey]: { equals: f(value) } }), [`${fieldKey}_not`]: (value: T | null) => @@ -14,7 +14,7 @@ export const impls = { }, }; }, - equalityConditionsInsensitive(fieldKey: string, f: (a: any) => any = identity) { + equalityConditionsInsensitive(fieldKey: string, f: (a: any) => any = identity): any { return { [`${fieldKey}_i`]: (value: string) => ({ [fieldKey]: { equals: f(value), mode: 'insensitive' }, @@ -31,7 +31,7 @@ export const impls = { }; }, - inConditions(fieldKey: string, f: (a: any) => any = identity) { + inConditions(fieldKey: string, f: (a: any) => any = identity): any { return { [`${fieldKey}_in`]: (value: (T | null)[]) => (value.includes(null) @@ -56,7 +56,7 @@ export const impls = { }; }, - orderingConditions(fieldKey: string, f: (a: any) => any = identity) { + orderingConditions(fieldKey: string, f: (a: any) => any = identity): any { return { [`${fieldKey}_lt`]: (value: T) => ({ [fieldKey]: { lt: f(value) } }), [`${fieldKey}_lte`]: (value: T) => ({ [fieldKey]: { lte: f(value) } }), @@ -65,7 +65,7 @@ export const impls = { }; }, - containsConditions(fieldKey: string, f: (a: any) => any = identity) { + containsConditions(fieldKey: string, f: (a: any) => any = identity): any { return { [`${fieldKey}_contains`]: (value: string) => ({ [fieldKey]: { contains: f(value) } }), [`${fieldKey}_not_contains`]: (value: string) => ({ @@ -74,7 +74,7 @@ export const impls = { }; }, - stringConditions(fieldKey: string, f: (a: any) => any = identity) { + stringConditions(fieldKey: string, f: (a: any) => any = identity): any { return { ...impls.containsConditions(fieldKey, f), [`${fieldKey}_starts_with`]: (value: string) => ({ [fieldKey]: { startsWith: f(value) } }), @@ -88,7 +88,7 @@ export const impls = { }; }, - stringConditionsInsensitive(fieldKey: string, f: (a: any) => any = identity) { + stringConditionsInsensitive(fieldKey: string, f: (a: any) => any = identity): any { return { [`${fieldKey}_contains_i`]: (value: string) => ({ [fieldKey]: { contains: f(value), mode: 'insensitive' }, diff --git a/yarn.lock b/yarn.lock index 4601334b22f..bca4a50138a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2676,7 +2676,7 @@ resolved "https://registry.yarnpkg.com/@types/extract-files/-/extract-files-8.1.0.tgz#4728440e1d92a6d1d11ac47f5a10e3f9ce47f044" integrity sha512-ulxvlFU71yLVV3JxdBgryASAIp+aZQuQOpkhU1SznJlcWz0qsJCWHqdJqP6Lprs3blqGS5FH5GbBkU0977+Wew== -"@types/facepaint@^1.2.1": +"@types/facepaint@1.2.1": version "1.2.1" resolved "https://registry.yarnpkg.com/@types/facepaint/-/facepaint-1.2.1.tgz#925f8f0f2ed7766487c58736d37c2ceded6966f8" integrity sha512-LBMeEmlndIC5yEm8g1ulIcAm38xDhVcqcgVrSv6bnn31yQnYT+XUT5Nljj9un2gr0cItCd5Gt02oGJuXjKdjSg==