From a6c0d9803ecde293b82a0464375a7dad6669ee52 Mon Sep 17 00:00:00 2001 From: Eric Peterson Date: Thu, 15 Oct 2020 11:08:16 +0200 Subject: [PATCH] Type with interface instead of class. --- plugins/newrelic/src/api/index.ts | 6 +++++- plugins/newrelic/src/plugin.ts | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/plugins/newrelic/src/api/index.ts b/plugins/newrelic/src/api/index.ts index 692cb19e6f..eb94acdbd1 100644 --- a/plugins/newrelic/src/api/index.ts +++ b/plugins/newrelic/src/api/index.ts @@ -68,7 +68,11 @@ type Options = { proxyPathBase?: string; }; -export class NewRelicApi { +export interface NewRelicApi { + getApplications(): Promise; +} + +export class NewRelicClient implements NewRelicApi { private readonly discoveryApi: DiscoveryApi; private readonly proxyPathBase: string; diff --git a/plugins/newrelic/src/plugin.ts b/plugins/newrelic/src/plugin.ts index f247158fbd..5f5ba88617 100644 --- a/plugins/newrelic/src/plugin.ts +++ b/plugins/newrelic/src/plugin.ts @@ -20,7 +20,7 @@ import { createRouteRef, discoveryApiRef, } from '@backstage/core'; -import { NewRelicApi, newRelicApiRef } from './api'; +import { NewRelicClient, newRelicApiRef } from './api'; import NewRelicComponent from './components/NewRelicComponent'; export const rootRouteRef = createRouteRef({ @@ -34,7 +34,7 @@ export const plugin = createPlugin({ createApiFactory({ api: newRelicApiRef, deps: { discoveryApi: discoveryApiRef }, - factory: ({ discoveryApi }) => new NewRelicApi({ discoveryApi }), + factory: ({ discoveryApi }) => new NewRelicClient({ discoveryApi }), }), ], register({ router }) {