Skip to main content

createApiFactory()

Home > @backstage/core-plugin-api > createApiFactory

Used to infer types for a standalone ApiFactory that isn't immediately passed to another function.

Signature:

function createApiFactory<Api, Impl extends Api>(api: ApiRef<Api>, instance: Impl): ApiFactory<Api, Impl, {}>;

Parameters

ParameterTypeDescription
apiApiRef<Api>Ref of the API that will be produced by the factory.
instanceImplImplementation of the API to use.

Returns:

ApiFactory<Api, Impl, {}>