chore: starting to addthje scaffolder form extension point
Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
@@ -20,7 +20,7 @@ import { BackstagePlugin, Extension } from '../plugin/types';
|
||||
import { RouteRef, useRouteRef } from '../routing';
|
||||
import { attachComponentData } from './componentData';
|
||||
|
||||
type ComponentLoader<T> =
|
||||
export type ComponentLoader<T> =
|
||||
| {
|
||||
lazy: () => Promise<T>;
|
||||
}
|
||||
|
||||
@@ -20,3 +20,4 @@ export {
|
||||
createRoutableExtension,
|
||||
createComponentExtension,
|
||||
} from './extensions';
|
||||
export type { ComponentLoader } from './extensions';
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Copyright 2021 Spotify AB
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { Extension, ComponentLoader } from '@backstage/core';
|
||||
|
||||
export type FormExtensionOptions<T> = {
|
||||
name: string;
|
||||
component: ComponentLoader<T>;
|
||||
};
|
||||
|
||||
export function createScaffolderFormExtension<
|
||||
T extends (props: any) => JSX.Element | null
|
||||
>(options: FormExtensionOptions<T>): Extension<T> {}
|
||||
Reference in New Issue
Block a user