I've been playing around with
# package-development
d
I've been playing around with extensibility in my own plugins in Umbraco 14. I found out I can read manifest definitions of my own custom type using an
UmbExtensionsApiInitializer
, but I don't know how to convert a list of api manifests into a list of object instances. Any idea if I'm going the right direction at all or if I'm completely off?
I think I found it (haven't been able to fix enough build errors to test yet). I looked at this example here:
Copy code
typescript
new UmbExtensionsManifestInitializer(this, umbExtensionsRegistry, 'searchProvider', null, async (providers) => {
            const searchProviders: Array<SearchProvider> = [];

            for (const provider of providers) {
                const api = await createExtensionApi<UmbSearchProvider<UmbSearchResultItemModel>>(this, provider.manifest);
                if (api) {
                    searchProviders.push({
                        name: provider.manifest.meta?.label || provider.manifest.name,
                        api,
                        alias: provider.alias,
                    });
                }
            }

            this._searchProviders = searchProviders;

            if (this._searchProviders.length > 0) {
                this._currentProvider = this._searchProviders[0];
            }
        });
provider
here happens to have an
api
property and I think maybe that's the object instance I'm looking for
n
If the manifest has an element property, you can just new it up that way too
2 Views