[ML] Enable consistent-type-imports eslint rule (#176921)

Enabling `consistent-type-imports` rule and running `node scripts/eslint
--no-cache --fix` to fix every type import.

Affects x-pack plugins: `ml`, `transform`, `aiops`, `data_visualizer`
and `x-pack/packages/ml`

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
James Gowdy 2024-03-07 10:29:20 +00:00 committed by GitHub
parent 5ef169f0f0
commit 3670b4fa5f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
1341 changed files with 3873 additions and 3187 deletions

View file

@ -1004,6 +1004,22 @@ module.exports = {
},
},
/**
* ML overrides
*/
{
files: [
'x-pack/plugins/aiops/**/*.{js,mjs,ts,tsx}',
'x-pack/plugins/data_visualizer/**/*.{js,mjs,ts,tsx}',
'x-pack/plugins/ml/**/*.{js,mjs,ts,tsx}',
'x-pack/plugins/transform/**/*.{js,mjs,ts,tsx}',
'x-pack/packages/ml/**/*.{js,mjs,ts,tsx}',
],
rules: {
'@typescript-eslint/consistent-type-imports': 'error',
},
},
/**
* Security Solution overrides. These rules below are maintained and owned by
* the people within the security-detection-engine team. Please see ping them

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
/**
* Wraps the supplied aggregations in a sampler aggregation.

View file

@ -7,7 +7,7 @@
import { get } from 'lodash';
import * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server';
import { KBN_FIELD_TYPES } from '@kbn/field-types';

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { KBN_FIELD_TYPES } from '@kbn/field-types';
import type { KBN_FIELD_TYPES } from '@kbn/field-types';
/**
* Represents a field-based cardinality aggregation configuration.

View file

@ -5,7 +5,8 @@
* 2.0.
*/
import React, { FC } from 'react';
import type { FC } from 'react';
import React from 'react';
import { EuiBadge, EuiText, EuiToolTip } from '@elastic/eui';
import { formatDate } from '@elastic/eui';

View file

