import { CtpClient, type CallbackOptions } from "./client.js";
import type { DepthMarketData, ForQuoteRsp, SpecificInstrument, RspUserLogin, UserLogout } from "./generated/structs.gen.js";
export interface MdLoginReq {
    tradingDay?: string;
    brokerId?: string;
    userId?: string;
    password?: string;
    userProductInfo?: string;
}
/** Market-data event names (symbolic; plain strings also work). */
export declare enum MarketDataEvent {
    FrontConnected = "front-connected",
    FrontDisconnected = "front-disconnected",
    HeartBeatWarning = "heart-beat-warning",
    RspUserLogin = "rsp-user-login",
    RspUserLogout = "rsp-user-logout",
    RspQryMulticastInstrument = "rsp-qry-multicast-instrument",
    RspError = "rsp-error",
    RspSubMarketData = "rsp-sub-market-data",
    RspUnSubMarketData = "rsp-unsub-market-data",
    RspSubForQuote = "rsp-sub-for-quote",
    RspUnSubForQuote = "rsp-unsub-for-quote",
    RtnDepthMarketData = "rtn-depth-market-data",
    RtnForQuote = "rtn-for-quote"
}
export declare class MarketData extends CtpClient {
    constructor(flowPath: string, fronts: string | string[]);
    getApiVersion(): string;
    getTradingDay(): string;
    /** Subscribe to depth market data. Returns the CTP send code (0 = ok). */
    subscribe(instrumentIds: string[]): number;
    unsubscribe(instrumentIds: string[]): number;
    subscribeForQuote(instrumentIds: string[]): number;
    unsubscribeForQuote(instrumentIds: string[]): number;
    /** Log in; resolves with the login response (or rejects on CTP error). */
    login(req?: MdLoginReq): Promise<RspUserLogin>;
    logout(req?: {
        brokerId?: string;
        userId?: string;
    }): Promise<UserLogout>;
    private armedTrader?;
    /** Route this market data's ticks to a Trader's armed triggers (see Trader.arm).
     *  A MarketData feeds exactly one Trader's registry; attaching a second,
     *  different Trader throws rather than silently stealing the feed. */
    attachArm(trader: {
        _armRegistry(): unknown;
    }): void;
    /** @internal test-only: inject a synthetic depth tick into the ring. Optional
     *  bid/ask override the defaults (3499/3501) so tests can drive edge prices
     *  (e.g. a DBL_MAX no-bid sentinel) through the real arm/onTick path. */
    _injectTestTick(bid?: number, ask?: number): void;
    /** @internal test-only: spawn a background producer thread that pushes `n`
     *  synthetic ticks into the ring (cross-thread doorbell stress). Each tick's
     *  requestId carries its sequence number. */
    _burstTicks(n: number, jitterUs?: number): void;
    on(event: "rtn-depth-market-data", cb: (data: DepthMarketData, opts: CallbackOptions) => void): this;
    on(event: "rtn-for-quote", cb: (data: ForQuoteRsp, opts: CallbackOptions) => void): this;
    on(event: "front-connected", cb: (data: undefined, opts: CallbackOptions) => void): this;
    on(event: "front-disconnected", cb: (reason: number, opts: CallbackOptions) => void): this;
    on(event: "heart-beat-warning", cb: (lapse: number, opts: CallbackOptions) => void): this;
    on(event: "rsp-user-login", cb: (data: RspUserLogin, opts: CallbackOptions) => void): this;
    on(event: "rsp-sub-market-data", cb: (data: SpecificInstrument, opts: CallbackOptions) => void): this;
    on(event: "rsp-error", cb: (data: undefined, opts: CallbackOptions) => void): this;
    on(event: string, cb: (...args: never[]) => void): this;
}
//# sourceMappingURL=market-data.d.ts.map