Add output return type to makeFieldSchema
Signed-off-by: Stephen Glass <stephen@stephen.glass>
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
---
|
||||
'@backstage/plugin-scaffolder': patch
|
||||
'@backstage/plugin-scaffolder-react': patch
|
||||
---
|
||||
|
||||
Add schema output return type to the `makeFieldSchema` function return
|
||||
@@ -131,6 +131,8 @@ export interface FieldSchema<TReturn, TUiOptions> {
|
||||
// (undocumented)
|
||||
readonly schema: CustomFieldExtensionSchema;
|
||||
// (undocumented)
|
||||
readonly TOutput: TReturn;
|
||||
// (undocumented)
|
||||
readonly TProps: FieldExtensionComponentProps<TReturn, TUiOptions>;
|
||||
// @deprecated (undocumented)
|
||||
readonly type: FieldExtensionComponentProps<TReturn, TUiOptions>;
|
||||
|
||||
@@ -33,6 +33,7 @@ export function makeFieldSchema<
|
||||
const { output, uiOptions } = options;
|
||||
return {
|
||||
TProps: undefined as any,
|
||||
TOutput: undefined as any,
|
||||
schema: {
|
||||
returnValue: zodToJsonSchema(output(z)) as JSONSchema7,
|
||||
uiOptions: uiOptions && (zodToJsonSchema(uiOptions(z)) as JSONSchema7),
|
||||
@@ -57,4 +58,5 @@ export interface FieldSchema<TReturn, TUiOptions> {
|
||||
|
||||
readonly schema: CustomFieldExtensionSchema;
|
||||
readonly TProps: FieldExtensionComponentProps<TReturn, TUiOptions>;
|
||||
readonly TOutput: TReturn;
|
||||
}
|
||||
|
||||
@@ -53,5 +53,6 @@ export function makeFieldSchemaFromZod<
|
||||
type: null as any,
|
||||
uiOptionsType: null as any,
|
||||
TProps: undefined as any,
|
||||
TOutput: undefined as any,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user