Lynx

genui / a2ui / defineCatalog

defineCatalog()

function defineCatalog(inputs: readonly CatalogInput[]): Catalog

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.

Parameters

ParameterType
inputsreadonly CatalogInput[]

Returns

Catalog

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),
]);

Defined in

@lynx-js/genui/a2ui/src/catalog/defineCatalog.ts:214

Except as otherwise noted, this work is licensed under a Creative Commons Attribution 4.0 International License, and code samples are licensed under the Apache License 2.0.