mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Docs: reduce number of API Extractor warnings
This commit is contained in:
parent
7cd4066e9a
commit
e13f15f646
@ -1,7 +1,13 @@
|
||||
import { Registry, RegistryItem } from '../utils/Registry';
|
||||
|
||||
/**
|
||||
* @alpha
|
||||
*/
|
||||
export interface MonacoLanguageRegistryItem extends RegistryItem {
|
||||
init: () => Promise<void>;
|
||||
}
|
||||
|
||||
/**
|
||||
* @alpha
|
||||
*/
|
||||
export const monacoLanguageRegistry = new Registry<MonacoLanguageRegistryItem>();
|
||||
|
@ -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<T> {
|
||||
type: MappingType;
|
||||
options: T;
|
||||
}
|
||||
|
||||
/**
|
||||
* @alpha
|
||||
*/
|
||||
export interface ValueMap extends BaseValueMap<Record<string, ValueMappingResult>> {
|
||||
type: MappingType.ValueToText;
|
||||
}
|
||||
|
||||
/**
|
||||
* @alpha
|
||||
*/
|
||||
export interface RangeMapOptions {
|
||||
from: number | null; // changed from string
|
||||
to: number | null;
|
||||
result: ValueMappingResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* @alpha
|
||||
*/
|
||||
export interface RangeMap extends BaseValueMap<RangeMapOptions> {
|
||||
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<SpecialValueOptions> {
|
||||
type: MappingType.SpecialValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* @alpha
|
||||
*/
|
||||
export type ValueMapping = ValueMap | RangeMap | SpecialValueMap;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user