import { z } from 'zod';
import { JsonSchema7Type } from 'zod-to-json-schema/src/parseDef.js';
import { Broker } from '../broker.js';
import { MethodProfile, MicroserviceConfig, MicroserviceInfo, MicroserviceMethodConfig } from '../types/index.js';
export type DiscoveryOptions = {
    transformConfig?: (config: MicroserviceConfig) => MicroserviceConfig;
};
export declare class Discovery {
    private readonly broker;
    private readonly configOrGetter;
    private readonly options;
    readonly id: string;
    readonly startedAt: Date;
    readonly methodStats: Record<string, MethodProfile>;
    private readonly handleSchemaWrap;
    private readonly handleInfoWrap;
    private readonly handlePingWrap;
    private readonly handleStatsWrap;
    private _isStarted;
    constructor(broker: Broker, configOrGetter: MicroserviceConfig | (() => MicroserviceConfig), options?: DiscoveryOptions);
    get originalConfig(): MicroserviceConfig;
    get config(): MicroserviceConfig;
    get isStarted(): boolean;
    start(): Promise<this>;
    stop(): Promise<this>;
    publish(): Promise<void>;
    private publishRegistration;
    profileMethod(name: string, error: string | undefined, time: number): void;
    private makeMicroserviceData;
    private makeMethodData;
    getMethodSubject<R, T>(name: string, method: MicroserviceMethodConfig<R, T>): string;
    makeInfo(): MicroserviceInfo;
    getMethodSchema<T, R>(name: string, kind: keyof Pick<MicroserviceMethodConfig<T, R>, 'request' | 'response'>): z.ZodType | undefined;
    getMethodJsonSchema<T, R>(name: string, kind: keyof Pick<MicroserviceMethodConfig<T, R>, 'request' | 'response'>): JsonSchema7Type | undefined;
    private handleSchema;
    private handleInfo;
    private handleStats;
    private handlePing;
}
