Extension Features
Since version 3.9
Feature Hooks
The feature hooks expose different hooks to extend features of an extension.
registerFeature
A hook to register or extend a feature for an extension.
Parameters
name: string
- The name of the featureoptions:
ExtensionFeatures
- The options of the Feature
Example
./example-extension/acme-extension/index.ts
export default defineExtension({
unstable_lifecycleHooks: {
onFeaturesInit: (hooks) => {
hooks.registerFeature("acme-feature", {
ui: {
componentsMap: {
Header: new URL("./components/AcmeHeader.tsx", import.meta.url),
Toolbar: new URL("./components/AcmeToolbar.tsx", import.meta.url),
Footer: new URL("./components/AcmeFooter.tsx", import.meta.url),
},
},
});
},
},
});