Skip to main content
Version: Next

CreateExtensionOptions

Home > @backstage/frontend-plugin-api > CreateExtensionOptions

Signature:

export type CreateExtensionOptions<TKind extends string | undefined, TName extends string | undefined, UOutput extends AnyExtensionDataRef, TInputs extends {
[inputName in string]: ExtensionInput<AnyExtensionDataRef, {
optional: boolean;
singleton: boolean;
}>;
}, TConfigSchema extends {
[key: string]: (zImpl: typeof z) => z.ZodType;
}, UFactoryOutput extends ExtensionDataValue<any, any>> = {
kind?: TKind;
name?: TName;
attachTo: {
id: string;
input: string;
};
disabled?: boolean;
inputs?: TInputs;
output: Array<UOutput>;
config?: {
schema: TConfigSchema;
};
factory(context: {
node: AppNode;
apis: ApiHolder;
config: {
[key in keyof TConfigSchema]: z.infer<ReturnType<TConfigSchema[key]>>;
};
inputs: Expand<ResolvedExtensionInputs<TInputs>>;
}): Iterable<UFactoryOutput>;
} & VerifyExtensionFactoryOutput<UOutput, UFactoryOutput>;

References: AnyExtensionDataRef, ExtensionInput, ExtensionDataValue, AppNode, ApiHolder, ResolvedExtensionInputs