UNPKG

avro-to-json-schema

Version:
17 lines (16 loc) 1.16 kB
export { EnumType, Field, isArrayType, isEnumType, isLogicalType, isMapType, isOptional, isRecordType, RecordType, Type, } from "./model"; import { EnumType, Field, RecordType, Schema, Type } from "./model"; /** Convert a primitive type from avro to TypeScript */ export declare function convertPrimitive(avroType: string): string; /** Converts an Avro record type to a TypeScript file */ export declare function avroToJSONSchema(schema: Schema): { file: string; dependencies: string[]; records: string[]; }; /** Convert an Avro Record type. Return the name, but add the definition to the file */ export declare function convertRecord(recordType: RecordType, fileBuffer: string[], dependencies: string[], records: string[]): string; /** Convert an Avro Enum type. Return the name, but add the definition to the file */ export declare function convertEnum(enumType: EnumType, fileBuffer: string[]): string; export declare function convertType(type: Type, buffer: string[], dependencies: string[], records: string[]): string; export declare function convertFieldDec(field: Field, buffer: string[], dependencies: string[], records: string[]): string;