@ -8,25 +8,20 @@
import React, { type FC, useCallback, useEffect, useMemo, useState } from 'react';
import moment from 'moment';
import {
Axis,
import type {
BrushEndListener,
Chart,
ElementClickListener,
HistogramBarSeries,
Position,
ScaleType,
Settings,
XYChartElementEvent,
XYBrushEvent,
} from '@elastic/charts';
import {
import { Axis, Chart, HistogramBarSeries, Position, ScaleType, Settings } from '@elastic/charts';
import type {
BarStyleAccessor,
RectAnnotationSpec,
} from '@elastic/charts/dist/chart_types/xy_chart/utils/specs';
import { getTimeZone } from '@kbn/visualization-utils';
import { i18n } from '@kbn/i18n';
import { IUiSettingsClient } from '@kbn/core/public';
import type { IUiSettingsClient } from '@kbn/core/public';
import {
getLogRateAnalysisType,
getSnappedWindowParameters,

View file

@ -5,11 +5,12 @@
* 2.0.
*/
import React, { FC } from 'react';
import type { FC } from 'react';
import React from 'react';
import { RectAnnotation } from '@elastic/charts';
import { useEuiTheme } from '@elastic/eui';
import { RectAnnotationSpec } from '@elastic/charts/dist/chart_types/xy_chart/utils/specs';
import type { RectAnnotationSpec } from '@elastic/charts/dist/chart_types/xy_chart/utils/specs';
interface BrushAnnotationProps {
id: string;

View file

@ -7,7 +7,7 @@
import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import { ES_FIELD_TYPES } from '@kbn/field-types';
import { ML_JOB_AGGREGATION, KIBANA_AGGREGATION, ES_AGGREGATION } from './aggregation_types';
import type { ML_JOB_AGGREGATION, KIBANA_AGGREGATION, ES_AGGREGATION } from './aggregation_types';
import { MLCATEGORY } from './field_types';
/**

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { ML_PARTITION_FIELDS, ML_ANOMALY_RESULT_TYPE } from './constants';
import type { ML_PARTITION_FIELDS, ML_ANOMALY_RESULT_TYPE } from './constants';
import type { MlKibanaUrlConfig } from './custom_urls';
/**

View file

@ -7,7 +7,7 @@
import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import {
import type {
CATEGORY_EXAMPLES_VALIDATION_STATUS,
VALIDATION_RESULT,
} from '../constants/categorization';

View file

@ -15,7 +15,7 @@ import {
isRegressionAnalysis,
} from './analytics_utils';
import { OUTLIER_SCORE } from './constants';
import { DataFrameAnalyticsConfig } from './types';
import type { DataFrameAnalyticsConfig } from './types';
/**
* ES id _id

View file

@ -5,13 +5,13 @@
* 2.0.
*/
import Boom from '@hapi/boom';
import type Boom from '@hapi/boom';
import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import { isPopulatedObject } from '@kbn/ml-is-populated-object';
import { EsErrorBody } from '@kbn/ml-error-utils';
import type { EsErrorBody } from '@kbn/ml-error-utils';
import type { MlUrlConfig } from '@kbn/ml-anomaly-utils';
import { ANALYSIS_CONFIG_TYPE } from './constants';
import type { ANALYSIS_CONFIG_TYPE } from './constants';
/**
* Interface for DFA API response for deletion status

View file

@ -11,7 +11,8 @@ import { BarSeries, Chart, Settings, ScaleType, LEGACY_LIGHT_THEME } from '@elas
import { mathWithUnits, type UseEuiTheme, type EuiDataGridColumn } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { isUnsupportedChartData, ChartData } from '../lib/field_histograms';
import type { ChartData } from '../lib/field_histograms';
import { isUnsupportedChartData } from '../lib/field_histograms';
import { useColumnChart } from '../hooks/use_column_chart';

View file

@ -6,8 +6,14 @@
*/
import { isEqual } from 'lodash';
import React, { memo, useEffect, useRef, FC } from 'react';
import type { FC } from 'react';
import React, { memo, useEffect, useRef } from 'react';
import type {
EuiDataGridCellPopoverElementProps,
EuiDataGridProps,
UseEuiTheme,
} from '@elastic/eui';
import {
EuiButtonEmpty,
EuiButtonIcon,
@ -15,26 +21,23 @@ import {
EuiCodeBlock,
EuiCopy,
EuiDataGrid,
EuiDataGridCellPopoverElementProps,
EuiDataGridProps,
EuiFlexGroup,
EuiFlexItem,
EuiMutationObserver,
EuiSpacer,
EuiTitle,
EuiToolTip,
UseEuiTheme,
mathWithUnits,
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n-react';
import { CoreSetup } from '@kbn/core/public';
import type { CoreSetup } from '@kbn/core/public';
import { DEFAULT_SAMPLER_SHARD_SIZE } from '@kbn/ml-agg-utils';
import { isPopulatedObject } from '@kbn/ml-is-populated-object';
import { euiDataGridStyle, euiDataGridToolbarSettings, INDEX_STATUS } from '../lib/common';
import { UseIndexDataReturnType } from '../lib/types';
import type { UseIndexDataReturnType } from '../lib/types';
const histogramHeaderProps = { className: 'cellHeaderWithHistogramChart' };
const cssOverride = ({ euiTheme }: UseEuiTheme) =>

View file

@ -12,13 +12,15 @@ import '@testing-library/jest-dom/extend-expect';
import { KBN_FIELD_TYPES } from '@kbn/field-types';
import type {
NumericChartData,
OrdinalChartData,
UnsupportedChartData,
} from '../lib/field_histograms';
import {
isNumericChartData,
isOrdinalChartData,
isUnsupportedChartData,
NumericChartData,
OrdinalChartData,
UnsupportedChartData,
} from '../lib/field_histograms';
import { getFieldType, getLegendText, getXScaleType, useColumnChart } from './use_column_chart';

View file

@ -18,17 +18,16 @@ import { euiThemeVars } from '@kbn/ui-theme';
import { i18n } from '@kbn/i18n';
import { KBN_FIELD_TYPES } from '@kbn/field-types';
import {
isNumericChartData,
isOrdinalChartData,
import type {
ChartData,
ChartDataItem,
NumericDataItem,
OrdinalDataItem,
} from '../lib/field_histograms';
import { isNumericChartData, isOrdinalChartData } from '../lib/field_histograms';
import { NON_AGGREGATABLE } from '../lib/common';
import { DataGridItem } from '../lib/types';
import type { DataGridItem } from '../lib/types';
const cssHistogramLegendBoolean = css({
width: '100%',

View file

@ -7,15 +7,15 @@
import React, { useCallback, useEffect, useMemo, useState } from 'react';
import { EuiDataGridSorting, EuiDataGridColumn } from '@elastic/eui';
import type { EuiDataGridSorting, EuiDataGridColumn } from '@elastic/eui';
import { ES_CLIENT_TOTAL_HITS_RELATION } from '@kbn/ml-query-utils';
import { INDEX_STATUS } from '../lib/common';
import { ChartData } from '../lib/field_histograms';
import type { ChartData } from '../lib/field_histograms';
import { ColumnChart } from '../components/column_chart';
import { COLUMN_CHART_DEFAULT_VISIBILITY_ROWS_THRESHOLD, INIT_MAX_COLUMNS } from '../lib/common';
import {
import type {
ChartsVisible,
ColumnId,
DataGridItem,

View file

@ -7,11 +7,8 @@
import type { DataViewField } from '@kbn/data-views-plugin/common';
import {
getDataGridSchemaFromKibanaFieldType,
MultiColumnSorter,
multiColumnSortFactory,
} from './common';
import type { MultiColumnSorter } from './common';
import { getDataGridSchemaFromKibanaFieldType, multiColumnSortFactory } from './common';
const data = [
{ s: 'a', n: 1 },

View file

@ -9,10 +9,10 @@ import moment from 'moment-timezone';
import { useMemo } from 'react';
import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import { EuiDataGridCellValueElementProps, EuiDataGridStyle } from '@elastic/eui';
import type { EuiDataGridCellValueElementProps, EuiDataGridStyle } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { CoreSetup } from '@kbn/core/public';
import type { CoreSetup } from '@kbn/core/public';
import type { DataView, DataViewField } from '@kbn/data-views-plugin/common';
import type { FieldFormat } from '@kbn/field-formats-plugin/common';
import { ES_FIELD_TYPES, KBN_FIELD_TYPES } from '@kbn/field-types';

View file

@ -5,10 +5,10 @@
* 2.0.
*/
import { Dispatch, SetStateAction } from 'react';
import type { Dispatch, SetStateAction } from 'react';
import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import {
import type {
EuiDataGridCellValueElementProps,
EuiDataGridPaginationProps,
EuiDataGridSorting,
@ -16,10 +16,10 @@ import {
} from '@elastic/eui';
import type { TimeRange as TimeRangeMs } from '@kbn/ml-date-picker';
import { FeatureImportanceBaseline } from '@kbn/ml-data-frame-analytics-utils';
import type { FeatureImportanceBaseline } from '@kbn/ml-data-frame-analytics-utils';
import { INDEX_STATUS } from './common';
import { ChartData } from './field_histograms';
import type { INDEX_STATUS } from './common';
import type { ChartData } from './field_histograms';
interface Dictionary<TValue> {
[id: string]: TValue;

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { DataViewsService } from '@kbn/data-views-plugin/common';
import type { DataViewsService } from '@kbn/data-views-plugin/common';
export class DataViewHandler {
constructor(private dataViewService: DataViewsService) {}

View file

@ -5,9 +5,9 @@
* 2.0.
*/
import Boom from '@hapi/boom';
import type Boom from '@hapi/boom';
import { EsErrorBody } from '@kbn/ml-error-utils';
import type { EsErrorBody } from '@kbn/ml-error-utils';
/**
* Interface for data view API response for deletion status

View file

@ -5,10 +5,12 @@
* 2.0.
*/
import React, { FC, useCallback, useEffect, useMemo, useState } from 'react';
import type { FC } from 'react';
import React, { useCallback, useEffect, useMemo, useState } from 'react';
import { Subscription } from 'rxjs';
import { debounce } from 'lodash';
import type { OnRefreshProps, OnTimeChangeProps } from '@elastic/eui';
import {
useIsWithinMaxBreakpoint,
EuiButton,
@ -16,8 +18,6 @@ import {
EuiFlexItem,
EuiSuperDatePicker,
type EuiSuperDatePickerProps,
OnRefreshProps,
OnTimeChangeProps,
} from '@elastic/eui';
import type { TimeRange } from '@kbn/es-query';

View file

@ -5,10 +5,12 @@
* 2.0.
*/
import React, { FC, useCallback, useMemo, useState } from 'react';
import type { FC } from 'react';
import React, { useCallback, useMemo, useState } from 'react';
import type { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types';
import type { EuiRadioGroupOption } from '@elastic/eui';
import {
EuiButton,
EuiButtonIcon,
@ -17,7 +19,6 @@ import {
EuiPanel,
EuiPopover,
EuiRadioGroup,
EuiRadioGroupOption,
EuiToolTip,
} from '@elastic/eui';

View file

@ -15,7 +15,8 @@ import type { TimeRange } from '@kbn/es-query';
import type { TimefilterContract } from '@kbn/data-plugin/public';
import { useDatePickerContext } from './use_date_picker_context';
import { mlTimefilterRefresh$, Refresh } from '../services/timefilter_refresh_service';
import type { Refresh } from '../services/timefilter_refresh_service';
import { mlTimefilterRefresh$ } from '../services/timefilter_refresh_service';
/**
* Options interface for the `useTimefilter` custom hook.

View file

@ -6,9 +6,8 @@
*/
import { isPopulatedObject } from '@kbn/ml-is-populated-object';
import type { ErrorType, MLErrorObject } from './types';
import {
ErrorType,
MLErrorObject,
isBoomError,
isErrorString,
isErrorMessage,

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { MLErrorObject, ErrorType } from './types';
import type { MLErrorObject, ErrorType } from './types';
/**
* ML Request Failure

View file

@ -7,7 +7,7 @@
import type Boom from '@hapi/boom';
import * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import type { IHttpFetchError } from '@kbn/core-http-browser';

View file

@ -5,8 +5,9 @@
* 2.0.
*/
import { Dispatch, SetStateAction, useState } from 'react';
import { EuiInMemoryTable, Direction, Pagination } from '@elastic/eui';
import type { Dispatch, SetStateAction } from 'react';
import { useState } from 'react';
import type { EuiInMemoryTable, Direction, Pagination } from '@elastic/eui';
/**
* Returned type for useTableState hook

View file

@ -9,7 +9,7 @@ import { useMemo } from 'react';
import { of } from 'rxjs';
import useObservable from 'react-use/lib/useObservable';
import { euiDarkVars as euiThemeDark, euiLightVars as euiThemeLight } from '@kbn/ui-theme';
import { ThemeServiceStart } from '@kbn/core-theme-browser';
import type { ThemeServiceStart } from '@kbn/core-theme-browser';
export type EuiThemeType = typeof euiThemeLight | typeof euiThemeDark;

View file

@ -6,7 +6,7 @@
*/
import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import { Query } from '@kbn/es-query';
import type { Query } from '@kbn/es-query';
/**
* Builds the base filter criteria used in queries,

View file

@ -6,7 +6,7 @@
*/
import { get } from 'lodash';
import * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import { isPopulatedObject } from '@kbn/ml-is-populated-object';
import { getSampleProbability } from './get_sample_probability';

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { Reducer, ReducerAction, ReducerState } from 'react';
import type { Reducer, ReducerAction, ReducerState } from 'react';
type StringReducerPayload = string | string[] | undefined;
export type StringReducer = Reducer<string, StringReducerPayload>;

View file

@ -21,7 +21,8 @@ import { isEqual } from 'lodash';
import { getNestedProperty } from '@kbn/ml-nested-property';
import { decode, encode } from '@kbn/rison';
import { BehaviorSubject, Observable } from 'rxjs';
import type { Observable } from 'rxjs';
import { BehaviorSubject } from 'rxjs';
import { distinctUntilChanged } from 'rxjs/operators';
import { isPopulatedObject } from '@kbn/ml-is-populated-object';

View file

@ -10,7 +10,7 @@ import type {
AggregationsCustomCategorizeTextAnalyzer,
} from '@elastic/elasticsearch/lib/api/types';
import { createRandomSamplerWrapper } from '@kbn/ml-random-sampler-utils';
import type { createRandomSamplerWrapper } from '@kbn/ml-random-sampler-utils';
import { createCategorizeQuery } from './create_categorize_query';

View file

@ -7,9 +7,9 @@
import { get } from 'lodash';
import { estypes } from '@elastic/elasticsearch';
import type { estypes } from '@elastic/elasticsearch';
import { createRandomSamplerWrapper } from '@kbn/ml-random-sampler-utils';
import type { createRandomSamplerWrapper } from '@kbn/ml-random-sampler-utils';
import type { Category, CategoriesAgg, CatResponse } from './types';

View file

@ -5,7 +5,8 @@
* 2.0.
*/
import { schema, TypeOf } from '@kbn/config-schema';
import type { TypeOf } from '@kbn/config-schema';
import { schema } from '@kbn/config-schema';
import { i18n } from '@kbn/i18n';
import { isRuntimeField } from '@kbn/ml-runtime-field-utils';

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { estypes } from '@elastic/elasticsearch';
import type { estypes } from '@elastic/elasticsearch';
export interface Category {
key: string;

View file

@ -5,7 +5,8 @@
* 2.0.
*/
import { schema, TypeOf } from '@kbn/config-schema';
import type { TypeOf } from '@kbn/config-schema';
import { schema } from '@kbn/config-schema';
export const aiopsLogRateAnalysisSchemaV1 = schema.object({
start: schema.number(),

View file

@ -5,7 +5,8 @@
* 2.0.
*/
import { schema, TypeOf } from '@kbn/config-schema';
import type { TypeOf } from '@kbn/config-schema';
import { schema } from '@kbn/config-schema';
const significantItem = schema.object({
key: schema.string(),

View file

@ -7,7 +7,8 @@
import type { SignificantItem, SignificantItemGroup } from '@kbn/ml-agg-utils';
import { API_ACTION_NAME, AiopsLogRateAnalysisApiAction } from './log_rate_analysis/actions';
import type { AiopsLogRateAnalysisApiAction } from './log_rate_analysis/actions';
import { API_ACTION_NAME } from './log_rate_analysis/actions';
interface StreamState {
ccsWarning: boolean;

View file

@ -5,7 +5,8 @@
* 2.0.
*/
import { duration, Duration, unitOfTime } from 'moment';
import type { Duration, unitOfTime } from 'moment';
import { duration } from 'moment';
import dateMath from '@kbn/datemath';
type SupportedUnits = unitOfTime.Base;

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { Moment } from 'moment';
import type { Moment } from 'moment';
export interface TimeRangeBounds {
min?: Moment;

View file

@ -9,20 +9,19 @@
// `x-pack/plugins/data_visualizer/public/application/index_data_visualizer/utils/saved_search_utils.ts`
import { cloneDeep } from 'lodash';
import { IUiSettingsClient } from '@kbn/core/public';
import type { IUiSettingsClient } from '@kbn/core/public';
import { getEsQueryConfig, SearchSource } from '@kbn/data-plugin/common';
import type { SavedSearch } from '@kbn/saved-search-plugin/public';
import { FilterManager, isQuery, mapAndFlattenFilters } from '@kbn/data-plugin/public';
import type { FilterManager } from '@kbn/data-plugin/public';
import { isQuery, mapAndFlattenFilters } from '@kbn/data-plugin/public';
import type { Query, Filter, AggregateQuery } from '@kbn/es-query';
import {
fromKueryExpression,
toElasticsearchQuery,
buildQueryFromFilters,
buildEsQuery,
Query,
Filter,
AggregateQuery,
} from '@kbn/es-query';
import { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import type { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import type { DataView } from '@kbn/data-views-plugin/public';
import type { SimpleSavedObject } from '@kbn/core/public';
import { isPopulatedObject } from '@kbn/ml-is-populated-object';

View file

@ -6,14 +6,15 @@
*/
import { memoize } from 'lodash';
import { FieldFormatsStart } from '@kbn/field-formats-plugin/public';
import React, { FC } from 'react';
import { PersistableStateAttachmentViewProps } from '@kbn/cases-plugin/public/client/attachment_framework/types';
import type { FieldFormatsStart } from '@kbn/field-formats-plugin/public';
import type { FC } from 'react';
import React from 'react';
import type { PersistableStateAttachmentViewProps } from '@kbn/cases-plugin/public/client/attachment_framework/types';
import { FIELD_FORMAT_IDS } from '@kbn/field-formats-plugin/common';
import { FormattedMessage } from '@kbn/i18n-react';
import { EuiDescriptionList } from '@elastic/eui';
import deepEqual from 'fast-deep-equal';
import { EmbeddableChangePointChartProps } from '../embeddable';
import type { EmbeddableChangePointChartProps } from '../embeddable';
export const initComponent = memoize(
(fieldFormats: FieldFormatsStart, EmbeddableComponent: FC<EmbeddableChangePointChartProps>) => {

View file

@ -15,7 +15,7 @@ import {
EMBEDDABLE_CHANGE_POINT_CHART_TYPE,
} from '../../common/constants';
import { getEmbeddableChangePointChart } from '../embeddable/embeddable_change_point_chart_component';
import { AiopsPluginStartDeps } from '../types';
import type { AiopsPluginStartDeps } from '../types';
export function registerChangePointChartsAttachment(
cases: CasesPublicSetup,

View file

@ -5,15 +5,8 @@
* 2.0.
*/
import React, {
createContext,
FC,
useCallback,
useContext,
useEffect,
useMemo,
useState,
} from 'react';
import type { FC } from 'react';
import React, { createContext, useCallback, useContext, useEffect, useMemo, useState } from 'react';
import { type DataViewField } from '@kbn/data-views-plugin/public';
import { startWith } from 'rxjs';
import type { Filter, Query } from '@kbn/es-query';
@ -28,7 +21,8 @@ import {
getEsQueryFromSavedSearch,
} from '../../application/utils/search_utils';
import { useAiopsAppContext } from '../../hooks/use_aiops_app_context';
import { type TimeBuckets, TimeBucketsInterval } from '../../../common/time_buckets';
import type { TimeBucketsInterval } from '../../../common/time_buckets';
import { type TimeBuckets } from '../../../common/time_buckets';
import { useDataSource } from '../../hooks/use_data_source';
import { useTimeBuckets } from '../../hooks/use_time_buckets';

View file

@ -4,7 +4,8 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import React, { FC, useCallback, useState } from 'react';
import type { FC } from 'react';
import React, { useCallback, useState } from 'react';
import {
EuiButtonEmpty,
EuiCallOut,

View file

@ -5,13 +5,14 @@
* 2.0.
*/
import React, { FC, useMemo } from 'react';
import type { FC } from 'react';
import React, { useMemo } from 'react';
import { map } from 'rxjs/operators';
import { pick } from 'lodash';
import { EuiThemeProvider as StyledComponentsThemeProvider } from '@kbn/kibana-react-plugin/common';
import { EuiSpacer } from '@elastic/eui';
import { DataView } from '@kbn/data-views-plugin/common';
import type { DataView } from '@kbn/data-views-plugin/common';
import type { SavedSearch } from '@kbn/saved-search-plugin/public';
import { StorageContextProvider } from '@kbn/ml-local-storage';
import { UrlStateProvider } from '@kbn/ml-url-state';
@ -25,7 +26,8 @@ import { UI_SETTINGS } from '@kbn/data-plugin/common';
import { type Observable } from 'rxjs';
import { DataSourceContext } from '../../hooks/use_data_source';
import { AiopsAppContext, AiopsAppDependencies } from '../../hooks/use_aiops_app_context';
import type { AiopsAppDependencies } from '../../hooks/use_aiops_app_context';
import { AiopsAppContext } from '../../hooks/use_aiops_app_context';
import { AIOPS_STORAGE_KEYS } from '../../types/storage';
import { PageHeader } from '../page_header';

View file

@ -14,7 +14,7 @@ import {
type DefaultItemAction,
type EuiBasicTableColumn,
} from '@elastic/eui';
import { EuiTableSelectionType } from '@elastic/eui/src/components/basic_table/table_types';
import type { EuiTableSelectionType } from '@elastic/eui/src/components/basic_table/table_types';
import { FilterStateStore, type Filter } from '@kbn/es-query';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n-react';
@ -22,9 +22,8 @@ import { useTableState } from '@kbn/ml-in-memory-table';
import React, { useCallback, useEffect, useMemo, useRef, type FC } from 'react';
import { useAiopsAppContext } from '../../hooks/use_aiops_app_context';
import { useDataSource } from '../../hooks/use_data_source';
import type { FieldConfig, SelectedChangePoint } from './change_point_detection_context';
import {
FieldConfig,
SelectedChangePoint,
useChangePointDetectionContext,
type ChangePointAnnotation,
} from './change_point_detection_context';

View file

@ -5,7 +5,8 @@
* 2.0.
*/
import React, { FC, useCallback, useEffect, useRef } from 'react';
import type { FC } from 'react';
import React, { useCallback, useEffect, useRef } from 'react';
import type { Filter, Query, TimeRange } from '@kbn/es-query';
import { useCommonChartProps } from './use_common_chart_props';
import { useAiopsAppContext } from '../../hooks/use_aiops_app_context';

View file

@ -25,16 +25,16 @@ import { FormattedMessage } from '@kbn/i18n-react';
import { i18n } from '@kbn/i18n';
import type { FieldStatsServices } from '@kbn/unified-field-list/src/components/field_stats';
import { useTimefilter, useTimeRangeUpdates } from '@kbn/ml-date-picker';
import type { SaveModalDashboardProps } from '@kbn/presentation-util-plugin/public';
import {
LazySavedObjectSaveModalDashboard,
SaveModalDashboardProps,
withSuspense,
} from '@kbn/presentation-util-plugin/public';
import { EuiContextMenuProps } from '@elastic/eui/src/components/context_menu/context_menu';
import type { EuiContextMenuProps } from '@elastic/eui/src/components/context_menu/context_menu';
import { isDefined } from '@kbn/ml-is-defined';
import { MaxSeriesControl } from './max_series_control';
import type { ChangePointDetectionViewType } from '../../../common/constants';
import {
ChangePointDetectionViewType,
CHANGE_POINT_DETECTION_VIEW_TYPE,
EMBEDDABLE_CHANGE_POINT_CHART_TYPE,
} from '../../../common/constants';
@ -47,10 +47,10 @@ import { MAX_CHANGE_POINT_CONFIGS, SPLIT_FIELD_CARDINALITY_LIMIT } from './const
import { FunctionPicker } from './function_picker';
import { MetricFieldSelector } from './metric_field_selector';
import { SplitFieldSelector } from './split_field_selector';
import type { SelectedChangePoint } from './change_point_detection_context';
import {
type ChangePointAnnotation,
type FieldConfig,
SelectedChangePoint,
useChangePointDetectionContext,
} from './change_point_detection_context';
import { useChangePointResults } from './use_change_point_agg_request';

View file

@ -7,7 +7,8 @@
import { EuiButtonGroup } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import React, { FC } from 'react';
import type { FC } from 'react';
import React from 'react';
import { fnOperationTypeMapping } from './constants';
interface FunctionPickerProps {

View file

@ -16,7 +16,7 @@ import {
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { type SearchRequest } from '@elastic/elasticsearch/lib/api/types';
import { EuiComboBoxOptionOption } from '@elastic/eui/src/components/combo_box/types';
import type { EuiComboBoxOptionOption } from '@elastic/eui/src/components/combo_box/types';
import { debounce } from 'lodash';
import usePrevious from 'react-use/lib/usePrevious';
import { useAiopsAppContext } from '../../hooks/use_aiops_app_context';

View file

@ -5,7 +5,8 @@
* 2.0.
*/
import React, { FC, useCallback, useState } from 'react';
import type { FC } from 'react';
import React, { useCallback, useState } from 'react';
import { i18n } from '@kbn/i18n';
import { type Filter, fromKueryExpression, type Query } from '@kbn/es-query';
import { type SearchBarOwnProps } from '@kbn/unified-search-plugin/public/search_bar';

View file

@ -5,7 +5,8 @@
* 2.0.
*/
import React, { FC, useMemo, useCallback } from 'react';
import type { FC } from 'react';
import React, { useMemo, useCallback } from 'react';
import { i18n } from '@kbn/i18n';
import { EuiComboBox, type EuiComboBoxOptionOption, EuiFormRow } from '@elastic/eui';
import { useAiopsAppContext } from '../../hooks/use_aiops_app_context';

View file

@ -16,12 +16,12 @@ import type {
import { METRIC_TYPE } from '@kbn/analytics';
import { useReload } from '../../hooks/use_reload';
import { useAiopsAppContext } from '../../hooks/use_aiops_app_context';
import {
import type {
ChangePointAnnotation,
ChangePointDetectionRequestParams,
FieldConfig,
useChangePointDetectionControlsContext,
} from './change_point_detection_context';
import { useChangePointDetectionControlsContext } from './change_point_detection_context';
import { useDataSource } from '../../hooks/use_data_source';
import { useCancellableSearch } from '../../hooks/use_cancellable_search';
import {

View file

@ -11,7 +11,7 @@ import { useMemo } from 'react';
import { useFilterQueryUpdates } from '../../hooks/use_filters_query';
import { fnOperationTypeMapping } from './constants';
import { useDataSource } from '../../hooks/use_data_source';
import { ChangePointAnnotation, FieldConfig } from './change_point_detection_context';
import type { ChangePointAnnotation, FieldConfig } from './change_point_detection_context';
/**
* Provides common props for the Lens Embeddable component

View file

@ -5,11 +5,12 @@
* 2.0.
*/
import React, { FC } from 'react';
import type { FC } from 'react';
import React from 'react';
import { FormattedMessage } from '@kbn/i18n-react';
import { EuiButtonGroup, EuiFormRow, type EuiButtonGroupOptionProps } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { ChangePointDetectionViewType } from '../../../common/constants';
import type { ChangePointDetectionViewType } from '../../../common/constants';
const viewTypeOptions: EuiButtonGroupOptionProps[] = [
{

View file

@ -8,7 +8,7 @@
import React, { type FC } from 'react';
import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
import {
import type {
BarStyleAccessor,
RectAnnotationSpec,
} from '@elastic/charts/dist/chart_types/xy_chart/utils/specs';
@ -17,7 +17,7 @@ import type { LogRateHistogramItem, WindowParameters } from '@kbn/aiops-utils';
import { DocumentCountChart, type BrushSelectionUpdateHandler } from '@kbn/aiops-components';
import { useAiopsAppContext } from '../../../hooks/use_aiops_app_context';
import { DocumentCountStats } from '../../../get_document_stats';
import type { DocumentCountStats } from '../../../get_document_stats';
import { TotalCountHeader } from '../total_count_header';

View file

@ -5,13 +5,16 @@
* 2.0.
*/
import React, { FC, useMemo, useState, useCallback } from 'react';
import {
FieldStats,
import type { FC } from 'react';
import React, { useMemo, useState, useCallback } from 'react';
import type {
FieldStatsProps,
FieldStatsServices,
FieldStatsState,
FieldTopValuesBucketParams,
} from '@kbn/unified-field-list/src/components/field_stats';
import {
FieldStats,
FieldTopValuesBucket,
} from '@kbn/unified-field-list/src/components/field_stats';
import { isDefined } from '@kbn/ml-is-defined';

View file

@ -9,7 +9,7 @@ import { EuiButtonIcon, EuiToolTip } from '@elastic/eui';
import React, { useCallback, useMemo, useState } from 'react';
import { i18n } from '@kbn/i18n';
import { isDefined } from '@kbn/ml-is-defined';
import {
import type {
FieldStatsServices,
FieldStatsProps,
} from '@kbn/unified-field-list/src/components/field_stats';

View file

@ -9,7 +9,7 @@ import { i18n } from '@kbn/i18n';
import { createAction } from '@kbn/ui-actions-plugin/public';
import type { CoreStart } from '@kbn/core/public';
import { ACTION_CATEGORIZE_FIELD, type CategorizeFieldContext } from '@kbn/ml-ui-actions';
import { AiopsPluginStartDeps } from '../../types';
import type { AiopsPluginStartDeps } from '../../types';
import { showCategorizeFlyout } from './show_flyout';
export const createCategorizeFieldAction = (coreStart: CoreStart, plugins: AiopsPluginStartDeps) =>

View file

@ -5,13 +5,13 @@
* 2.0.
*/
import React, { FC, useCallback, useMemo, useState } from 'react';
import type { FC } from 'react';
import React, { useCallback, useMemo, useState } from 'react';
import type { EuiBasicTableColumn, EuiTableSelectionType } from '@elastic/eui';
import {
useEuiBackgroundColor,
EuiInMemoryTable,
EuiBasicTableColumn,
EuiTableSelectionType,
EuiHorizontalRule,
EuiSpacer,
EuiButtonIcon,
@ -21,8 +21,8 @@ import {
import { i18n } from '@kbn/i18n';
import type { TimefilterContract } from '@kbn/data-plugin/public';
import { DataViewField } from '@kbn/data-views-plugin/common';
import { Filter } from '@kbn/es-query';
import type { DataViewField } from '@kbn/data-views-plugin/common';
import type { Filter } from '@kbn/es-query';
import { useTableState } from '@kbn/ml-in-memory-table';
import moment from 'moment';

View file

@ -5,7 +5,8 @@
* 2.0.
*/
import React, { FC } from 'react';
import type { FC } from 'react';
import React from 'react';
import { EuiText, EuiSpacer, useEuiTheme } from '@elastic/eui';
import { i18n } from '@kbn/i18n';

View file

@ -5,7 +5,8 @@
* 2.0.
*/
import React, { FC } from 'react';
import type { FC } from 'react';
import React from 'react';
import { EuiFlexGroup, EuiFlexItem, EuiText, EuiButtonEmpty } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n-react';
import {
@ -13,7 +14,7 @@ import {
QUERY_MODE,
} from '../../../../common/api/log_categorization/get_category_query';
import { useEuiTheme } from '../../../hooks/use_eui_theme';
import { getLabels } from './labels';
import type { getLabels } from './labels';
interface Props {
categoriesCount: number;

View file

@ -5,11 +5,10 @@
* 2.0.
*/
import React, { FC } from 'react';
import {
FieldValidationResults,
CATEGORY_EXAMPLES_VALIDATION_STATUS,
} from '@kbn/ml-category-validator';
import type { FC } from 'react';
import React from 'react';
import type { FieldValidationResults } from '@kbn/ml-category-validator';
import { CATEGORY_EXAMPLES_VALIDATION_STATUS } from '@kbn/ml-category-validator';
import { EuiCallOut } from '@elastic/eui';
import { i18n } from '@kbn/i18n';

View file

@ -5,7 +5,8 @@
* 2.0.
*/
import React, { FC } from 'react';
import type { FC } from 'react';
import React from 'react';
import moment from 'moment';
import { EuiButtonEmpty } from '@elastic/eui';

View file

@ -5,7 +5,8 @@
* 2.0.
*/
import React, { FC, useMemo } from 'react';
import type { FC } from 'react';
import React, { useMemo } from 'react';
import { i18n } from '@kbn/i18n';
import { DocumentCountChart as DocumentCountChartRoot } from '@kbn/aiops-components';
@ -13,7 +14,7 @@ import { DocumentCountChart as DocumentCountChartRoot } from '@kbn/aiops-compone
import type { Category } from '../../../common/api/log_categorization/types';
import { useAiopsAppContext } from '../../hooks/use_aiops_app_context';
import { DocumentCountStats } from '../../get_document_stats';
import type { DocumentCountStats } from '../../get_document_stats';
import { TotalCountHeader } from '../document_count_content/total_count_header';

View file

@ -5,9 +5,11 @@
* 2.0.
*/
import React, { FC, useCallback, useMemo } from 'react';
import type { FC } from 'react';
import React, { useCallback, useMemo } from 'react';
import { EuiText, EuiHorizontalRule } from '@elastic/eui';
import { css, SerializedStyles } from '@emotion/react';
import type { SerializedStyles } from '@emotion/react';
import { css } from '@emotion/react';
import type { Category } from '../../../common/api/log_categorization/types';
import { useIsDarkTheme } from '../../hooks/use_eui_theme';

View file

@ -5,7 +5,8 @@
* 2.0.
*/
import React, { FC } from 'react';
import type { FC } from 'react';
import React from 'react';
import { FormattedMessage } from '@kbn/i18n-react';
import { EuiEmptyPrompt } from '@elastic/eui';

View file

@ -5,7 +5,8 @@
* 2.0.
*/
import React, { FC } from 'react';
import type { FC } from 'react';
import React from 'react';
import {
EuiButton,
EuiFlexGroup,

View file

@ -4,7 +4,8 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import React, { FC } from 'react';
import type { FC } from 'react';
import React from 'react';
import { pick } from 'lodash';
import type { SavedSearch } from '@kbn/saved-search-plugin/public';

View file

@ -4,7 +4,8 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import React, { FC, useState, useEffect, useCallback, useRef, useMemo } from 'react';
import type { FC } from 'react';
import React, { useState, useEffect, useCallback, useRef, useMemo } from 'react';
import {
EuiTitle,
@ -24,7 +25,8 @@ import type { SavedSearch } from '@kbn/saved-search-plugin/public';
import type { DataView, DataViewField } from '@kbn/data-views-plugin/public';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n-react';
import { buildEmptyFilter, Filter } from '@kbn/es-query';
import type { Filter } from '@kbn/es-query';
import { buildEmptyFilter } from '@kbn/es-query';
import { usePageUrlState } from '@kbn/ml-url-state';
import type { FieldValidationResults } from '@kbn/ml-category-validator';
import type { CategorizationAdditionalFilter } from '../../../common/api/log_categorization/create_category_request';

View file

@ -5,9 +5,11 @@
* 2.0.
*/
import React, { FC, useState, useEffect, useCallback, useMemo } from 'react';
import type { FC } from 'react';
import React, { useState, useEffect, useCallback, useMemo } from 'react';
import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import type { EuiComboBoxOptionOption } from '@elastic/eui';
import {
EuiButton,
EuiSpacer,
@ -15,7 +17,6 @@ import {
EuiFlexItem,
EuiPageBody,
EuiComboBox,
EuiComboBoxOptionOption,
EuiFormRow,
EuiSkeletonText,
} from '@elastic/eui';

View file

@ -5,7 +5,8 @@
* 2.0.
*/
import React, { FC, useCallback, useMemo, useState } from 'react';
import type { FC } from 'react';
import React, { useCallback, useMemo, useState } from 'react';
import {
EuiFlexItem,
EuiPopover,
@ -21,12 +22,8 @@ import { FormattedMessage } from '@kbn/i18n-react';
import useObservable from 'react-use/lib/useObservable';
import { RandomSamplerRangeSlider } from './random_sampler_range_slider';
import {
RandomSampler,
RandomSamplerOption,
RANDOM_SAMPLER_OPTION,
RANDOM_SAMPLER_SELECT_OPTIONS,
} from './random_sampler';
import type { RandomSampler, RandomSamplerOption } from './random_sampler';
import { RANDOM_SAMPLER_OPTION, RANDOM_SAMPLER_SELECT_OPTIONS } from './random_sampler';
interface Props {
randomSampler: RandomSampler;

View file

@ -5,7 +5,8 @@
* 2.0.
*/
import React, { FC } from 'react';
import type { FC } from 'react';
import React from 'react';
import { EuiBetaBadge } from '@elastic/eui';

View file

@ -5,7 +5,8 @@
* 2.0.
*/
import React, { FC } from 'react';
import type { FC } from 'react';
import React from 'react';
import { pick } from 'lodash';
import type { SavedSearch } from '@kbn/saved-search-plugin/public';

View file

@ -5,13 +5,15 @@
* 2.0.
*/
import React, { useCallback, useEffect, useState, FC } from 'react';
import type { FC } from 'react';
import React, { useCallback, useEffect, useState } from 'react';
import { isEqual } from 'lodash';
import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import { EuiFlexGroup, EuiFlexItem, EuiPageBody, EuiPageSection, EuiSpacer } from '@elastic/eui';
import { Filter, FilterStateStore, Query } from '@kbn/es-query';
import type { Filter, Query } from '@kbn/es-query';
import { FilterStateStore } from '@kbn/es-query';
import { useUrlState, usePageUrlState } from '@kbn/ml-url-state';
import type { SearchQueryLanguage } from '@kbn/ml-query-utils';
import type { WindowParameters } from '@kbn/aiops-utils';

View file

@ -5,7 +5,8 @@
* 2.0.
*/
import React, { useEffect, useMemo, useState, FC } from 'react';
import type { FC } from 'react';
import React, { useEffect, useMemo, useState } from 'react';
import { isEqual, uniq } from 'lodash';
import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';

View file

@ -5,20 +5,20 @@
* 2.0.
*/
import React, { FC, useCallback, useEffect, useMemo, useState } from 'react';
import type { FC } from 'react';
import React, { useCallback, useEffect, useMemo, useState } from 'react';
import { orderBy, isEqual } from 'lodash';
import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import type { EuiBasicTableColumn, EuiTableSortingType } from '@elastic/eui';
import {
useEuiBackgroundColor,
EuiBadge,
EuiBasicTable,
EuiBasicTableColumn,
EuiCode,
EuiIcon,
EuiIconTip,
EuiText,
EuiTableSortingType,
EuiToolTip,
} from '@elastic/eui';

View file

@ -5,19 +5,19 @@
* 2.0.
*/
import React, { FC, useCallback, useEffect, useMemo, useState } from 'react';
import type { FC } from 'react';
import React, { useCallback, useEffect, useMemo, useState } from 'react';
import { orderBy, isEqual } from 'lodash';
import type { EuiBasicTableColumn, EuiTableSortingType } from '@elastic/eui';
import {
useEuiBackgroundColor,
EuiBadge,
EuiBasicTable,
EuiBasicTableColumn,
EuiButtonIcon,
EuiIcon,
EuiScreenReaderOnly,
EuiSpacer,
EuiTableSortingType,
EuiText,
EuiToolTip,
RIGHT_ALIGNMENT,

View file

@ -7,7 +7,7 @@
import React, { useMemo } from 'react';
import { SerializableRecord } from '@kbn/utility-types';
import type { SerializableRecord } from '@kbn/utility-types';
import { fromKueryExpression, toElasticsearchQuery } from '@kbn/es-query';
import { i18n } from '@kbn/i18n';
import { isSignificantItem, type SignificantItem, SIGNIFICANT_ITEM_TYPE } from '@kbn/ml-agg-utils';

View file

@ -5,18 +5,12 @@
* 2.0.
*/
import React, { FC } from 'react';
import type { FC } from 'react';
import React from 'react';
import { css } from '@emotion/react';
import {
Chart,
BarSeries,
PartialTheme,
ScaleType,
Settings,
Tooltip,
TooltipType,
} from '@elastic/charts';
import type { PartialTheme } from '@elastic/charts';
import { Chart, BarSeries, ScaleType, Settings, Tooltip, TooltipType } from '@elastic/charts';
import { EuiLoadingChart, EuiTextColor } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n-react';

View file

@ -6,7 +6,8 @@
*/
import { css } from '@emotion/react';
import React, { FC, useCallback, useMemo } from 'react';
import type { FC } from 'react';
import React, { useCallback, useMemo } from 'react';
import { EuiFlexGroup, EuiFlexItem, EuiPageHeader } from '@elastic/eui';

View file

@ -5,12 +5,13 @@
* 2.0.
*/
import React, { FC, useEffect, useState } from 'react';
import type { FC } from 'react';
import React, { useEffect, useState } from 'react';
import { EuiFlexItem, EuiFlexGroup } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { Query, Filter } from '@kbn/es-query';
import type { Query, Filter } from '@kbn/es-query';
import type { TimeRange } from '@kbn/es-query';
import { DataView, DataViewField } from '@kbn/data-views-plugin/public';
import type { DataView, DataViewField } from '@kbn/data-views-plugin/public';
import type { SearchQueryLanguage } from '@kbn/ml-query-utils';
import { useAiopsAppContext } from '../../hooks/use_aiops_app_context';
import { createMergedEsQuery } from '../../application/utils/search_utils';

View file

@ -22,7 +22,8 @@ import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n-react';
import { isPopulatedObject } from '@kbn/ml-is-populated-object';
import { pick } from 'lodash';
import React, { FC, useCallback, useEffect, useMemo, useState } from 'react';
import type { FC } from 'react';
import React, { useCallback, useEffect, useMemo, useState } from 'react';
import usePrevious from 'react-use/lib/usePrevious';
import {
ChangePointDetectionControlsContextProvider,
@ -38,8 +39,8 @@ import { ViewTypeSelector } from '../components/change_point_detection/view_type
import { useAiopsAppContext } from '../hooks/use_aiops_app_context';
import { DataSourceContextProvider } from '../hooks/use_data_source';
import { DEFAULT_SERIES } from './const';
import { EmbeddableChangePointChartInput } from './embeddable_change_point_chart';
import { EmbeddableChangePointChartProps } from './embeddable_change_point_chart_component';
import type { EmbeddableChangePointChartInput } from './embeddable_change_point_chart';
import type { EmbeddableChangePointChartProps } from './embeddable_change_point_chart_component';
import { type EmbeddableChangePointChartExplicitInput } from './types';
export interface AnomalyChartsInitializerProps {

View file

@ -7,28 +7,27 @@
import React, { Suspense } from 'react';
import ReactDOM from 'react-dom';
import {
Embeddable as AbstractEmbeddable,
EmbeddableInput,
EmbeddableOutput,
IContainer,
} from '@kbn/embeddable-plugin/public';
import type { EmbeddableInput, EmbeddableOutput, IContainer } from '@kbn/embeddable-plugin/public';
import { Embeddable as AbstractEmbeddable } from '@kbn/embeddable-plugin/public';
import { KibanaThemeProvider } from '@kbn/kibana-react-plugin/public';
import { ThemeServiceStart } from '@kbn/core-theme-browser';
import { DataPublicPluginStart, UI_SETTINGS } from '@kbn/data-plugin/public';
import { type CoreStart, IUiSettingsClient } from '@kbn/core/public';
import type { ThemeServiceStart } from '@kbn/core-theme-browser';
import type { DataPublicPluginStart } from '@kbn/data-plugin/public';
import { UI_SETTINGS } from '@kbn/data-plugin/public';
import type { IUiSettingsClient } from '@kbn/core/public';
import { type CoreStart } from '@kbn/core/public';
import { DatePickerContextProvider } from '@kbn/ml-date-picker';
import { pick } from 'lodash';
import { LensPublicStart } from '@kbn/lens-plugin/public';
import type { LensPublicStart } from '@kbn/lens-plugin/public';
import { Subject } from 'rxjs';
import type { UsageCollectionSetup } from '@kbn/usage-collection-plugin/public';
import type { DataView } from '@kbn/data-views-plugin/common';
import type { FieldFormatsStart } from '@kbn/field-formats-plugin/public';
import { EmbeddableInputTracker } from './embeddable_chart_component_wrapper';
import { EMBEDDABLE_ORIGIN, EmbeddableChangePointType } from '../../common/constants';
import type { EmbeddableChangePointType } from '../../common/constants';
import { EMBEDDABLE_ORIGIN } from '../../common/constants';
import { AiopsAppContext, type AiopsAppDependencies } from '../hooks/use_aiops_app_context';
import { EmbeddableChangePointChartProps } from './embeddable_change_point_chart_component';
import type { EmbeddableChangePointChartProps } from './embeddable_change_point_chart_component';
export type EmbeddableChangePointChartInput = EmbeddableInput & EmbeddableChangePointChartProps;

View file

@ -8,12 +8,8 @@
import type { CoreStart } from '@kbn/core/public';
import type { TimeRange } from '@kbn/es-query';
import React from 'react';
import {
EmbeddableFactory,
EmbeddableOutput,
EmbeddableRoot,
useEmbeddableFactory,
} from '@kbn/embeddable-plugin/public';
import type { EmbeddableFactory, EmbeddableOutput } from '@kbn/embeddable-plugin/public';
import { EmbeddableRoot, useEmbeddableFactory } from '@kbn/embeddable-plugin/public';
import { EuiLoadingChart } from '@elastic/eui';
import {
type ChangePointDetectionViewType,

View file

@ -5,23 +5,18 @@
* 2.0.
*/
import {
EmbeddableFactoryDefinition,
ErrorEmbeddable,
IContainer,
} from '@kbn/embeddable-plugin/public';
import type { EmbeddableFactoryDefinition, IContainer } from '@kbn/embeddable-plugin/public';
import { ErrorEmbeddable } from '@kbn/embeddable-plugin/public';
import { i18n } from '@kbn/i18n';
import { type DataPublicPluginStart } from '@kbn/data-plugin/public';
import { StartServicesAccessor } from '@kbn/core-lifecycle-browser';
import {
import type { StartServicesAccessor } from '@kbn/core-lifecycle-browser';
import type {
EMBEDDABLE_CHANGE_POINT_CHART_TYPE,
EmbeddableChangePointType,
} from '../../common/constants';
import type { AiopsPluginStart, AiopsPluginStartDeps } from '../types';
import {
EmbeddableChangePointChart,
EmbeddableChangePointChartInput,
} from './embeddable_change_point_chart';
import type { EmbeddableChangePointChartInput } from './embeddable_change_point_chart';
import { EmbeddableChangePointChart } from './embeddable_change_point_chart';
export interface EmbeddableChangePointChartStartServices {
data: DataPublicPluginStart;

View file

@ -7,7 +7,8 @@
import { BehaviorSubject, combineLatest, type Observable } from 'rxjs';
import { distinctUntilChanged, map } from 'rxjs/operators';
import React, { FC, useEffect, useMemo, useState } from 'react';
import type { FC } from 'react';
import React, { useEffect, useMemo, useState } from 'react';
import { css } from '@emotion/react';
import useObservable from 'react-use/lib/useObservable';
import { ChangePointsTable } from '../components/change_point_detection/change_points_table';
@ -22,7 +23,7 @@ import type {
EmbeddableChangePointChartInput,
EmbeddableChangePointChartOutput,
} from './embeddable_change_point_chart';
import { EmbeddableChangePointChartProps } from './embeddable_change_point_chart_component';
import type { EmbeddableChangePointChartProps } from './embeddable_change_point_chart_component';
import { FilterQueryContextProvider, useFilterQueryUpdates } from '../hooks/use_filters_query';
import { DataSourceContextProvider, useDataSource } from '../hooks/use_data_source';
import { useAiopsAppContext } from '../hooks/use_aiops_app_context';

View file

@ -8,8 +8,8 @@
import type { CoreStart } from '@kbn/core/public';
import { toMountPoint } from '@kbn/react-kibana-mount';
import React from 'react';
import { EmbeddableChangePointChartExplicitInput } from './types';
import { AiopsAppDependencies } from '..';
import type { EmbeddableChangePointChartExplicitInput } from './types';
import type { AiopsAppDependencies } from '..';
import { AiopsAppContext } from '../hooks/use_aiops_app_context';
import type { AiopsPluginStartDeps } from '../types';
import { ChangePointChartInitializer } from './change_point_chart_initializer';

View file

@ -6,13 +6,13 @@
*/
import type { FC } from 'react';
import { IEmbeddable } from '@kbn/embeddable-plugin/public';
import type { IEmbeddable } from '@kbn/embeddable-plugin/public';
import type { SelectedChangePoint } from '../components/change_point_detection/change_point_detection_context';
import {
import type {
EmbeddableChangePointChartInput,
EmbeddableChangePointChartOutput,
} from './embeddable_change_point_chart';
import { EmbeddableChangePointChartProps } from './embeddable_change_point_chart_component';
import type { EmbeddableChangePointChartProps } from './embeddable_change_point_chart_component';
export type EmbeddableChangePointChartExplicitInput = {
title: string;

View file

@ -16,7 +16,7 @@ import type { Query } from '@kbn/es-query';
import type { RandomSamplerWrapper } from '@kbn/ml-random-sampler-utils';
import { buildExtendedBaseFilterCriteria } from './application/utils/build_extended_base_filter_criteria';
import { GroupTableItem } from './components/log_rate_analysis_results_table/types';
import type { GroupTableItem } from './components/log_rate_analysis_results_table/types';
export interface DocumentCountStats {
interval?: number;

View file

@ -8,8 +8,8 @@
import { useCallback } from 'react';
import { stringHash } from '@kbn/ml-string-hash';
import { AttachmentType } from '@kbn/cases-plugin/common';
import { EmbeddableChangePointChartInput } from '../embeddable/embeddable_change_point_chart';
import { EmbeddableChangePointChartType } from '../embeddable/embeddable_change_point_chart_factory';
import type { EmbeddableChangePointChartInput } from '../embeddable/embeddable_change_point_chart';
import type { EmbeddableChangePointChartType } from '../embeddable/embeddable_change_point_chart_factory';
import { useAiopsAppContext } from './use_aiops_app_context';
/**

View file

@ -5,8 +5,9 @@
* 2.0.
*/
import React, { createContext, FC, useCallback, useContext, useEffect, useState } from 'react';
import { DataView } from '@kbn/data-views-plugin/common';
import type { FC } from 'react';
import React, { createContext, useCallback, useContext, useEffect, useState } from 'react';
import type { DataView } from '@kbn/data-views-plugin/common';
import type { SavedSearch } from '@kbn/saved-search-plugin/public';
import { EuiEmptyPrompt } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n-react';

View file

@ -16,12 +16,8 @@ import { extractErrorProperties } from '@kbn/ml-error-utils';
import { RANDOM_SAMPLER_SEED } from '../../common/constants';
import {
DocumentCountStats,
getDocumentCountStatsRequest,
processDocumentCountStats,
DocumentStatsSearchStrategyParams,
} from '../get_document_stats';
import type { DocumentCountStats, DocumentStatsSearchStrategyParams } from '../get_document_stats';
import { getDocumentCountStatsRequest, processDocumentCountStats } from '../get_document_stats';
import { useAiopsAppContext } from './use_aiops_app_context';

View file

@ -5,7 +5,8 @@
* 2.0.
*/
import React, { FC, Suspense } from 'react';
import type { FC } from 'react';
import React, { Suspense } from 'react';
import { EuiErrorBoundary, EuiSkeletonText } from '@elastic/eui';
import type { LogRateAnalysisAppStateProps } from './components/log_rate_analysis';

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { PluginInitializerContext } from '@kbn/core/server';
import type { PluginInitializerContext } from '@kbn/core/server';
export async function plugin(initializerContext: PluginInitializerContext) {
const { AiopsPlugin } = await import('./plugin');

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { UsageCounter } from '@kbn/usage-collection-plugin/server';
import type { UsageCounter } from '@kbn/usage-collection-plugin/server';
export function trackAIOpsRouteUsage(
analysisType: string,

Some files were not shown because too many files have changed in this diff Show more