UNPKG

@stoplight/elements-core

Version:

[![docs](https://img.shields.io/badge/API%20Docs-site-green.svg?style=flat-square)](https://meta.stoplight.io/docs/elements) [![license](https://img.shields.io/npm/l/@stoplight/elements?style=flat-square)](./LICENSE)

21 lines (20 loc) • 1.61 kB
import { IMediaTypeContent } from '@stoplight/types'; import * as React from 'react'; export declare type BodyParameterValues = Record<string, string | File>; export declare type ParameterOptional = Record<string, boolean>; export declare const isFormDataContent: (content: IMediaTypeContent) => boolean; export declare const isBinaryContent: (content: IMediaTypeContent) => boolean; export declare function createRequestBody(mediaTypeContent: IMediaTypeContent | undefined, bodyParameterValues: BodyParameterValues | undefined): Promise<string | Blob | ArrayBuffer | ReadableStream<any> | ArrayBufferView | FormData | undefined>; export declare const useBodyParameterState: (mediaTypeContent: IMediaTypeContent | undefined) => readonly [BodyParameterValues, React.Dispatch<React.SetStateAction<BodyParameterValues>>, ParameterOptional, React.Dispatch<React.SetStateAction<ParameterOptional>>, { readonly isFormDataBody: true; readonly isBinaryBody: false; readonly bodySpecification: IMediaTypeContent<false>; }] | readonly [BodyParameterValues, React.Dispatch<React.SetStateAction<BodyParameterValues>>, ParameterOptional, React.Dispatch<React.SetStateAction<ParameterOptional>>, { readonly isFormDataBody: false; readonly isBinaryBody: true; readonly bodySpecification: IMediaTypeContent<false>; }] | readonly [BodyParameterValues, React.Dispatch<React.SetStateAction<BodyParameterValues>>, ParameterOptional, React.Dispatch<React.SetStateAction<ParameterOptional>>, { readonly isFormDataBody: false; readonly isBinaryBody: false; readonly bodySpecification: undefined; }];