UNPKG

@infinite-debugger/swagger-to-ts

Version:

swagger-to-ts is a powerful library that allows you to generate TypeScript code from Swagger documentation or OpenAPI specifications. It simplifies the process of integrating API definitions into your TypeScript projects, saving you time and effort.

30 lines (29 loc) 1.22 kB
import { APIFunctionsCodeConfiguration, GeneratedSchemaCodeConfiguration, RequestGroupings, TagNameToEntityLabelsMap } from '../models'; export declare const getAPIAdapterCode: () => string; export interface GenerateAPIFunctionsCodeConfigurationOptions { /** * The request groupings to generate code for. */ requestGroupings: RequestGroupings; /** * The tag to entity label mappings. */ tagToEntityLabelMappings: TagNameToEntityLabelsMap; /** * The schema to entity mappings. */ schemaToEntityMappings: Record<string, string>; /** * The models to validation schema mappings. */ modelsToValidationSchemaMappings: Record<string, GeneratedSchemaCodeConfiguration>; /** * Whether or not to trim null values from responses. */ trimNullValuesFromResponses?: boolean; /** * The name of the local scope. */ localScopeName: string; } export declare const getAPIFunctionsCodeConfiguration: ({ requestGroupings, tagToEntityLabelMappings, schemaToEntityMappings, modelsToValidationSchemaMappings, trimNullValuesFromResponses, localScopeName, }: GenerateAPIFunctionsCodeConfigurationOptions) => APIFunctionsCodeConfiguration;