Docs: reduce number of API Extractor warnings

This commit is contained in:
Jack Westbrook 2021-05-11 18:47:34 +02:00 committed by GitHub
parent 7cd4066e9a
commit e13f15f646
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 41 additions and 1 deletions

View File

@ -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>();

View File

@ -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;

View File

@ -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;