Docs: added code comments for everything in the @grafana/runtime package. (#23456)

* added comments for the angular loader.

* added code documentation for backendSrv.

* docs for datasource_srv.

* added some more docs.

* added documentation for the locationsrv.

* started to add docs for echo srv.

* added docs for meta srv.2

* added docs for analytics.

* draft documentation of the DataSourceWithBackend.

* added docs for last files.

* fixed all warnigns in api-extractor.

* fixed some typos and captializations.
This commit is contained in:
Marcus Andersson
2020-04-15 10:46:51 +02:00
committed by GitHub
parent b3df2d007a
commit ab8305fcb9
13 changed files with 420 additions and 29 deletions
@@ -10,21 +10,37 @@ import { Observable, from } from 'rxjs';
import { config } from '..';
import { getBackendSrv } from '../services';
// Ideally internal (exported for consistency)
const ExpressionDatasourceID = '__expr__';
/**
* Describes the current healt status of a data source plugin.
*
* @public
*/
export enum HealthStatus {
Unknown = 'UNKNOWN',
OK = 'OK',
Error = 'ERROR',
}
/**
* Describes the payload returned when checking the health of a data source
* plugin.
*
* @public
*/
export interface HealthCheckResult {
status: HealthStatus;
message: string;
details?: Record<string, any>;
}
/**
* Extend this class to implement a data source plugin that is depending on the Grafana
* backend API.
*
* @public
*/
export class DataSourceWithBackend<
TQuery extends DataQuery = DataQuery,
TOptions extends DataSourceJsonData = DataSourceJsonData
@@ -86,6 +102,8 @@ export class DataSourceWithBackend<
/**
* Override to apply template variables
*
* @virtual
*/
applyTemplateVariables(query: DataQuery) {
return query;