From e13f15f646a3bb2363656ea8420106a7efe3f8ae Mon Sep 17 00:00:00 2001 From: Jack Westbrook Date: Tue, 11 May 2021 18:47:34 +0200 Subject: [PATCH] Docs: reduce number of API Extractor warnings --- .../src/monaco/languageRegistry.ts | 6 ++++ .../grafana-data/src/types/valueMapping.ts | 30 +++++++++++++++++++ .../grafana-data/src/utils/anyToNumber.ts | 6 +++- 3 files changed, 41 insertions(+), 1 deletion(-) diff --git a/packages/grafana-data/src/monaco/languageRegistry.ts b/packages/grafana-data/src/monaco/languageRegistry.ts index 5a8fe8bded7..fcfc843ab31 100644 --- a/packages/grafana-data/src/monaco/languageRegistry.ts +++ b/packages/grafana-data/src/monaco/languageRegistry.ts @@ -1,7 +1,13 @@ import { Registry, RegistryItem } from '../utils/Registry'; +/** + * @alpha + */ export interface MonacoLanguageRegistryItem extends RegistryItem { init: () => Promise; } +/** + * @alpha + */ export const monacoLanguageRegistry = new Registry(); diff --git a/packages/grafana-data/src/types/valueMapping.ts b/packages/grafana-data/src/types/valueMapping.ts index f371d42de69..9a6eda042d5 100644 --- a/packages/grafana-data/src/types/valueMapping.ts +++ b/packages/grafana-data/src/types/valueMapping.ts @@ -1,39 +1,63 @@ +/** + * @alpha + */ export enum MappingType { ValueToText = 'value', // was 1 RangeToText = 'range', // was 2 SpecialValue = 'special', } +/** + * @alpha + */ export interface ValueMappingResult { text?: string; color?: string; index?: number; } +/** + * @alpha + */ interface BaseValueMap { type: MappingType; options: T; } +/** + * @alpha + */ export interface ValueMap extends BaseValueMap> { type: MappingType.ValueToText; } +/** + * @alpha + */ export interface RangeMapOptions { from: number | null; // changed from string to: number | null; result: ValueMappingResult; } +/** + * @alpha + */ export interface RangeMap extends BaseValueMap { type: MappingType.RangeToText; } +/** + * @alpha + */ export interface SpecialValueOptions { match: SpecialValueMatch; result: ValueMappingResult; } +/** + * @alpha + */ export enum SpecialValueMatch { True = 'true', False = 'false', @@ -43,8 +67,14 @@ export enum SpecialValueMatch { Empty = 'empty', } +/** + * @alpha + */ export interface SpecialValueMap extends BaseValueMap { type: MappingType.SpecialValue; } +/** + * @alpha + */ export type ValueMapping = ValueMap | RangeMap | SpecialValueMap; diff --git a/packages/grafana-data/src/utils/anyToNumber.ts b/packages/grafana-data/src/utils/anyToNumber.ts index cf480d4d3c9..7cb69d0920d 100644 --- a/packages/grafana-data/src/utils/anyToNumber.ts +++ b/packages/grafana-data/src/utils/anyToNumber.ts @@ -1,6 +1,10 @@ import { toNumber } from 'lodash'; -/** Will return any value as a number or NaN */ +/** + * Will return any value as a number or NaN + * + * @internal + * */ export function anyToNumber(value: any): number { if (typeof value === 'number') { return value;