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..a9af2306d5f 100644 --- a/design-system/packages/core/package.json +++ b/design-system/packages/core/package.json @@ -5,7 +5,6 @@ "main": "dist/core.cjs.js", "module": "dist/core.esm.js", "devDependencies": { - "@types/facepaint": "^1.2.1", "@types/react": "^17.0.11", "react": "^17.0.2", "react-dom": "^17.0.2" @@ -17,6 +16,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' },