Home > @lynx-js/genui-a2ui > defineCatalog
defineCatalog() function
Build a catalog from a list of components, [component, manifest] pairs, and/or function entries. Duplicate names within the same kind are rejected. Function entries register their impls into functionRegistry immediately, so any executeFunctionCall after defineCatalog can route to them.
Signature:
Parameters
Returns:
Example
import { Text, Button } from '@lynx-js/genui/a2ui'; import { defineCatalog, defineFunction } from '@lynx-js/genui/a2ui'; import { required } from '@lynx-js/genui/a2ui/functions'; import textManifest from '@lynx-js/genui/a2ui/catalog/Text/catalog.json' with { type: 'json' };
const catalog = defineCatalog([ [Text, textManifest], Button, defineFunction(required), ]);