Front-end macros service API

Last modified by Manuel Leduc on 2026/07/20 10:41

Content

Reference

MacrosService

The service handling the registration and delivery of macros.

interface MacrosService {
  // List all registered macros.
  list(): MacroWithUnknownParamsType[];

  // Get a macro by its id.
  get(id: string): MacroWithUnknownParamsType | null;
}

list()

Returns every registered macro.

ReturnsDescription
MacroWithUnknownParamsType[]All registered macros. The returned array is a copy, so mutating it does not affect the service.

get(id)

Returns a single macro looked up by its identifier.

ParameterTypeDescription
idstringThe identifier of the macro to retrieve (matched against the macro's infos.id).
ReturnsDescription
MacroWithUnknownParamsType or nullThe registered macro with the provided id, or null when no macro matches.

macrosServiceName

A constant string equal to "MacrosService". Use it as the binding name to resolve the serviceĀ from the Inversify container.

const macrosServiceName: "MacrosService";

ComponentInit

Registers the default MacrosService implementation. Instantiating this class with an Inversify container binds macrosServiceName to the default implementation, as the default binding.

class ComponentInit {
  constructor(container: Container);
}
ParameterTypeDescription
containerContainerThe Inversify container in which the service is registered.

Get Connected