mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[Deprecations/Docs] Address uncommented apis (#204198)
## Summary #203042 highlighted these APIs not having comments. ### Checklist - [x] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials
This commit is contained in:
parent
bc5c097184
commit
25b171d6d7
3 changed files with 34 additions and 1 deletions
|
@ -25,10 +25,14 @@ import { registerRoutes } from './routes';
|
|||
import { config as deprecationConfig, DeprecationConfigType } from './deprecation_config';
|
||||
import { registerApiDeprecationsInfo, registerConfigDeprecationsInfo } from './deprecations';
|
||||
|
||||
/**
|
||||
* Deprecation Service: Internal Start contract
|
||||
*/
|
||||
export interface InternalDeprecationsServiceStart {
|
||||
/**
|
||||
* Creates a {@link DeprecationsClient} with provided SO client and ES client.
|
||||
*
|
||||
* @param esClient Scoped Elasticsearch client
|
||||
* @param savedObjectsClient Scoped SO Client
|
||||
*/
|
||||
asScopedToClient(
|
||||
esClient: IScopedClusterClient,
|
||||
|
|
|
@ -87,27 +87,50 @@ import type { SavedObjectsClientContract } from '@kbn/core-saved-objects-api-ser
|
|||
* @public
|
||||
*/
|
||||
export interface DeprecationsServiceSetup {
|
||||
/**
|
||||
* Registers deprecation messages or notices for a specific feature or functionality
|
||||
* within the application. This allows developers to flag certain behaviors or APIs
|
||||
* as deprecated, providing guidance and warnings for future deprecation plans.
|
||||
*
|
||||
* @param {RegisterDeprecationsConfig} deprecationContext - The configuration object containing
|
||||
* information about the deprecated features, including messages, corrective actions,
|
||||
* and any relevant metadata to inform users or developers about the deprecation.
|
||||
*/
|
||||
registerDeprecations: (deprecationContext: RegisterDeprecationsConfig) => void;
|
||||
}
|
||||
|
||||
/**
|
||||
* Options to provide when registering deprecations via {@link DeprecationsServiceSetup.registerDeprecations}.
|
||||
* @public
|
||||
*/
|
||||
export interface RegisterDeprecationsConfig {
|
||||
/**
|
||||
* Method called when the user wants to list any existing deprecations.
|
||||
* Returns the list of deprecation messages to warn about.
|
||||
* @param {GetDeprecationsContext} context Scoped clients and helpers to ease fetching the deprecations.
|
||||
*/
|
||||
getDeprecations: (context: GetDeprecationsContext) => MaybePromise<DeprecationsDetails[]>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Scoped clients and helpers to ease fetching the deprecations.
|
||||
* @public
|
||||
*/
|
||||
export interface GetDeprecationsContext {
|
||||
/** Elasticsearch client scoped to the current user */
|
||||
esClient: IScopedClusterClient;
|
||||
/** Saved Objects client scoped to the current user and space */
|
||||
savedObjectsClient: SavedObjectsClientContract;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides a method to scope the {@link DeprecationsServiceSetup | Deprecations Service} to a specific domain.
|
||||
* @public
|
||||
*/
|
||||
export interface DeprecationRegistryProvider {
|
||||
/**
|
||||
* Returns the {@link DeprecationsServiceSetup | Deprecations Service} scoped to a specific domain.
|
||||
* @param domainId Domain ID to categorize the deprecations reported under it.
|
||||
*/
|
||||
getRegistry: (domainId: string) => DeprecationsServiceSetup;
|
||||
}
|
||||
|
|
|
@ -15,6 +15,9 @@ import type { DomainDeprecationDetails } from '@kbn/core-deprecations-common';
|
|||
* @public
|
||||
*/
|
||||
export interface DeprecationsClient {
|
||||
/**
|
||||
* Fetch all Kibana deprecations.
|
||||
*/
|
||||
getAllDeprecations: () => Promise<DomainDeprecationDetails[]>;
|
||||
}
|
||||
|
||||
|
@ -23,5 +26,8 @@ export interface DeprecationsClient {
|
|||
* @public
|
||||
*/
|
||||
export interface DeprecationsRequestHandlerContext {
|
||||
/**
|
||||
* {@link DeprecationsClient | Deprecations client} exposed in the request handler context.
|
||||
*/
|
||||
client: DeprecationsClient;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue