import { StateEvents, StateManager } from '../../../state/state-manager.interface';
import { ExtendedParams } from '../../base-interfaces/extended-params';
import { StreamingChainError } from './streaming-chain-error';
export interface RequestParams extends ExtendedParams {
    service?: string;
    /**
     * Defines quantity of summary links from display template that should be excluded from the response.
     */
    overrideSummaryLinks?: number;
    /**
     * Defines whether summary links should be excluded from the response.
     * @default true
     */
    skipSummaryLinks?: boolean;
    /**
     * Defines whether empty fields should be skipped in response.
     * @default true
     */
    skipEmpty?: boolean;
    /**
     * Indicates the number of Chain Record names to guess in advance
     * @default 10
     */
    nameGuessingQuantity?: 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'
     */
    api?: string;
}
export interface Params extends RequestParams {
    name: string;
}
declare const Add: 'Add';
declare const Update: 'Update';
declare const Remove: 'Remove';
declare const Complete: 'Complete';
export declare const Event: {
    Complete: "Complete";
    Add: "Add";
    Remove: "Remove";
    Update: "Update";
    Error: "error";
    StateChanged: "stateChanged";
};
export declare const QUANTITY_CHAIN_RECORDS_TO_REQUEST = 10;
export declare const STREAMING_CHAINS_NAME_PATTERN: RegExp;
export interface Events extends StateEvents {
    [Add]: (constituent: string, index: number, sc: Stream) => void;
    [Update]: (newConstituent: string, oldConstituent: string, index: number, sc: Stream) => void;
    [Remove]: (constituent: string, index: number, sc: Stream) => void;
    [Complete]: (constituents: string[], sc: Stream) => void;
    [Event.Error]: (err: StreamingChainError, sc: Stream) => void;
}
/**
 * Chains are used to hold instrument names that have a common association.
 * The stream provides the flexibility to define request properties offered by the platform using an intuitive, fluent API.
 */
export interface Stream extends StateManager<Events> {
    /**
     * Parameters passed to Pricing.Chain.Definition method to create a definition object instance
     */
    readonly definition: Params;
    /**
     * A chain record name.
     */
    readonly name: string;
    /**
     * @returns true if decoding is completed, otherwise false
     */
    isChain: boolean;
    /**
     * @returns a list of the summary links of the chain record
     */
    summaryLinks: string[];
    /**
     * @returns a list of constituents in the chain record
     */
    readonly constituents: string[];
    onAdd(cb: OnAddCallback): this;
    onRemove(cb: OnRemoveCallback): this;
    onComplete(cb: OnCompleteCallback): this;
    onUpdate(cb: OnUpdateCallback): this;
    onError(cb: OnErrorCallback): this;
}
export declare type OnAddCallback = (constituent: string, index: number, sc: Stream) => void;
export declare type OnRemoveCallback = OnAddCallback;
export declare type OnUpdateCallback = (newConstituent: string, oldConstituent: string, index: number, sc: Stream) => void;
export declare type OnCompleteCallback = (constituents: string[], sc: Stream) => void;
export declare type OnErrorCallback = (error: Error, sc: Stream) => void;
export {};
