///
export declare type LanguageCode = 'ar' | 'zh' | 'cs' | 'da_DK' | 'nl_NL' | 'en' | 'et_EE' | 'fr' | 'de' | 'el' | 'he_IL' | 'hu_HU' | 'id_ID' | 'it' | 'ja' | 'ko' | 'fa' | 'pl' | 'pt' | 'ro' | 'ru' | 'sk_SK' | 'es' | 'sv' | 'th' | 'tr' | 'vi';
export interface ISubscription {
subscribe(obj: object | null, member: TFunc, singleshot?: boolean): void;
unsubscribe(obj: object | null, member: TFunc): void;
unsubscribeAll(obj: object | null): void;
}
export interface IDelegate extends ISubscription {
fire: TFunc;
}
export interface IDestroyable {
destroy(): void;
}
export interface FormatterParseResult {
res: boolean;
}
export interface ErrorFormatterParseResult extends FormatterParseResult {
error?: string;
res: false;
}
export interface SuccessFormatterParseResult extends FormatterParseResult {
res: true;
suggest?: string;
}
export interface IFormatter {
format(value: any): string;
parse?(value: string): ErrorFormatterParseResult | SuccessFormatterParseResult;
}
/**
* This is the generic type useful for declaring a nominal type,
* which does not structurally matches with the base type and
* the other types declared over the same base type
*
* Usage:
* @example
* type Index = Nominal;
* // let i: Index = 42; // this fails to compile
* let i: Index = 42 as Index; // OK
* @example
* type TagName = Nominal;
*/
export declare type Nominal = T & {
[Symbol.species]: Name;
};
export declare type StudyInputValueType = string | number | boolean;
export declare type StudyOverrideValueType = string | number | boolean;
export interface StudyOverrides {
[key: string]: StudyOverrideValueType;
}
export interface WatchedValueSubscribeOptions {
once?: boolean;
callWithLast?: boolean;
}
export interface IWatchedValueReadonly {
value(): T;
subscribe(callback: (value: T) => void, options?: WatchedValueSubscribeOptions): void;
unsubscribe(callback?: ((value: T) => void) | null): void;
spawn(): IWatchedValueReadonlySpawn;
}
export interface IWatchedValueReadonlySpawn extends IWatchedValueReadonly, IDestroyable {
}
export declare type WatchedValueCallback = (value: T) => void;
export interface IWatchedValue extends IWatchedValueReadonly {
value(): T;
setValue(value: T, forceUpdate?: boolean): void;
subscribe(callback: WatchedValueCallback, options?: WatchedValueSubscribeOptions): void;
unsubscribe(callback?: WatchedValueCallback | null): void;
readonly(): IWatchedValueReadonly;
spawn(): IWatchedValueSpawn;
}
export interface IWatchedValueSpawn extends IWatchedValueReadonlySpawn, IWatchedValue {
spawn(): IWatchedValueSpawn;
}
export declare const enum ConnectionStatus {
Connected = 1,
Connecting = 2,
Disconnected = 3,
Error = 4,
}
export declare const enum OrderType {
Limit = 1,
Market = 2,
Stop = 3,
StopLimit = 4,
}
export declare const enum Side {
Buy = 1,
Sell = -1,
}
export declare const enum OrderStatus {
Canceled = 1,
Filled = 2,
Inactive = 3,
Placing = 4,
Rejected = 5,
Working = 6,
}
export declare const enum ParentType {
Order = 1,
Position = 2,
Trade = 3,
}
export declare const enum OrderTicketFocusControl {
StopLoss = 1,
StopPrice = 2,
TakeProfit = 3,
}
export declare const enum NotificationType {
Error = 0,
Success = 1,
}
export interface TableRow {
priceFormatter?: IFormatter;
[name: string]: any;
}
export interface TableFormatterInputs {
value: number | string | Side | OrderType | OrderStatus;
prevValue?: number | undefined;
row: TableRow;
$container: JQuery;
priceFormatter?: IFormatter;
}
export declare type TableElementFormatFunction = (inputs: TableFormatterInputs) => string | JQuery;
export interface TableElementFormatter {
name: string;
format: TableElementFormatFunction;
}
export declare type StandardFormatterName = 'date' | 'default' | 'fixed' | 'formatPrice' | 'formatPriceForexSup' | 'integerSeparated' | 'localDate' | 'percentage' | 'pips' | 'profit' | 'side' | 'status' | 'symbol' | 'type';
export interface DOMLevel {
price: number;
volume: number;
}
export interface DOMData {
snapshot: boolean;
asks: DOMLevel[];
bids: DOMLevel[];
}
export interface QuantityMetainfo {
min: number;
max: number;
step: number;
}
export interface InstrumentInfo {
qty: QuantityMetainfo;
pipValue: number;
pipSize: number;
minTick: number;
description: string;
domVolumePrecision?: number;
}
export interface CustomFields {
[key: string]: any;
}
export interface PreOrder {
symbol: string;
brokerSymbol?: string;
type?: OrderType;
side?: Side;
qty: number;
status?: OrderStatus;
stopPrice?: number;
limitPrice?: number;
stopLoss?: number;
takeProfit?: number;
duration?: OrderDuration;
}
export interface PlacedOrder extends PreOrder, CustomFields {
id: string;
filledQty?: number;
avgPrice?: number;
updateTime?: number;
takeProfit?: number;
stopLoss?: number;
type: OrderType;
side: Side;
status: OrderStatus;
}
export interface OrderWithParent extends PlacedOrder {
parentId: string;
parentType: ParentType;
}
export declare type Order = OrderWithParent | PlacedOrder;
export interface Position {
id: string;
symbol: string;
brokerSymbol?: string;
qty: number;
side: Side;
avgPrice: number;
[key: string]: any;
}
export interface Trade extends CustomFields {
id: string;
date: number;
symbol: string;
brokerSymbol?: string;
qty: number;
side: Side;
price: number;
}
export interface Execution extends CustomFields {
symbol: string;
brokerSymbol?: string;
price: number;
qty: number;
side: Side;
time: number;
}
export interface AccountInfo {
id: string;
name: string;
currency?: string;
}
export interface AccountManagerColumn {
id?: string;
label: string;
className?: string;
formatter?: StandardFormatterName | 'orderSettings' | 'posSettings' | string;
property?: string;
sortProp?: string;
modificationProperty?: string;
notSortable?: boolean;
help?: string;
highlightDiff?: boolean;
fixedWidth?: boolean;
notHideable?: boolean;
hideByDefault?: boolean;
}
export interface SortingParameters {
columnId: string;
asc?: boolean;
}
export interface AccountManagerTable {
id: string;
title?: string;
columns: AccountManagerColumn[];
initialSorting?: SortingParameters;
changeDelegate: IDelegate<(data: object) => void>;
getData(): Promise