Skip to content

plugin-api/EntityBrowserRegistry#

entityBrowserRegistry#

const entityBrowserRegistry: EntityBrowserRegistry;

EntityInfo#

Entity Browser Plugin Registry

Allows plugins to register custom entity types for the entity browser system. Plugins can provide fetch handlers, preview handlers, and current entity name getters.

Properties#

description?#

optional description?: string;

name#

name: string;

EntityTypeHandler#

Properties#

fetchEntities#

fetchEntities: () => Promise<EntityInfo[]>;

Fetch all entities of this type

Returns#

Promise<EntityInfo[]>

fetchPreview?#

optional fetchPreview?: (name) => Promise<any>;

Fetch preview data (called when user selects in list - read-only, doesn't modify working state)

Parameters#
Parameter Type
name string
Returns#

Promise<any>

getCurrentEntityName?#

optional getCurrentEntityName?: () => string | undefined;

Get current entity name (for highlighting in list)

Returns#

string | undefined

icon?#

optional icon?: ComponentType<{
}>;

Optional icon component

isEmpty?#

optional isEmpty?: () => boolean;

Returns true when the entity has no meaningful content (skips unsaved-changes dialog)

Returns#

boolean

loadEntity#

loadEntity: (name) => Promise<void>;

Load an entity into working state (called when user clicks "Load" button)

Parameters#
Parameter Type
name string
Returns#

Promise<void>

previewComponent?#

optional previewComponent?: ComponentType<{
  entityName: string;
  previewData: any;
}>;

Optional custom preview component