Get rid of global types (#81739)

* move global typings to packages/kbn-utility-types

* update all imports

* add tests

* mute error

* update docs

* ok

* rename kbn-utility-types/test --> kbn-utility-types/jest
This commit is contained in:
Mikhail Shustov 2020-10-28 13:03:04 +03:00 committed by GitHub
parent e160d54970
commit 2782204cc1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
136 changed files with 252 additions and 143 deletions

19
typings/index.d.ts vendored
View file

@ -34,22 +34,3 @@ declare module '*.svg' {
// eslint-disable-next-line import/no-default-export
export default content;
}
type MethodKeysOf<T> = {
[K in keyof T]: T[K] extends (...args: any[]) => any ? K : never;
}[keyof T];
type PublicMethodsOf<T> = Pick<T, MethodKeysOf<T>>;
type MockedKeys<T> = { [P in keyof T]: jest.Mocked<T[P]> };
type DeeplyMockedKeys<T> = {
[P in keyof T]: T[P] extends (...args: any[]) => any
? jest.MockInstance<ReturnType<T[P]>, Parameters<T[P]>>
: DeeplyMockedKeys<T[P]>;
} &
T;
type Writable<T> = {
-readonly [K in keyof T]: T[K];
};