import { ApiFactory } from '@backstage/core-plugin-api'; /** * Represents a mocked version of an API, where you automatically have access to * the mocked versions of all of its methods along with a factory that returns * that same mock. * * @public */ export type ApiMock = { factory: ApiFactory; } & { [Key in keyof TApi]: TApi[Key] extends (...args: infer Args) => infer Return ? TApi[Key] & jest.MockInstance : TApi[Key]; };