feat: fixing api doc type export error

Signed-off-by: marmionl <l.marmion+copilot@elsvier.com>
This commit is contained in:
marmionl
2024-01-12 18:33:04 +00:00
parent 170c023384
commit c4b7528ee1
2 changed files with 9 additions and 12 deletions
+1
View File
@@ -166,6 +166,7 @@ export const OpenApiDefinitionWidget: (
export type OpenApiDefinitionWidgetProps = {
definition: string;
requestInterceptor?: (req: any) => any | Promise<any>;
supportedSubmitMethods?: string[];
};
// @public (undocumented)
@@ -25,30 +25,26 @@ const LazyOpenApiDefinition = React.lazy(() =>
})),
);
type HttpMethods =
| 'get'
| 'put'
| 'post'
| 'delete'
| 'options'
| 'head'
| 'patch'
| 'trace';
/** @public */
export type OpenApiDefinitionWidgetProps = {
definition: string;
requestInterceptor?: (req: any) => any | Promise<any>;
supportedSubmitMethods?: HttpMethods[];
supportedSubmitMethods?: string[];
};
/** @public */
export const OpenApiDefinitionWidget = (
props: OpenApiDefinitionWidgetProps,
) => {
const validSubmitMethods = props.supportedSubmitMethods?.map(method =>
method.toLocaleLowerCase(),
);
return (
<Suspense fallback={<Progress />}>
<LazyOpenApiDefinition {...props} />
<LazyOpenApiDefinition
{...props}
supportedSubmitMethods={validSubmitMethods}
/>
</Suspense>
);
};