backend-app-api: rename BackendRegistrable to BackendFeature
Co-authored-by: Patrik Oldsberg <poldsberg@gmail.com> Co-authored-by: Fredrik Adelöw <freben@gmail.com> Signed-off-by: Johan Haals <johan.haals@gmail.com>
This commit is contained in:
@@ -14,11 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {
|
||||
BackendInitRegistry,
|
||||
BackendRegistrable,
|
||||
ExtensionPoint,
|
||||
} from './types';
|
||||
import { BackendInitRegistry, BackendFeature, ExtensionPoint } from './types';
|
||||
|
||||
/** @public */
|
||||
export function createExtensionPoint<T>(options: {
|
||||
@@ -46,8 +42,8 @@ export interface BackendPluginConfig<TOptions> {
|
||||
export function createBackendPlugin<TOptions>(
|
||||
config: BackendPluginConfig<TOptions>,
|
||||
): undefined extends TOptions
|
||||
? (options?: TOptions) => BackendRegistrable
|
||||
: (options: TOptions) => BackendRegistrable {
|
||||
? (options?: TOptions) => BackendFeature
|
||||
: (options: TOptions) => BackendFeature {
|
||||
return (options?: TOptions) => ({
|
||||
id: config.id,
|
||||
register(register: BackendInitRegistry) {
|
||||
@@ -70,8 +66,8 @@ export interface BackendModuleConfig<TOptions> {
|
||||
export function createBackendModule<TOptions>(
|
||||
config: BackendModuleConfig<TOptions>,
|
||||
): undefined extends TOptions
|
||||
? (options?: TOptions) => BackendRegistrable
|
||||
: (options: TOptions) => BackendRegistrable {
|
||||
? (options?: TOptions) => BackendFeature
|
||||
: (options: TOptions) => BackendFeature {
|
||||
return (options?: TOptions) => ({
|
||||
id: `${config.pluginId}.${config.moduleId}`,
|
||||
register(register: BackendInitRegistry) {
|
||||
|
||||
@@ -22,6 +22,6 @@ export {
|
||||
} from './factories';
|
||||
export type {
|
||||
BackendInitRegistry,
|
||||
BackendRegistrable,
|
||||
BackendFeature,
|
||||
ExtensionPoint,
|
||||
} from './types';
|
||||
|
||||
@@ -48,7 +48,7 @@ export interface BackendInitRegistry {
|
||||
}
|
||||
|
||||
/** @public */
|
||||
export interface BackendRegistrable {
|
||||
export interface BackendFeature {
|
||||
id: string;
|
||||
register(reg: BackendInitRegistry): void;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user