diff --git a/packages/types/src/main/TPredicate.ts b/packages/types/src/main/TPredicate.ts new file mode 100644 index 000000000..c1ac4841d --- /dev/null +++ b/packages/types/src/main/TPredicate.ts @@ -0,0 +1 @@ +export type TPredicate = (...args: any[]) => boolean diff --git a/packages/types/src/main/index.ts b/packages/types/src/main/index.ts index 55b00f683..3c73fc80c 100644 --- a/packages/types/src/main/index.ts +++ b/packages/types/src/main/index.ts @@ -11,3 +11,4 @@ export { ICurrency } from './ICurrency' export { IPromiseConstructor, IPromise } from './IPromise' export { IStorage } from './IStorage' export { IMoney } from './IMoney' +export { TPredicate } from './TPredicate' diff --git a/packages/types/src/test/TPredicate.ts b/packages/types/src/test/TPredicate.ts new file mode 100644 index 000000000..9157ec906 --- /dev/null +++ b/packages/types/src/test/TPredicate.ts @@ -0,0 +1,4 @@ +import { TPredicate } from './index'; + +const wrongPredicate: TPredicate = (a: number, b: number): number => a + b; // $ExpectError +const predicate: TPredicate = (a: number, b: number): boolean => a > b;