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)

17 lines (16 loc) • 1.08 kB
import * as Sampler from '@stoplight/json-schema-sampler'; import { IMediaTypeContent } from '@stoplight/types'; import { JSONSchema7 } from 'json-schema'; declare type Example = { label: string; data: string; }; export declare const stringifyExampleWithResolvedSchema: (value: any, schema: any) => string; export declare type GenerateExampleFromMediaTypeContentOptions = Sampler.Options; export declare const useGenerateExampleFromMediaTypeContent: (mediaTypeContent: IMediaTypeContent | undefined, chosenExampleIndex?: number, { skipReadOnly, skipWriteOnly, skipNonRequired, ticks }?: GenerateExampleFromMediaTypeContentOptions) => string; export declare const generateExampleFromMediaTypeContent: (mediaTypeContent: IMediaTypeContent | undefined, document: any, chosenExampleIndex?: number, options?: GenerateExampleFromMediaTypeContentOptions) => string; export declare const generateExamplesFromJsonSchema: (schema: JSONSchema7 & { 'x-examples'?: unknown; }) => Example[]; export declare const exceedsSize: (example: string, size?: number) => boolean; export {};