import { OMMStreamRequestParams } from '../../../delivery/stream/omm-stream.interface';
import { OMMFields, OMMFieldValue, OMMResponseState } from '../../../delivery/stream/protocol/omm-types.interface';
import { Session } from '../../../session';
import { StateEvents, StateManager } from '../../../state/state-manager.interface';
import { StreamError } from './pricing-stream-error';
export declare const MARKET_PRICE_DOMAIN = "MarketPrice";
export interface OpenStreamParams {
    /**
     * Defines should we receive updates for the streaming request or just a snapshot with automatic
     * streaming closing
     */
    withUpdates: boolean;
}
export interface Params extends Pick<OMMStreamRequestParams, Exclude<keyof OMMStreamRequestParams, 'domain' | 'streaming' | 'filter' | 'api' | 'name'>> {
    universe: string | string[];
}
export declare const StreamEvent: {
    Refresh: "Refresh";
    Status: "Status";
    Update: "Update";
    Complete: "Complete";
    Error: "error";
    StateChanged: "stateChanged";
};
export declare type StreamRefreshCallback = (refresh: OMMFields, instrument?: string, stream?: Stream) => void;
export declare type StreamUpdateCallback = (update: OMMFields, instrument?: string, stream?: Stream) => void;
export declare type StreamStatusCallback = (status: OMMResponseState, instrument?: string, stream?: Stream) => void;
export declare type StreamCompleteCallback = (stream?: Stream) => void;
export declare type StreamErrorCallback = (error: StreamError, stream?: Stream) => void;
export interface StreamEvents extends StateEvents {
    [StreamEvent.Refresh]: StreamRefreshCallback;
    [StreamEvent.Update]: StreamUpdateCallback;
    [StreamEvent.Status]: StreamStatusCallback;
    [StreamEvent.Complete]: StreamCompleteCallback;
    [StreamEvent.Error]: StreamErrorCallback;
}
/**
 * The interface is responsible for requesting, processing and managing level 1 (MarketPrice domain) quotes and trades.
 * The object will automatically manage an in-memory image of the requested instrument,
 * keeping track of streaming updates allowing an interface to reach into the object to retrieve up-to-date values.
 */
export interface Stream extends StateManager<StreamEvents> {
    /**
     * Parameters passed to Pricing.Definition method to create a pricing definition object instance
     */
    readonly definition: Params;
    readonly session: Session;
    /**
     * Retrieve a value for the specific field.
     * @param instrument name of instrument
     * @param field of the instrument
     * @returns value for the field
     */
    getFieldValue(instrument: string, field: string): OMMFieldValue | undefined;
    /**
     * Retrieve an object with values for the specified fields
     * @param instrument name of instrument
     * @param fields of the specific fields
     * @returns object with the fields values or with all fields values if names are not specified
     */
    getFields(instrument: string, fields?: string[]): OMMFields | undefined;
    /**
     * Retrieve a state of the latest response
     * @param instrument name of instrument
     * @returns a state of the latest response
     */
    getItemStatus(instrument: string): OMMResponseState | undefined;
    onRefresh(cb: StreamRefreshCallback): Stream;
    onUpdate(cb: StreamUpdateCallback): Stream;
    onStatus(cb: StreamStatusCallback): Stream;
    onComplete(cb: StreamCompleteCallback): Stream;
    onError(cb: StreamErrorCallback): Stream;
    open(params?: OpenStreamParams): Promise<this>;
}
