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';
|
import { Registry, RegistryItem } from '../utils/Registry';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @alpha
|
||||||
|
*/
|
||||||
export interface MonacoLanguageRegistryItem extends RegistryItem {
|
export interface MonacoLanguageRegistryItem extends RegistryItem {
|
||||||
init: () => Promise<void>;
|
init: () => Promise<void>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @alpha
|
||||||
|
*/
|
||||||
export const monacoLanguageRegistry = new Registry<MonacoLanguageRegistryItem>();
|
export const monacoLanguageRegistry = new Registry<MonacoLanguageRegistryItem>();
|
||||||
|
@ -1,39 +1,63 @@
|
|||||||
|
/**
|
||||||
|
* @alpha
|
||||||
|
*/
|
||||||
export enum MappingType {
|
export enum MappingType {
|
||||||
ValueToText = 'value', // was 1
|
ValueToText = 'value', // was 1
|
||||||
RangeToText = 'range', // was 2
|
RangeToText = 'range', // was 2
|
||||||
SpecialValue = 'special',
|
SpecialValue = 'special',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @alpha
|
||||||
|
*/
|
||||||
export interface ValueMappingResult {
|
export interface ValueMappingResult {
|
||||||
text?: string;
|
text?: string;
|
||||||
color?: string;
|
color?: string;
|
||||||
index?: number;
|
index?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @alpha
|
||||||
|
*/
|
||||||
interface BaseValueMap<T> {
|
interface BaseValueMap<T> {
|
||||||
type: MappingType;
|
type: MappingType;
|
||||||
options: T;
|
options: T;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @alpha
|
||||||
|
*/
|
||||||
export interface ValueMap extends BaseValueMap<Record<string, ValueMappingResult>> {
|
export interface ValueMap extends BaseValueMap<Record<string, ValueMappingResult>> {
|
||||||
type: MappingType.ValueToText;
|
type: MappingType.ValueToText;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @alpha
|
||||||
|
*/
|
||||||
export interface RangeMapOptions {
|
export interface RangeMapOptions {
|
||||||
from: number | null; // changed from string
|
from: number | null; // changed from string
|
||||||
to: number | null;
|
to: number | null;
|
||||||
result: ValueMappingResult;
|
result: ValueMappingResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @alpha
|
||||||
|
*/
|
||||||
export interface RangeMap extends BaseValueMap<RangeMapOptions> {
|
export interface RangeMap extends BaseValueMap<RangeMapOptions> {
|
||||||
type: MappingType.RangeToText;
|
type: MappingType.RangeToText;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @alpha
|
||||||
|
*/
|
||||||
export interface SpecialValueOptions {
|
export interface SpecialValueOptions {
|
||||||
match: SpecialValueMatch;
|
match: SpecialValueMatch;
|
||||||
result: ValueMappingResult;
|
result: ValueMappingResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @alpha
|
||||||
|
*/
|
||||||
export enum SpecialValueMatch {
|
export enum SpecialValueMatch {
|
||||||
True = 'true',
|
True = 'true',
|
||||||
False = 'false',
|
False = 'false',
|
||||||
@ -43,8 +67,14 @@ export enum SpecialValueMatch {
|
|||||||
Empty = 'empty',
|
Empty = 'empty',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @alpha
|
||||||
|
*/
|
||||||
export interface SpecialValueMap extends BaseValueMap<SpecialValueOptions> {
|
export interface SpecialValueMap extends BaseValueMap<SpecialValueOptions> {
|
||||||
type: MappingType.SpecialValue;
|
type: MappingType.SpecialValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @alpha
|
||||||
|
*/
|
||||||
export type ValueMapping = ValueMap | RangeMap | SpecialValueMap;
|
export type ValueMapping = ValueMap | RangeMap | SpecialValueMap;
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
import { toNumber } from 'lodash';
|
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 {
|
export function anyToNumber(value: any): number {
|
||||||
if (typeof value === 'number') {
|
if (typeof value === 'number') {
|
||||||
return value;
|
return value;
|
||||||
|
Loading…
Reference in New Issue
Block a user