kibana/x-pack/plugins/ml/server/shared.ts
Walter Rafelsberger 385d0dc84a
[ML] Package @kbn/ml-anomaly-utils (#155697)
Creates Package `@kbn/ml-anomaly-utils`.

- This moves some of the utility functions, constants and types related
to Anomaly Detection we previously exposed from the `ml` plugin itself
to a package `@kbn/ml-anomaly-utils`, resulting in ~5.9KB reduction of
the plugin's page load bundle size.
- To reduce increases in async bundle size for consuming plugins the
utils have been refactored into individual files to allow deep imports
and get some optimization through that. Some previously duplicated code
in consuming plugins has been deleted and replaced with deep imports of
the corresponding original code in the package.
- Types have been prefixed with `Ml`.
- Constants have been prefixed with `ML_`.

Created package via `node scripts/generate package @kbn/ml-anomaly-utils
--web --dir ./x-pack/packages/ml/anomaly_utils`.
2023-05-03 08:46:27 +02:00

19 lines
1 KiB
TypeScript

/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
export * from '../common/types/anomaly_detection_jobs';
export * from './lib/capabilities/errors';
export type { ModuleSetupPayload } from './shared_services/providers/modules';
import type { SharedServices } from './shared_services';
export type AlertingService = ReturnType<SharedServices['alertingServiceProvider']>;
export type AnomalyDetectors = ReturnType<SharedServices['anomalyDetectorsProvider']>;
export type JobService = ReturnType<SharedServices['jobServiceProvider']>;
export type MlSystem = ReturnType<SharedServices['mlSystemProvider']>;
export type Modules = ReturnType<SharedServices['modulesProvider']>;
export type ResultsService = ReturnType<SharedServices['resultsServiceProvider']>;
export type TrainedModels = ReturnType<SharedServices['trainedModelsProvider']>;