chore: updating type parameters names to be TReturnValue
Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
@@ -25,8 +25,8 @@ import { Extension, attachComponentData } from '@backstage/core-plugin-api';
|
||||
export const FIELD_EXTENSION_WRAPPER_KEY = 'scaffolder.extensions.wrapper.v1';
|
||||
export const FIELD_EXTENSION_KEY = 'scaffolder.extensions.field.v1';
|
||||
|
||||
export function createScaffolderFieldExtension<T = any>(
|
||||
options: FieldExtensionOptions<T>,
|
||||
export function createScaffolderFieldExtension<TReturnValue = unknown>(
|
||||
options: FieldExtensionOptions<TReturnValue>,
|
||||
): Extension<() => null> {
|
||||
return {
|
||||
expose() {
|
||||
|
||||
@@ -21,13 +21,11 @@ import { FieldValidation, FieldProps } from '@rjsf/core';
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export type CustomFieldValidator<T> =
|
||||
| ((data: T, field: FieldValidation) => void)
|
||||
| ((
|
||||
data: T,
|
||||
field: FieldValidation,
|
||||
context: { apiHolder: ApiHolder },
|
||||
) => void);
|
||||
export type CustomFieldValidator<TReturnValue> = (
|
||||
data: TReturnValue,
|
||||
field: FieldValidation,
|
||||
context: { apiHolder: ApiHolder },
|
||||
) => void;
|
||||
|
||||
/**
|
||||
* Type for the Custom Field Extension with the
|
||||
@@ -35,10 +33,10 @@ export type CustomFieldValidator<T> =
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export type FieldExtensionOptions<T = any> = {
|
||||
export type FieldExtensionOptions<TReturnValue = unknown> = {
|
||||
name: string;
|
||||
component: (props: FieldProps<T>) => JSX.Element | null;
|
||||
validation?: CustomFieldValidator<T>;
|
||||
component: (props: FieldProps<TReturnValue>) => JSX.Element | null;
|
||||
validation?: CustomFieldValidator<TReturnValue>;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user