Skip to content

Commit

Permalink
Fix TypeScript errors
Browse files Browse the repository at this point in the history
  • Loading branch information
emmatown committed Jul 7, 2021
1 parent 5f4ecfc commit efc2a31
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
6 changes: 6 additions & 0 deletions .changeset/chatty-bulldogs-dream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@keystone-ui/core': patch
'@keystone-next/types': patch
---

Fixed TypeScript errors in declarations
1 change: 1 addition & 0 deletions design-system/packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
14 changes: 7 additions & 7 deletions packages-next/types/src/legacy-filters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { schema } from '.';
const identity = (x: any) => x;

export const impls = {
equalityConditions<T>(fieldKey: string, f: (a: any) => any = identity) {
equalityConditions<T>(fieldKey: string, f: (a: any) => any = identity): any {
return {
[fieldKey]: (value: T) => ({ [fieldKey]: { equals: f(value) } }),
[`${fieldKey}_not`]: (value: T | null) =>
Expand All @@ -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' },
Expand All @@ -31,7 +31,7 @@ export const impls = {
};
},

inConditions<T>(fieldKey: string, f: (a: any) => any = identity) {
inConditions<T>(fieldKey: string, f: (a: any) => any = identity): any {
return {
[`${fieldKey}_in`]: (value: (T | null)[]) =>
(value.includes(null)
Expand All @@ -56,7 +56,7 @@ export const impls = {
};
},

orderingConditions<T>(fieldKey: string, f: (a: any) => any = identity) {
orderingConditions<T>(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) } }),
Expand All @@ -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) => ({
Expand All @@ -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) } }),
Expand All @@ -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' },
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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==
Expand Down

0 comments on commit efc2a31

Please sign in to comment.