UNPKG

1.03 kBTypeScriptView Raw
1import { IFormRenderer, IFormRendererRegistry } from './tokens';
2/**
3 * A registry for property renderers used in the FormEditor component.
4 */
5export declare class FormRendererRegistry implements IFormRendererRegistry {
6 /**
7 * Adds a renderer for a given property of a given settings plugin.
8 *
9 * The id must follow that structure `<ISettingRegistry.IPlugin.id>.<propertyName>`
10 *
11 * @param id - Unique ID for the given renderer.
12 * @param renderer - A renderer interfacing IFormRenderer.
13 */
14 addRenderer(id: string, renderer: IFormRenderer): void;
15 /**
16 * Returns all registered renderers in dictionary form.
17 * @returns - A dictionary that maps an id to a renderer.
18 */
19 get renderers(): {
20 [id: string]: IFormRenderer;
21 };
22 /**
23 * Returns the renderer for the given id
24 * @param id - The unique id for the renderer.
25 * @returns - A renderer interfacing IFormRenderer.
26 */
27 getRenderer(id: string): IFormRenderer;
28 private _renderers;
29}