Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tsconfig for url_forwarding #81177

Merged
merged 19 commits into from
Oct 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/core/public/apm_system.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

jest.mock('@elastic/apm-rum');
import { init, apm } from '@elastic/apm-rum';
import { DeeplyMockedKeys } from '../typings';
import { ApmSystem } from './apm_system';

const initMock = init as jest.Mocked<typeof init>;
Expand Down
1 change: 1 addition & 0 deletions src/core/public/chrome/chrome_service.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/
import { BehaviorSubject } from 'rxjs';
import type { PublicMethodsOf } from '@kbn/utility-types';
import { DeeplyMockedKeys } from '../../typings';
import { ChromeBadge, ChromeBrand, ChromeBreadcrumb, ChromeService, InternalChromeStart } from './';

const createStartContractMock = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* under the License.
*/
import type { PublicMethodsOf } from '@kbn/utility-types';
import { MockedKeys } from '../../typings';
import {
NotificationsService,
NotificationsSetup,
Expand Down
1 change: 1 addition & 0 deletions src/core/public/overlays/overlay_service.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* under the License.
*/
import type { PublicMethodsOf } from '@kbn/utility-types';
import { DeeplyMockedKeys } from '../../typings';
import { OverlayService, OverlayStart } from './overlay_service';
import { overlayBannersServiceMock } from './banners/banners_service.mock';
import { overlayFlyoutServiceMock } from './flyout/flyout_service.mock';
Expand Down
1 change: 1 addition & 0 deletions src/core/server/core_context.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/

import { REPO_ROOT } from '@kbn/dev-utils';
import { DeeplyMockedKeys } from '../typings';
import { CoreContext } from './core_context';
import { Env, IConfigService } from './config';
import { configServiceMock, getEnvOptions } from './config/mocks';
Expand Down
1 change: 1 addition & 0 deletions src/core/server/elasticsearch/client/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/
import { Client, ApiResponse } from '@elastic/elasticsearch';
import { TransportRequestPromise } from '@elastic/elasticsearch/lib/Transport';
import { DeeplyMockedKeys } from '../../../typings';
import { ElasticsearchClient } from './types';
import { ICustomClusterClient } from './cluster_client';

Expand Down
1 change: 1 addition & 0 deletions src/core/server/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import { of } from 'rxjs';
import { duration } from 'moment';
import { ByteSizeValue } from '@kbn/config-schema';
import { MockedKeys } from '../typings';
import { PluginInitializerContext, CoreSetup, CoreStart, StartServicesAccessor } from '.';
import { loggingSystemMock } from './logging/logging_system.mock';
import { loggingServiceMock } from './logging/logging_service.mock';
Expand Down
4 changes: 2 additions & 2 deletions src/core/typings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
* under the License.
*/

type DeeplyMockedKeys<T> = {
export 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 MockedKeys<T> = { [P in keyof T]: jest.Mocked<T[P]> };
export type MockedKeys<T> = { [P in keyof T]: jest.Mocked<T[P]> };
31 changes: 31 additions & 0 deletions src/plugins/kibana_legacy/public/angular/kbn_top_nav.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import { Injectable, IDirectiveFactory, IScope, IAttributes, IController } from 'angular';

export const createTopNavDirective: Injectable<IDirectiveFactory<
IScope,
JQLite,
IAttributes,
IController
>>;
export const createTopNavHelper: (
options: unknown
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: This is NavigationPublicPluginStart['ui']

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for that. I think I'll leave it since it's not widely used and I wanted to be as generic as possible since I'm not familiar with the code.

) => Injectable<IDirectiveFactory<IScope, JQLite, IAttributes, IController>>;
export function loadKbnTopNavDirectives(navUi: unknown): void;
20 changes: 20 additions & 0 deletions src/plugins/kibana_legacy/public/angular/promises.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

export function PromiseServiceCreator($q: unknown, $timeout: unknown): (fn: unknown) => unknown;
20 changes: 20 additions & 0 deletions src/plugins/kibana_legacy/public/angular/watch_multi.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

export function watchMultiDecorator($provide: unknown): void;
27 changes: 27 additions & 0 deletions src/plugins/kibana_legacy/public/utils/kbn_accessible_click.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import { Injectable, IDirectiveFactory, IScope, IAttributes, IController } from 'angular';

export const KbnAccessibleClickProvider: Injectable<IDirectiveFactory<
IScope,
JQLite,
IAttributes,
IController
>>;
4 changes: 4 additions & 0 deletions src/plugins/kibana_legacy/public/utils/private.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,8 @@
* under the License.
*/

import { IServiceProvider } from 'angular';

export type IPrivate = <T>(provider: (...injectable: any[]) => T) => T;

export function PrivateProvider(): IServiceProvider;
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

export function registerListenEventListener($rootScope: unknown): void;
15 changes: 15 additions & 0 deletions src/plugins/url_forwarding/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"composite": true,
"outDir": "./target/types",
"emitDeclarationOnly": true,
"declaration": true,
"declarationMap": true
},
"include": ["public/**/*"],
"references": [
{ "path": "../../core/tsconfig.json" },
{ "path": "../kibana_legacy/tsconfig.json" }
]
}
10 changes: 6 additions & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@
"src/test_utils/**/*",
"src/core/**/*",
"src/plugins/kibana_legacy/**/*",
"src/plugins/kibana_usage_collection/**/*",
"src/plugins/kibana_utils/**/*",
"src/plugins/kibana_react/**/*",
"src/plugins/usage_collection/**/*",
"src/plugins/telemetry_collection_manager/**/*",
"src/plugins/kibana_utils/**/*",
"src/plugins/newsfeed/**/*",
"src/plugins/telemetry/**/*",
"src/plugins/kibana_usage_collection/**/*",
"src/plugins/newsfeed/**/*"
"src/plugins/telemetry_collection_manager/**/*",
"src/plugins/url_forwarding/**/*",
"src/plugins/usage_collection/**/*"
// In the build we actually exclude **/public/**/* from this config so that
// we can run the TSC on both this and the .browser version of this config
// file, but if we did it during development IDEs would not be able to find
Expand Down
12 changes: 7 additions & 5 deletions tsconfig.refs.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
{
"include": [],
"references": [
{ "path": "./src/test_utils/tsconfig.json" },
{ "path": "./src/core/tsconfig.json" },
{ "path": "./src/plugins/kibana_utils/tsconfig.json" },
{ "path": "./src/test_utils/tsconfig.json" },
{ "path": "./src/plugins/kibana_legacy/tsconfig.json" },
{ "path": "./src/plugins/kibana_react/tsconfig.json" },
{ "path": "./src/plugins/usage_collection/tsconfig.json" },
{ "path": "./src/plugins/telemetry_collection_manager/tsconfig.json" },
{ "path": "./src/plugins/telemetry/tsconfig.json" },
{ "path": "./src/plugins/kibana_usage_collection/tsconfig.json" },
{ "path": "./src/plugins/kibana_utils/tsconfig.json" },
{ "path": "./src/plugins/newsfeed/tsconfig.json" },
{ "path": "./src/plugins/telemetry/tsconfig.json" },
{ "path": "./src/plugins/telemetry_collection_manager/tsconfig.json" },
{ "path": "./src/plugins/url_forwarding/tsconfig.json" },
{ "path": "./src/plugins/usage_collection/tsconfig.json" }
]
}
32 changes: 14 additions & 18 deletions x-pack/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
{
"extends": "../tsconfig.base.json",
"include": [
"mocks.ts",
"typings/**/*",
"plugins/**/*",
"test_utils/**/*",
"tasks/**/*"
],
"include": ["mocks.ts", "typings/**/*", "plugins/**/*", "test_utils/**/*", "tasks/**/*"],
"exclude": [
"test/**/*",
"plugins/security_solution/cypress/**/*",
"plugins/apm/e2e/cypress/**/*",
"plugins/apm/scripts/**/*",
"plugins/licensing/**/*",
"plugins/global_search/**/*",
"plugins/telemetry_collection_xpack/**/*"
"plugins/licensing/**/*",
"plugins/security_solution/cypress/**/*",
"plugins/telemetry_collection_xpack/**/*",
"test/**/*"
],
"compilerOptions": {
"paths": {
Expand All @@ -28,15 +22,17 @@
},
"references": [
{ "path": "../src/core/tsconfig.json" },
{ "path": "../src/plugins/kibana_utils/tsconfig.json" },
{ "path": "../src/plugins/kibana_legacy/tsconfig.json" },
{ "path": "../src/plugins/kibana_react/tsconfig.json" },
{ "path": "./plugins/licensing/tsconfig.json" },
{ "path": "./plugins/global_search/tsconfig.json" },
{ "path": "../src/plugins/usage_collection/tsconfig.json" },
{ "path": "../src/plugins/telemetry_collection_manager/tsconfig.json" },
{ "path": "../src/plugins/telemetry/tsconfig.json" },
{ "path": "../src/plugins/kibana_usage_collection/tsconfig.json" },
{ "path": "./plugins/telemetry_collection_xpack/tsconfig.json" },
{ "path": "../src/plugins/kibana_utils/tsconfig.json" },
{ "path": "../src/plugins/newsfeed/tsconfig.json" },
{ "path": "../src/plugins/telemetry/tsconfig.json" },
{ "path": "../src/plugins/telemetry_collection_manager/tsconfig.json" },
{ "path": "../src/plugins/url_forwarding/tsconfig.json" },
{ "path": "../src/plugins/usage_collection/tsconfig.json" },
{ "path": "./plugins/global_search/tsconfig.json" },
{ "path": "./plugins/licensing/tsconfig.json" },
{ "path": "./plugins/telemetry_collection_xpack/tsconfig.json" }
]
}