///
import { COMPATIBILITY } from './constants';
import { SchemaRegistryAPIClientArgs } from './api';
import Cache from './cache';
import { Schema, RawAvroSchema, AvroSchema, SchemaType, ConfluentSchema, SchemaRegistryAPIClientOptions, AvroConfluentSchema } from './@types';
interface RegisteredSchema {
id: number;
}
interface Opts {
compatibility?: COMPATIBILITY;
separator?: string;
subject: string;
}
interface AvroDecodeOptions {
readerSchema?: RawAvroSchema | AvroSchema | Schema;
}
interface DecodeOptions {
[SchemaType.AVRO]?: AvroDecodeOptions;
}
export default class SchemaRegistry {
private api;
private cacheMissRequests;
private options;
cache: Cache;
constructor({ auth, clientId, host, retry, agent }: SchemaRegistryAPIClientArgs, options?: SchemaRegistryAPIClientOptions);
private isConfluentSchema;
private getConfluentSchema;
register(schema: Exclude, userOpts: Opts): Promise;
register(schema: RawAvroSchema | AvroConfluentSchema, userOpts?: Omit & {
subject?: string;
}): Promise;
register(schema: RawAvroSchema | ConfluentSchema, userOpts: Opts): Promise;
private _getSchema;
getSchema(registryId: number): Promise;
encode(registryId: number, payload: any): Promise;
private collectInvalidPaths;
decode(buffer: Buffer, options?: DecodeOptions): Promise;
getRegistryId(subject: string, version: number | string): Promise;
getRegistryIdBySchema(subject: string, schema: AvroSchema | RawAvroSchema | ConfluentSchema): Promise;
getLatestSchemaId(subject: string): Promise;
private getSchemaOriginRequest;
}
export {};