keep BackendFeatureFactory internal
Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
This commit is contained in:
@@ -9,6 +9,16 @@ export interface BackendFeature {
|
||||
$$type: '@backstage/BackendFeature';
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
export interface BackendFeatureFactory<
|
||||
TOptions extends [options?: object] = [],
|
||||
> {
|
||||
// (undocumented)
|
||||
$$type: '@backstage/BackendFeatureFactory';
|
||||
// (undocumented)
|
||||
(...options: TOptions): BackendFeature;
|
||||
}
|
||||
|
||||
// @alpha (undocumented)
|
||||
export interface FeatureDiscoveryService {
|
||||
// (undocumented)
|
||||
|
||||
@@ -126,12 +126,12 @@ export namespace coreServices {
|
||||
// @public
|
||||
export function createBackendModule<TOptions extends [options?: object] = []>(
|
||||
config: BackendModuleConfig | ((...params: TOptions) => BackendModuleConfig),
|
||||
): BackendFeatureFactory<TOptions>;
|
||||
): (...params: TOptions) => BackendFeature;
|
||||
|
||||
// @public
|
||||
export function createBackendPlugin<TOptions extends [options?: object] = []>(
|
||||
config: BackendPluginConfig | ((...params: TOptions) => BackendPluginConfig),
|
||||
): BackendFeatureFactory<TOptions>;
|
||||
): (...params: TOptions) => BackendFeature;
|
||||
|
||||
// @public
|
||||
export function createExtensionPoint<T>(
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
import { createServiceRef } from './services';
|
||||
import { BackendFeature } from './wiring';
|
||||
import { BackendFeature, BackendFeatureFactory } from './wiring';
|
||||
|
||||
/** @alpha */
|
||||
export interface FeatureDiscoveryService {
|
||||
@@ -33,4 +33,4 @@ export const featureDiscoveryServiceRef =
|
||||
});
|
||||
|
||||
export type { ServiceRef } from './services';
|
||||
export type { BackendFeature };
|
||||
export type { BackendFeature, BackendFeatureFactory };
|
||||
|
||||
@@ -21,6 +21,7 @@ import {
|
||||
InternalBackendModuleRegistration,
|
||||
InternalBackendPluginRegistration,
|
||||
BackendFeatureFactory,
|
||||
BackendFeature,
|
||||
} from './types';
|
||||
|
||||
/**
|
||||
@@ -86,7 +87,7 @@ export interface BackendPluginConfig {
|
||||
*/
|
||||
export function createBackendPlugin<TOptions extends [options?: object] = []>(
|
||||
config: BackendPluginConfig | ((...params: TOptions) => BackendPluginConfig),
|
||||
): BackendFeatureFactory<TOptions> {
|
||||
): (...params: TOptions) => BackendFeature {
|
||||
const configCallback = typeof config === 'function' ? config : () => config;
|
||||
|
||||
const factory: BackendFeatureFactory<TOptions> = (...options) => {
|
||||
@@ -179,7 +180,7 @@ export interface BackendModuleConfig {
|
||||
*/
|
||||
export function createBackendModule<TOptions extends [options?: object] = []>(
|
||||
config: BackendModuleConfig | ((...params: TOptions) => BackendModuleConfig),
|
||||
): BackendFeatureFactory<TOptions> {
|
||||
): (...params: TOptions) => BackendFeature {
|
||||
const configCallback = typeof config === 'function' ? config : () => config;
|
||||
const factory: BackendFeatureFactory<TOptions> = (...options: TOptions) => {
|
||||
const c = configCallback(...options);
|
||||
|
||||
Reference in New Issue
Block a user