mirror of
https://github.com/elastic/kibana.git
synced 2025-06-27 10:40:07 -04:00
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:
parent
e160d54970
commit
2782204cc1
136 changed files with 252 additions and 143 deletions
19
typings/index.d.ts
vendored
19
typings/index.d.ts
vendored
|
@ -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];
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue