Remove redundant x-pack/typings. (#55042)

This commit is contained in:
Aleh Zasypkin 2020-01-16 18:45:39 +01:00 committed by GitHub
parent 178c7a48fc
commit 41316bac31
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 14 additions and 72 deletions

View file

@ -7,7 +7,10 @@
]
},
"include": [
"**/*"
"**/*",
"../typings/**/*"
],
"exclude": []
"exclude": [
"../typings/jest.d.ts"
]
}

View file

@ -1,25 +0,0 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import 'hapi';
import { XPackMainPlugin } from '../../legacy/plugins/xpack_main/server/xpack_main';
import { SecurityPlugin } from '../../legacy/plugins/security';
import { ActionsPlugin, ActionsClient } from '../../legacy/plugins/actions';
import { AlertingPlugin, AlertsClient } from '../../legacy/plugins/alerting';
declare module 'hapi' {
interface Request {
getActionsClient?: () => ActionsClient;
getAlertsClient?: () => AlertsClient;
}
interface PluginProperties {
xpack_main: XPackMainPlugin;
security?: SecurityPlugin;
actions?: ActionsPlugin;
alerting?: AlertingPlugin;
}
}

View file

@ -1,7 +0,0 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
declare module '@hapi/basic';

View file

@ -1,28 +0,0 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
declare module '*.html' {
const template: string;
// eslint-disable-next-line import/no-default-export
export default template;
}
declare module 'lodash/internal/toPath' {
function toPath(value: string | string[]): string[];
export = toPath;
}
declare module '*.json' {
const json: any;
// eslint-disable-next-line import/no-default-export
export default json;
}
type MethodKeysOf<T> = {
[K in keyof T]: T[K] extends (...args: any[]) => any ? K : never;
}[keyof T];
type PublicMethodsOf<T> = Pick<T, MethodKeysOf<T>>;

View file

@ -27,15 +27,6 @@ type Writable<T> = {
-readonly [K in keyof T]: T[K];
};
type MockedKeys<T> = { [P in keyof T]: jest.Mocked<Writable<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;
// allow JSON files to be imported directly without lint errors
// see: https://github.com/palantir/tslint/issues/1264#issuecomment-228433367
// and: https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#arbitrary-expressions-are-forbidden-in-export-assignments-in-ambient-contexts

View file

@ -4,8 +4,16 @@
* you may not use this file except in compliance with the Elastic License.
*/
// https://github.com/styled-components/jest-styled-components/issues/264
type MockedKeys<T> = { [P in keyof T]: jest.Mocked<Writable<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;
// https://github.com/styled-components/jest-styled-components/issues/264
declare namespace jest {
interface AsymmetricMatcher {
$$typeof: Symbol; //eslint-disable-line