The array of extension data references that this input expects.
Optionalconfig: TConfig & { replaces?: { id: string; input: string }[] }The configuration object for the input.
An extension input declaration.
Extension inputs created with this function can be passed to any inputs map
as part of creating or overriding an extension.
The array of extension data references defines the data this input expects. If the required data is not provided by the attached extension, the attachment will fail.
The config object can be used to restrict the behavior and shape of the
input. By default an input will accept zero or more extensions from any
plugin. The following options are available:
singleton: If set to true, only one extension can be attached to the
input at a time. Additional extensions will trigger an app error and be
ignored.optional: If set to true, the input is optional and can be omitted,
this only has an effect if the singleton is set to true.internal: If set to true, only extensions from the same plugin will be
allowed to attach to this input. Other extensions will trigger an app error
and be ignored.const extension = createExtension({
attachTo: { id: 'example-parent', input: 'example-input' },
inputs: {
content: createExtensionInput([coreExtensionData.reactElement], {
singleton: true,
}),
},
output: [coreExtensionData.reactElement],
*factory({ inputs }) {
const content = inputs.content?.get(coreExtensionData.reactElement);
yield coreExtensionData.reactElement(<ContentWrapper>{content}</ContentWrapper>);
},
});
Creates a new extension input to be passed to the input map of an extension.