import { ExtendedParams } from '../../content/base-interfaces/extended-params';
import { Session } from '../../session/session.interface';
import { StateEvents, StateManager } from '../../state/state-manager.interface';
import { OMMRefreshResponse, OMMStatusResponse, OMMUpdateResponse } from './protocol/omm-types.interface';
/**
 * Defines OMMStreamRequestParams specification.
 */
export interface OMMStreamRequestParams extends ExtendedParams {
    /**
     * The item name of interest.
     */
    name: string;
    /**
     * Offers the ability to use specific service to manage the realtime streaming data.
     * @default defined within the streaming platform
     */
    service?: string;
    /**
     * Defines the domain for the specific data of interest. For example, MarketPrice, MarketByPrice, MarketByOrder, etc.
     * @default MarketPrice
     */
    domain?: string;
    /**
     * Specifies whether the stream will deliver the initial image following by updates.
     * A value of false implies no streaming and that only the initial image will be delivered. The is commonly referred to as a snapshot.
     * @default true
     */
    streaming?: boolean;
    /**
     * Specifies the specific fields to be delivered when messages arrive.
     * @default All fields
     */
    fields?: string[];
    /**
     * A filter specification used to request which filter entries will be present in a Filter List payload.
     */
    filter?: number;
    /**
     * Connection name to be used for a particular Item Stream
     * All the configurations from this connection will be applied unless another
     * connection name is specified
     * @default 'streaming/pricing/main' // see DEFAULT_STREAM_CONNECTION_NAME below
     */
    api?: string;
}
/**
 * Default streaming connection name in the configuration file.
 * extends keyof ConfigSchema['streaming']['connections']
 */
export declare const DEFAULT_OMM_STREAMING_CONNECTION_NAME = "streaming/pricing/main";
/**
 * Defines OMMStream Required Params specification.
 */
export interface OMMStreamRequiredParams {
    /**
     * The Session defines the platform where you want to retrieve your data.
     */
    session: Session;
    /**
     * The item name of interest.
     */
    name: string;
}
declare const Status: 'Status';
declare const Update: 'Update';
declare const Refresh: 'Refresh';
declare const OMMStreamEvent: {
    Refresh: "Refresh";
    Status: "Status";
    Update: "Update";
    Complete: "Complete";
    Error: "error";
    StateChanged: "stateChanged";
};
export declare type OMMStreamRefreshCb = (data: OMMRefreshResponse, stream: OMMStream) => void;
export declare type OMMStreamStatusCb = (data: OMMStatusResponse, stream: OMMStream) => void;
export declare type OMMStreamUpdateCb = (data: OMMUpdateResponse, stream: OMMStream) => void;
export declare type OMMStreamCompleteCb = (stream: OMMStream) => void;
export declare type OMMStreamErrorCb = (error: Error, stream: OMMStream) => void;
export interface OMMStreamEvents extends StateEvents {
    [Refresh]: OMMStreamRefreshCb;
    [Update]: OMMStreamUpdateCb;
    [Status]: OMMStreamStatusCb;
    [OMMStreamEvent.Error]: OMMStreamErrorCb;
    [OMMStreamEvent.Complete]: OMMStreamCompleteCb;
}
/**
 * An OMMStream defines a realtime streaming interface supporting services providing market data.
 * The stream provides the flexibility to define request properties offered by the platform using an intuitive, fluent API.
 */
export interface OMMStream extends StateManager<OMMStreamEvents> {
    /**
     * @returns an instrument name
     */
    readonly name: string;
    onRefresh(cb: OMMStreamRefreshCb): this;
    onUpdate(cb: OMMStreamUpdateCb): this;
    onStatus(cb: OMMStreamStatusCb): this;
    onError(cb: OMMStreamErrorCb): this;
    onComplete(cb: OMMStreamCompleteCb): this;
}
export interface OMMStreamDefinition {
    getStream(session?: Session): OMMStream;
}
export declare class OMMStream {
    static Event: {
        Refresh: "Refresh";
        Status: "Status";
        Update: "Update";
        Complete: "Complete";
        Error: "error";
        StateChanged: "stateChanged";
    };
    static Definition(name: string): OMMStreamDefinition;
    static Definition(params: OMMStreamRequestParams): OMMStreamDefinition;
}
export {};
