diff --git a/x-pack/plugins/triggers_actions_ui/public/application/type_registry.ts b/x-pack/plugins/triggers_actions_ui/public/application/type_registry.ts index f5fe6f96ca8c0..c712e55a38bf3 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/type_registry.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/type_registry.ts @@ -57,6 +57,26 @@ export class TypeRegistry { return this.objectTypes.get(id)!; } + /** + * Deletes an object type in the type registry + */ + public delete(id: string): void { + if (!this.has(id)) { + throw new Error( + i18n.translate( + 'xpack.triggersActionsUI.typeRegistry.delete.missingActionTypeErrorMessage', + { + defaultMessage: 'Object type "{id}" is not registered.', + values: { + id, + }, + } + ) + ); + } + this.objectTypes.delete(id); + } + public list() { return Array.from(this.objectTypes).map(([id, objectType]) => objectType); }