keep BackendFeatureFactory internal

Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
This commit is contained in:
Vincenzo Scamporlino
2023-08-08 13:00:08 +02:00
parent 35ccc2365a
commit 9261f22f1c
50 changed files with 128 additions and 133 deletions
+2 -2
View File
@@ -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);