Registry class

Signature

  1. export declare class Registry<T extends RegistryItem>

Import

  1. import { Registry } from '@grafana/data';

Constructors

ConstructorModifiersDescription
constructor(init)Constructs a new instance of the Registry class

Properties

PropertyModifiersTypeDescription
setInit(init: () => T[]) => void

Methods

MethodModifiersDescription
get(id)
getIfExists(id)
isEmpty()
list(ids)Return a list of values by ID, or all values if not specified
register(ext)
selectOptions(current, filter)

constructor(init)

Constructs a new instance of the Registry class

Signature

  1. constructor(init?: (() => T[]) | undefined);

Parameters

ParameterTypeDescription
init(() => T[]) | undefined

setInit property

Signature

  1. setInit: (init: () => T[]) => void;

get method

Signature

  1. get(id: string): T;

Parameters

ParameterTypeDescription
idstring

Returns:

T

getIfExists method

Signature

  1. getIfExists(id: string | undefined): T | undefined;

Parameters

ParameterTypeDescription
idstring | undefined

Returns:

T | undefined

isEmpty method

Signature

  1. isEmpty(): boolean;

Returns:

boolean

list method

Return a list of values by ID, or all values if not specified

Signature

  1. list(ids?: any[]): T[];

Parameters

ParameterTypeDescription
idsany[]

Returns:

T[]

register method

Signature

  1. register(ext: T): void;

Parameters

ParameterTypeDescription
extT

Returns:

void

selectOptions method

Signature

  1. selectOptions(current?: string[], filter?: (ext: T) => boolean): RegistrySelectInfo;

Parameters

ParameterTypeDescription
currentstring[]
filter(ext: T) => boolean

Returns:

RegistrySelectInfo