openapi-ts-mock-generator
Version:
typescript mock data generator based openapi
27 lines (23 loc) • 868 B
text/typescript
import { ParseSchemaType, TypeScriptCodeOptions } from '../core/types.mjs';
import 'openapi-types';
/**
* 코드 생성 관련 유틸리티 함수들
*/
/**
* 객체를 TypeScript 코드로 변환 (nullable 타입 확장 지원)
* 동적 모킹에서 optional 필드를 지원하는 코드를 생성
*/
declare const toTypeScriptCode: (param: ParseSchemaType, options: TypeScriptCodeOptions) => string;
/**
* 멀티라인 코드를 한 줄로 압축
*/
declare const compressCode: (code: string) => string;
/**
* TypeScript 인터페이스 코드 생성
*/
declare const generateInterface: (name: string, properties: Record<string, string>) => string;
/**
* TypeScript 타입 별칭 코드 생성
*/
declare const generateTypeAlias: (name: string, type: string) => string;
export { compressCode, generateInterface, generateTypeAlias, toTypeScriptCode };