/// /// /// /// /// /// /// /// /// /// declare module FintaChart { /** * Interface contains method to cleanup internal resources */ interface IDisposable { /** * Cleanup memory and dispose class instance */ dispose(): void; } } declare module FintaChart { /** * Supports state operations. * * @template T The type of the state instance. */ interface IStateable { /** * Returns state of current instance. * * @return The state of current instance. */ saveState(): T; /** * Restores instance state. * * @param state The previously saved state. */ restoreState(state: T): void; } } declare module FintaChart { } declare module FintaChart { interface BBRun { text: string; bold: boolean; italic: boolean; underline: boolean; color?: string; } class BBCode { private static readonly MAX_LEN; private static readonly MAX_TAGS; private static readonly MAX_DEPTH; private static readonly MAX_COLOR_LEN; private static readonly NAMED_COLORS; static parse(text: string): BBRun[][]; private static literal; private static parseInternal; private static readTag; private static safeColor; private static inByteRange; } } declare module FintaChart { } interface Math { round(value: string): number; roundToDecimals(value: number, decimals: number): number; trunc(value: number): number; } declare module FintaChart { const state2 = "PAYVFBpUSGwYCBwTagMaBxMPERc3Gk8HBgNIIhgIXQQtCxQ="; type IAction1 = (arg: T) => void; /** * @description Represents string padding options * @export * @interface IStringPaddingOptions */ interface IStringPaddingOptions { /** * @description Align left * @type {boolean} * @memberof IStringPaddingOptions */ alignLeft: boolean; /** * @description Padding */ padding: string; /** * @description Width * @type {number} * @memberof IStringPaddingOptions */ width: number; } /** * @description Represents java script extensions * @export * @class ExtensionJavaScript */ class ExtensionJavaScript { /** * @description Applies mixins * @static * @param {*} derivedCtor * @param {any[]} baseCtors * @memberof ExtensionJavaScript */ static applyMixins(derivedCtor: any, baseCtors: any[]): void; /** * @description Compare approx * @static * @param {number} number1 * @param {number} number2 * @returns {number} * @memberof ExtensionJavaScript */ static approxCompare(number1: number, number2: number): number; /** * @description Binary search * @static * @param {number[]} data * @param {number} searchElement * @returns {number} * @memberof ExtensionJavaScript */ static binarySearch(data: number[], searchElement: number): number; /** * @description Calculates digits by tick size * @static * @param {number} tickSize * @returns {number} * @memberof ExtensionJavaScript */ static calculateDigitsByTickSize(tickSize: number): number; /** * @description Clones * @static * @template T * @param {T} obj * @returns {T} * @memberof ExtensionJavaScript */ static clone(obj: T): T; /** * @description Equals * @static * @param {number} left * @param {number} right * @returns {boolean} * @memberof ExtensionJavaScript */ static equals(left: number, right: number): boolean; /** * @description Extends * @static * @param {ObjectConstructor} dst * @param {ObjectConstructor} src * @memberof ExtensionJavaScript */ static extend(dst: ObjectConstructor, src: ObjectConstructor): void; /** * @description Filters text * @static * @param {string} text * @returns {string} * @memberof ExtensionJavaScript */ static filterText(text: string): string; /** * @description Returns flatten array * @static * @template T * @param {T[]} array * @returns {T[]} * @memberof ExtensionJavaScript */ static flattenArray(array: T[]): T[]; /** * @description Returns flatten array * @static * @template T * @param {(T | T[] | T[][] | T[][][])} array * @param {(item: T) => void} callback * @memberof ExtensionJavaScript */ static flattenedArray(array: T | T[] | T[][] | T[][][], callback: (item: T) => void): void; /** * @description Returns is finite number * @static * @param {*} value * @returns {boolean} * @memberof ExtensionJavaScript */ static isFiniteNumber(value: any): boolean; /** * @description Returns is finite number or NaN * @static * @param {*} value * @returns {boolean} * @memberof ExtensionJavaScript */ static isFiniteNumberOrNaN(value: any): boolean; /** * @description Returns is function * @static * @param {*} value * @returns {boolean} * @memberof ExtensionJavaScript */ static isFunction(value: any): boolean; /** * @description Returns is negative number * @static * @param {*} value * @returns {boolean} * @memberof ExtensionJavaScript */ static isNegativeNumber(value: any): boolean; /** * @description Returns is number * @static * @param {*} value * @returns {boolean} * @memberof ExtensionJavaScript */ static isNumber(value: any): boolean; /** * @description Returns is positive number * @static * @param {*} value * @returns {boolean} * @memberof ExtensionJavaScript */ static isPositiveNumber(value: any): boolean; /** * @description Returns is positive number or NaN * @static * @param {*} value * @returns {boolean} * @memberof ExtensionJavaScript */ static isPositiveNumberOrNaN(value: any): boolean; /** * @description Returns log * @static * @param {number} value * @returns {number} * @memberof ExtensionJavaScript */ static log(value: number): number; /** * @description Returns pad string * @static * @param {string} str * @param {IStringPaddingOptions} options * @returns {string} * @memberof ExtensionJavaScript */ static padStr(str: string, options: IStringPaddingOptions): string; /** * @description Returns shallow clone * @static * @template T * @param {T} obj * @returns {T} * @memberof ExtensionJavaScript */ static shallowClone(obj: T): T; /** * @description Sorts * @static * @template T * @param {T[]} array * @param {(left: T, right: T) => number} comparer * @memberof ExtensionJavaScript */ static sort(array: T[], comparer: (left: T, right: T) => number): void; /** * @description Truncates * @static * @param {number} value * @returns * @memberof ExtensionJavaScript */ static truncateEx(value: number): number; static generateGUID(): string; static hashCode(str: string): number; static singleActivePromise Promise, U>(fn: T, result: (arr: U) => void): (...args: Parameters) => void; } } declare module FintaChart { /** * Provides color helper functions. * * @category Utils */ class Color { /** * Determines whether specified color is a dark color. * * @param color The color * @return true if provided color is a dark color; otherwise, false. */ static isDark(color: string): boolean; /** * Determines whether specified color is a light color. * * @param color The color * @return true if provided color is a light color; otherwise, false. */ static isLight(color: string): boolean; /** * Generates color that is visible on specified color(s). * * @param value The color or list of colors. * @return Color that is visible on specified color(s). */ static visibleColor(value: string | string[]): string; /** * Converts color to hexadecimal format. * * @param color The color. * @return Color in hexadecimal format. */ static toHex(color: string): string; /** * Converts color to RGB format. * * @param color The color. * @return Color in RGB format. */ static toRgb(color: string | ColorFormats.RGBA): string; /** * Makes color lighten. * * @param colorString The color. * @param luminosity The luminosity. * @return Color, lighten than a given color. */ static lighten(colorString: string, luminosity?: number): string; /** * Returns random color. * * @return Random color. */ static random(): string; /** * Compares two color turning them to hex. * * @param firstColor First color to compare. * @param secondColor Second color to compare. * @return boolean. */ static compare(firstColor: string, secondColor: string): boolean; } } declare module FintaChart { } declare module FintaChart { } interface Document { mozFullScreenElement?: Element; mozFullScreenEnabled?: boolean; msFullscreenElement?: Element; msFullscreenEnabled?: boolean; webkitFullscreenEnabled?: boolean; querySelector(selectors: string): E | null; querySelectorAll(selectors: string): NodeListOf; mozCancelFullScreen(): any; msExitFullscreen(): any; webkitExitFullscreen(): any; } interface Element { ALLOW_KEYBOARD_INPUT?: number; mozFullScreenElement: Element | undefined; msFullscreenElement: Element | undefined; querySelector(selectors: string): E | null; querySelectorAll(selectors: string): NodeListOf; closest(selectors: string): E | null; mozRequestFullScreen(): any; msRequestFullscreen(): any; webkitRequestFullscreen(flag?: number): any; } interface Event { key?: string; } declare module FintaChart { /** * Represents html extensions * * @category Utils */ class HtmlHelper { /** * Retina canvas * * @param canvas * @param context * @param width * @param height */ /** * Upper bound for the device pixel ratio used when sizing canvases. * Lower values trade sharpness for far cheaper fills on mobile. */ static dprCap: number; static canvasRetina(canvas: HTMLCanvasElement, context: CanvasRenderingContext2D, width: number, height: number): void; /** * Returns full screen is enabled * * @return */ static fullscreenEnabled(): boolean; /** * Enters full screen * * @param element */ static enterFullscreen(element?: HTMLElement): void; /** * Exits full screen */ static exitFullscreen(): void; /** * Cleans up html code * * @param value * @return */ static cleanupHtmlCode(value: string | HTMLElement): HTMLElement; /** * Sets back ground color * * @param control * @param backgroundColors */ static background(control: HTMLElement, backgroundColors: string[] | string): void; /** * Sets back ground color * * @param control * @param color */ static backgroundColor(control: HTMLElement, color: string): void; /** * Set background color with gradient * * @param control * @param colors */ static gradientBackground(control: HTMLElement, colors: string[]): void; /** * Sets visibility * * @param control * @param visible */ static visibility(control: HTMLElement, visible: boolean): void; /** * Updates canvas size * * @param canvas * @param width * @param height */ static updateCanvasSize(canvas: HTMLCanvasElement, width: number, height: number): void; static toBorderStyle(lineStyle: LineStyle): string; static downloadFile(data: string, fileName: string, fileType?: string): void; } } declare module FintaChart { /** * Native DOM utility functions replacing legacy patterns. * * @category Utils */ class DomUtils { /** * Creates an HTMLElement from an HTML string. * If the string contains multiple root elements, wraps them in a div. * * @param html The HTML string to parse. * @return The created element. */ static createElement(html: string): HTMLElement; /** * Creates an array of HTMLElements from an HTML string. * Unlike createElement, this preserves multiple root elements * without wrapping them in a container div. * * @param html The HTML string to parse. * @return Array of created elements. */ static createElements(html: string): HTMLElement[]; /** * Creates and appends a child element with optional CSS classes. * * @param parent The parent element. * @param tag The tag name for the new element. * @param classes CSS classes to add. * @return The created element. */ static appendElement(parent: HTMLElement, tag: string, ...classes: string[]): HTMLElement; /** * Creates and prepends a child element with optional CSS classes. * * @param parent The parent element. * @param tag The tag name for the new element. * @param classes CSS classes to add. * @return The created element. */ static prependElement(parent: HTMLElement, tag: string, ...classes: string[]): HTMLElement; /** * Creates and appends an absolutely-positioned canvas element. * * @param parent The parent element. * @return The created canvas element. */ static appendCanvas(parent: HTMLElement): HTMLCanvasElement; /** * Applies border style from a stroke theme. * * @param el The target element. * @param border The CSS border property name (e.g. 'border', 'border-top'). * @param theme The stroke theme. */ static applyBorder(el: HTMLElement, border: string, theme: IStrokeTheme): void; /** * Applies border style with fixed 0.05em width from a stroke theme. * * @param el The target element. * @param border The CSS border property name. * @param theme The stroke theme. */ static applyBorderBFT(el: HTMLElement, border: string, theme: IStrokeTheme): void; /** * Applies fill background color from a fill theme. * * @param el The target element. * @param theme The fill theme. */ static applyFill(el: HTMLElement, theme: IFillTheme): void; /** * Applies text style from a text theme. * * @param el The target element. * @param theme The text theme. */ static applyTextStyle(el: HTMLElement, theme: ITextTheme): void; /** * Sets a CSS property on an element. * * @param el The target element. * @param prop The CSS property name. * @param value The CSS property value. */ static css(el: HTMLElement, prop: string, value: string | number): void; private static _rectCache; private static _rectCacheStamp; /** * Bounding rect cached within an 8ms frame bucket. * * @param el The element. * @return The (possibly cached) bounding rect. */ static cachedBoundingRect(el: HTMLElement): DOMRect; /** * Converts client (viewport) coordinates to local element coordinates. * * @param el The reference element. * @param clientX Client X coordinate. * @param clientY Client Y coordinate. * @return Local point coordinates. */ static clientToLocalPoint(el: HTMLElement, clientX: number, clientY: number): IPoint; /** * Converts local element coordinates to client (viewport) coordinates. * * @param el The reference element. * @param localX Local X coordinate. * @param localY Local Y coordinate. * @return Client point coordinates. */ static localToClientPoint(el: HTMLElement, localX: number, localY: number): IPoint; /** * Returns the content size (inner dimensions excluding borders, including padding). * Equivalent to legacy innerWidth/innerHeight helpers. * * @param el The element. * @return The content size. */ static contentSize(el: HTMLElement): ISize; /** * Returns the outer size including borders. * Equivalent to legacy outerWidth/outerHeight helpers. * * @param el The element. * @return The outer size. */ static outerSize(el: HTMLElement): ISize; /** * Sets the position and size of an element. * * @param el The target element. * @param frame The bounds to apply. */ static setFrame(el: HTMLElement, frame: IBounds): void; /** * Sets the CSS position (left, top) of an element. * * @param el The target element. * @param left Left offset in pixels. * @param top Top offset in pixels. */ static setPosition(el: HTMLElement, left: number, top: number): void; /** * Centers element horizontally in the viewport with a given top offset. * Replaces legacy jqTop extension. * * @param el The target element. * @param topOffset The top CSS value (e.g. '6rem'). */ static centerHorizontally(el: HTMLElement, topOffset: string): void; /** * Binds a tap handler firing once on touch or click. * * @param el The target element. * @param handler The tap handler. */ static onTap(el: HTMLElement, handler: (e: Event) => void): void; /** * Shows an element by clearing its display style. * * @param el The element to show. */ static show(el: HTMLElement | null): void; /** * Hides an element by setting display to none. * * @param el The element to hide. */ static hide(el: HTMLElement | null): void; /** * Toggles element visibility. * * @param el The element to toggle. * @param visible If provided, forces visible/hidden state. */ static toggle(el: HTMLElement | null, visible?: boolean): void; /** * Sets the i18n data attribute and optional default text. * * @param el The target element. * @param key The i18n key. * @param defaultValue Optional default text. */ static localize(el: HTMLElement, key: string, defaultValue?: string): void; /** * Finds a single descendant matching the selector. * * @param el The parent element. * @param selector CSS selector. * @return The matching element or null. */ static find(el: HTMLElement, selector: string): HTMLElement | null; /** * Finds all descendants matching the selector. * * @param el The parent element. * @param selector CSS selector. * @return Array of matching elements. */ static findAll(el: HTMLElement, selector: string): HTMLElement[]; /** * Returns the document owning a node. Falls back to the main * document for detached nodes, so dropdowns keep working when the * chart is moved between documents (e.g. Document Picture-in-Picture). * * @param node The node whose document is required. * @return The owning document. */ static ownerDocumentOf(node: Node | null | undefined): Document; /** * Returns the window owning a node. Falls back to the main window * for detached nodes. * * @param node The node whose window is required. * @return The owning window. */ static ownerWindowOf(node: Node | null | undefined): Window; /** * Removes all child elements matching a tag from an element. * Used for HTML sanitization. * * @param el The parent element. * @param tags Tag names to remove. */ static removeChildrenByTag(el: HTMLElement, ...tags: string[]): void; /** * Inserts an element after a reference element. * * @param newElement The element to insert. * @param referenceElement The reference element. * @return The inserted element. */ static insertAfter(newElement: HTMLElement, referenceElement: HTMLElement): HTMLElement; /** * Deep clones an object. Replaces $.extend(true, {}, obj). * * @param obj The object to clone. * @return The cloned object. */ static deepClone(obj: T): T; } } declare module FintaChart { /** * Draggable position info passed to callbacks. */ interface IDraggablePosition { left: number; top: number; } /** * Configuration options for makeDraggable. */ interface IDraggableOptions { /** Element used as drag handle. If not set, the element itself is the handle. */ handle?: HTMLElement | string; /** Constrains dragging within the given element, or "window" for viewport. */ containment?: HTMLElement | string; /** Restricts dragging to a single axis: 'x' or 'y'. */ axis?: 'x' | 'y'; /** Called when dragging starts. */ onStart?: () => void; /** Called during dragging. */ onDrag?: (position: IDraggablePosition) => void; /** Called when dragging stops. */ onStop?: (position: IDraggablePosition) => void; } /** * Controller returned by makeDraggable for managing the draggable instance. */ interface IDraggableController { /** Destroys the draggable behavior, removing all event listeners. */ destroy(): void; /** Enables or disables dragging. */ setEnabled(enabled: boolean): void; /** Re-clamps the element inside its containment (e.g. after a resize). */ reclamp(): void; } /** * Makes an element draggable using native pointer events. * Replaces legacy UI .draggable(). * * @param el The element to make draggable. * @param options Configuration options. * @return A controller for managing the draggable. */ function makeDraggable(el: HTMLElement, options?: IDraggableOptions): IDraggableController; } declare module FintaChart { /** * Configuration options for makeResizable. */ interface IResizableOptions { /** Direction of resizing: 'horizontal' or 'vertical'. */ direction: 'horizontal' | 'vertical'; /** Minimum width in pixels (for horizontal). */ minWidth?: number; /** Minimum height in pixels (for vertical). */ minHeight?: number; /** Container element for boundary constraints. */ container?: HTMLElement; /** Called when resizing starts. */ onStart?: () => void; /** Called during resizing. */ onResize?: () => void; /** Called when resizing stops. */ onStop?: () => void; } /** * Controller returned by makeResizable for managing the resizable instance. */ interface IResizableController { /** Destroys the resizable behavior, removing all event listeners. */ destroy(): void; } /** * Makes an element resizable by adding drag handles on its edges. * Replaces legacy UI .resizable() with custom implementation. * * @param el The element to make resizable. * @param options Configuration options. * @return A controller for managing the resizable. */ function makeResizable(el: HTMLElement, options: IResizableOptions): IResizableController; } declare module FintaChart { } declare module FintaChart { } /** * @hidden */ interface Math { round(value: string): number; roundToDecimals(value: number, decimals: number): number; trunc(value: number): number; } declare module FintaChart { } declare module FintaChart { } declare module FintaChart { } declare module FintaChart { } declare module FintaChart { function createChart(container: HTMLElement, config: IChartConfig): Chart; } declare module FintaChart { /** * Represents string padding options. * * @category Utils */ interface IStringPaddingOptions { /** * The flag that indicates whether text should be aligned on left. */ alignLeft: boolean; /** * The padding symbol. */ padding: string; /** * The desired text length. */ width: number; } /** * Provides string helper functions. */ class StringHelper { /** * Applies html encoding to given text. * * @param text The text to encode. * @return HTML encoded text. */ static htmlEncode(text: string): string; /** * Aligns characters in the string by padding them. * * @param str The string to pad. * @param options The padding options. * @return A new string that is equivalent to the given string but aligned and padded with as many characters * as needed to create a desired length. */ static pad(str: string, options: IStringPaddingOptions): string; static reverse(str: string): string; } } declare module FintaChart { /** * Represents a chainable DOM helper * */ interface ITcdDomHelper { /** * Returns shape settings drag panel * * @param chart * @return */ shapeSettingsDragPane(chart?: Chart): ShapeSettingsDragPane; /** * Returns chart context menu * * @param config * @return */ chartContextMenu(config: IChartContextMenuConfig): ChartContextMenu; /** * Returns color picker * * @param config * @return */ colorPicker(config: Spectrum.Options): ColorPicker; /** * Returns comparing context menu * * @param config * @return */ compareInstrumentContextMenu(config: ICompareInstrumentContextMenuConfig): CompareInstrumentContextMenu; /** * Returns indicator context menu * * @param config * @return */ indicatorContextMenu(config: IIndicatorContextMenuConfig): IndicatorContextMenu; /** * Returns instrument search * * @param config * @return */ instrumentSearch(config: IInstrumentSearchConfig): InstrumentSearch; /** * Returns numeric field * * @param config * @return */ numericField(config: INumericFieldConfig): HTMLElement; /** * Returns scroll bar * * @param chart * @return */ scrollbar(chart?: Chart): Scrollbar; /** * Returns simple drop down * * @return */ simpleDropdown(): DropDown; /** * Returns template manager * * @param config * @return */ templatesManager(config: ITemplatesConfig): TemplatesManager; /** * Returns time frame picker * * @param config * @return */ timeFramePicker(config: ITimeFramePickerConfig): TimeFramePicker; /** * Returns Toolbar * * @param chart * @return */ toolbar(chart?: Chart | IToolbarConfig): Toolbar; /** * Returns toolbar drop down button * * @param config * @return */ toolbarDropDownButton(config: IToolbarDropDownButtonConfig): ToolbarDropDownButton; /** * Returns waiting bar * * @return */ waitingBar(chart: Chart): IWaitingBar; } /** * Standalone native-element factory. Replaces $(el).tcd() pattern. */ function tcd(el: HTMLElement): ITcdDomHelper; } declare module FintaChart { type TDataRowsValue = Date | number; type TDataRowsValues = Date[] | number[]; /** * Represents Data Rows Config */ interface IDataRowsConfig { /** * Data Rows Config name */ name: string; /** * Data Rows Config values */ values: TDataRowsValues; } /** * Represents Data Rows */ interface IDataRows { /** * Data Row's first value */ firstValue: TDataRowsValue; /** * Data Row's date data rows */ dateDataRows: boolean; /** * Data Row's prices data rows */ pricesDataRows: boolean; /** * Data Row's last value */ lastValue: TDataRowsValue; /** * Data Row's length */ length: number; /** * Data Row's name */ name: string; /** * Data Row's name marker */ nameMarker: string; /** * Data Row's records count */ recordsCount: number; /** * Adds Data Rows * * @param value */ add(...value: (TDataRowsValue | TDataRowsValues)[]): void; /** * Ceils Data Row's index * * @param searchValue * @return Data Row's index */ ceilIndex(searchValue: TDataRowsValue): number; /** * Clears Data Row */ clear(): void; /** * Floors Data Row's index * * @param search * @return Data Row's index */ floorIndex(search: TDataRowsValue): number; /** * Retrieves data from Data Rows * * @param row * @param startIndex */ fromDataRow(row: DataRows, startIndex: number): any; /** * Initializes Data Rows * * @param recordsCount * @param rowName */ initialize(recordsCount: number, rowName: string): void; /** * Retrieves Data Row's left visible index value * * @param index * @return Data Row's left visible index value */ leftVisibleIndexValue(index: number): number; /** * Retrieves Data Row's min max values * * @param startIndex * @param count * @return Data Row's min max values */ minMaxValues(startIndex: number, count: number): IMinMax; /** * Retrieves Data Row's right visible index value * * @param index * @return Data Row's right visible index value */ rightVisibleIndexValue(index: number): number; /** * Sets Data Row's value * * @param index * @param value */ setValue(index: number, value: number): any; /** * Converts to Data Rows * * @param name * @return Data Rows */ toDataRow(name: string): DataRows; /** * Trims Data Rows * * @param maxLength * @return Data Rows */ trim(maxLength: number): number; /** * Updates Data Row's last * * @param value */ updateLast(value: TDataRowsValue): void; /** * Retrieves Data Row's value * * @param index * @return Data Row's value */ value(index: number): number; /** * Retrieves Data Row's value at index * * @param index * @param value * @return Data Row's value at index */ valueAtIndex(index: number, value?: TDataRowsValue): TDataRowsValue; } /** * Represents Min Max */ interface IMinMax { /** * Min Max's min */ min?: T; /** * Min Max's max */ max?: T; } const DataRowsMarker: { DATE: string; OPEN: string; HIGH: string; LOW: string; CLOSE: string; VOLUME: string; HEIKIN_ASHI: string; RENKO: string; RANGE_BAR: string; LINE_BREAK: string; POINT_AND_FIGURE: string; KAGI: string; MEDIAN: string; TYPICAL: string; WEIGHTED: string; }; /** * Provides model of Data Rows */ class DataRows implements IDataRows { private _name; private _values; /** * Data Row's records count */ recordsCount: number; /** * Creates an instance of DataRows. * * @param config */ constructor(config?: string | IDataRowsConfig); get firstValue(): TDataRowsValue; get dateDataRows(): boolean; get pricesDataRows(): boolean; get lastValue(): TDataRowsValue; get length(): number; get name(): string; set name(value: string); get nameMarker(): string; /** * Get Data Row's values */ get values(): TDataRowsValues; set values(value: TDataRowsValues); /** * Retrieves Data Row's data row from * * @param row * @param startIndex * @return Data Row's data row from */ static fromDataRow(row: DataRows, startIndex: number): DataRows; add(...value: (TDataRowsValue | TDataRowsValues)[]): void; /** * Retrieves Data Row's binary index of * * @param searchElement * @return Data Row's binary index of */ binaryIndexOf(searchElement: TDataRowsValue): number; ceilIndex(searchValue: TDataRowsValue): number; clear(): void; floorIndex(search: TDataRowsValue): number; fromDataRow(row: DataRows, startIndex: number): void; initialize(recordsCount: number, rowName: string): void; /** * Inserts Data Rows * * @param index * @param value */ insert(index: number, value: TDataRowsValue | TDataRowsValues): void; /** * Retrieves Data Row's items count between values * * @param startValue * @param endValue * @return Data Row's items count between values */ itemsCountBetweenValues(startValue: number, endValue: number): number; leftVisibleIndexValue(index: number): number; minMaxValues(startIndex?: number, count?: number): IMinMax; rightVisibleIndexValue(index: number): number; setValue(index: number, value: number): void; toDataRow(name: string): DataRows; trim(maxLength: number): number; updateLast(value: TDataRowsValue): void; value(index: number): number; valueAtIndex(index: number, value?: TDataRowsValue): TDataRowsValue; } } declare module FintaChart { import DataRows = FintaChart.DataRows; /** * Represents Bar */ interface IBar { /** * Bar's date */ date: Date; /** * Bar's open */ open: number; /** * Bar's hight */ high: number; /** * Bar's low */ low: number; /** * Bar's close */ close: number; /** * Bar's volume */ volume: number; } /** * Represents OHLC Data Rows */ interface IOHLCDataRows { /** * OHLC Data Row's date */ date: DataRows; /** * OHLC Data Row's open */ open: DataRows; /** * OHLC Data Row's hight */ high: DataRows; /** * OHLC Data Row's low */ low: DataRows; /** * OHLC Data Row's close */ close: DataRows; } /** * Represents OHLC Data Rows */ interface IBarDataRows extends IOHLCDataRows { /** * OHLC Data Row's volume */ volume: DataRows; } /** * Raw OHLC arrays (used for cloned/RTH session history, before wrapping into DataRows) */ interface IOhlcArrays { date: Date[]; open: number[]; high: number[]; low: number[]; close: number[]; volume: number[]; } /** * Provides model of Data Context */ class DataContext { private _dataRows; get dataRows(): { [key: string]: DataRows; }; /** * Get Data Context's date data rows */ get dateDataRows(): DataRows; get dateRowsNames(): string[]; dataRowsCopy: IOhlcArrays | null; /** * Adds Data Context's bar data rows * * @param symbol * @return Data Context's bar data rows */ addBarDataRows(symbol?: string): IBarDataRows; /** * Adds Data Context's data rows * * @param dataRows * @param replaceIfExists * @return Data Context's data rows */ addDataRows(dataRows: string | DataRows, replaceIfExists?: boolean): DataRows; /** * Appends Data Context's bars * * @param bars */ appendBars(...bars: (IBar | IBar[])[]): void; /** * Appends Data Context's instruments bars * * @param instrument * @param bars */ appendInstrumentBars(instrument: IInstrument | null, ...bars: (IBar | IBar[])[]): void; /** * Retrieves Data Context's bar * * @param indexOrDate * @param barDataRows * @return Data Context's bar */ bar(indexOrDate: number | Date, barDataRows?: IBarDataRows): IBar; /** * Retrieves Data Context's bar data rows * * @param prefix * @param createIfNotFound * @return Data Context's bar data rows */ barDataRows(prefix?: string, createIfNotFound?: boolean): IBarDataRows; /** * Clears Data Context's bar data rows * * @param instrument */ clearBarDataRows(instrument?: IInstrument | null): void; /** * Clears Data Context's data rows * * @param dataRows */ clearDataRows(dataRows?: string | DataRows): void; /** * Cuts Data Context's data rows * * @param record * @param length */ cutDataRows(record: number, length: number): void; cutBarDataRows(record: number, length: number): void; /** * Finds Data Context's data rows * * @param rowMarker * @return Data Context's data rows */ findDataRows(rowMarker: string): DataRows; /** * Retrieves Data Context's data rows * * @param name * @param addIfNotFound * @return Data Context's data rows */ getDataRows(name: string, addIfNotFound?: boolean): DataRows; /** * Retrieves Data Context's index by date * * @param date * @return Data Context's index by date */ indexByDate(date: Date): number; /** * Inserts Data Context's bars * * @param index * @param bars */ insertBars(index: number, bars: IBar | IBar[]): void; /** * Inserts Data Context's instruments bars * * @param instrument * @param index * @param bars */ insertInstrumentBars(instrument: IInstrument | null, index: number, bars: IBar | IBar[]): void; /** * Retrieves Data Context's OHLC data rows * * @param prefix * @param createIfNotFound * @return Data Context's OHLC data rows */ ohlcDataRows(prefix?: string, createIfNotFound?: boolean): IOHLCDataRows; /** * Removes Data Context's data rows * * @param dataRows */ removeDataRows(dataRows?: string | DataRows): void; /** * Trims Data Context's data rows * * @param maxLength */ trimDataRows(maxLength: number): void; private eachDataRows; } } declare module FintaChart { const TimeSpan: { MILLISECONDS_IN_YEAR: number; MILLISECONDS_IN_MONTH: number; MILLISECONDS_IN_WEEK: number; MILLISECONDS_IN_DAY: number; MILLISECONDS_IN_HOUR: number; MILLISECONDS_IN_MINUTE: number; MILLISECONDS_IN_SECOND: number; }; enum Periodicity { TICK = "t", SECOND = "s", MINUTE = "", HOUR = "h", DAY = "d", WEEK = "w", MONTH = "m", YEAR = "y" } /** * Represents Time Frame */ interface ITimeFrame { /** * Time Frame's interval */ interval: number; /** * Time Frame's periodicity */ periodicity: string; } const TimeUnits: { secondsInMinute: number; minutesInHour: number; minutesInDay: number; hoursInDay: number; daysInWeek: number; daysInMonth: number; daysInYear: number; weeksInYear: number; monthsInYear: number; }; /** * Provides model of Time Frame */ class TimeFrame implements ITimeFrame { interval: number; periodicity: string; /** * Creates an instance of TimeFrame. * * @param periodicity * @param interval */ constructor(periodicity?: string, interval?: number); /** * Retrieves Time Frame's periodicity name * * @param periodicityCode * @return Time Frame's periodicity name */ static periodicityName(periodicityCode: string): string; /** * Retrieves Time Frame's periodicity short name * * @param periodicityCode * @return Time Frame's periodicity short name */ static periodicityShortName(periodicityCode: string): string; /** * Retrieves Time Frame's interval * * @param timeFrame * @return Time Frame's interval */ static toInterval(timeFrame: ITimeFrame): number; /** * Retrieves Time Frame's interval time frame * * @param timeInterval * @return Time Frame's interval time frame */ static fromInterval(timeInterval: number): TimeFrame; static shortName(timeFrame: ITimeFrame | number): string; static equals(left: TimeFrame, right: TimeFrame): boolean; /** * Converts Time Frame to string * * @return Converted Time Frame to string */ toString(): string; private static periodicityCode; } } declare module FintaChart { /** * */ interface IBoxDateReversed { date: Date; price: number; } } declare module FintaChart { /** * */ class TimeFrameBarsManager implements IDisposable { private readonly _chart; private _store; constructor(chart: Chart); getTimeFrameBars(timeFrame: ITimeFrame): IBarDataRows; dispose(): void; private getStoredTimeFrameBars; private storeBars; private clearStore; private subscribe; private unsubscribe; private onLastBarUpdated; private onBarsAppended; private recalculateDataRows; private static getEmptyBarDataRows; } } declare module FintaChart { /** * Represents Formatter Date Time * */ interface IDateTimeFormatter extends IStateable { /** * Formatter Date Time locale */ locale: string; /** * Formatter Date Time time interval */ timeInterval?: number; /** * Retrieves Formatter Date Time's format * * @param date * @return */ format(date: Date): string; } /** * Represents Formatter Date Time State * */ interface IDateTimeFormatterState { /** * Formatter Date Time State's instance type name */ type: string; /** * Formatter Date Time State's locale */ locale: string; } /** * Provides model of Formatter Date Time */ abstract class DateTimeFormatter implements IDateTimeFormatter { /** * Get name on instance type */ static get type(): string; private _locale; /** * Get Formatter Date Time locale */ get locale(): string; set locale(value: string); saveState(): IDateTimeFormatterState; restoreState(state: IDateTimeFormatterState): void; abstract format(date: Date): string; /** * On locale changed event emit */ protected onLocaleChanged(): void; } } declare module FintaChart { } declare module FintaChart { /** * Represents Formatter Number * */ interface INumberFormatter extends IStateable { /** * Formatter Number's locale */ locale: string; /** * Retrieves Formatter Number's format * * value * @return Formatter Number's format */ format(value: number, tickSize: number): string; } /** * Represents Formatter Number State * */ interface INumberFormatterState { /** * Formatter Number State's instance type name */ type: string; /** * Formatter Number State's locale */ locale: string; } } declare module FintaChart { } declare module FintaChart { } declare module FintaChart { } declare module FintaChart { } declare module FintaChart { } declare module FintaChart { } declare module FintaChart { /** * Represents Local Storage */ interface ILocalStorage { /** * Saves Local Storage * * @param key * @param data * @return */ save(key: string, data: string): void; /** * Loads Local Storage * * @param key * @return */ load(key: string): Promise; /** * Clears Local Storage * * @param key * @return */ clear(key?: string): Promise; } } declare module FintaChart { /** * Provides model of Local Storage Wrapper */ class LocalStorage implements ILocalStorage { /** * Clears Local Storage * * @param key */ clear(key?: string): Promise; /** * Loads Local Storage * * @param key * @return Loaded data from storage */ load(key: string): Promise; /** * Saves Local Storage * * @param key * @param data */ save(key: string, data: string): void; private static ensureLocalStorageAvailable; } } declare module FintaChart { /** * Describes datafeed. */ interface IDatafeedBase extends IDisposable { /** * Sends request to load data * * @param request */ send(request: IRequest): void; /** * Cancels load data request * * @param request */ cancel(request: IRequest): void; /** * Returns is request in progress * * @param request */ isBusy(request: IRequest): boolean; /** * Notifies about compare error * * @param message * @param symbol */ notifyCompareError(message: string, symbol?: string): void; } /** * Represents base data feed * * @category Datafeeds */ abstract class DatafeedBase implements IDatafeedBase { private static _requestId; private _requestPerId; /** * Increments request id */ static createRequestNumber(): number; dispose(): void; send(request: IRequest): void; /** * Notifies about compare error * * @param message * @param symbol */ notifyCompareError(message: string, symbol?: string): void; cancel(request: IRequest): void; isBusy(request: IRequest): boolean; /** * Handles request completing * * @param request * @param bars */ protected onCompleteRequest(request: IBarsRequest, bars: IBar[]): void; /** * Handles request canceling * * @param request */ protected onCancelRequest(request: IBarsRequest): void; } } declare module FintaChart { /** * Represents data feed core config */ interface IDatafeedConfig { /** * Returns instruments */ instruments(): Promise; /** * Loads data * * @param request * @return */ loadData(request: IBarsRequest): Promise; /** * Handles real time subscription * * @param instrumentName * @param exchange */ onSubscribeRealtime(instrumentName: string, exchange: string): void; /** * handles real time unsubscription * * @param instrumentName * @param exchange */ onUnsubscribeRealtime(instrumentName: string, exchange: string): void; } /** * Describes realtime tick data. */ interface ITick { /** * The symbol name. */ symbol: string; /** * The timestamp. */ timeStamp: number; /** * The ask price */ ask: number; /** * The ask size. */ askSize: number; /** * The bid price. */ bid: number; /** * The bid size. */ bidSize: number; /** * The last price. */ price: number; /** * The last volume. */ volume: number; } /** * Represents data feed core * * @category Datafeeds */ class DatafeedCore extends DatafeedBase { private _chart; private _config; private _currentInstrument; /** * Creates an instance of DatafeedCore. * * @param config */ constructor(config: IDatafeedConfig); /** * Handles real time tick * * @param tick */ onRealtimeTick(tick: ITick): void; send(request: IBarsRequest): void; private static getLastBar; private static initBar; private static updateLastBar; private loadData; } } declare module FintaChart { /** * The kind of datafeed request. */ enum RequestKind { /** * The request to load bars. */ BARS = "bars", /** * The request to load additional portion of bars for the chart. */ MORE_BARS = "moreBars" } /** * Describes datafeed request. */ interface IRequest { /** * The chart associated with the request. */ chart?: Chart; /** * The unique request number. */ requestNumber?: number; /** * The request kind. */ kind: RequestKind; } /** * Describes request to load bar data. */ interface IBarsRequest extends IRequest { /** * The instrument. */ instrument?: IInstrument; /** * The number of bars to load. */ count: number; /** * The ending date to load bars. */ endDate?: Date; /** * Reset visible range to default view after load. */ resetVisibleRange?: boolean; } } declare module FintaChart.Formatters { /** * Provides external data formatter csv * */ class ExternalDataFormatterCsv implements IFileDatafeedFormatter { /** * Parses bars * * @param data * @param request * @return */ parseBars(data: string, request: IBarsRequest): Promise; } } declare module FintaChart.Formatters { } declare module FintaChart { /** * Represents file data feed instrument */ interface IFileDatafeedInstruments { [name: string]: { instrument: IInstrument; info: IFileInstrumentDescriptionExtended[]; }; } /** * Represents file instrument description extended */ interface IFileInstrumentDescriptionExtended { /** * Path */ path: string; /** * Interval */ interval: number; /** * Periodicity * Supported codes: * TICK: "t", * SECOND: "s", * MINUTE: "", * HOUR: "h", * DAY: "d", * WEEK: "w", * MONTH: "m", * YEAR: "y" */ periodicity: string; } /** * Represents file data feed formatter */ interface IFileDatafeedFormatter { /** * Parsers bars * * @param data * @param request * @return */ parseBars(data: string | object[], request: IBarsRequest): Promise; } /** * Represents file data feed config */ interface IFileDatafeedConfig { /** * External data formatter */ externalDataFormatter: IFileDatafeedFormatter; /** * Instruments */ instruments: IFileDatafeedInstruments; } /** * Represents file data feed * * @category Datafeeds */ class FileDatafeed extends DatafeedBase { private readonly _config; /** * Creates an instance of FileDatafeed. * * @param config */ constructor(config: IFileDatafeedConfig); /** * Inits * * @return */ init(): Promise; send(request: IBarsRequest): void; private compareBars; private loadData; private processResult; } } declare module FintaChart { /** * Represents rest request adapter */ interface IRestRequestAdapter { /** * Returns format history * * @param request * @return */ formatGetHistory(request: IBarsRequest): { path: string; config: RequestInit; }; /** * Returns format instruments * * @return */ formatGetInstruments(): { path: string; config: RequestInit; }; /** * Returns format ticks * * @param name * @param exchange * @return */ formatGetLastTick(name: string, exchange: string): { path: string; config: RequestInit; }; } /** * Rest response adapter */ interface IRestResponseAdapter { /** * Returns bars * * @param data * @return */ formatBars(data: any): IBar[]; /** * Return format instruments * * @param data * @return */ formatInstruments(data: any): IInstrument[]; /** * Returns format real time * * @param data * @return */ formatRealtime(data: any): ITick; } /** * Configuration shape accepted by the generic `Datafeed` wrapper. */ interface IGenericDatafeedConfig { /** * Base URI of the REST data source. */ url: string; /** * Polling interval for realtime updates, in milliseconds. * Defaults to 5000 ms when omitted. */ realtimeUpdateInterval?: number; } /** * Provides rest data feed * * @category Datafeeds */ class RestDatafeed { private _datafeed; private _instruments; private _requestFormatter; private _responseFormatter; private readonly _datasourceApiUri; private readonly _realtimeUpdateInterval; currentInstrument: string; /** * Creates an instance of RestDatafeed. * * @param baseApiUri * @param realtimeUpdateInterval */ constructor(baseApiUri: string, realtimeUpdateInterval: number); /** * Get request formatter */ get requestFormatter(): IRestRequestAdapter; /** * Set request formatter */ set requestFormatter(value: IRestRequestAdapter); /** * Get response formatter */ get responseFormatter(): IRestResponseAdapter; /** * Set response formatter */ set responseFormatter(value: IRestResponseAdapter); /** * Inits * * @return */ init(): Promise; private getInstruments; private getLastTick; private loadHistorical; private onSubscribe; private onUnsubscribe; } /** * Generic options-object datafeed used by the quick-start examples: * * ```javascript * new FintaChart.Datafeed({ url: '/api/bars' }); * ``` * * Thin wrapper over `RestDatafeed` that accepts a configuration * object rather than positional arguments. The two-string positional * form (`new Datafeed('/api', 5000)`) is also supported for parity * with `RestDatafeed`. */ class Datafeed extends RestDatafeed { constructor(config: IGenericDatafeedConfig | string, realtimeUpdateInterval?: number); } } declare module FintaChart { /** * Represents web socket data feed */ interface IWebSocketDatafeedRequest { /** * Returns format history * * @param request * @return */ formatGetHistory(request: IBarsRequest): string; /** * Returns format instruments * * @return */ formatGetInstruments(): string; /** * Returns format subscribe * * @param name * @param exchange * @return */ formatSubscribe(name: string, exchange: string): string; /** * Returns format unsubscribe * * @param name * @param exchange * @return */ formatUnsubscribe(name: string, exchange: string): string; } /** * Represents web socket data feed response */ interface IWebSocketDatafeedResponse { /** * Formats bars * * @param response * @return */ formatBars(response: string): IBar[]; /** * Formats instruments * * @param response * @return */ formatInstruments(response: string): IInstrument[]; /** * Formats real time * * @param response * @return */ formatRealtime(response: string): ITick; } /** * Represents web socket data feed * * @category Datafeeds */ class WebsocketDatafeed { private _datafeed; private _instruments; private _requestFormatter; private _responseFromatter; private _webSocket; private readonly _datasourceApiUri; /** * Creates an instance of WebsocketDatafeed. * * @param datasourceApiUri */ constructor(datasourceApiUri: string); /** * Get request formatter */ get requestFormatter(): IWebSocketDatafeedRequest; set requestFormatter(value: IWebSocketDatafeedRequest); /** * Get response formatter */ get responseFormatter(): IWebSocketDatafeedResponse; set responseFormatter(value: IWebSocketDatafeedResponse); /** * Inits data feed * * @return */ init(): Promise; private getInstruments; private initWebSocket; private loadHistorical; private onSubscribe; private onUnsubscribe; } } declare module FintaChart { abstract class Eventable { private _preventPropagation; private _chart; private _targetSubscriptions; /** * Chart */ get chart(): Chart; /** * Invokes event * * @param event * @param newValue * @param oldValue */ invoke(event: string, newValue?: unknown, oldValue?: unknown): void; /** * Returns prevent propagation * * @param preventEvents * @return */ preventPropagation(preventEvents?: boolean): boolean; /** * Subscribes to events fired with this object as their target. * * Routes through the chart's event emitter and filters to events * whose `target === this`, so multiple instances of the same class * (e.g. several shapes) each receive only their own events. * * @param events Space-delimited event name(s). * @param handler Listener invoked with the matching event. * @return This instance for chaining. */ on(events: string, handler: IEventHandler): Eventable; /** * Unsubscribes from events previously registered via `on`. * * Omitting `handler` removes every listener for `events`; omitting * both removes every listener registered through this `Eventable`. */ off(events?: string, handler?: IEventHandler): Eventable; } } declare module FintaChart { /** * Represents event container. */ class EventAgent { private _listenersPerEvent; /** * Invokes specified event across all listeners. * * @param eventName The event name. * @param event The event. */ invoke(eventName: string, event?: IEvent): void; /** * Subscribes to events. * * @param eventNames The event names delimited by space. * @param handler The event handler. * @param target The event target. */ on(eventNames: string, handler: IEventHandler, target?: unknown): void; /** * Unsubscribes from events. * * @param eventNames The event names. * @param target The event target. */ off(eventNames: string, target?: unknown): void; private static splitEvents; private static parseEvent; private remove; } } declare module FintaChart { /** * Describes event. */ interface IEvent { /** * The event sender. */ sender: unknown; /** * The event target. */ target: unknown; /** * The event type. */ type: string; } /** * Describes event that is sent if value changed. */ interface IValueChangedEvent extends IEvent { /** * The old value. */ oldValue?: T; /** * The new value. */ value?: T; } type IEventHandler = (eventObject: IEvent) => void; /** * Describes event emitter */ interface IEventEmitter { /** * Invokes specified event. * * @param eventType The event type. * @param event The event. */ invoke(eventType: string, event: IEvent): void; /** * Invokes value changed event. * * @template T The type of the value. * @param eventType The event type. * @param newValue The new value. * @param oldValue The old value. */ invokeValueChanged(eventType: string, newValue: T, oldValue?: T): void; /** * Prevents event from propagation. * * @param preventEvents The flag that indicates whether event propagation should be stopped. */ preventPropagation(preventEvents?: boolean): void; } /** * Represents event emitter */ class EventEmitter implements IEventEmitter { private _eventAgent; private _preventPropagation; invoke(eventName: string, data: IEvent): void; invokeValueChanged(eventType: string, newValue?: T, oldValue?: T): void; preventPropagation(preventEvents?: boolean): void; /** * Invokes value changed event for specified target. * * @template T The type of the value. * @param target The target. * @param eventType The event type. * @param newValue The new value. * @param oldValue The old value. */ invokeTargetValueChanged(target: unknown, eventType: string, newValue?: T, oldValue?: T): void; /** * Subscribes to events. * * @param events The events delimited by space. * @param handler The event handler. * @param target The event target. * @return Current event emitter instance. */ on(events: string, handler: IEventHandler, target?: unknown): EventEmitter; /** * Unsubscribes from events. * * @param events The events delimited by space. * @param target The event target. * @return Current event emitter instance. */ off(events: string, target?: unknown): EventEmitter; } } declare module FintaChart { /** * Represents property change event. */ class PropertyChangeEvent { /** * The property name. */ readonly key: string; /** * The property value. */ readonly value: unknown; /** * Initializes new instance of [[PropertyChangeEvent]] class. * * @param key The property name. * @param value The property value. */ constructor(key: string, value: unknown); } } declare module FintaChart { /** * Represents window event * * @category Motion events */ interface IWindowEvent { /** * Event object */ evt: Event; /** * Overrides the native (read-only) `which` button value. */ which?: number; /** * Pane */ pane?: Pane; /** * Pointer position */ pointerPosition: IPoint; /** * Stop propagation */ stopPropagation: boolean; /** * Touches */ touches?: TouchList; } /** * Motion event config * * @category Motion events */ interface IMotionEventConfig { /** * Button */ button?: number; /** * Context */ context?: object; /** * Handler */ handler?: MotionEventHandler; /** * Hit test */ hitTest?: MotionEventHitTestHandler; /** * Keys */ keys?: number[]; } /** * @category Motion events */ type MotionEventHandler = (motionEvent: MotionEvent, event: IWindowEvent) => void; /** * @category Motion events */ type MotionEventHitTestHandler = (position: IPoint) => boolean; /** * @category Motion events */ enum MouseButton { LEFT = 1, SCROLL = 2, RIGHT = 3 } /** * @category Motion events */ enum MouseEvent { ENTER = "mouseenter", LEAVE = "mouseleave", MOVE = "mousemove", DOWN = "mousedown", UP = "mouseup", CLICK = "click", DOUBLE_CLICK = "dblclick", CONTEXT_MENU = "contextmenu", WHEEL = "mousewheel", SCROLL = "DOMMouseScroll", OVER = "mouseover" } /** * @category Motion events */ enum TouchEvent { START = "touchstart", MOVE = "touchmove", END = "touchend", CANCEL = "touchcancel" } /** * @category Motion events */ enum MotionEventState { NONE = 0, STARTED = 1, CONTINUED = 2, FINISHED = 3 } /** * @category Motion events */ enum PointerKind { NONE = 0, MOUSE = 1, TOUCH = 2 } /** * Represents motion event * * @category Motion events */ class MotionEvent { /** * Keys */ private readonly _keys; /** * Pointer type */ private _pointerKind; /** * State */ private _state; /** * Button */ readonly button: MouseButton; /** * Context */ context: unknown; /** * Handler */ handler: MotionEventHandler; /** * Hit test */ hitTest: MotionEventHitTestHandler; /** * Gets pointer name */ get pointerKind(): PointerKind; /** * Gets event state */ get state(): MotionEventState; protected set state(value: MotionEventState); /** * Creates an instance of MotionEvent. * * @param config The motion event config. */ constructor(config?: IMotionEventConfig); /** * Handles event * * @param event The window event to handle. * @return true if event was handled; otherwise, false. */ handleEvent(event: IWindowEvent): boolean; /** * Determines whether motion event is active. * * @return true if motion event is active; otherwise, false. */ isActive(): boolean; /** * Resets motion event to initial state. */ reset(): void; /** * Checks button * * @param event */ protected checkButton(event: IWindowEvent): boolean; /** * Checks hit * * @param event */ protected checkHit(event: IWindowEvent): boolean; /** * Check keys * * @param event */ protected checkKeys(event: IWindowEvent): boolean; /** * Invokes handler * * @param event */ protected invokeHandler(event: IWindowEvent): void; /** * Updates pointer name * * @param event */ protected updatePointerKind(event: IWindowEvent): void; } } declare module FintaChart { /** * Represents motion event array * * @category Motion events */ class MotionEventArray { /** * Motion events */ readonly motionEvents: MotionEvent[]; /** * Creates an instance of MotionEventArray. * * @param motionEvents * @param context * @param hitTestFunc */ constructor(motionEvents?: MotionEvent | MotionEvent[], context?: unknown, hitTestFunc?: MotionEventHitTestHandler); /** * Adds events to the collection. * * @param motionEvents The motion event or an array of motion events to add. */ add(motionEvents: MotionEvent | MotionEvent[]): void; /** * Determines whether specified event is present in the collection. * * @param motionEvent The motion event to find. * @return true if given motion event is present in the collection; otherwise, false. */ contains(motionEvent: MotionEvent): boolean; /** * Handles specified window event. * * @param event The window event to handle. * @param inBounds * @return true if event was handled; otherwise, false. */ handleEvent(event: IWindowEvent, inBounds?: boolean): boolean; /** * Resets all motion events to initial state. */ reset(): void; } } declare module FintaChart { /** * Describes click motion event config. * * @category Motion events */ interface IClickMotionEventConfig extends IMotionEventConfig { /** * Max touch interval */ maxTouchInterval?: number; /** * Max touch offset */ maxTouchOffset?: number; } /** * Motion event click * * @category Motion events */ class ClickMotionEvent extends MotionEvent { private _isTouch; private _maxTouchInterval; private _maxTouchOffset; private _startDate; private _startPoint; /** * The max touch interval. */ get maxTouchInterval(): number; set maxTouchInterval(value: number); /** * The max touch offset */ get maxTouchOffset(): number; set maxTouchOffset(value: number); /** * Creates an instance of ClickMotionEvent. * * @param config */ constructor(config?: IClickMotionEventConfig); handleEvent(event: IWindowEvent): boolean; private finish; } } declare module FintaChart { /** * Describes context menu motion event config. * * @category Motion events */ interface IContextMenuMotionEventConfig extends IMotionEventConfig { /** * Max touch offset */ maxTouchOffset?: number; /** * Touch interval */ touchInterval?: number; } /** * Represents motion event context menu * * @category Motion events */ class ContextMenuMotionEvent extends MotionEvent { private _isTouch; private _lastEvent; private _maxTouchOffset; private _startPoint; private _timeoutId; private _touchInterval; /** * The max touch offset */ get maxTouchOffset(): number; set maxTouchOffset(value: number); /** * The touch interval */ get touchInterval(): number; set touchInterval(value: number); /** * Creates an instance of ContextMenuMotionEvent. * * @param config */ constructor(config?: IContextMenuMotionEventConfig); handleEvent(event: IWindowEvent): boolean; /** * Creates lightweight event snapshot. */ private snapshot; private finish; private startTimer; private stopTimer; } } declare module FintaChart { /** * Represents motion event double click config * * @category Motion events */ interface IMotionEventDoubleClickConfig extends IMotionEventConfig { /** * Max touch interval */ maxTouchInterval?: number; /** * Max touch offset */ maxTouchOffset?: number; } /** * Represents motion event double click * * @category Motion events */ class DoubleClickMotionEvent extends MotionEvent { private _isSecondTouch; private _maxTouchInterval; private _maxTouchOffset; private _startDate; private _startPoint; /** * The max touch interval */ get maxTouchInterval(): number; set maxTouchInterval(value: number); /** * The max touch offset */ get maxTouchOffset(): number; set maxTouchOffset(value: number); /** * Creates an instance of DoubleClickMotionEvent. * * @param config = */ constructor(config?: IMotionEventDoubleClickConfig); handleEvent(event: IWindowEvent): boolean; private finish; } } declare module FintaChart { /** * Represents motion event mouse hover config * * @category Motion events */ interface IMouseHoverMotionEventConfig extends IMotionEventConfig { /** * Enter event enabled */ enterEventEnabled?: boolean; /** * Hover event enabled */ hoverEventEnabled?: boolean; /** * Leave event enabled */ leaveEventEnabled?: boolean; } /** * Represents Motion event mouse hover * * @category Motion events */ class MouseHoverMotionEvent extends MotionEvent { private readonly _optimization; /** * Enter enabled */ enterEnabled: boolean; /** * Hover enabled */ hoverEnabled: boolean; /** * Leave enabled */ leaveEnabled: boolean; /** * Creates an instance of MouseHoverMotionEvent. * * @param config */ constructor(config: IMouseHoverMotionEventConfig); handleEvent(event: IWindowEvent): boolean; } } declare module FintaChart { /** * Represents motion event mouse wheel * * @category Motion events */ class MouseWheelMotionEvent extends MotionEvent { private _optimization; private _wheelDeltaAccum; /** * Delta */ delta: number; handleEvent(event: IWindowEvent): boolean; reset(): void; /** * Accumulates wheel ticks and defers the handler. * * @param event */ private accumulate; } } declare module FintaChart { /** * Represents motion event pencil device config * * @category Motion events */ interface IMoveMotionEventConfig extends IMotionEventConfig { /** * Horizontal move enabled */ horizontalMoveEnabled?: boolean; /** * Min move distance */ minMoveDistance?: number; /** * Vertical move enabled */ verticalMoveEnabled?: boolean; } /** * Represents * * @category Motion events */ class MoveMotionEvent extends MotionEvent { private readonly _optimization; private _lastPoint; private _minMoveDistance; private _prevPoint; private _which; /** * Horizontal move enabled */ horizontalMoveEnabled: boolean; /** * Move offset */ moveOffset: IPoint; /** * Vertical move enabled */ verticalMoveEnabled: boolean; /** * Get move distance */ get minMoveDistance(): number; set minMoveDistance(value: number); /** * Creates an instance of MoveMotionEvent. * * @param config */ constructor(config?: IMoveMotionEventConfig); handleEvent(event: IWindowEvent): boolean; } } declare module FintaChart { /** * Represents motion event pinch config * * @category Motion events */ interface IMotionEventPinchConfig extends IMotionEventConfig { /** * Min distance */ minDistance?: number; /** * Min scale change */ minScaleStep?: number; } /** * Represents motion event pinch * * @category Motion events */ class PinchMotionEvent extends MotionEvent { private _minDistance; private _minScaleStep; private _smoothing; private _startDistance; private _lastDistance; private _samples; /** * Scale relative to gesture start */ scale: number; /** * Scale relative to previous move */ scaleDelta: number; /** * Midpoint between touches, in local coordinates */ center: IPoint; /** * The min distance */ get minDistance(): number; set minDistance(value: number); /** * The min scale step */ get minScaleStep(): number; set minScaleStep(value: number); /** * Creates an instance of PinchMotionEvent. * * @param config */ constructor(config?: IMotionEventPinchConfig); handleEvent(event: IWindowEvent): boolean; reset(): void; /** * Begins gesture once a second touch lands. * * @param event * @param touches */ private start; /** * Updates scale while both touches move. * * @param event * @param touches */ private move; /** * Ends gesture and clears state. * * @param event * @param touches */ private finish; /** * Marks gesture finished and clears measurements. */ private cancel; /** * Returns median of the last three distances. * * @param distance The newest measured distance. */ private smooth; /** * Returns midpoint in local coordinates. * * @param event * @param touches */ private centerOf; private static distanceOf; private static touchesOf; } } declare module FintaChart { /** * @ignore */ class DemoModePopup { private readonly _chart; private _isShown; private _element; private _isClosable; constructor(chart: Chart); show(closable?: boolean): Promise; hide(): void; private init; private onClose; private onSubmit; private collectFormData; private validate; private isValidEmail; private sendPurchaseRequest; private sendViaBackend; private showError; private showSuccess; private clearMessages; } } declare module FintaChart { /** * @ignore */ interface ICheckLicenseResponse { expireAt: number; state: string; isValid: boolean; } /** * @ignore */ function handleStates(chart: Chart, n?: number): void; /** * @ignore */ function getState2(): string; /** * @ignore */ function checkDialog(content: string): boolean; /** * @ignore */ function checkLicense(): Promise; } declare module FintaChart { /** * Represents environment theme */ interface IEnvironmentTheme { /** * bg color */ bgColor: string | string[]; /** * Down candle border stroke color */ downCandleBorderStrokeColor: string; /** * Down candle border stroke enabled */ downCandleBorderStrokeEnabled: boolean; /** * Down candle fil color */ downCandleFillColor: string; /** * Down candle shadow stroke color */ downCandleShadowStrokeColor: string; /** * Font size */ fontSize?: number; /** * Line stroke color */ lineStrokeColor: string; /** * Pane grid stroke color */ paneGridStrokeColor: string; /** * Scale horizontal fill color */ horizontalScaleFillColor: string; /** * Scale Vertical fill color */ verticalScaleFillColor: string; /** * Scale vertical text fill color */ verticalScaleTextFillColor: string; /** * Scale vertical text font family */ verticalScaleTextFontFamily: string; /** * Up candle fill color */ upCandleFillColor: string; /** * Up candle stroke color */ upCandleStrokeColor: string; /** * Up candle stroke enabled */ upCandleStrokeEnabled: boolean; /** * Up candle shadow stroke color */ upCandleShadowStrokeColor: string; useSmoothedLines: boolean; verticalScaleLabelFillColor: string; verticalScaleLabelTextColor: string; showExecutionLabels: boolean; showExecution: boolean; /** * Pre/Post market fill color */ preMarketFillColor: string; afterMarketFillColor: string; closeMarketFillColor: string; } } declare const defaultTheme: Record; declare const darkTheme: Record; declare const fintatechDarkTheme: Record; declare const beetTheme: Record; declare const grayTheme: Record; declare const oliveTheme: Record; declare const orangeTheme: Record; declare const purpleTheme: Record; declare const skyTheme: Record; declare const tealTheme: Record; declare module FintaChart { enum StrokePriority { COLOR = "color" } enum FillPriority { COLOR = "color" } enum LineStyle { SOLID = "solid", DASH = "dash", DOT = "dot", DASH_DOT = "dash-dot" } const FontDefaults: { fontFamily: string; fontSize: number; fontStyle: string; fontVariant: string; fontWeight: string; }; const StrokeDefaults: { strokePriority: string; strokeColor: string; width: number; lineStyle: LineStyle; lineJoin: CanvasLineJoin; lineCap: CanvasLineCap; }; const DashArray: { DOT: number[]; DASH: number[]; DASH_DOT: number[]; }; const Themes: { readonly default: Record; readonly light: Record; readonly dark: Record; readonly fintatechDark: Record; readonly beet: Record; readonly gray: Record; readonly olive: Record; readonly orange: Record; readonly purple: Record; readonly sky: Record; readonly teal: Record; /** * Look up a built-in theme by string name (case-insensitive). * Returns `null` if the name is unknown. */ byName(name: string): Record | null; /** * Sets the default theme applied to subsequent `new Chart(...)` * instances that don't pass an explicit `theme` option. Accepts * either a string name (`'Dark'`, `'Light'`, …) or a theme object. */ use(theme: string | Record): void; /** * @internal Returns the theme previously selected via `use()`, * or `null` if no global override is set. */ readonly currentDefault: Record; }; /** * Capitalised alias surface — `FintaChart.Theme.Dark`, * `FintaChart.Theme.Light`, `FintaChart.Theme.use('Dark')`. * Resolves to the same theme objects as `FintaChart.Themes`. */ const Theme: { readonly Default: Record; readonly Light: Record; readonly Dark: Record; readonly FintatechDark: Record; readonly Beet: Record; readonly Gray: Record; readonly Olive: Record; readonly Orange: Record; readonly Purple: Record; readonly Sky: Record; readonly Teal: Record; byName(name: string): Record | null; use(theme: string | Record): void; }; /** * Represents stroke theme */ interface IStrokeTheme { /** * Line cap */ lineCap?: CanvasLineCap; /** * Line join */ lineJoin?: CanvasLineJoin; /** * Line style */ lineStyle?: LineStyle; /** * Stroke color */ strokeColor?: string; /** * Weather the stroke color is default */ default?: boolean; /** * Stroke enabled */ strokeEnabled?: boolean; /** * Stroke priority */ strokePriority?: string; /** * Width */ width?: number; } /** * Describes linear gradient color stop. */ interface ILinearGradientColorStop { /** * The color of the stop. */ color: string; /** * The offset of the stop. */ stop: number; } /** * Describes radial gradient circle. */ interface IRadialGradientCircle { /** * The center point of the circle. */ center: IPoint; /** * The radius of the circle. */ radius: number; /** * The color of the stop. */ color: string; /** * The offset of the stop. */ stop?: number; } /** * Represents Fill theme */ interface IFillTheme { /** * Fill color */ fillColor?: string; /** * Weather the fill color is default */ default?: boolean; /** * Fill enabled */ fillEnabled?: boolean; /** * Fill priority */ fillPriority?: string; /** * Line gradient */ linearGradient?: string[] | ILinearGradientColorStop[]; /** * Radius gradient */ radialGradient?: IRadialGradientCircle[]; } /** * Represents text theme */ interface ITextTheme extends IStrokeTheme, IFillTheme { /** * Decoration */ decoration?: string; /** * Fill color */ fillColor: string; /** * Font family */ fontFamily: string; /** * Font size */ fontSize: number; /** * Font style */ fontStyle: string; /** * Font variant */ fontVariant?: string; /** * Font weight */ fontWeight?: string; /** * Line height */ lineHeight?: number; } /** * Check box theme */ interface ICheckBoxTheme { /** * Fill */ fill: IFillTheme; /** * Line */ line: IStrokeTheme; } } declare module FintaChart { /** * Represents html extensions */ class ThemeHelper { /** * Returns font size * * @param theme * @return */ static fontSize(theme: ITextTheme): number; /** * Returns line width * * @param theme * @return */ static lineWidth(theme: IStrokeTheme): number; static isLight(chartTheme: any): boolean; } } declare module FintaChart { class ThemeUtils { private static isObject; static deepMerge(target: T, source: Partial): T; private static mergeInto; } } declare module FintaChart { /** * Represents container dislocation * */ interface IContainerDislocation { /** * Height */ height: number; /** * Width */ width: number; } /** * Represents chart container * */ class ChartContainer implements IDisposable { private readonly _parent; private readonly _undoRedo; private _shapeDragPane; private _chartsItems; private _dislocation; private _inFullScreenMode; private _inFullWindowMode; private _scrollbar; private _toolbar; private _onFullscreenChanged; private _onFullWindowChanged; /** * Creates an instance of ChartContainer. * * @param parent */ constructor(parent: HTMLElement); /** * Get shape settings drag pane */ get shapeSettingsDragPane(): ShapeSettingsDragPane; /** * Get charts */ get charts(): Chart[]; /** * Get hot key controller */ get undoRedo(): UndoRedoController; /** * Get container dislocation */ get containerDislocation(): IContainerDislocation; set containerDislocation(value: IContainerDislocation); /** * Get parent */ get parent(): HTMLElement; /** * Get scroll bar */ get scrollbar(): Scrollbar; /** * Get toolbar */ get toolbar(): Toolbar; /** * Adds chart * * @param config * @return */ addChart(config?: IChartConfig): Chart; /** * Creates multiple charts * * @param configs */ createMultipleCharts(configs: IChartConfig[]): void; dispose(): void; private onFullScreenChange; private onFullWindowChange; } /** * Alias for `ChartContainer`. Both names appear in the public guides * (`FintaChart.ChartContainer` and `FintaChart.ChartsContainer`); both * resolve to the same class on the runtime. */ const ChartsContainer: typeof ChartContainer; } declare module FintaChart { } declare module FintaChart { } declare module FintaChart { /** * Represents html content loader. */ class HtmlLoader { private static readonly _htmlPerName; /** * Loads html resource. * * @param relativePath The path to the resource relative to the root HTML dialogs path. * @return Promise which will be resolved with HTML content. */ static load(relativePath: string): Promise; /** * Loads html resource. * * @param relativePath The path to the resource relative to the root HTML dialogs path. * @param clone The flag that indicates whether resulting element should be cloned. * @return Promise which will be resolved with HTMLElement. */ static loadHtml(relativePath: string, clone?: boolean): Promise; /** * Loads html resource as native HTMLElement. * * @param relativePath The path to the resource relative to the root HTML dialogs path. * @param clone The flag that indicates whether resulting element should be cloned. * @return Promise which will be resolved with HTMLElement. */ static loadHtmlElement(relativePath: string, clone?: boolean): Promise; private static getUri; } } declare module FintaChart { import TranslationOptions = I18next.TranslationOptions; /** * Provides localization. */ class Localizer { private static initializedLocales; /** * Fallback locale */ static fallbackLocale: string; /** * Localizes specified element. * * @param chart The chart. * @param element The element to localize. */ static localize(chart: Chart, element?: HTMLElement): Promise; /** * Localizes an HTMLElement using the internal localization adapter. * * @param element The element to localize. */ static localizeElement(element: HTMLElement): void; /** * @description Localizes text * @static * @param {(Chart | string)} chartOrLocale * @param {string} [key] * @param {TranslationOptions} [trlOptions] * @returns {Promise} * @memberof Localizator */ static localizeText(chartOrLocale: Chart | string, key?: string, trlOptions?: TranslationOptions): Promise; /** * Returns localized text with specified key in the translation dictionary. * * @param chart The chart. * @param key The key of the text in the translation dictionary. * @param options The translation options. * @return Promise that is resolved with localized text. */ static get(chart: Chart, key: string, options?: TranslationOptions): Promise; /** * Returns localized text with specified key in the translation dictionary. * * @param locale The locale. * @param key The key of the text in the translation dictionary. * @param options The translation options. * @return Promise that is resolved with localized text. */ static get(locale: string, key: string, options?: TranslationOptions): Promise; /** * Returns localized text with specified key in the translation dictionary. * * @param chart The chart. * @param key The key of the text in the translation dictionary. * @param defaultValue The default value if translation not found. * @return Promise that is resolved with localized text. */ static getOrDefault(chart: Chart, key: string, defaultValue: string): Promise; private static isInitialized; private static init; private static prepare; private static _localizeElement; private static _applyLocalization; private static _applyLocalizedValue; private static _localize; } } declare module FintaChart { /** * Describes default resource paths. */ interface IResourcePathDefaults { /** * The resources root path. */ root: string; /** * The localization resources path. */ localization: string; /** * The HTML dialog resources path. */ htmlDialogs: string; } /** * Represents ResourcePath */ class ResourcePath { static defaults: IResourcePathDefaults; private static _root; private static _localization; private static _htmlDialogs; /** * Get root */ static get root(): string; static set root(value: string); /** * Get localization */ static get localization(): string; static set localization(value: string); /** * Get html dialogs */ static get htmlDialogs(): string; static set htmlDialogs(value: string); } } declare module FintaChart { /** * Describes SVG graphics loader. */ interface ISvgLoaderConfig { chart: Chart; } /** * Represents SVG graphics loader. */ class SvgLoader { static path: string; private static readonly _svgAttr; private static readonly _svgClass; private static readonly _svgPerName; private static readonly _htmlElementsPerSvgName; private static _nativeContainer; private static _config; /** * Initializes * * @param config */ static init(config: ISvgLoaderConfig): void; /** * Loads SVG graphics for specified HTML element. * * @param htmlElement The HTML element. */ static load(htmlElement?: HTMLElement): void; private static getPath; private static getContainer; private static subscribe; private static resolveNativeElement; private static loadElement; private static loadFile; private static sanitizeSvg; private static updateElements; private static updateElement; } } declare module FintaChart { /** * Provides enumeration of browser names. */ enum Browser { UNKNOWN = 0, IE = 1, FIREFOX = 2, OPERA = 3, KONQUEROR = 4, IRON = 5, SAFARI = 6, CHROME = 7, EDGE = 8 } /** * Describes user agent information. */ interface IUserAgent { /** * The browser. */ browser: Browser; /** * The browser version. */ browserVersion: string; /** * The flag that indicates whether browser is run on Android. */ isAndroid: boolean; /** * The flag that indicates whether browser is run on iOS. */ isIOS: boolean; /** * The flag that indicates whether browser is run on tablet. */ isTablet: boolean; /** * The flag that indicates whether browser is run on phone. */ isPhone: boolean; /** * The flag that indicates whether browser is run on phone or tablet. */ isMobile: boolean; /** * The OS version. */ osVersion: string; /** * @description Directory * @memberof IUserAgent */ directory: IDirectory; } const DEFAULT_DIRECTORY: { root: string; htmlDialogs: string; localization: string; }; interface IDirectory { /** * @description Localization * @type {string} * @memberof IDirectory */ localization: string; /** * @description Root * @type {string} * @memberof IDirectory */ root: string; /** * @description HTML dialogs * @type {string} * @memberof IDirectory */ htmlDialogs: string; } class Directory implements IDirectory { private _localization; private _root; private _htmlDialogs; /** * @description Get localization * @property {string} localization * @memberof Directory */ get localization(): string; /** * @description Set localization * @property {string} localization * @memberof Directory */ set localization(value: string); /** * @description Get root * @property {string} root * @memberof Directory */ get root(): string; /** * @description Set root * @property {string} root * @memberof Directory */ set root(value: string); /** * @description Get html dialogs * @property {string} htmlDialogs * @memberof Directory */ get htmlDialogs(): string; /** * @description Set html dialogs * @property {string} htmlDialogs * @memberof Directory */ set htmlDialogs(value: string); } const UserAgent: IUserAgent; /** * Updates device mode at runtime. * * @param isMobile Whether the chart should behave as a mobile device. */ function setMobile(isMobile: boolean): void; } declare module FintaChart { /** * Describes bounds rectangle. */ interface IBounds { /** * The left X coordinate of the rectangle. */ left: number; /** * The top Y coordinate of the rectangle. */ top: number; /** * The width of the rectangle. */ width: number; /** * The height of the rectangle. */ height: number; } /** * Represents bounds rectangle. */ class Bounds implements IBounds, ICloneable { left: number; top: number; width: number; height: number; /** * Creates an instance of Bounds. * * @param bounds The source bounds instance. */ constructor(bounds?: IBounds); /** * The bottom Y coordinate. */ get bottom(): number; /** * The right X coordinate. */ get right(): number; /** * Applies padding. * * @param padding The padding. */ applyPadding(padding: IPadding): void; clone(): Bounds; /** * Determines whether point is inside the current rectangle. * * @param point The point. * @return true if the point is inside the current rectangle, otherwise false. */ containsPoint(point: IPoint): boolean; /** * Copies from * * @param bounds */ copyFrom(bounds: IBounds): void; /** * Crop bottom * * @param bounds */ cropBottom(bounds: Bounds): void; /** * Crop left * * @param bounds */ cropLeft(bounds: Bounds): void; /** * Crop right * * @param bounds */ cropRight(bounds: Bounds): void; /** * Crop top * * @param bounds */ cropTop(bounds: Bounds): void; /** * Equals * * @param bounds * @return */ equals(bounds: IBounds): boolean; /** * Returns string * * @return */ toString(): string; } } declare module FintaChart { /** * Represents canvas render */ class CanvasRenderer implements IRenderer { private _lineDashFunc; private _canvas; private _context; private _linearGradientCache; /** * Get canvas */ get canvas(): HTMLCanvasElement; set canvas(value: HTMLCanvasElement); /** * Get content */ get context(): CanvasRenderingContext2D; clearRect(x: number, y: number, width: number, height: number): void; clip(): void; save(): void; restore(): void; beginPath(): void; closePath(): void; translate(x: number, y: number): void; rotate(angle: number): void; scale(x: number, y: number): void; textOptions(options: ITextRenderingOptions): void; moveTo(x: number, y: number): void; moveToPoint(point: IPoint): void; arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void; arcPath(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void; bezierCurve(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void; circle(centerX: number, centerY: number, radius: number): void; circlePath(centerX: number, centerY: number, radius: number): void; ellipse(centerX: number, centerY: number, horRadius: number, verRadius: number): void; ellipsePath(centerX: number, centerY: number, horRadius: number, verRadius: number): void; horizontalLine(x1: number, x2: number, y: number): void; horizontalPath(x1: number, x2: number, y: number): void; image(image: HTMLImageElement, dstX: number, dstY: number, dstWidth?: number, dstHeight?: number): void; line(x1: number, y1: number, x2: number, y2: number): void; linePath(x1: number, y1: number, x2: number, y2: number): void; lineTo(x: number, y: number): void; lineToPoint(point: IPoint): void; polygon(...points: (number | IPoint)[]): void; polygonPath(...coordinates: (number | IPoint)[]): void; polyline(points: (number | IPoint)[]): void; polylinePath(points: (number | IPoint)[]): void; quadraticCurve(cpx: number, cpy: number, x: number, y: number): void; rect(x: number, y: number, width: number, height: number): void; rectRounded(x: number, y: number, width: number, height: number, radius: number): void; rectPath(x: number, y: number, width: number, height: number): void; textWidth(text: string): number; verticalLine(x: number, y1: number, y2: number): void; shadow(options: IShadowRenderingOptions): void; strokeTheme(theme: IStrokeTheme, force?: boolean): void; stroke(theme?: IStrokeTheme, force?: boolean): void; fillTheme(theme: IFillTheme, force?: boolean): void; fill(theme?: IFillTheme, force?: boolean, fillRule?: CanvasFillRule): void; fillStrokeTheme(fillTheme: IFillTheme, strokeTheme: IStrokeTheme): void; fillStroke(fillTheme?: IFillTheme, strokeTheme?: IStrokeTheme): void; textTheme(theme: ITextTheme): void; fillText(text: string, x: number, y: number, textTheme?: ITextTheme): void; private static dashArray; private static font; private linearGradient; private radialGradient; private initLineDashFunc; } } declare module FintaChart { class Cartesian { static readonly REGULAR_DEVIATION: number; static readonly MAGNET_DEVIATION: number; static DEVIATION: number; /** * Calculates length between specified points. * * @param point1 The first point. * @param point2 The second point. * @return Length between given points. */ static len(point1: IPoint, point2: IPoint): number; /** * Calculates x length between specified points. * * @param point1 The first point. * @param point2 The second point. * @return X length between given points. */ static xLength(point1: IPoint, point2: IPoint): number; /** * Calculates y length between specified points. * * @param point1 The first point. * @param point2 The second point. * @return Y length between given points. */ static yLength(point1: IPoint, point2: IPoint): number; /** * Returns is value near value * * @param value1 * @param value2 * @return */ static isValueNearValue(value1: number, value2: number): boolean; /** * Returns is value between or near value * * @param value * @param value1 * @param value2 * @return */ static isValueBetweenOrNearValues(value: number, value1: number, value2: number): boolean; /** * Returns is point near point * * @param point * @param checkPoint * @return */ static isPointNearPoint(point: IPoint, checkPoint: IPoint | IPoint[]): boolean; /** * Returns is point near rect point * * @param point * @param rectPoint1 * @param rectPoint2 * @return */ static isPointNearRectPoints(point: IPoint, rectPoint1: IPoint, rectPoint2: IPoint): boolean; /** * Returns is point inside or near rectangle * * @param point * @param bounds * @return */ static isPointInsideOrNearRect(point: IPoint, bounds: IBounds): boolean; /** * Returns is point inside or near rect points * * @param point * @param rectPoint1 * @param rectPoint2 * @return */ static isPointInsideOrNearRectPoints(point: IPoint, rectPoint1: IPoint, rectPoint2: IPoint): boolean; /** * Returns is point near circle * * @param point * @param centerPoint * @param radius * @return */ static isPointNearCircle(point: IPoint, centerPoint: IPoint, radius: number | IPoint): boolean; /** * Returns is point inside or dear circle * * @param point * @param centerPoint * @param radius * @return */ static isPointInsideOrNearCircle(point: IPoint, centerPoint: IPoint, radius: number | IPoint): boolean; /** * Returns is point near polygon * * @param point * @param polygonPoints * @return */ static isPointNearPolygon(point: IPoint, polygonPoints: IPoint[]): boolean; /** * Returns is point near polygon * * @param point * @param polygonPoints * @return */ static isPointInsidePolygon(point: IPoint, polygonPoints: IPoint[]): boolean; /** * Returns is point near line * * @param point * @param linePoint1 * @param linePoint2 * @return */ static isPointNearLine(point: IPoint, linePoint1: IPoint, linePoint2: IPoint): boolean; /** * Returns is point near polygon * * @param point * @param polylinePoints * @return */ static isPointNearPolyline(point: IPoint, polylinePoints: IPoint[]): boolean; /** * Returns is point near ellipse * * @param point * @param centerPoint * @param radiusPoint * @return */ static isPointNearEllipse(point: IPoint, centerPoint: IPoint, radiusPoint: IPoint): boolean; /** * returns is point near ellipse with radiuses * * @param point * @param center * @param horRadius * @param verRadius * @return */ static isPointNearEllipseWithRadiuses(point: IPoint, center: IPoint, horRadius: number, verRadius: number): boolean; /** * Intersections point * * @param point1 * @param point2 * @param point3 * @param point4 * @return */ static intersectionPoints(point1: IPoint, point2: IPoint, point3: IPoint, point4: IPoint): IPoint; } } declare module FintaChart { /** * Describes css size of the element. */ interface ICssSize { /** * The width of the element. */ width: number | string; /** * The height of the element. */ height: number | string; } } declare module FintaChart { /** * Describes data point. */ interface IDataPoint { /** * The X as horizontal coordinate. */ x?: number; /** * The date as horizontal coordinate. */ date?: Date; /** * The record as horizontal coordinate. */ record?: number; /** * The Y as vertical coordinate. */ y?: number; /** * The value as vertical coordinate. */ value?: number; } /** * Represents visual data point */ class DataPoint implements IDataPoint, ICloneable { x: number; date: Date; record: number; y: number; value: number; /** * Creates an instance of DataPoint. * * @param config */ constructor(config?: IDataPoint); /** * Converts * * @param point * @param behavior * @param coordinateMapper * @return */ static convert(point: IPoint, behavior: IPointBehavior, coordinateMapper: ScaleCoordinateMapper): DataPoint; /** * Clears */ clear(): void; clone(): DataPoint; /** * Returns date * * @param coordinateMapper * @return */ getDate(coordinateMapper: ScaleCoordinateMapper): Date; /** * Returns records * * @param coordinateMapper * @return */ getRecord(coordinateMapper: ScaleCoordinateMapper): number; /** * Returns value * * @param coordinateMapper * @return */ getValue(coordinateMapper: ScaleCoordinateMapper): number; /** * Returns x * * @param coordinateMapper * @return */ getX(coordinateMapper: ScaleCoordinateMapper): number; /** * Returns y * * @param coordinateMapper * @return */ getY(coordinateMapper: ScaleCoordinateMapper): number; /** * Moves to * * @param x * @param y * @param coordinateMapper * @return */ moveTo(x: number, y: number, coordinateMapper: ScaleCoordinateMapper): DataPoint; /** * Moves to point * * @param point * @param coordinateMapper * @return */ moveToPoint(point: IPoint, coordinateMapper: ScaleCoordinateMapper): DataPoint; /** * moves to x * * @param x * @param coordinateMapper * @return */ moveToX(x: number, coordinateMapper: ScaleCoordinateMapper): DataPoint; /** * Moves to y * * @param y * @param scaleCoordinateMapper * @return */ moveToY(y: number, scaleCoordinateMapper: ScaleCoordinateMapper): DataPoint; /** * Returns point * * @param coordinateMapper * @return */ toPoint(coordinateMapper: ScaleCoordinateMapper): IPoint; /** * Translates point to specified offset. * * @param offset The offset. * @param coordinateMapper The coordinate mapper. * @return Current point translated to given offset. */ translate(offset: IPoint, coordinateMapper: ScaleCoordinateMapper): DataPoint; } } declare module FintaChart { /** * Provides text alignments. */ enum TextAlign { /** * The text is left-aligned. */ LEFT = "left", /** * The text is right-aligned. */ RIGHT = "right", /** * The text is centered. */ CENTER = "center" } /** * Provides text baselines. */ enum TextBaseline { /** * The text baseline is the top of the rendering rectangle. */ TOP = "top", /** * The text baseline is the middle of the rendering rectangle. */ MIDDLE = "middle", /** * The text baseline is the bottom of the rendering rectangle. */ BOTTOM = "bottom", /** * The text baseline is the normal alphabetic baseline. */ ALPHABETIC = "alphabetic" } /** * Describes text rendering options. */ interface ITextRenderingOptions { /** * The text alignment. */ align?: TextAlign; /** * The text baseline. */ baseline?: TextBaseline; } interface IShadowRenderingOptions { color: string; spread?: number; xOffset?: number; yOffset?: number; } /** * Represents render */ interface IRenderer { /** * Clear rectangle * * @param x * @param y * @param width * @param height */ clearRect(x: number, y: number, width: number, height: number): void; /** * Clip */ clip(): void; /** * Saves */ save(): void; /** * Restores */ restore(): void; /** * Begins path */ beginPath(): void; /** * Close path */ closePath(): void; /** * Translates * * @param x * @param y */ translate(x: number, y: number): void; /** * Rotates * * @param angle */ rotate(angle: number): void; /** * Scales * * @param x * @param y */ scale(x: number, y: number): void; /** * Text options * * @param options */ textOptions(options: ITextRenderingOptions): void; /** * Move to * * @param x * @param y */ moveTo(x: number, y: number): void; moveToPoint(point: IPoint): void; /** * Arc * * @param x * @param y * @param radius * @param startAngle * @param endAngle * @param anticlockwise */ arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void; /** * Arc path * * @param x * @param y * @param radius * @param startAngle * @param endAngle * @param antiClockwise */ arcPath(x: number, y: number, radius: number, startAngle: number, endAngle: number, antiClockwise?: boolean): void; /** * Bezier curve * * @param cp1x * @param cp1y * @param cp2x * @param cp2y * @param x * @param y */ bezierCurve(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void; /** * Circle * * @param centerX * @param centerY * @param radius */ circle(centerX: number, centerY: number, radius: number): void; /** * Circle path * * @param x * @param y * @param radius */ circlePath(x: number, y: number, radius: number): void; /** * Ellipse * * @param centerX * @param centerY * @param horRadius * @param verRadius */ ellipse(centerX: number, centerY: number, horRadius: number, verRadius: number): void; /** * Ellipse path * * @param centerX * @param centerY * @param horRadius * @param verRadius */ ellipsePath(centerX: number, centerY: number, horRadius: number, verRadius: number): void; /** * Horizontal line * * @param x1 * @param x2 * @param y */ horizontalLine(x1: number, x2: number, y: number): void; /** * Horizontal path * * @param x1 * @param x2 * @param y */ horizontalPath(x1: number, x2: number, y: number): void; /** * Image * * @param image * @param dstX * @param dstY * @param dstWidth * @param dstHeight */ image(image: HTMLImageElement, dstX: number, dstY: number, dstWidth?: number, dstHeight?: number): void; /** * Line * * @param x1 * @param y1 * @param x2 * @param y2 */ line(x1: number, y1: number, x2: number, y2: number): void; /** * Line path * * @param x1 * @param y1 * @param x2 * @param y2 */ linePath(x1: number, y1: number, x2: number, y2: number): void; /** * line to * * @param x * @param y */ lineTo(x: number, y: number): void; lineToPoint(point: IPoint): void; /** * Polygon * * @param points */ polygon(...points: (number | IPoint)[]): void; /** * Polygon path * * @param points */ polygonPath(...points: (number | IPoint)[]): void; /** * Poly line * * @param points */ polyline(points: (number | IPoint)[]): void; /** * Poly line path * * @param points */ polylinePath(points: (number | IPoint)[]): void; /** * Quadratic curve * * @param cpx * @param cpy * @param x * @param y */ quadraticCurve(cpx: number, cpy: number, x: number, y: number): void; /** * Rect * * @param x * @param y * @param width * @param height */ rect(x: number, y: number, width: number, height: number): void; /** * Rect rounded * * @param x * @param y * @param width * @param height * @param radius */ rectRounded(x: number, y: number, width: number, height: number, radius: number): void; /** * Rect path * * @param x * @param y * @param width * @param height */ rectPath(x: number, y: number, width: number, height: number): void; /** * Text width * * @param text * @return */ textWidth(text: string): number; /** * Vertical line * * @param x * @param y1 * @param y2 */ verticalLine(x: number, y1: number, y2: number): void; shadow(options: IShadowRenderingOptions): void; /** * Strokes theme * * @param stroke */ strokeTheme(stroke: IStrokeTheme): void; /** * Strokes * * @param theme * @param force */ stroke(theme?: IStrokeTheme, force?: boolean): void; fillTheme(theme: IFillTheme): void; /** * Fills * * @param theme * @param force * @param fillRule */ fill(theme?: IFillTheme, force?: boolean, fillRule?: CanvasFillRule): void; /** * Fills stroke theme * * @param fillTheme * @param strokeTheme */ fillStrokeTheme(fillTheme: IFillTheme, strokeTheme: IStrokeTheme): void; /** * Fills stroke * * @param fillTheme * @param strokeTheme */ fillStroke(fillTheme?: IFillTheme, strokeTheme?: IStrokeTheme): void; /** * Text theme * * @param textTheme */ textTheme(textTheme: ITextTheme): void; /** * Fills text * * @param text * @param x * @param y * @param textTheme */ fillText(text: string, x: number, y: number, textTheme?: ITextTheme): void; } } declare module FintaChart { /** * Describes padding area. */ interface IPadding { /** * The width of the padding area on the left. */ left: number; /** * The height of the padding area on the top. */ top: number; /** * The width of the padding area on the left. */ right: number; /** * The height of the padding area on the bottom. */ bottom: number; } } declare module FintaChart { /** * Describes cartesian point */ interface IPoint { /** * The X coordinate. */ x: number; /** * The Y coordinate. */ y: number; } } declare module FintaChart { enum XPointBehavior { X = "x", RECORD = "record", DATE = "date" } enum YPointBehavior { Y = "y", VALUE = "value" } /** * Represents point behavior */ interface IPointBehavior { /** * x */ x: XPointBehavior; /** * y */ y: YPointBehavior; } } declare module FintaChart { } declare module FintaChart { } declare module FintaChart { /** * Describes size of the element. */ interface ISize { /** * The width of the element. */ width: number; /** * The height of the element. */ height: number; } } declare module FintaChart { /** * Describes abstract component. */ interface IComponent extends IDisposable { } /** * Represents abstract component. */ abstract class Component implements IComponent { abstract dispose(): void; } } declare module FintaChart { /** * Describes canvas layer config. * */ interface ICanvasLayerConfig { /** * The parent element. */ parent: HTMLElement; /** * The size of the canvas. */ size?: ISize; } /** * Represents canvas layer. * */ class CanvasLayer extends Component { private _canvasEl; private _parentEl; private _renderer; private _sizeCache; private _sizeCacheStamp; /** * The canvas element. */ get canvas(): HTMLCanvasElement; /** * The parent container. */ get parent(): HTMLElement; /** * The renderer. */ get renderer(): IRenderer; /** * The size of the canvas in CSS pixels (matches the legacy jQuery `.width()`/`.height()` * behavior — distinct from the canvas element's `width`/`height` attributes which carry * the device-pixel backing-store size on HiDPI displays). */ get size(): ISize; set size(value: ISize); /** * Creates an instance of CanvasLayer. * * @param config The configuration. */ constructor(config: ICanvasLayerConfig); dispose(): void; private init; } } declare module FintaChart { /** * Describes visual component. */ interface IVisualComponent extends IComponent { /** * Applies theme. */ applyTheme(): any; /** * Resizes component. * * @param bounds The new bounds. */ resize(bounds?: Bounds): void; } /** * Represents abstract visual component. */ abstract class VisualComponent extends Component implements IVisualComponent { abstract applyTheme(): any; abstract resize(bounds?: Bounds): any; } } declare module FintaChart { /** * Describes component that is built on HTML elements. */ interface IHtmlComponent extends IVisualComponent { /** * The parent html container. */ readonly container: HTMLElement; /** * Refreshes component. */ refresh(): void; } /** * Represents component that is built on HTML elements. */ abstract class HtmlComponent extends VisualComponent implements IHtmlComponent { private _container; get container(): HTMLElement; dispose(): void; resize(): void; refresh(): void; /** * Creates html component's container. */ protected abstract createContainer(): HTMLElement; /** * Destroy html component's container */ protected destroyContainer(): void; } } declare module FintaChart { /** * Describes [[ChartComponent]] configuration. */ interface IChartComponentConfig { /** * The chart. */ chart?: Chart; } /** * Describes component that uses chart. */ interface IChartComponent extends IComponent { /** * The chart. */ chart: Chart; } /** * Represents component that uses chart. */ abstract class ChartComponent extends Component implements IChartComponent { private _chart; /** * Creates an instance of ChartComponent. * * @param config */ constructor(config?: IChartComponentConfig); get chart(): Chart; set chart(value: Chart); dispose(): void; /** * The method gets called before the chart change. */ protected onChartChanging(): void; /** * The method gets called after the chart change. */ protected onChartChanged(): void; /** * Subscribes to chart events. */ protected subscribe(): void; /** * Unsubscribes from chart events. */ protected unsubscribe(): void; } } declare module FintaChart { /** * Describes abstract control. */ interface IControl extends IComponent { /** * Paints control. */ paint(): void; /** * Handles window events. * * @param event The event. * @return true if event was handled, otherwise false. */ onEvent(event: IWindowEvent): boolean; /** * Determines whether specified point is inside the control. * * @param point The point. * @return true if a given point is inside the control, otherwise false. */ hitTest(point: IPoint): boolean; /** * Updates control size. * * @param frame The frame bounds. */ resize(frame: Bounds): void; } /** * Represents abstract control. */ abstract class Control extends Component implements IControl { private _motionEvents; /** * Creates an instance of [[Control]]. */ constructor(); paint(): void; onEvent(event: IWindowEvent, inBounds?: boolean): boolean; hitTest(point: IPoint): boolean; resize(frame: Bounds): void; /** * Initializes motion events required by control. * * @return [[MotionEventArray]] that contains events required by control. */ protected initMotionEvents(): MotionEventArray; } } declare module FintaChart { /** * Describes HTML control. */ interface IHtmlControl extends IControl { /** * The parent container. */ container: HTMLElement; /** * The frame rectangle. */ frame: Bounds; } /** * Represents HTML control. */ abstract class HtmlControl extends Control implements IHtmlControl { private _frame; private _container; get container(): HTMLElement; protected set container(value: HTMLElement); get frame(): Bounds; dispose(): void; hitTest(point: IPoint): boolean; resize(frame: Bounds): void; /** * Creates container element. * * @return Container element. */ protected abstract createContainer(): HTMLElement; /** * Removes container element. */ protected removeContainer(): void; } } declare module FintaChart { /** * Describes [[ChartHtmlControl]] configuration. */ interface IChartHtmlControlConfig { /** * The chart. */ readonly chart: Chart; } /** * Describes [[HtmlControl]] that uses chart. */ interface IChartHtmlControl extends IHtmlControl { /** * The chart. */ chart: Chart; } /** * Represents [[HtmlControl]] that uses chart. */ abstract class ChartHtmlControl extends HtmlControl implements IChartHtmlControl { private readonly _chart; get chart(): Chart; /** * Creates an instance of [[ChartHtmlControl]]. * * @param config The configuration. */ protected constructor(config: IChartHtmlControlConfig); dispose(): void; /** * Subscribes to events. */ protected abstract subscribe(): void; /** * Unsubscribes from events. */ protected abstract unsubscribe(): void; } } declare module FintaChart { } declare module FintaChart { /** * Represents Item * */ interface IDropDownItem { /** * Item's data attribute */ dataAttr?: string; /** * Is item selected */ selected: boolean; /** * Item's style */ style: CSSStyleDeclaration; /** * Item's title */ title: string; /** * Item's value */ value: string | number; } /** * Provides model of SIMPLE Dropdown * */ class DropDown implements IDisposable { private static _initialized; private _container; private _foundItem; private _items; private _itemsContainer; private _onchange; private _parentContainer; private _selectedContainer; /** * Creates an instance of DropDown. * * @param container */ constructor(container: HTMLElement); dispose(): void; /** * Finds SIMPLE Dropdown item * * @return Founded SIMPLE Dropdown item */ selected(): IDropDownItem; /** * On SIMPLE Dropdown event * * @param event * @param callback */ on(event: string, callback: VoidFunction): void; /** * Updates SIMPLE Dropdown item * * @param value * @param performOnChange */ select(value: unknown, performOnChange?: boolean): void; private closeItem; private closeOpenedItems; private closeOpenedItemsSilence; private createElements; private init; private initHandlers; private onContainerClick; private onItemClick; private refresh; } } declare module FintaChart { /** * Represents Numeric Field Config * */ interface INumericFieldConfig { /** * Is Numeric Field allow negative */ allowNegative: boolean; /** * Numeric Field's max value */ maxValue: number; /** * Numeric Field's min value */ minValue: number; /** * Numeric Field's price decimals */ priceDecimals: number; /** * Is show Numeric Field's arrows */ showArrows: boolean; /** * Numeric Field's value */ value: number; /** * On Numeric Field change * * @param value * @param obj */ onChange(value: number, obj: HTMLInputElement): void; } class NumericField { /** * Initializes a numeric field on the given HTMLInputElement. */ static init(el: HTMLInputElement, options: Partial): void; static getValue(control: HTMLElement): number; static setValue(control: HTMLElement, value: number): void; static enable(control: HTMLElement): void; static disable(control: HTMLElement): void; static highlightInvalid(control: HTMLElement): void; static nohighlightInvalid(control: HTMLElement): void; static setBounds(control: HTMLElement, min: number, max: number): void; } } declare module FintaChart { /** * Represents Dialog Config * */ interface IDialogConfig { /** * Dialog Config chart */ chart: Chart; } } declare module FintaChart { } declare module FintaChart { } declare module FintaChart { } declare module FintaChart { } declare module FintaChart { /** * Represents Context Menu Config * */ interface IContextMenuConfig { /** * Context Menu Config menu container */ menuContainer?: HTMLElement; /** * Is show Context Menu on click */ showOnClick?: boolean; /** * On Context Menu item selected * * @param selectedMenu * @param isChecked */ onItemSelected(selectedMenu: HTMLElement, isChecked?: boolean): void; /** * On Context Menu show */ onShow?(): void; } /** * Provides model of Context Menu * */ class ContextMenu implements IDisposable { private _isShown; private _shownAt; private _docClickHandler; private _docContextMenuHandler; private _docTouchHandler; private _winScrollHandler; private _winResizeHandler; private _bodyMenuOpenHandler; private _menuClickTouchHandler; private _subscribedDoc; private _subscribedView; /** * Context Menu's config */ protected config: TConfig; /** * Get Context Menu's container */ get container(): HTMLElement; /** * Creates an instance of ContextMenu. * * @param config * @param targetDomObject */ constructor(config: TConfig, targetDomObject?: HTMLElement); dispose(): void; /** * Hides Context Menu */ hide(): void; /** * Shows context menu. * * @param event */ show(event: Event): void; private static _getSubMenuPosition; private static _toggleSubMenu; private calculateMenuPosition; private getLeftLocation; private getTopLocation; private subscribeEvents; private unsubscribeEvents; } } declare module FintaChart { /** * Describes chart context menu config. * */ export interface IChartContextMenuConfig extends IContextMenuConfig { /** * The chart */ chart: Chart; } enum ContextMenuItem { FORMAT = "format" } /** * Represents chart context menu. * */ export class ChartContextMenu extends ContextMenu { private static container; /** * Chart Context Menu's menu item */ static MenuItem: typeof ContextMenuItem; /** * Creates an instance of ChartContextMenu. * * @param targetDomObject * @param config */ constructor(targetDomObject: HTMLElement, config: IChartContextMenuConfig); dispose(): void; private init; private onShow; } export {}; } declare module FintaChart { /** * Provides model of Control Color Picker * */ class ColorPicker { private _picker; private _initialized; private _pendingConfig?; private _pendingColor?; private _observer?; /** * Retrieves Control Color Picker's color * * @return */ get color(): string; set color(value: string); /** * Creates an instance of ColorPicker. * * @param domObjects * @param config */ constructor(domObjects: HTMLElement, config: Spectrum.Options); static get(control: HTMLElement): string; static set(control: HTMLElement, color: string): void; static hide(control: HTMLElement): void; static enable(control: HTMLElement, enable: boolean): void; enable(value?: boolean): void; private static isElementReady; private static hasSpectrum; private initSpectrum; private waitForAttach; private static initParams; private static palette; private static adopt; } } declare module FintaChart { /** * Represents Control Drag Pane Config * */ interface IDragPaneConfig { /** * Control Drag Pane Config container */ container?: HTMLElement; /** * Control Drag Pane Config root container */ rootContainer?: HTMLElement; } /** * Provides model of Control Drag Pane * */ class DragPane implements IDisposable { /** * Control Drag Pane's container */ protected container: HTMLElement; /** * Control Drag Pane's root container */ protected rootContainer: HTMLElement; /** * Bound resize handler reference for cleanup */ private _resizeHandler; /** * Whether the pane has been placed at its initial position */ private _positioned; /** * Pointer offset from the pane top-left at drag start */ private _dragOffsetX; private _dragOffsetY; /** * Bound drag handlers for cleanup */ private _onDragStart; private _onDragMove; private _onDragEnd; /** * Drag handle element */ private _handleEl; get visible(): boolean; /** * Creates an instance of DragPane. * * @param config */ constructor(config: IDragPaneConfig); dispose(): void; /** * Hides Control Drag Pane */ protected hide(): void; /** * Initializes Control Drag Pane */ protected initialize(): void; /** * Shows Control Drag Pane */ protected show(): void; /** Returns the offsetParent rect the pane is positioned against. */ private parentRect; /** Places the pane near the top-center of the chart. */ private placeInitial; private onDragStart; private onDragMove; private onDragEnd; /** Sets absolute position within the offsetParent, clamped inside it. */ private applyPosition; private clampIntoViewport; private eventPoint; private teardownDrag; private onResize; } } declare module FintaChart { /** * Provides model of Notification */ class Notification { private static _options; /** * Shows error notification. * * @param msg The error message. * @param chart The chart. * @param title The notification title. */ static error(msg: string, chart?: Chart, title?: string): void; /** * Shows information notification. * * @param msg The notification message. * @param title The notification title. */ static info(msg: string, title?: string): void; /** * Shows success notification. * * @param msg The notification message. * @param chart The chart. * @param title? The notification title. */ static success(msg: string, chart: Chart, title?: string): void; /** * Shows warning notification. * * @param msg The warning message. * @param chart The chart. * @param title The notification title. */ static warning(msg: string, chart?: Chart, title?: string): void; private static makeTitle; } } declare module FintaChart { /** * Represents Tooltip State * */ interface ITooltipState { /** * Tooltip State's name */ name: string; /** * Tooltip State's location */ location: string; /** * Tooltip State's text */ text: string; /** * Tooltip State's theme */ theme?: any; } /** * Represents Tooltip Config * */ interface ITooltipConfig { /** * Tooltip options */ options?: ITooltipOptions; /** * Tooltip parent */ parent: IPaneObject; } /** * Represents Tooltip Options * */ interface ITooltipOptions { /** * Tooltip name */ kind?: string; /** * Tooltip location */ location: string; /** * Tooltip text */ text: string; /** * Tooltip theme */ theme?: any; } /** * Represents Shape Trend Channel Config * */ interface ITooltipDefaults { /** * Tooltip name */ kind: string; /** * Tooltip text */ text: string; /** * Tooltip theme */ theme?: any; } /** * Provides model of Tooltip * */ class Tooltip implements IDisposable, IStateable { static defaults: ITooltipDefaults; private _arrowAfter; private _arrowBefore; private _arrowMainBefore; private _contentElement; private _id; private _isInDom; private _maxContentWidth; private _minSize; private _options; private _parent; private _tooltipElement; private _visible; /** * Tooltip layout bounds */ layoutBounds: IBounds; /** * Creates an instance of Tooltip. * * @param config */ constructor(config: ITooltipConfig); /** * Get shape's current theme or default theme if current theme is not set */ get defaultLayoutTemplate(): any; /** * Get default theme of shape */ get defaultTemplate(): any; /** * Get tooltip content name */ get contentKind(): string; set contentKind(value: string); /** * Get tooltip location */ get location(): string; set location(value: string); /** * Get tooltip size */ get size(): ISize; /** * Get tooltip text */ get text(): string; set text(value: string); /** * Get tooltip theme */ get theme(): any; set theme(value: any); /** * Get tooltip visible */ get visible(): boolean; dispose(): void; saveState(): ITooltipState; restoreState(state: ITooltipState): void; /** * Setups Tooltip layout theme */ setupLayoutTheme(): void; /** * Hides Tooltip */ hide(): void; /** * Moves Tooltip point to * * @param point */ moveTo(point: IPoint): void; /** * Shows Tooltip * * @param point */ show(point: IPoint): void; private actualPosition; private adjustArrow; private applyText; private calculateLocation; private initElements; } } declare module FintaChart { /** * Provides model of Text Style Selector */ class TextStyleSelector { private _checkboxes; private _labels; private _selector; /** * Creates an instance of TextStyleSelector. * * @param selector */ constructor(selector: HTMLElement); /** * Retrieves selected Text Style Selector state * * @param val * @return Selected Text Style Selector state */ selectedState(val: string): boolean; /** * Selects Text Style Selector's state * * @param val * @param state */ selectState(val: string, state: boolean): void; private init; } } declare module FintaChart { interface ICustomTimeFrameConfig extends IDialogConfig { /** * The callback that is called to apply settings. * * @param theme The theme. */ done(newTimeFrame: ITimeFrame): void; } } declare module FintaChart { /** * Represents Instrument Search Config * */ interface IInstrumentSearchConfig { /** * Instrument Search Config chart */ chart?: Chart; /** * Instrument Search Config instruments */ instruments?: IInstrument[]; /** * Instrument Search Config value */ value?: string; /** * * @param instrument */ onChange?(instrument: IInstrument): void; allowSelection?(): boolean; } /** * Provides model of Instrument Search * */ class InstrumentSearch { readonly _config: IInstrumentSearchConfig; readonly _inputField: HTMLInputElement; private readonly _resultsDropDown; private _currentText; private _isDropDownVisible; private _noResults; private _resultsCount; private _searchDelayTimer; private _exchange; private _value; private _disabled; private _selectedFilters; private _page; private _size; private _isLoad; private _subscribedDocs; /** * Creates an instance of InstrumentSearch. * * @param rootContainer * @param config */ constructor(rootContainer: HTMLElement, config: IInstrumentSearchConfig); /** * Retrieves Instrument Search's by symbol * * @return Instrument Searched by symbol */ getBySymbol(symbol: string): Promise; /** * Retrieves Instrument Search's by id * * @return Instrument Searched by id */ getById(id: string): Promise; /** * Set Instrument Search's instrument * * @param instrument */ set(instrument?: IInstrument): void; enable(): void; disable(): void; private static escapeHtml; private static generateListElement; private generateExchangeFilters; private generateSearchResults; private getInputValue; private getInstrumentBySymbol; private getInstruments; private static normalizeSymbolForSearch; private getInstrumentById; hideDropDown(): void; private highlightDropDownItem; private static highlightHTMLText; private init; /** * Returns the body of the document currently owning the input. * Resolved lazily (not cached) so the dropdown keeps working when * the chart is moved between documents (e.g. Picture-in-Picture). */ private ownerBody; /** * Subscribes document/window listeners in the document currently * owning the input. Called on init and on every open, so the * dropdown keeps working after the chart moves between documents * (e.g. Picture-in-Picture). Each document is subscribed at most * once; handlers are idempotent. */ private subscribeDocumentEvents; private static searchTextPositions; private setValue; private loadData; private setupInputListeners; private showDropDown; private _scrollTopList; } } declare module FintaChart { /** * Provides model of Replay Mode Manager * */ class ReplayModeManager extends Control { private _chart; private _closeBtn; private _forwardBtn; private _isPlayStarted; private _jumToActivated; private _jumpToBtn; private _playPauseBtn; private _replayChartText; private _startRecordPromptEl; private _speedInput; private _speedItemContainer; private _speedSelectDropdown; private _timeInterval; private _toRealTimeBtn; private _toolbar; /** * Number of trailing future-projection placeholder bars (bars with no * price data) detected in the series when replay engaged. While replay * is active this many NaN-OHLC placeholder bars are kept past the * replay cursor so forward-projecting indicators (e.g. composite cycle * forecast) keep their slots and can still plot into the future. */ private _projectionCount; replaySpeed: number; /** * Replay Mode Manager's current index */ currentIndex: number; /** * Is Replay Mode Manager in play mode */ isInPlayMode: boolean; /** * Retrieves Replay Mode Manager's origin data rows */ originDataRows: Record; /** * Creates an instance of ReplayModeManager. * * @param chart */ constructor(chart: Chart); /** * Get Replay Mode Manager's chart */ get chart(): Chart; set chart(value: Chart); /** * Get Replay Mode Manager's pane */ get pane(): Pane; /** * Initializes Replay Mode Manager * * @param toolbar */ initialize(toolbar: Toolbar): void; /** * Retrieves is Replay Mode Manager's chart type requires calculations * * @param chartType * @return Is Replay Mode Manager's chart type requires calculations */ chartTypeRequiresCalculations(chartType: string): boolean; createCopySeries(): void; dispose(): void; /** * Forwards Replay Mode Manager */ forward(): void; /** * Hit tests Replay Mode Manager's point * * @param point * @return Replay Mode Manager's point is hit */ hitTest(point: IPoint): boolean; /** * Jumps to */ jumpTo(): void; /** * Surfaces the start-record prompt and arms jumpTo so the next pane click * sets the replay start point. Called when a user clicks play/forward/toRealTime * before any start record has been chosen. */ promptForStartRecord(): void; /** * Plays */ play(): void; /** * Shows Replay Mode Manager's replay mode line */ showReplayModeLine(): void; /** * Stops Replay Mode Manager's replay mode */ stopReplayMode(): void; /** * Moves to real time */ toRealTime(): void; /** * Updates Replay Mode Manager's replay chart text */ updateReplayChartText(): void; protected initMotionEvents(): MotionEventArray; /** * Update last value in original rows */ updateLastValue(bar: IBar, instrument?: IInstrument): void; /** * Add value to original rows */ addValueToRow(bar: IBar, instrument?: IInstrument): void; /** * Returns last bar from original series */ getLastOriginBar(): IBar; private bindControlClicks; private subscribe; private createReplayChartText; private showStartRecordPrompt; private hideStartRecordPrompt; private disabledButton; private enabledButton; private generateSpeedItems; private onClick; private initField; private onSpeedChanged; private setBtnView; private setPauseView; private startPlay; private setPlayView; /** * Counts the trailing future-projection placeholder bars in the * preserved origin series — bars at the end of the data that carry no * price (NaN/empty close). Consumers append these for forward-projection * rendering; we keep an equally-sized window alive past the replay * cursor so projecting indicators still have slots to plot into. */ private countTrailingPlaceholders; /** * Builds a no-price placeholder bar carrying the date at `index` in * the given (origin) series, or null when `index` is out of range. */ private placeholderBarAt; /** * Appends the future-projection placeholder window (NaN-OHLC bars with * real future dates from the origin series) starting at origin index * `start`, for the primary series and every compared instrument, so * forward-projecting indicators keep slots past the replay cursor. */ private appendProjectionPlaceholders; /** * Reveals the bar at the current replay index. * * Without a projection window (legacy behaviour) the bar is simply * appended. With a projection window active the real bar is written * in-place into the first placeholder slot (its date already matches) * and one fresh placeholder is appended at the tail, so the projection * window keeps its width and forward-projecting indicators continue to * plot past the replay cursor. */ private revealNextReplayBar; /** * Overwrites the OHLCV values at `index` of the given bar data rows * with `bar` (the date is left untouched — it already matches). */ private revealInPlace; } } declare module FintaChart { /** * Represents Templates Config * */ interface ITemplatesConfig { /** * Templates Config align dropdown */ alignDropdown: (container: HTMLElement, chart: Chart) => void; /** * Templates Config chart */ chart: Chart; } /** * Provides model of Templates Manager * */ class TemplatesManager { private readonly editModeItem; private readonly errorClass; private readonly itemAttribute; private readonly itemClass; private readonly itemEdit; private readonly itemRemove; private readonly _alignDropdown; private readonly _templateDataProvider; private _bodyContainer; private _chart; private _confirmButton; private _container; private _controlContainer; private _createButton; private _editMode; private _editingItemIndex; private _input; private _templates; private _updateListener; private _isDisabled; /** * Creates an instance of TemplatesManager. * * @param rootElement * @param config */ constructor(rootElement: HTMLElement, config: ITemplatesConfig); /** * Set Templates Manager's new chart */ setNewChart(chart: Chart): void; disable(): void; enable(): void; private static getTemplateItemUI; private checkExistName; private init; private renderTemplateList; private onListUpdated; private setUIState; unsubscribeFromUpdate(): void; } } declare module FintaChart { /** * Represents Time Frame Picker Config * */ interface ITimeFramePickerConfig { /** * Time Frame Picker Config chart */ chart?: Chart; /** * Time Frame Picker Config time frame */ timeFrame?: ITimeFrame; /** * On Time Frame Picker Config selection changed * * @param timeFrame */ selectionChanged(timeFrame: TimeFrame): any; allowSelection?(timeFrame: TimeFrame): boolean; } /** * Provides model of Time Frame Picker * */ class TimeFramePicker { private readonly _rootDomElement; private _btnWrapper; private _config; private _domObjects; private _hasCustomPicker; private _isActive; private _last; private _hoverTimer; private _windowScrollHandler; private _windowResizeHandler; private _bodyClickHandler; private _bodyTouchHandler; private _subscribedDoc; private _subscribedView; /** * Creates an instance of TimeFramePicker. * * @param rootContainer * @param config */ constructor(rootContainer: HTMLElement, config: ITimeFramePickerConfig); /** * Get Time Frame Picker's chart */ get chart(): Chart; set chart(value: Chart); /** * Sets Time Frame Picker * * @param timeFrame */ set(timeFrame: ITimeFrame): void; private static extractDataFromItem; private static getDomObjects; private activateItem; private dropDownBounds; private alignDropdown; private invoke; private getPickerIntervalValue; private hideDropDown; private init; private selectDistinctPredefinedTimeFrames; private setCustomPickerValues; private setLabels; private setValue; private showDropDown; private synchronizeWithCustomPicker; private toggleDropDown; /** * Subscribes document/window listeners in the document currently * owning the picker. Called on init and on every open, so the * dropdown keeps working after the chart moves between documents * (e.g. Picture-in-Picture). */ private subscribeDocumentEvents; private unsubscribe; } } declare module FintaChart { class ToolbarCalendar { private _chart; private _element; private _onSelect; private _selected; private _viewYear; private _viewMonth; private _months; private _weekdaysShort; private _clearText; private _todayText; constructor(chart: Chart, host: HTMLElement); get isVisible(): boolean; /** * Shows the calendar for the given selection. * * @param selected Currently selected date, highlighted in the grid. * @param onSelect Invoked with the picked date, or `null` when cleared. */ show(selected: Date | null, onSelect: (date: Date | null) => void): void; hide(): void; private _loadLocalization; private _localize; private _splitLocalized; private _render; private _renderHeader; private _renderNavButton; private _renderGrid; private _renderDay; private _renderFooter; private _pick; private _isSameDay; private _shiftMonth; } } declare module FintaChart { /** * Identifier for a single toolbar button or group. * Names match tooltip hints for discoverability. */ enum ToolbarItem { /** Options — hint */ Theme = "theme", /** Options alias */ Options = "options", /** Instrument — hint */ InstrumentSearch = "instrumentSearch", /** Instrument alias */ Instrument = "instrument", /** Timeframes — hint */ TimeFramePicker = "timeFramePicker", /** Timeframes alias */ Timeframes = "timeframes", /** Indicators */ Indicators = "indicators", /** Candles — hint for ChartType */ ChartType = "chartType", /** Candles alias */ Candles = "candles", /** Compare — hint */ CompareInstrument = "compareInstrument", /** Compare alias */ Compare = "compare", /** Cursor options — hint */ CrossHair = "crossHair", /** Cursor alias */ Cursor = "cursor", /** CursorOptions alias */ CursorOptions = "cursorOptions", /** Templates */ Templates = "templates", /** Adjustment — hint */ Adjust = "adjust", /** Adjustment alias */ Adjustment = "adjustment", /** OHLC Pane — hint */ Ohlc = "ohlc", /** OHLC Pane alias */ OhlcPane = "ohlcPane", /** OHLC Cards — hint */ OhlcCard = "ohlcCard", /** OHLC Cards alias */ OhlcCards = "ohlcCards", /** Bar replay — hint */ ReplayMode = "replayMode", /** BarReplay alias */ BarReplay = "barReplay", /** Trading — hint */ TradePanel = "tradePanel", /** Trading alias */ Trading = "trading", /** Undo */ Undo = "undo", /** Redo */ Redo = "redo", /** Save as Image — hint */ Snapshot = "snapshot", /** SaveImage alias */ SaveImage = "saveImage", /** Export */ Export = "export", /** View Mode */ ViewMode = "viewMode", /** Trendlines — hint */ Geometrical = "geometrical", /** Trendlines alias */ Trendlines = "trendlines", /** Shapes — hint */ Patterns = "patterns", /** Shapes alias */ Shapes = "shapes", /** Scribble — hint name */ Scribble = "scribble", /** FreeHand — code name, alias for Scribble */ FreeHand = "freeHand", /** Fibonacci tools — hint */ Fibonacci = "fibonacci", /** FibonacciTools alias */ FibonacciTools = "fibonacciTools", /** Trend Channel Shapes — hint */ TrendLines = "trendLines", /** TrendChannelShapes alias */ TrendChannelShapes = "trendChannelShapes", /** Etc. Shapes — hint */ LabelShapes = "labelShapes", /** EtcShapes alias */ EtcShapes = "etcShapes", /** Visible Profile — hint */ ProfileDrawing = "profileDrawing", /** ProfileTool alias */ ProfileTool = "profileTool", /** Text */ Text = "text", /** Bar Marker */ BarMarker = "barMarker", /** Balloon */ Balloon = "balloon", /** Measure */ Measure = "measure", /** Positions */ Positions = "positions", /** Zoom — hint */ ZoomIn = "zoomIn", /** Zoom alias */ Zoom = "zoom", /** In Shape Mode — hint */ StayInShapeMode = "stayInShapeMode", /** InShapeMode alias */ InShapeMode = "inShapeMode", /** Magnet — hint */ MagnetMode = "magnetMode", /** Magnet alias */ Magnet = "magnet", /** Lock — hint */ LockMode = "lockMode", /** Lock alias */ Lock = "lock", /** Hide drawings — hint */ HideOptions = "hideOptions", /** HideDrawings alias */ HideDrawings = "hideDrawings", /** Remove Selected Shape — hint */ Delete = "delete", /** RemoveShape alias */ RemoveShape = "removeShape", /** General Shapes — hint */ Miscellaneous = "miscellaneous", /** GeneralShapes alias */ GeneralShapes = "generalShapes", /** Date Range */ DateRange = "dateRange", /** Sessions — hint */ TradingSession = "tradingSession", /** Sessions alias */ Sessions = "sessions", /** Log scale — hint */ ScaleLog = "scaleLog", /** Log alias */ Log = "log", /** Percent scale — hint */ ScalePercent = "scalePercent", /** Percent alias */ Percent = "percent", /** Auto scale — hint */ ScaleAuto = "scaleAuto", /** Auto alias */ Auto = "auto", /** Scroll to last bar */ ScrollToLastBar = "scrollToLastBar" } /** Config can be array or map */ type ToolbarHiddenItems = ToolbarItem[] | Partial>; /** Normalize array or map to array */ function toolbarHiddenItemsToArray(input?: ToolbarHiddenItems | null): ToolbarItem[]; /** * CSS selector for each ToolbarItem inside Toolbar container. */ const ToolbarItemSelectors: Record; } declare module FintaChart { /** * Represents Toolbar Config * */ interface IToolbarConfig { /** * Toolbar Config chart */ chart?: Chart; /** * Toolbar Config parent */ parent: HTMLElement; /** * Is show view mode */ showViewMode?: boolean; /** * Toolbar items to hide — array or map */ toolbarHiddenItems?: ToolbarHiddenItems; } /** * Provides model of Toolbar * */ class Toolbar implements IDisposable { private _chart; private _container; private _controls; private _draggableElements; private _draggableControllers; private _leftToolbarScroll; private _rootContainer; private _toolbarScroll; private _locked; private _lastOrderTime; private _disponsed; private _autoScaleBtn; private _logScaleBtn; private _percentScaleBtn; private _lockShapesBtn; private _dateRangeButtons; private _dateRangeMenuItems; private _applyingDateRangePreset; private _dateRangeFrom; private _dateRangeTo; private _openDateRangePopup; private _dateRangeResizeObserver; private _dateRangeInlineWidth; private _scalePercentageAdapter; private _toolbarHiddenItems; private _appliedHiddenSelectors; onAmountChanged: (quantity: number) => void; /** * Creates an instance of Toolbar. * * @param config */ constructor(config: IToolbarConfig); /** * * Get Toolbar's chart */ get chart(): Chart; set chart(value: Chart); /** * Get Toolbar's container */ get container(): HTMLElement; /** * Toolbar's activate button * * @param draggable */ activateButton(draggable: HTMLElement): void; getBottomToolbarRightSide(): HTMLElement; /** * Activates Toolbar's draggable by it self * * @param activator */ activateDraggableByItself(activator: HTMLElement): void; getSearchInstrumentInput(): HTMLElement; lock(): void; dispose(): void; /** Get hidden toolbar items */ getToolbarHiddenItems(): ToolbarItem[]; /** Set hidden toolbar items and reapply */ setToolbarHiddenItems(items: ToolbarHiddenItems): void; /** Hide/show toolbar elements via config */ private applyToolbarVisibility; private setElementsVisibility; private cleanupToolbarDividers; private findPrevVisibleSibling; private findNextVisibleSibling; /** * Prepends Toolbar to * * @param container */ prependTo(container: HTMLElement): void; /** * Shows Toolbar's supported time frames */ supportedTimeFramesShow(): void; private _createPeriodicityForm; private _subscribeToCreateCustomTimeFrame; private _subscribeDateRangeControls; private onDocumentTap; private _subscribeCollapsedDateRange; private _observeDateRangeWidth; private _subscribeCustomDateRange; private updateDateRangeApplyState; private formatDisplayDate; private truncateToDay; private endOfDay; /** * Applies a bottom-toolbar date-range preset (1D, 5D, ..., All). * * @param presetKey */ applyDateRangePreset(presetKey: string): void; private applyDateRange; private setActiveDateRangeButton; private closestSupportedTimeFrame; private parseSupportedTimeFrame; private addToDate; setTimeFrame(timeFrame: TimeFrame): void; /** * Refresh toolbar components depend to size */ refreshSize(): void; setTimeFrameValue(timeFrame: ITimeFrame): void; activateMagnet(mode: string): void; /** * Update trade panel units value * * @param quantity default quantity expressed in units (backend contract) */ updateTradeHandlerUnits(quantity: number): void; private activateStayInShapeModeBtn; private collapseBtnClicked; private hideCollapse; private showCollapse; private deactivateButton; private deactivateDraggable; private endShape; private onAdjustClick; private onSnapshotClick; private onChartTypeChange; private onCollapseBtnClicked; private onCompareInstrumentClick; private onContinuedModeClick; private onCrossHairChange; private onDeleteClick; private onHideOptionClick; /** Reflects the hide buttons' active class from real chart state. */ private syncHideButtonsState; onIndicatorsClick(): void; applyIndicator(typeName: string): void; private onInstrumentChange; private onReplayModeClick; onShapeClick(dataValue: string, isActivated: boolean): Shape | null; private onShapeModeClick; private onThemeClick; private onTimeFrameChange; private onViewModeChange; private onZoomInClick; private init; setTradingSession(value?: string): void; private updateDragPanelposition; private initDraggableElements; private getFormattedPrice; private initTradePanel; private switchOrderType; private subscribeOnBarsUpdate; private getBarsChangedEvents; private unsubscribeFromBarsUpdate; private updateSellBuyValues; private getLastPrice; private exportData; private setZIndexes; private startShape; private subscribeEvents; private toggleButtonActivator; private toggleDraggableByActivator; private deactivateDropDownElementBtn; private deactivateHideShapesBtn; private deactivateStayInShapeModeBtn; private unsubscribeEvents; private updateForNewChart; private activateAutoScaleBtnIfNeeded; private activateLogBtnIfNeeded; private activatePercentScaleBtnIfNeeded; private updateMagnetModeIfNeeded; private onAutoScaleClick; onLogScaleClick(): void; onPercentScaleClick(): void; get basePrice(): number; private getRootContainer; private onMagnetMode; private updateCalculatorValues; private resetTradePanelOnInstrumentChange; private onLockShapesClick; private replaceLockIcon; private getStaticQuantitiesForCalc; private getQuantityRules; private normalizeAmountByRules; private getNumberDecimals; private getPriceDecimals; } } declare module FintaChart { /** * Represents Toolbar Drop Down Button Config * */ interface IToolbarDropDownButtonConfig { /** * Toolbar Drop Down Button's chart */ chart?: Chart; /** * Toolbar Drop Down Button's selected item */ selectedItem?: string; /** * On Toolbar Drop Down Button;s selection changed * * @param dataValue * @param isActivated */ selectionChanged(dataValue: string, isActivated?: boolean): any; allowSelection?(): boolean; } /** * Provides model of Toolbar Drop Down Button * */ class ToolbarDropDownButton { private readonly _rootElement; private _btnActivate; private _btnWrapper; private _btn_toggleDropDown; private _canFireFromHead; private _canToggle; private _config; private _hasChildren; private _isActivated; private _isActive; private _items; private _itemsContainer; private _itemsWrapper; private _isDisabled; private _hoverCloseTimer; private _subscribedDocs; /** * Creates an instance of ToolbarDropDownButton. * * @param rootElement * @param config */ constructor(rootElement: HTMLElement, config: IToolbarDropDownButtonConfig); /** * Get Toolbar Drop Down Button's chart */ get chart(): Chart; set chart(value: Chart); /** * Aligns Toolbar Drop Down Button's dropdown * * @param templateDropdown * @param chart */ alignDropdown(templateDropdown: HTMLElement, chart: Chart): void; /** * Activates Toolbar Drop Down Button */ activate(fire?: boolean): void; /** * Deactivates Toolbar Drop Down Button */ deactivate(fire?: boolean): void; /** * Selects Toolbar Drop Down Button's item * * @param val * @param fire */ selectItem(val: string, fire: boolean): void; enable(): void; disable(): void; /** * Returns the body of the document currently owning the button. * Resolved lazily (not cached) so the dropdown keeps working when * the chart is moved between documents (e.g. Picture-in-Picture). */ private ownerBody; /** * Returns the window of the document currently owning the button. */ private ownerView; private dropDownBounds; /** * Subscribes body/window listeners in the document currently owning * the button. Called on init and on every open, so the dropdown * keeps working after the chart moves between documents. * Each document is subscribed at most once; handlers are idempotent. */ private subscribeDocumentEvents; private activateButton; private activeIcon; private deactivateButton; private fireFromHead; private scheduleHoverClose; private hideDropDown; private init; private setValue; /** * Handles a tap/click on the button head, routing to toggle, fire or * drop-down open depending on the button configuration and platform. * * @param e The originating tap/click event. */ private handleHeadTap; private showDropDown; private toggleButton; private toggleDropDown; private triggerActiveButton; } } declare module FintaChart { } declare module FintaChart { class TimeFrameChangePopup { private _chart; private _isShown; private _element; private _timeFrame; private _correctTF; private _inputField; private _labelInfo; constructor(chart: Chart); show(value: string): Promise; hide(): void; private _loadTemplate; private _initializePopup; private _initFields; private subscribeEvents; private changeTimeFrame; private checkSupportedTimeFrames; private convertSupportedTimeFrame; } } declare module FintaChart { abstract class CommandBase { /** * Executes command. */ abstract execute(): void; /** * Rolls back command. */ abstract rollback(): void; } /** * Represents abstract command. * * @template TExecutor The command executor type. */ abstract class Command extends CommandBase { /** * The command executor. */ protected executor: TExecutor; /** * Initializes a new instance of the [[Command]] class. * * @param executor The command executor. */ protected constructor(executor: TExecutor); } } declare module FintaChart { /** * Describes chart type. * * @category Chart types */ interface IChartType extends IChartComponent, IStateable, IDisposable { /** * The type of chart type instance. */ readonly type: string; /** * The parent pane. */ readonly pane: Pane; /** * Determines whether chart type is time based (1 min, 1 hour, etc). * For example, candle chart type is time based but renko is non-time based. */ readonly isTimeBased: boolean; /** * The flag that indicates whether price line should be stretched to the left. */ stretchPricingLines: boolean; /** * The flag that indicates whether price line should be visible. */ showPricingLines: boolean; /** * Returns primary data row marker to be used instead of specified default marker. * Some chart types have OHLCV data different from the original chart data (like renko, kagi, etc). * In this case indicators, ... should use row markers provided by chart type instead of default. * For example, .kagi.close should be used instead of .close. * * @param rowMarker The default row marker. * @return Primary data row marker for a given default marker. */ primaryDataRowMarker(rowMarker: string): string; /** * Resets chart type properties to default values. */ resetToDefaults(): void; /** * Applies chart type to the chart. * * @param autoScale The flag that indicates whether automatic scaling should be applied to the axis. */ apply(autoScale?: boolean): void; /** * Refreshes chart type (recalculates data rows if necessary). */ refresh(): void; /** * Check trading session hours */ TradingSessionHoursCheck(scrollToLastBar?: boolean): any; } /** * Describes chart type defaults. * * @category Chart types */ interface IChartTypeDefaults { /** * The flag that indicates whether price line should be stretched to the left. */ stretchPricingLines: boolean; /** * The flag that indicates whether price line should be visible. */ showPricingLines: boolean; } /** * Describes chart type configuration properties. * * @category Chart types */ interface IChartTypeConfig extends IChartComponentConfig { /** * The chart type options. */ options?: IChartTypeOptions; } /** * Describes chart type options * * @category Chart types */ interface IChartTypeOptions { /** * The flag that indicates whether price line should be stretched to the left. */ stretchPricingLines?: boolean; /** * The flag that indicates whether price line should be visible. */ showPricingLines?: boolean; } /** * Describes chart type state. * * @category Chart types */ interface IChartTypeState { /** * The name of chart type. */ readonly type: string; /** * The chart type options */ options: IChartTypeOptions; } /** * Represents abstract chart type. * * @category Chart types */ abstract class ChartTypeBase extends ChartComponent implements IChartType { /** * Gets type name of chart type instance. */ static get type(): string; /** * The default chart type properties. */ static defaults: IChartTypeDefaults; /** * The plot used to render chart type. */ private _plot; /** * The default chart type properties. */ protected get defaults(): IChartTypeDefaults; /** * The type name of chart type instance. */ get type(): string; get isTimeBased(): boolean; abstract get stretchPricingLines(): boolean; abstract set stretchPricingLines(value: boolean); abstract get showPricingLines(): boolean; abstract set showPricingLines(value: boolean); /** * The plot used to render chart type. */ protected get plot(): Plot; /** * The pane. */ get pane(): Pane; /** * Initializes a new instance of the [[ChartTypeBase]] class. */ protected constructor(config?: IChartTypeConfig); dispose(): void; abstract saveState(): IChartTypeState; abstract restoreState(state: IChartTypeState): any; abstract resetToDefaults(): void; primaryDataRowMarker(rowMarker: string): string; apply(autoScale?: boolean): void; refresh(): void; /** * @description check trading session hours * * @memberof ChartType */ /** * @param scrollToLastBar Whether the session change may move the view. */ TradingSessionHoursCheck(scrollToLastBar?: boolean): void; /** * Returns chart type specified data row marker. * * @return Chart type specified data row marker. */ protected chartTypeDataRowMarker(): string; protected onChartChanging(): void; /** * Creates plot used to display chart type. * * @return The plot used to display chart type. */ protected abstract createPlot(): Plot; /** * Updates plot parameters. */ protected abstract updatePlot(): void; /** * Calculates ATR value for specified period. * * @param period The period. * @return Calculated ATR value. */ protected atrValue(period: number): number; /** * Calculates percentage value for the previous close price. * * @param percent The percentage. * @return Percentage value for the previous close price. */ protected percentageValue(percent: number): number; /** * Returns predefined traditional value based on previous close price. * * @return Predefined traditional value based on previous close price. */ protected traditionalValue(): number; /** * Removes chart type specified data rows. */ private removeDataRows; } } declare module FintaChart { /** * Represents abstract chart type with specified options. * * @template TOptions The class of chart type options. * @category Chart types */ abstract class ChartType extends ChartTypeBase { /** * Chart type options. */ private _options; /** * The chart type options. */ protected get options(): TOptions; get stretchPricingLines(): boolean; set stretchPricingLines(value: boolean); get showPricingLines(): boolean; set showPricingLines(value: boolean); /** * Initializes a new instance of the [[ChartType]] class. */ constructor(config?: IChartTypeConfig); resetToDefaults(): void; saveState(): IChartTypeState; restoreState(state: IChartTypeState): void; protected updatePlot(): void; } } declare module FintaChart { /** * Represents factory of chart types. * * @category Chart types */ class ChartTypeFactory { private static readonly _objFactory; /** * Gets known chart types. */ static get knownTypes(): IterableIterator; /** * Adds chart type to the factory. * * @param type The chart type. */ static add(type: typeof ChartTypeBase): void; /** * Creates new chart type instance of specified type name. * * @param typeName The type name of chart type. * @return Chart type instance of given type. */ static create(typeName: string): IChartType; /** * Restores chart type from a previously saved state. * * @param state The saved chart type state. * @return Chart type instance. */ static restore(state: IChartTypeState): IChartType; } } declare module FintaChart { } declare module FintaChart { /** * @category Chart types */ abstract class VolumeBasedChartType extends ChartType { apply(autoScale?: boolean): void; dispose(): void; } } declare module FintaChart { /** * Represents line chart type with filled bottom area. * * @category Chart types */ class AreaChartType extends ChartType { static get type(): string; protected createPlot(): Plot; } } declare module FintaChart { /** * Represents [bar](https://www.investopedia.com/terms/b/barchart.asp) chart type. * * @category Chart types */ class BarChartType extends ChartType { static get type(): string; protected createPlot(): Plot; } } declare module FintaChart { /** * Represents [candlestick](https://www.investopedia.com/terms/c/candlestick.asp) chart type. * * @category Chart types */ class CandleChartType extends ChartType { static get type(): string; protected createPlot(): Plot; } } declare module FintaChart { /** * Represents [CandleVolume](https://school.stockcharts.com/doku.php?id=chart_analysis:candlevolume) type. * * @category Chart types */ class CandleVolumeChartType extends VolumeBasedChartType { static get type(): string; protected createPlot(): Plot; } } declare module FintaChart { /** * Represents [colored bar](https://www.investopedia.com/terms/b/barchart.asp) chart type. * * @category Chart types */ class ColoredBarChartType extends ChartType { static get type(): string; protected createPlot(): Plot; } } declare module FintaChart { /** * Represents colored high-low bar chart type. * * @category Chart types */ class ColoredHLBarChartType extends ChartType { static get type(): string; protected createPlot(): Plot; } } declare module FintaChart { /** * Represents colored high-low-close bar chart type. * * @category Chart types */ class ColoredHLCBarChartType extends ChartType { static get type(): string; protected createPlot(): Plot; } } declare module FintaChart { /** * Represents [Equivolume](https://www.investopedia.com/terms/e/equivolume.asp) chart type. * * @category Chart types */ class EquiVolumeChartType extends VolumeBasedChartType { static get type(): string; protected createPlot(): Plot; } } declare module FintaChart { /** * Represents model of Equi Volume Shadow chart type. * * @category Chart types */ class EquiVolumeShadowChartType extends VolumeBasedChartType { static get type(): string; protected createPlot(): Plot; } } declare module FintaChart { /** * Represents [Heikin Ashi](https://school.stockcharts.com/doku.php?id=chart_analysis:heikin_ashi) chart type. * * @category Chart types */ class HeikinAshiChartType extends ChartType { static get type(): string; get isTimeBased(): boolean; protected createPlot(): Plot; primaryDataRowMarker(rowMarker: string): string; protected chartTypeDataRowMarker(): string; refresh(): void; } } declare module FintaChart { /** * Represents high-low bar chart type. * * @category Chart types */ class HLBarChartType extends ChartType { static get type(): string; protected createPlot(): Plot; } } declare module FintaChart { /** * Represents high-low-close bar chart type. * * @category Chart types */ class HLCBarChartType extends ChartType { static get type(): string; protected createPlot(): Plot; } } declare module FintaChart { /** * Represents [hollow candle]( * https://stockcharts.com/articles/mailbag/2012/11/what-the-deal-with-these-colored-filled-and-hollow-candles.html) * chart type. * * @category Chart types */ class HollowCandleChartType extends ChartType { static get type(): string; protected createPlot(): Plot; } } declare module FintaChart { /** * Kagi reversal amount type. * * @category Chart types */ enum KagiReversalType { /** * The reversal amount based on Average True Range (ATR) value. */ ATR = "atr", /** * The reversal amount based on fixed value. */ FIXED = "fixed", /** * The reversal amount based on fixed number of points (tick size). */ POINTS = "points", /** * The reversal amount based on closing prices. */ TRADITIONAL = "traditional", /** * The reversal amount based on percentage of close price. */ PERCENTAGE = "percentage" } /** * Describes Kagi reversal amount. * * @category Chart types */ interface IKagiReversalAmount { /** * The amount reversal type. */ name: KagiReversalType; /** * The amount reversal value. */ value: number; } /** * Describes Kagi chart type configuration. * * @category Chart types */ interface IKagiChartTypeConfig extends IChartTypeConfig { /** * The Kagi chart type options. */ options?: IKagiChartTypeOptions; } /** * Describes Kagi chart type defaults. * * @category Chart types */ interface IKagiChartTypeDefaults extends IChartTypeDefaults { /** * The reversal amount. */ reversal: IKagiReversalAmount; } /** * Describes Kagi chart type options. * * @category Chart types */ interface IKagiChartTypeOptions extends IChartTypeOptions { /** * The reversal amount. */ reversal: IKagiReversalAmount; } /** * Represents [Kagi](https://www.investopedia.com/terms/k/kagichart.asp) chart type. * * @category Chart types */ class KagiChartType extends ChartType { static get type(): string; static readonly defaults: IKagiChartTypeDefaults; private _reversalValue; get isTimeBased(): boolean; /** * The reversal amount. */ get reversal(): IKagiReversalAmount; set reversal(value: IKagiReversalAmount); /** * The calculated reversal value. */ get reversalValue(): number; /** * Initializes a new instance of the [[KagiChartType]] class. * * @param config The Kagi chart type configuration. */ constructor(config?: IKagiChartTypeConfig); protected createPlot(): Plot; protected chartTypeDataRowMarker(): string; refresh(): void; private calculateReversalValue; } } declare module FintaChart { /** * Represents [line](https://www.investopedia.com/terms/l/linechart.asp) chart type. * * @category Chart types */ class LineChartType extends ChartType { static get type(): string; protected createPlot(): Plot; } } declare module FintaChart { /** * Describes line break chart type defaults. * * @category Chart types */ interface ILineBreakChartTypeDefaults extends IChartTypeDefaults { /** * The number of lines. */ lines: number; } /** * Describes line break chart type configuration. * * @category Chart types */ interface ILineBreakChartTypeConfig extends IChartTypeConfig { /** * The line break chart type options. */ options?: ILineBreakChartTypeOptions; } /** * Describes line break chart type options. * * @category Chart types */ interface ILineBreakChartTypeOptions extends IChartTypeOptions { /** * The number of lines. */ lines?: number; } /** * Represents [line break](https://school.stockcharts.com/doku.php?id=chart_analysis:three_line_break) chart type. * * @category Chart types */ class LineBreakChartType extends ChartType { static get type(): string; static readonly defaults: ILineBreakChartTypeDefaults; get isTimeBased(): boolean; /** * The number of lines. */ get lines(): number; set lines(value: number); /** * Initializes a new instance of the [[LineBreakChartType]] class. * * @param config The line break chart type configuration. */ constructor(config?: ILineBreakChartTypeConfig); protected createPlot(): Plot; protected chartTypeDataRowMarker(): string; refresh(): void; } } declare module FintaChart { /** * The type of Point and Figure box size. * * @category Chart types */ enum PointAndFigureBoxSizeType { /** * The box size based on Average True Range (ATR) value. */ ATR = "atr", /** * The box size based on fixed value. */ FIXED = "fixed", /** * The box size based on fixed number of points (tick size). */ POINTS = "points", /** * The box size based on closing prices. */ TRADITIONAL = "traditional", /** * The box size based on percentage of close price. */ PERCENTAGE = "percentage" } /** * The source data row(s) to be used in Point and Figure calculation. * * @category Chart types */ enum PointAndFigureSource { /** * The close prices data row. */ CLOSE = "close", /** * The high/low prices data rows. */ HIGH_LOW = "highLow" } /** * Describes Point and Figure box size. * * @category Chart types */ interface IPointAndFigureBoxSize { /** * The box size type. */ name: PointAndFigureBoxSizeType; /** * The box size value. */ value: number; } /** * Describes Point and Figure chart type defaults. * * @category Chart types */ interface IPointAndFigureChartTypeDefaults extends IChartTypeDefaults { /** * The box size. */ boxSize: IPointAndFigureBoxSize; /** * The reversal amount. */ reversal: number; /** * The source data row(s). */ source: PointAndFigureSource; /** * The flag that indicates whether month changes should be visible. */ showMonth: boolean; /** * The flag that indicates whether signals should be visible. */ showSignals: boolean; /** * The flag that indicates whether trend lines should be visible. */ showTrend: boolean; /** * The flag that indicates whether grid should be visible. */ applyGrid: boolean; } /** * Describes Point and Figure chart type configuration. * * @category Chart types */ interface IPointAndFigureChartTypeConfig extends IChartTypeConfig { /** * The Point and Figure chart type options. */ options?: IPointAndFigureChartTypeOptions; } /** * Describes Point and Figure chart type options. * * @category Chart types */ interface IPointAndFigureChartTypeOptions extends IChartTypeOptions { /** * The box size. */ boxSize?: IPointAndFigureBoxSize; /** * The reversal amount. */ reversal?: number; /** * The source data rows. */ source?: PointAndFigureSource; /** * The flag that indicates whether month changes should be visible. */ showMonth?: boolean; /** * The flag that indicates whether trend lines should be visible. */ showSignals?: boolean; /** * The flag that indicates whether trend lines should be visible. */ showTrend?: boolean; /** * The flag that indicates whether grid should be visible. */ applyGrid?: boolean; } /** * Represents [Point and Figure (P&F)](https://www.investopedia.com/terms/p/pointandfigurechart.asp) chart type. * * @category Chart types */ class PointAndFigureChartType extends ChartType { static get type(): string; static readonly defaults: IPointAndFigureChartTypeDefaults; private _boxSizeValue; private _prevVerticalAdapter; private _prevHorizontalAdapter; get isTimeBased(): boolean; /** * The box size. */ get boxSize(): IPointAndFigureBoxSize; set boxSize(value: IPointAndFigureBoxSize); /** * The calculated box size value. */ get boxSizeValue(): number; /** * The reversal amount. */ get reversal(): number; set reversal(value: number); /** * The source data row(s). */ get source(): PointAndFigureSource; set source(value: PointAndFigureSource); /** * The flag that indicates whether trend lines should be visible. */ get showSignals(): boolean; set showSignals(value: boolean); /** * The flag that indicates whether month changes should be visible. */ get showMonth(): boolean; set showMonth(value: boolean); /** * The flag that indicates whether trend lines should be visible. */ get showTrend(): boolean; set showTrend(value: boolean); /** * The flag that indicates whether grid should be visible. */ get applyGrid(): boolean; set applyGrid(value: boolean); /** * Initializes a new instance of the [[PointAndFigureChartType]] class. */ constructor(config?: IPointAndFigureChartTypeConfig); protected createPlot(): Plot; protected chartTypeDataRowMarker(): string; refresh(): void; dispose(): void; private calculateBoxSizeValue; } } declare module FintaChart { /** * The type of range bar chart type range. * * @category Chart types */ enum RangeBarRangeType { /** * The range based on fixed value. */ FIXED = "fixed", /** * The range based on Average True Range (ATR) value. */ ATR = "atr", /** * The range based on fixed number of points (tick size). */ POINTS = "points", /** * The range based on closing prices. */ TRADITIONAL = "traditional", /** * The range based on percentage of close price. */ PERCENTAGE = "percentage" } /** * Describes the size of range bar. * * @category Chart types */ interface IRangeBarSize { /** * The range type. */ name: RangeBarRangeType; /** * The range value. */ value: number; } /** * Describes range bar chart type defaults. * * @category Chart types */ interface IRangeBarChartTypeDefaults extends IChartTypeDefaults { /** * The range size. */ range: IRangeBarSize; } /** * Describes range bar chart type configuration. * * @category Chart types */ interface IChartTypeRangeBarConfig extends IChartTypeConfig { /** * The chart type options. */ options?: IRangeBarChartTypeOptions; } /** * Describes range chart type options. * * @category Chart types */ interface IRangeBarChartTypeOptions extends IChartTypeOptions { /** * The range size. */ range?: IRangeBarSize; } /** * Represents range bar chart type. * * @category Chart types */ class RangeBarChartType extends ChartType { static get type(): string; static readonly defaults: IRangeBarChartTypeDefaults; private _rangeValue; /** * Initializes a new instance of the [[RangeBarChartType]] class. */ constructor(config?: IChartTypeRangeBarConfig); get isTimeBased(): boolean; /** * The range size. */ get range(): IRangeBarSize; set range(value: IRangeBarSize); /** * The calculated range size. */ get rangeValue(): number; protected createPlot(): Plot; protected chartTypeDataRowMarker(): string; refresh(): void; private calculateRangeValue; } } declare module FintaChart { /** * The type of the renko box size. * * @category Chart types */ enum RenkoBoxSizeType { /** * The box size based on fixed value. */ FIXED = "fixed", /** * The box size based on Average True Range (ATR) value. */ ATR = "atr", /** * The box size based on fixed number of points (tick size). */ POINTS = "points", /** * The box size based on closing prices. */ TRADITIONAL = "traditional", /** * The box size based on percentage of close price. */ PERCENTAGE = "percentage" } /** * Describes Renko box size type. * * @category Chart types */ interface IRenkoBoxSize { /** * The box size type. */ name: RenkoBoxSizeType; /** * The box size value. */ value: number; } /** * Describes Renko chart type defaults. * * @category Chart types */ interface IRenkoChartTypeDefaults extends IChartTypeDefaults { /** * The box size. */ boxSize: IRenkoBoxSize; } /** * Describes Renko chart type configuration. * * @category Chart types */ interface IRenkoChartTypeConfig extends IChartTypeConfig { /** * The configuration options. */ options?: IRenkoChartTypeOptions; } /** * Describes Renko chart type options. * * @category Chart types */ interface IRenkoChartTypeOptions extends IChartTypeOptions { /** * The box size. */ boxSize?: IRenkoBoxSize; } /** * Describes Renko chart type state. * * @category Chart types */ interface IRenkoChartTypeState extends IChartTypeState { /** * The options. */ options: IRenkoChartTypeOptions; } /** * Represents [renko](https://www.investopedia.com/terms/r/renkochart.asp) chart type. * * @category Chart types */ class RenkoChartType extends ChartType { static get type(): string; static readonly defaults: IRenkoChartTypeDefaults; private _boxSizeValue; /** * Initializes a new instance of [[RenkoChartType]] class. */ constructor(config?: IRenkoChartTypeConfig); get isTimeBased(): boolean; /** * The box size. */ get boxSize(): IRenkoBoxSize; set boxSize(value: IRenkoBoxSize); /** * The calculated box size value. */ get boxSizeValue(): number; protected createPlot(): Plot; protected chartTypeDataRowMarker(): string; refresh(): void; private calculateBoxSizeValue; } } declare module FintaChart { /** * Describes chart type handler. * * @category Chart types */ interface IChartTypeHandler extends IChartComponent { /** * The flag that indicates whether the handler is enabled. */ enabled: boolean; /** * Refreshes chart type. */ refresh(): void; } /** * Represents handler to switch between chart types according to the column width. * * @category Chart types */ class AutoSwitchChartTypeHandler extends ChartComponent implements IChartTypeHandler { enabled: boolean; refresh(): void; } } declare module FintaChart { /** * Represents Cross Hair State */ interface ICrossHairState { /** * Cross Hair State's cross hair type */ type: string; /** * Cross Hair State's show bar offset */ showBarOffset?: boolean; } /** * Represents Cross Hair Config */ interface ICrossHairConfig extends IChartComponentConfig { /** * Cross Hair Config cross hair type */ type?: string; /** * Cross Hair Config show bar offset */ showBarOffset?: boolean; } enum CrossHairType { NONE = "none", LABELS = "labels", CROSS = "cross", CROSS_BARS = "crossBars", DOT = "dot" } /** * Provides model of Cross Hair */ class CrossHair extends ChartComponent implements IVisualComponent, IStateable { private _isDragging; private _options; /** * Cross Hair's component */ component: CrossHairComponent; /** * Is show Cross Hair's replay mode line */ showReplayModeLine: boolean; /** * Is Cross Hair visible */ visible: boolean; /** * Get Cross Hair's type */ get type(): string; /** * Set Cross Hair's type */ set type(type: string); /** * Get Cross Hair's show bar offset */ get showBarOffset(): boolean; /** * Set Cross Hair's show bar offset */ set showBarOffset(value: boolean); /** * Creates an instance of CrossHair. * * @param config */ constructor(config: ICrossHairConfig); saveState(): ICrossHairState; restoreState(state: ICrossHairState): void; /** * Setups Cross Hair's layout theme */ applyTheme(): void; dispose(): void; /** * Handles Cross Hair's motion event mouse hover * * @param motionEvent * @param event */ handleMotionEventMouseHover(motionEvent: MotionEvent, event: IWindowEvent): void; /** * Shows Cross Hair */ show(): void; /** * Hides Cross Hair */ hide(): void; /** * Initializes Cross Hair's visual dimensions */ resize(): void; /** * Moves Cross Hair's point to * * @param point * @param optimize */ moveTo(point: IPoint, optimize?: boolean): void; /** * Refreshes Cross Hair */ refresh(): void; protected subscribe(): void; protected unsubscribe(): void; } } declare module FintaChart { /** * Provides model of Cross Hair Component * */ class CrossHairComponent extends HtmlComponent { private _controls; private _crossHair; private _position; private _optimization; private _prevPosition; private _labelValue; /** * Get cross hair component's chart */ get chart(): Chart; /** * Creates an instance of CrossHairComponent. * * @param crossHair */ constructor(crossHair?: CrossHair); protected createContainer(): HTMLElement; applyTheme(): void; resize(): void; refresh(): void; /** * Moves point * * @param point * @param optimize * @param stopMagnet */ moveTo(point: IPoint, optimize?: boolean, stopMagnet?: boolean): void; /** * Updates cross hair component's floating labels */ updateLabels(): void; /** * Updates cross hair component's update location * * @param force * @param stopMagnet */ updateLocation(force?: boolean, stopMagnet?: boolean): void; /** * Updates cross hair component's visibility * * @param isVisible */ updateVisibility(isVisible?: boolean): void; private static applyLabelTheme; private static updateHorizontalLabelMetrics; private static updateVerticalLabelMetrics; private createControls; private createHorizontalAxisLabel; private createVerticalAxisLabel; private createTradingButton; private syncVerticalAxesLabels; private updateHorizontalAxisLabel; private updateVerticalAxisLabel; private updateTradingButton; } } declare module FintaChart { /** * Describes hotkeys settings dialog. */ interface IHotkeysSettingsConfig extends IDialogConfig { /** * The hotkeys handler. */ handler: IHotkeysHandler; } /** * Provides model of Keyboard Settings */ class HotkeysSettings { private _handler; private _container; private _newCombinationList; private _chart; /** * Creates an instance of HotkeysSettings. * * @param container */ constructor(container: HTMLElement); /** * Get Keyboard Setting's container */ set container(container: HTMLElement); /** * Initializes Keyboard Settings * * @param config */ init(config: IHotkeysSettingsConfig): void; /** * Saves new Keyboard Setting */ saveNewSetting(): void; /** * Set default Keyboard Setting */ resetToDefaults(): void; private _keydownHandler; /** * Subscribes */ subscribe(): void; /** * Unsubscribes */ unsubscribe(): void; private onKey; private createTemplate; } } declare module FintaChart { const Key: { SHIFT: number; CTRL: number; ALT: number; ESC: number; }; /** Minimal event shape needed by hotkey matching. */ interface IKeyLike { ctrlKey?: boolean; metaKey?: boolean; altKey?: boolean; shiftKey?: boolean; keyCode?: number; type: string; } /** * Describes all the actions to hotkeys in the chart. * Also lead to description translations */ enum ChartHotkeyType { OpenQuickSearch = "OpenQuickSearch", OpenIndicators = "OpenIndicators", Redo = "Redo", Undo = "Undo", InstrumentSearch = "InstrumentSearch", InstrumentSearchHide = "InstrumentSearchHide", ArrowLeft = "ArrowLeft", ArrowRight = "ArrowRight", MoveChartLeftRight = "MoveChartLeftRight", ZoomIn = "ZoomIn", ZoomOut = "ZoomOut", MoveFurtherLeft = "MoveFurtherLeft", MoveFurtherRight = "MoveFurtherRight", ToggleMaximizePane = "ToggleMaximizePane", ToggleCollapsePane = "ToggleCollapsePane", TakeSnapshot = "TakeSnapshot", ToggleLogarithmicScale = "ToggleLogarithmicScale", TogglePercentScale = "TogglePercentScale", EnableMeasureTool = "EnableMeasureTool", MoveSelectedDrawingUp = "MoveSelectedDrawingUp", MoveSelectedDrawingDown = "MoveSelectedDrawingDown", DrawTrendLine = "DrawTrendLine", DrawHorizontalLine = "DrawHorizontalLine", DrawVerticalLine = "DrawVerticalLine", DrawCrossLine = "DrawCrossLine", DrawFibRetracement = "DrawFibRetracement", DrawRectangle = "DrawRectangle", DrawSquare = "DrawSquare", DrawCircle = "DrawCircle", GoToDate = "GoToDate", StartKeyboardNavigation = "StartKeyboardNavigation", PartiallyEraseDraw = "PartiallyEraseDraw", EnableGannBoxFixedIncrements = "EnableGannBoxFixedIncrements", HideAllDrawings = "HideAllDrawings", MoveDrawingHorizontallyVertically = "MoveDrawingHorizontallyVertically", DeleteObject = "DeleteObject", CopyObject = "CopyObject", PasteObject = "PasteObject", TimeframeChange = "TimeframeChange", MaximizeChart = "MaximizeChart" } const chartHotkeyTranslationRootKey = "hotKey.combinationsCommands"; /** * Describes hotkey. */ interface HotkeyCombination { /** * The unique hotkey identifier. */ id: HotkeyActionType; /** * The hotkey combinations. */ combinations: string[]; /** * The hotkey code combinations. */ codeCombinations: string[]; /** * The hotkey description. */ description: string; /** * Defines if the hotkey is disabled. */ disabled?: boolean; /** * Defines if the hotkey is optional and can be disabled. */ optional?: boolean; /** * Processes current hotkey. * * @param chart The chart. * @param event */ action?(chart: Chart, event?: KeyboardEvent): void; } interface IHotkeysHandler extends IChartComponent, IStateable { /** * Adds new hotkey combination. * * @param hotkey * @return */ add(hotkey: HotkeyCombination): boolean; /** * Resets to default hotkeys combinations. */ resetToDefaults(): void; /** * Returns all hotkey combinations. * * @return A list of hotkey combinations. */ all(): HotkeyCombination[]; /** * Returns hotkey combination by id. * * @return Hotkey combination for a given id. * @param type */ findById(type: ChartHotkeyType): HotkeyCombination; /** * Handles event and executes hotkey action that matches it. * * @param event */ onEvent(event: KeyboardEvent): void; } /** * Represents hotkeys handler. */ class HotkeysHandler extends ChartComponent implements IHotkeysHandler { lastEvent: IKeyLike; lastEventTime: number; private _hotkeys; private _boundOnEvent; private readonly _eventDelay; /** * Creates an instance of [[HotkeysHandler]]. * * @param config The configuration. */ constructor(config: IChartComponentConfig); onEvent(event: KeyboardEvent): void; isEventSimultaneous(event: IKeyLike): boolean; resetToDefaults(): void; all(): HotkeyCombination[]; findById(id: ChartHotkeyType): HotkeyCombination; add(hotkey: HotkeyCombination): boolean; saveState(): HotkeyCombination[]; restoreState(state: HotkeyCombination[]): void; static eventMatchHotkey(hotkey: HotkeyCombination, event: IKeyLike): boolean; static getEventCodeCombination(event: IKeyLike): string; static onCopySnapshotToClipboard(chart: Chart): void; static onTogglePercentScale(chart: Chart): void; static onMoveFurtherLeft(chart: Chart): void; static onMoveFurtherRight(chart: Chart): void; static onArrowRight(chart: Chart): void; static onArrowLeft(chart: Chart): void; static onVerticalLine(chart: Chart): void; static onHorizontalLine(chart: Chart): void; static onTrendLine(chart: Chart): void; static onFibonacci(chart: Chart): void; static onZoomIn(chart: Chart): void; static onZoomOut(chart: Chart): void; static onCopy(chart: Chart): void; static onPaste(chart: Chart): void; static onDelete(chart: Chart): void; static onUndo(chart: Chart): void; static onRedo(chart: Chart): void; static onTimeFrameChange(chart: Chart, event: KeyboardEvent): void; static onInstrumentChange(chart: Chart, event: KeyboardEvent): void; static onHideInstrumentChange(chart: Chart): void; static onOpenIndicators(chart: Chart): void; static onToggleLogarithmicScale(chart: Chart): void; static onHideAllDrawings(chart: Chart): void; static onDrawRectangle(chart: Chart): void; static onMaximizeChart(chart: Chart): void; static onToggleCollapsePane(chart: Chart): void; static onMoveSelectedDrawingUp(chart: Chart): void; static onMoveSelectedDrawingDown(chart: Chart): void; protected subscribe(): void; protected unsubscribe(): void; private init; private handleEvent; private executeAction; private mapActionsToHotkeys; } const defaultChartHotkeys: HotkeyCombination[]; } declare module FintaChart { } declare module FintaChart { } declare module FintaChart { /** * */ enum MoonPhaseType { NewMoon = 0, FirstMoon = 1, FullMoon = 2, LastMoon = 3 } } declare module FintaChart { /** * Represents abstract indicator command. */ abstract class IndicatorCommand extends Command { /** * The indicator. */ protected readonly indicator: Indicator; /** * The indicator name. */ protected readonly indicatorName: string; /** * Initializes a new instance of [[IndicatorCommand] class. */ constructor(executor: Chart, indicator: Indicator); } } declare module FintaChart { /** * Represents command to add concrete indicator. */ class AddIndicatorCommand extends IndicatorCommand { execute(): void; rollback(): void; } } declare module FintaChart { /** * Represents command to delete all indicators. */ class DeleteIndicatorsCommand extends Command { /** * The list of indicators. */ private readonly _indicators; /** * Initializes new instance of [[DeleteIndicatorsCommand]] class. * * @param chart The chart. * @param indicators The list of indicators to delete. */ constructor(chart: Chart, indicators: Indicator[]); execute(): void; rollback(): void; } } declare module FintaChart { /** * Represents command to delete concrete indicator. */ class DeleteIndicatorCommand extends IndicatorCommand { /** * The flag that indicates whether pane should be deleted if there are no indicators on it. */ private readonly _removePaneIfNoIndicators; /** * Initializes new instance of [[DeleteIndicatorCommand]] class. * * @param chart The chart. * @param indicator The indicator to delete. * @param removePaneIfNoIndicators The flag that indicates whether pane should be deleted * if there are no indicators on it. */ constructor(chart: Chart, indicator: Indicator, removePaneIfNoIndicators: boolean); execute(): void; rollback(): void; } } declare module FintaChart { /** * Represents command to merge indicators. */ class MergeIndicatorsCommand extends Command { private readonly _indicator1; private readonly _indicator2; private _indicatorTmp; /** * Initializes new instance of [[MergeIndicatorsCommand] class. * * @param chart The chart. * @param indicator1 The first indicator. * @param indicator2 The second indicator. */ constructor(chart: Chart, indicator1: Indicator, indicator2: Indicator); execute(): void; rollback(): void; } } declare module FintaChart { /** * Represents command to update indicator. */ class UpdateIndicatorCommand extends IndicatorCommand { /** * The new changes (parameters, properties, ...). */ private readonly _newChanges; /** * The old changes (parameters, properties, ...). */ private readonly _oldChanges; /** * Initializes new instance of [[UpdateIndicatorCommand]] class. * * @param chart The chart. * @param indicator The indicator. * @param parameterChanges * @param propertyChanges */ constructor(chart: Chart, indicator: Indicator, parameterChanges: PropertyChangeEvent[], propertyChanges?: PropertyChangeEvent[]); execute(): void; rollback(): void; } } declare module FintaChart { /** * Provides model of Data Aggregator */ abstract class DataAggregator { private _currentBar; private _indicatorDataRowsInput; private _isFirstTickOfBar; private _isInUpdate; private _prevBar; protected _pane: Pane | null; protected _chart: Chart; /** * Is Data Aggregator initialized */ initialized: boolean; /** * Data Aggregator children indicator */ childrenIndicator: Indicator; /** * Data Aggregator parent data aggregator */ parentDataAggregator: DataAggregator; /** * Data Aggregator chart */ get chart(): Chart; /** * Get Data Aggregator close */ get close(): IndicatorDataRows; /** * Set Data Aggregator current bar */ set currentBar(value: number); /** * Get Data Aggregator current bar */ get currentBar(): number; /** * Get Data Aggregator date */ get date(): IndicatorDataRows; /** * Get Data Aggregator high */ get high(): IndicatorDataRows; /** * Set Data Aggregator indicator data rows input */ set indicatorDataRowsInput(value: IndicatorDataRowsInput); /** * Get Data Aggregator indicator data rows input */ get indicatorDataRowsInput(): IndicatorDataRowsInput; /** * Get Data Aggregator input */ get input(): IndicatorDataRows; /** * Get Data Aggregator input 2 */ get input2(): IndicatorDataRows; /** * Get Data Aggregator inputs */ get inputs(): DataRowsCollection; /** * Get is Data Aggregator first tick of bar */ get firstTickOfBar(): boolean; /** * Set is Data Aggregator first tick of bar */ set firstTickOfBar(value: boolean); /** * Get Data Aggregator low */ get low(): IndicatorDataRows; /** * Get Data Aggregator median */ get median(): IndicatorDataRows; /** * Get Data Aggregator open */ get open(): IndicatorDataRows; /** * Get Data Aggregator typical */ get typical(): IndicatorDataRows; /** * Get Data Aggregator volume */ get volume(): IndicatorDataRows; /** * Get Data Aggregator weighted */ get weighted(): IndicatorDataRows; /** * Retrieves is Data Aggregator input equals * * @param input * @return Is Data Aggregator input equals */ equalInput(input: IndicatorDataRows): boolean; /** * Retrieves Data Aggregator average * * @param dataRows * @param lookBackPeriod * @return Data Aggregator average */ getAverage(dataRows: IndicatorDataRows, lookBackPeriod: number): number; /** Checks finite valid number */ isValidNumber(value: unknown): boolean; /** Last valid value at bars ago */ lastValidInput(dataRows: IndicatorDataRows, fromBarsAgo: number): number; /** * Callback is new tick to update indicator calculations */ protected onInputTick(record?: number): void; /** * Callback to initialize indicator */ protected onInitializeIndicator(): void; /** * Callback to reset indicator settings to default state */ protected onResetDefaults(): void; /** * Initializes Data Aggregator indicator */ initializeIndicator(): void; /** * Refreshes Data Aggregator indicator * * @property {number} record * @return Is Data Aggregator indicator refreshed */ refreshIndicator(record?: number): boolean; private canUpdate; } } declare module FintaChart { /** * Describes collection of indicator data rows. */ class DataRowsCollection { private readonly _dataRowsArray; /** * Creates an instance of DataRowsCollection. * * @param dataRows The source data rows. */ constructor(...dataRows: IndicatorDataRows[]); /** * Gets data rows array. */ get dataRowsArray(): IndicatorDataRows[]; /** * Gets records count in a data row. */ get recordsCount(): number; /** * Adds one or more data rows. * * @param dataRows The data rows to add. */ add(...dataRows: IndicatorDataRows[]): void; /** * Returns data row by name. * * @param name The data row name. * @return Data row. */ get(name: string): IndicatorDataRows; /** * Returns data row by index. * * @param index The data row index. * @return Data row. */ get(index: number): IndicatorDataRows; /** * Finds data row index by name. * * @param name The data row name. * @return Data row index or -1 if not found. */ indexOf(name: string): number; /** * Removes data rows by names * * @param names Data row names to remove. */ remove(...names: string[]): void; } } declare module FintaChart { /** * Provides model of Data Rows Indicator Extended */ class ExtendedBarDataRows { private readonly _barDataRows; private readonly _chart; private _median; private _typical; private _weighted; /** * Creates an instance of ExtendedBarDataRows. * * @param chart * @param barDataRows */ constructor(chart: Chart, barDataRows: IBarDataRows); /** * Get Data Rows Indicator Extended median */ get median(): DataRows; /** * Get Data Rows Indicator Extended typical */ get typical(): DataRows; /** * Get Data Rows Indicator Extended weighted */ get weighted(): DataRows; private calculateMedian; private calculateTypical; private calculateWeighted; } } declare module FintaChart { const INDICATOR_NULL_VALUE: number; /** * Provides model of indicator data rows. */ class IndicatorDataRows extends DataRows { /** * Converts data rows into indicator data rows. * * @param dataRows The input data rows. * @param name The data rows name. * @return Indicator data rows with values from specified data rows. */ static fromDataRows(dataRows: DataRows, name?: string): IndicatorDataRows; private _dataAggregator; /** * Creates an instance of IndicatorDataRows. * * @param name The data rows name. * @param indicator The input indicator. */ constructor(name?: string, indicator?: Indicator); /** * Creates an instance of IndicatorDataRows. * * @param name The data rows name. * @param recordsCount The number of records. */ constructor(name?: string, recordsCount?: number); /** * The data aggregator. */ get dataAggregator(): DataAggregator; set dataAggregator(data: DataAggregator); /** * Fills data row with specified value. * * @param startIndex The starting index. * @param count The number of values to fill. * @param value The fill value. */ fill(startIndex: number, count: number, value: number): void; /** * Resets data row. * * @param recordsCount The new number of records. */ reset(recordsCount: number): void; /** * Returns data row value at the specified position from the end. * * @param barsAgo The value position from the end. * @return The data row value at the given position from the end. */ get(barsAgo: number): number; /** * Returns data row value at specified index. * * @param index The index of value. * @param value The value to set. * @return Data row value at a given index. */ value(index: number, value?: number): number; /** * Updates last value. * * @param value The value. */ set(value: number): void; /** * Updates value at specified position from the end. * * @param barsAgo The position from the end. * @param value The value. */ setValue(barsAgo: number, value: number): void; /** * Extracts data rows starting at specified index. * * @param startIndex The starting index. * @return A new data rows with values starting at a given index in the current data rows. */ toDataRows(startIndex: number): IndicatorDataRows; private getIndex; } } declare module FintaChart { /** * The names of input data rows. */ enum InputDataRowName { /** * Date data row name. */ DATE = ".date", /** * Close price data row name. */ CLOSE = ".close", /** * Volume data row name. */ VOLUME = ".volume", /** * HIGH price data row name. */ HIGH = ".high", /** * LOW price data row name. */ LOW = ".low", /** * Open price data row name. */ OPEN = ".open", /** * Weighted price data row name. */ WEIGHTED = ".weighted", /** * Median price data row name. */ MEDIAN = ".median", /** * Typical price data row name. */ TYPICAL = ".typical" } /** * Provides model of indicator input data row. */ class IndicatorDataRowsInput { private readonly _chart; private readonly _indicator; private _dataRowsIndicatorExtended; private _name; private _instrument; private _timeFrame; private _recordsCount; private _input; private _input2; private _inputs; private _barDataRows; private _date; private _open; private _high; private _low; private _close; private _volume; private _median; private _typical; private _weighted; /** * Creates an instance of IndicatorDataRowsInput. * * @param indicator The indicator * @param barDataRows The bar data rows. */ constructor(indicator: Indicator, barDataRows: IBarDataRows); /** * The name. */ get name(): string; set name(value: string); /** * The instrument. */ get instrument(): IInstrument; set instrument(instrument: IInstrument); /** * The time frame. */ get timeFrame(): ITimeFrame; set timeFrame(timeFrame: ITimeFrame); /** * The number of records. */ get recordsCount(): number; set recordsCount(value: number); /** * The input data rows. */ get input(): IndicatorDataRows; set input(input: IndicatorDataRows); /** * The first additional input data rows. */ get input2(): IndicatorDataRows; set input2(input: IndicatorDataRows); /** * The input data rows collection. */ get inputs(): DataRowsCollection; set inputs(inputs: DataRowsCollection); /** * The bar data rows. */ get barDataRows(): IBarDataRows; set barDataRows(bars: IBarDataRows); /** * The date data rows. */ set date(dataRows: IndicatorDataRows); get date(): IndicatorDataRows; /** * The open price data row. */ get open(): IndicatorDataRows; set open(dataRows: IndicatorDataRows); /** * The high price data rows. */ get high(): IndicatorDataRows; set high(dataRows: IndicatorDataRows); /** * The low price data row. */ get low(): IndicatorDataRows; set low(dataRows: IndicatorDataRows); /** * The close price data rows. */ get close(): IndicatorDataRows; set close(dataRows: IndicatorDataRows); /** * The volume data row. */ get volume(): IndicatorDataRows; set volume(dataRows: IndicatorDataRows); /** * The median price data row. */ get median(): IndicatorDataRows; set median(dataRows: IndicatorDataRows); /** * The typical price data row. */ get typical(): IndicatorDataRows; set typical(dataRows: IndicatorDataRows); /** * The weighted price data row. */ get weighted(): IndicatorDataRows; set weighted(dataRows: IndicatorDataRows); private init; private createDateDataRows; private createOpenDataRows; private createHighDataRows; private createLowDataRows; private createCloseDataRows; private createVolumeDataRows; private createMedianDataRows; private createTypicalDataRows; private createWeightedDataRows; private createDataRows; private createIndicatorDataRows; private static getDataRowsName; private getDataRows; } } declare module FintaChart { /** * Adds access to cached indicators. * * @category Indicators */ abstract class IndicatorCache extends DataAggregator { private _indicatorCaches; /** * Creates, if not already cached, and returns ADX indicator. * * @param input The input data rows. * @param period The period. * @return Cached ADX indicator. */ ADX(input?: IndicatorDataRows, period?: number): Indicator; /** * Creates, if not already cached, and returns CMO indicator. * * @param input The input data rows. * @param period The period. * @return Cached CMO indicator */ CMO(input?: IndicatorDataRows, period?: number): Indicator; /** * Creates, if not already cached, and returns EMA indicator. * * @param input The input indicator or data rows. * @param period The period. * @return Cached EMA indicator. */ EMA(input: Indicator | IndicatorDataRows, period: number): Indicator; /** * Creates, if not already cached, and returns Encapsulation indicator. * * @param input The input indicator or data rows. * @param period The period. * @return Cached Encapsulation indicator. */ Encapsulation(input: Indicator | IndicatorDataRows, period: number): Indicator; /** * Creates, if not already cached, and returns HMA indicator. * * @param input The input data rows. * @param period The period. * @return Cached HMA indicator. */ HMA(input?: IndicatorDataRows, period?: number): Indicator; /** * Creates, if not already cached, and returns HML indicator. * * @param input * @param period The period. * @return Cached HML indicator. */ HML(input?: Indicator | IndicatorDataRows, period?: number): Indicator; /** * Creates, if not already cached, and returns Linear Regression indicator. * * @param input The input indicator or data rows. * @param period The period. * @return Cached Linear regression indicator. */ LinearRegression(input?: Indicator | IndicatorDataRows, period?: number): Indicator; /** * Creates, if not already cached, and returns Log Change indicator. * * @param input The input data rows. * @return Cached Log Change indicator. */ LogChange(input: IndicatorDataRows): Indicator; /** * Creates, if not already cached, and returns MAXIMUM indicator. * * @param input * @param period The period. * @return Cached MAXIMUM indicator. */ MAXIMUM(input?: Indicator | IndicatorDataRows, period?: number): Indicator; /** * Creates, if not already cached, and returns MINIMUM indicator. * * @param input The input indicator or data rows. * @param period The period. * @return Cached MINIMUM indicator. */ MINIMUM(input?: Indicator | IndicatorDataRows, period?: number): Indicator; /** * Creates, if not already cached, and returns ROC indicator. * * @param input The input indicator or data rows. * @param period The period. * @return Cached ROC indicator. */ ROC(input?: Indicator | IndicatorDataRows, period?: number): Indicator; /** * Creates, if not already cached, and returns RSI indicator. * * @param input The input data rows. * @param period The period. * @param smooth The smoothing period. * @return Cached RSI indicator. */ RSI(input: IndicatorDataRows, period: number, smooth: number): Indicator; /** * Creates, if not already cached, and returns Range indicator. * * @return Cached Range indicator. */ Range(): Indicator; /** * Creates, if not already cached, and returns SMA indicator. * * @param input The input indicator or data rows. * @param period The period. * @return Cached SMA indicator. */ SMA(input: Indicator | IndicatorDataRows, period: number): Indicator; /** * Creates, if not already cached, and returns SUM indicator. * * @param input The input data rows. * @param period The period. * @return Cached SUM indicator. */ SUM(input?: IndicatorDataRows, period?: number): Indicator; /** * Creates, if not already cached, and returns StdDev indicator. * * @param input The input indicator or data rows. * @param period The period. * @return Cached Std. Dev indicator. */ StdDev(input: Indicator | IndicatorDataRows, period: number): Indicator; /** * Creates, if not already cached, and returns Swing Index indicator. * * @param limitValue The limit value. * @return Cached Swing Index indicator. */ SwingIndex(limitValue: number): Indicator; /** * Creates, if not already cached, and returns TEMA indicator. * * @param input The input data rows. * @param period The period. * @return Cached TEMA indicator. */ TEMA(input?: IndicatorDataRows, period?: number): Indicator; /** * Creates, if not already cached, and returns TMA indicator. * * @param input The input data rows. * @param period The period. * @return Cached TMA indicator. */ TMA(input?: IndicatorDataRows, period?: number): Indicator; /** * Creates, if not already cached, and returns TSF indicator. * * @param input The input data rows. * @param period The period. * @return Cached TSF indicator. */ TSF(input?: IndicatorDataRows, period?: number): Indicator; /** * Creates, if not already cached, and returns True Range indicator. * * @param input * @param period The period. * @return Cached True Range indicator. */ TrueRange(input?: Indicator | IndicatorDataRows, period?: number): Indicator; /** * Creates, if not already cached, and returns VIDYA indicator. * * @param input * @param period The period. * @return Cached VIDYA indicator. */ VIDYA(input?: Indicator | IndicatorDataRows, period?: number): Indicator; /** * Creates, if not already cached, and returns VMA indicator. * * @param input The input indicator or data rows. * @param period The period. * @return Cached VMA indicator. */ VMA(input: Indicator | IndicatorDataRows, period: number): Indicator; /** * Creates, if not already cached, and returns WMA indicator. * * @param input The input data rows. * @param period The period. * @return Cached WMA indicator. */ WMA(input?: IndicatorDataRows, period?: number): Indicator; /** * Creates, if not already cached, and returns WWS indicator. * * @param input The input indicator or data rows. * @param period The period. * @return Cached WWS indicator. */ WWS(input: Indicator | IndicatorDataRows, period: number): Indicator; /** * Returns cached indicator of specified type. * * @param callback The callback used to compare indicators in cache. * @param type The indicator type to search. * @return Indicator if found in the cache; otherwise, null. */ private getCachedIndicator; /** * Searches and initializes cached indicator of specified type. * * @param callback The callback used to compare indicators in cache. * @param type The indicator type to search. * @return Initialized indicator if found in the cache; otherwise, null. */ private getInitializedCachedIndicator; /** * Initializes and caches specified indicator. * * @param indicator The indicator. * @param input The input indicator or data rows. * @param period The period. * @param smooth The smoothing period. * @param limitValue The limit value. * @return Initialized and cached indicator. */ private cacheIndicator; } } declare module FintaChart { interface IIndicatorTitleParameterItem { parameterName: string; value: any; } interface IUpdateIndicatorParameters { [parameterName: string]: any; } interface IIndicatorParameterChanges { [parameterName: string]: { prevValue: any; currentValue: any; }; } /** * Represents abstract indicator. * * @category Indicators */ abstract class AbstractIndicator extends IndicatorCache { private _period; private _smooth; private _limitValue; private _displacement; /** * The name of the indicator. */ name: string; /** * Options value */ options: IIndicatorOptions; /** * Has input parameters */ hasInputParameters: boolean; get period(): number; set period(value: number); get smooth(): number; set smooth(value: number); get limitValue(): number; set limitValue(value: number); get displacement(): number; set displacement(value: number); /** * Get current indicator theme */ get plotTheme(): any; /** * Get levels theme */ get levelsTheme(): any; /** * Retrieve parameter value by name * * @param paramName * @return Parameter value */ parameterValue(paramName: string): any; /** * Check if available parameter with specified name * * @param paramName * @return */ containsParameter(paramName: string): boolean; /** * Update parameter value * * @param name * @param value */ updateParameter(name: string, value: unknown): void; updateParameters(updates: IUpdateIndicatorParameters): void; getOrdinalParameterName(parameterName: string, index: number): string; /** * Refresh titles reflection */ refreshParameterTitles(): IIndicatorTitleParameterItem[]; /** * Add or fill parameters * * @param aboveColor * @param belowColor */ protected addFillParameters(aboveColor: string, belowColor: string): void; /** * Add line parameter * * @param index * @param color * @param width * @param style */ protected addLineParameters(index: number, color: string, width: number, style: string): void; /** * Modify data rows values * * @param dataRows * @return */ protected dataRowsPeriod(dataRows: IndicatorDataRows): IndicatorDataRows; /** * Retrieve line theme by number * * @param index * @return */ protected lineTheme(index: number): any; /** * Set title text * * @param name * @param container */ protected updateTitle(name: string, container: HTMLElement): Promise; /** * Set localization attribute * * @param container * @param key */ protected updateTitleAttribute(container: HTMLElement, key: string): Promise; /** * Shift to the future data rows * * @param dataRows * @param positionsCount * @return Modified data rows */ protected shiftToFuture(dataRows: DataRows, positionsCount: number): DataRows; /** * Shift to the past data rows * * @param dataRows * @param positionsCount * @return Modified data rows */ protected shiftToPast(dataRows: DataRows, positionsCount: number): DataRows; protected onParameterUpdated(changes: IIndicatorParameterChanges): void; } } declare module FintaChart { interface IRestrictedIndicatorsProvider { restrictedIndicators(): string[]; } enum IndicatorDataRowsName { OPEN = "Open", HIGH = "High", LOW = "Low", CLOSE = "Close", VOLUME = "Volume", MEDIAN = "Median", TYPICAL = "Typical", WEIGHTED = "Weighted", DATE = "Date" } namespace IndicatorEvent { const SELECTED_CHANGED = "indicatorSelectedValueChanged"; const HOVERED_CHANGED = "indicatorHoveredValueChanged"; const SHOWED_CONTEXT_MENU = "indicatorShowedContextMenu"; const SELECTABLE_CHANGED = "indicatorSelectableValueChanged"; const HOVERABLE_CHANGED = "indicatorHoverableValueChanged"; } /** * Represents indicator configuration */ interface IIndicatorConfig { /** * Allow reflection of settings dialog state */ allowSettingsDialog?: boolean; /** * Apply indicator value */ applyIndicator?: boolean; /** * Chart instance value */ chart?: Chart; /** * Colored volume theme value */ coloredVolumeTheme?: any; /** * Enable labels for vertical scale state */ enableVerticalAxisLabels?: boolean; /** * Support hover state */ hoverable?: boolean; /** * Identifies if indicator is custom */ customIndicator?: boolean; /** * MA period value */ maPeriod?: number; /** * Pane height ratio value */ paneHeightRatio?: number; /** * Pane index value */ paneIndex?: number; /** * Parameters value */ parameters?: object; /** * Periods value */ periods?: number; /** * ROC period value */ rocPeriod?: number; /** * Scale vertical index value */ verticalScaleIndex?: number; /** * Selectable state */ selectable?: boolean; /** * Show parameters in title state */ showParamsInTitle?: boolean; /** * Show title state */ showTitle?: boolean; /** * Show values in title */ showValuesInTitle?: boolean; /** * Visible state */ visible?: boolean; } /** * Represents indicator options */ interface IIndicatorOptions { /** * Allow settings dialog */ allowSettingsDialog: boolean; /** * Apply indicator */ applyIndicator: boolean; /** * Colored volume theme */ coloredVolumeTheme?: any; /** * Enable scale vertical label */ enableVerticalAxisLabels: boolean; /** * Hoverable state */ hoverable?: boolean; /** * Height ratio of pane */ paneHeightRatio: number; /** * Parameters value */ parameters: object; /** * Scale vertical index */ verticalScaleIndex?: number; /** * Selectable state */ selectable?: boolean; /** * Show line levels */ showLineLevels?: boolean; /** * Show parameters in title */ showParamsInTitle: boolean; /** * Show title */ showTitle?: boolean; /** * Show values in title */ showValuesInTitle: boolean; /** * Visible state */ visible: boolean; /** * zIndex value */ zIndex?: number; canChangePane?: boolean; theme?: any; } /** * Represents indicator state */ /** * A single indicator plot value for the OHLC card. */ interface IIndicatorHoverValue { name: string; color: string; value: string; } interface IIndicatorTitleItem { text: string; tooltip?: string; color?: string; values?: number[]; } interface IIndicatorState { id?: string; parentId?: string; type: string; paneIndex?: number; isAutoScale?: boolean; prevParameters?: unknown; isCustom?: boolean; /** * Allow settings dialog */ allowSettingsDialog?: boolean; /** * Apply indicator */ applyIndicator?: boolean; /** * Colored volume theme */ coloredVolumeTheme?: any; /** * Enable scale vertical label */ enableVerticalAxisLabels?: boolean; /** * Hoverable state */ hoverable?: boolean; /** * Height ratio of pane */ paneHeightRatio?: number; /** * Parameters value */ parameters?: object; /** * Scale vertical index */ verticalScaleIndex?: number; /** * Selectable state */ selectable?: boolean; /** * Show line levels */ showLineLevels?: boolean; /** * Show parameters in title */ showParamsInTitle?: boolean; /** * Show title */ showTitle?: boolean; /** * Show values in title */ showValuesInTitle?: boolean; /** * Visible state */ visible?: boolean; /** * zIndex value */ zIndex?: number; canChangePane?: boolean; theme?: any; } const AutoScaleMultiplierValue = 5; /** * Provides model of Abstract indicator * * @category Indicators */ abstract class Indicator extends AbstractIndicator implements IDisposable, IStateable, IChartObject { /** * Gets instance type name. */ static get type(): string; parentIndicator: Indicator; parentId: string; appliedIndicators: Indicator[]; isCustom: boolean; customResultValues: Map; /** * Use primary data rows state */ usePrimaryDataRows: boolean; verticalScale: VerticalScale; private _isCustomScale; private _hovered; private _id; private _lineLevels; private _indicatorShapes; private _shapesById; private _shapesPanes; private _shapesForcePricePane; private _shapesFullyAttached; private _pixelShapeOffsets; private _legendOffset; private _barStyles; private _barStylesDirty; private _panelStyle; private _scriptStylesChart; private _requireDefaults; private _optionsTitle; private _parametersContextMenu; private _plotFill; private _plotFillSeries; private _removedPlotFill; private _plotDisplacements; private _plots; private _refreshDeferred; private _deferredFrom; private _prevParams; private _removeTitle; private _alertTitle; private _selected; private _titleControls; private _titleItems; private _titleItemViews; private _toggleTitleVisibility; private _values; private _titleContextMenu; private _inputDataRowName; private _inputDataRowName2; private _isLoading; /** * Is auto scale state */ private _isAutoScale; /** * Is overlay state */ private _isOverlay; /** * Pane value */ _pane: Pane | null; /** * Plot items */ private _plotItems; /** * Get input data row name */ get inputDataRowName(): string; /** * Set input data row name */ set inputDataRowName(value: string); /** * Get input data row name 2 */ get inputDataRowName2(): string; /** * Set input data row name */ set inputDataRowName2(value: string); /** * Get default theme of shape */ get defaultTheme(): any; get theme(): any; set theme(value: any); get lineLevels(): Shape[]; get indicatorShapes(): Shape[]; /** * Allow setting dialog state */ get allowSettingsDialog(): boolean; set allowSettingsDialog(value: boolean); /** * Apply indicator */ get applyIndicator(): boolean; set applyIndicator(value: boolean); /** * Get can hover state */ get canHover(): boolean; /** * Get if can merge down (move pane down) */ get canMergeDown(): boolean; /** * Get if can merge up (move pane up) */ get canMergeUp(): boolean; /** * Get if this indicator can be moved onto the primary (price) pane as an overlay. */ get canMoveToPrice(): boolean; /** * Get if can select */ get canSelect(): boolean; /** * Get if can un-merge down */ get canUnmergeDown(): boolean; /** * Get if can un-merge up */ get canUnmergeUp(): boolean; get canChangePane(): boolean; get chart(): Chart; set chart(value: Chart); /** * Gets instance type name. */ get type(): string; /** * Colored volume theme */ get coloredVolumeTheme(): any; set coloredVolumeTheme(value: any); /** * Get enableScale vertical labels */ get enableVerticalAxisLabels(): boolean; set enableVerticalAxisLabels(value: boolean); /** * Get hoverable state */ get hoverable(): boolean; set hoverable(value: boolean); /** * Get hovered state */ get hovered(): boolean; set hovered(value: boolean); /** * Get indicator ID */ get id(): string; set id(value: string); /** * Get if auto scale enabled */ get isAutoScale(): boolean; set isAutoScale(value: boolean); /** * Get if initialized */ get Initialized(): boolean; /** * Get if overlay */ get isOverlay(): boolean; protected set isOverlay(value: boolean); /** * Get pane */ get pane(): Pane; /** * get pane height ratio */ get paneHeightRatio(): number; /** * Pins the indicator to an explicit pane before it is attached to * a chart via `chart.addIndicators(...)`. * * Suppresses the default routing (which uses `isOverlay` to decide * between the primary pane and a freshly-created pane) and aligns * `isOverlay` with the chosen pane so subsequent layout / merge * behaviour remains consistent. * * Used internally by `Pane.addIndicator(...)` and * `Chart.addIndicatorInNewPane(...)`; rarely needed directly. * * @param pane The pane this indicator should live on. */ placeOnPane(pane: Pane): void; /** * Get indicator parameters */ get parameters(): object; /** * Get plots */ get plots(): Plot[]; /** * Get if selectable */ get selectable(): boolean; set selectable(value: boolean); /** * Get if selected */ get selected(): boolean; set selected(value: boolean); /** * Get show line levels */ get showLineLevels(): boolean; set showLineLevels(value: boolean); /** * Get show parameters in title */ get showParamsInTitle(): boolean; set showParamsInTitle(value: boolean); /** * Get if show title */ get showTitle(): boolean; set showTitle(value: boolean); /** * Get if show values in title */ get showValuesInTitle(): boolean; set showValuesInTitle(value: boolean); /** * Get values */ get values(): DataRowsCollection; set values(values: DataRowsCollection); /** * Get visibility */ get visible(): boolean; set visible(value: boolean); /** * Get z-Index */ get zIndex(): number; set zIndex(value: number); private get canCreateAlert(); get isLoading(): boolean; set isLoading(isLoading: boolean); /** * Creates an instance of Indicator. */ constructor(); /** * Add line * * @param color * @param pointY */ addLine(color: string, pointY: number): void; setTitleItems(items: IIndicatorTitleItem[]): void; addShape(state: IShapeState): Shape | null; setIndicatorShapes(states: IShapeState[], opts?: { onPricePane?: boolean; }): void; upsertIndicatorShapes(states: IShapeState[]): void; private removeIndicatorShape; removeIndicatorShapes(): void; private isPixelAnchoredShape; private routeAndAttach; layoutShapeLabels(pane: Pane): void; private layoutPixelShapes; private attachIndicatorShapes; /** * Replaces the whole set of per-bar color overrides owned by this * indicator (the `ScriptCalculated` snapshot channel). * * Bars are addressed by timestamp, so history loading and conflation * cannot shift them. Overrides are painted on the chart-type plot of * the price pane - wherever this indicator's own plots live - and are * dropped together with the indicator. * * @param styles Bar styles, or `null` to clear them. */ setBarStyles(styles: IScriptBarStyle[] | null): void; /** * Adds or replaces single bar overrides, keeping the rest (the * `ScriptUpdate` realtime channel). Re-sending the same timestamp * replaces that bar, so repeated ticks on a forming bar never pile up; * a style that paints nothing clears the bar again. * * @param styles Bar styles to merge in. */ upsertBarStyles(styles: IScriptBarStyle[] | null): void; /** * Drops every per-bar color override owned by this indicator. */ clearBarStyles(): void; /** * Sets the background this indicator paints - one per indicator, the * last call wins. The user theme is not touched and the gradient is * not serialized into the chart state. * * @param style Panel style, or `null` to restore the theme. */ setPanelStyle(style: IScriptPanelStyle | null): void; /** * Restores the theme background. */ clearPanelStyle(): void; /** * Pushes the buffered script styles to the chart registries. Called * whenever the indicator is (re)attached or refreshed, so a pane move * re-targets the background and a re-added indicator repaints its bars. */ private applyScriptStyles; /** * Removes this indicator's script styles from the chart registries. */ private removeScriptStyles; private static barStyleTime; /** * Add plot * * @param color * @param name * @param plotStyle * @param width * @param style */ addPlot(color: string, name: string, plotStyle?: string, width?: number, style?: string): Plot; /** * Add plot area - a filled region between two of this indicator's * plots. `name` / `name2` are plot names declared with * {@link Indicator.addPlot}; `aboveColor` paints the segments where * the **first** series is above the second one, `belowColor` the rest. * * Only one area per indicator is supported. * * @param name * @param name2 * @param aboveColor * @param belowColor */ addPlotArea(name: string, name2: string, aboveColor: string, belowColor: string): void; /** * Removes the area added with {@link Indicator.addPlotArea}. */ removePlotArea(): void; private dropRemovedPlotFill; setPlotDisplacement(name: string, bars: number): void; /** * Bind indicator to a vertical scale * * @param verticalScale */ bindToVerticalScale(verticalScale: VerticalScale): this; dispose(): void; /** * Paint indicator */ paint(): void; getLocalizationKeys(): void; /** * Perform hover */ hover(): void; restoreState(state: IIndicatorState): void; /** * Retrieve Fill plot * * @param theme * @param dataRows1 * @param dataRows2 * @return */ plotFill(theme: any, dataRows1: IndicatorDataRows, dataRows2: IndicatorDataRows): Plot; /** * Retrieve Histogram plot * * @param theme * @param dataRows * @param plotStyle * @return */ plotHistogram(theme: any, dataRows?: IndicatorDataRows, plotStyle?: string): Plot; /** * Retrieve Line plot * * @param theme * @param dataRows * @return */ plotLine(theme: any, dataRows?: IndicatorDataRows): Plot; /** * Remove indicator */ remove(): void; /** * Remove line levels */ removeLineLevels(): void; /** * Perform select */ select(): void; saveState(): any; /** * Reset to defaults */ resetDefaults(): void; /** * Show settings dialog */ showSettingsDialog(): void; /** * Refresh calculations */ refresh(): void; /** * Recalculates from a bar index, keeping earlier values. * * @param startIndex The first bar whose value changed. */ refreshFrom(startIndex: number): void; private refreshCore; getTimeFrame(): ITimeFrame; getExportParametersMap(): any; /** * Update hover record * * @param record */ updateHoverRecord(record?: number): void; getValues(): DataRowsCollection; /** * Per-plot values at a record for the OHLC card. * * @param record Record index; defaults to hovered record. * @return One { name, color, value } per plot. */ hoverValues(record?: number): IIndicatorHoverValue[]; /** * Update visibility of title elements */ updateTitleControlsVisibility(): void; /** * Define option * * @param key * @param value * @param valueChangedEventName */ protected setOption(key: string, value: any, valueChangedEventName?: string): void; /** * Initialize pane */ protected initPane(): void; protected normalizePlotItem(plotItem: any, indicatorDataRows: IndicatorDataRows): void; /** * Perform merge * * @param isMergingUp */ protected merge(isMergingUp: boolean): void; /** * Promote this indicator onto the primary (price) pane as an overlay. */ protected mergeIntoPrimaryPane(): void; /** * perform un-merge * * @param unmergeUp */ protected unmerge(unmergeUp: boolean): void; /** * Retrieve if needs custom scale */ protected needsCustomScale(): boolean; /** * Retrieve if the plots must stay out of the vertical auto scale. * * Script-driven indicators report whatever the script emits, which is not * necessarily comparable with the price (a script that keeps `IsOverlay` * on while plotting zeros drags the price scale minimum down to zero). * The scale range also gates zoom and scroll, so such values do not only * squash the candles - they lock the vertical axis as well. * * Only applies while the indicator actually shares the price pane scale: * on its own pane, or bound to its own scale, its plots are the only * input that scale has and excluding them would leave nothing to scale by. * * Override in a subclass to opt a custom indicator back in. */ protected excludeFromPriceAutoScale(): boolean; /** * Refresh item by number * * @param index */ protected refreshItem(index: number): boolean; private timeFrameBars; private addPane; private addPanePlot; private histogramTheme; private initIndicator; private initPaneTitle; private rebuildTitleItems; /** * Renders BBCode markup (as produced by the script engine's SetTitle) into the legend span. * Falls back to plain text if the markup carries no formatting. */ private renderTitleItemText; /** * Tooltips live in a title attribute, which cannot carry markup - keep the text, drop the tags. */ private static stripBBCode; private updateTitleItemValues; private setCustomScale; protected subscribe(): void; protected unsubscribe(): void; protected onLastBarUpdated(event: IValueChangedEvent): void; protected onBarsSet(event: IValueChangedEvent): void; protected onBarsAppended(event: IValueChangedEvent): void; protected onBarsInserted(event: IValueChangedEvent): void; protected onVisibilityChanged(visible: boolean): void; /** * Whether a refresh may be postponed until the indicator is shown. */ private canDeferRefresh; protected onChartTypeChanged(event: IValueChangedEvent): void; protected onReplayModeStartRecordSelected(event: IValueChangedEvent): void; protected onReplayModeStopped(): void; protected onThemeChanged(): void; private updatePaneTitle; private visualizePlotArea; private fillTheme; private findById; private displacedDataRows; private plotDisplacement; private withoutNaNValues; private localizedParameters; private localizeTimeFrameParameter; private removeControls; private resetValues; private updateAutoScaleMultiplier; private disablePaddings; private toggleVisibility; private addAlert; } } declare module FintaChart { const IndicatorParam: { SOURCE: string; SOURCE2: string; PERIODS: string; R2_SCALE: string; STANDARD_DEVIATIONS: string; MA_PERIOD: string; ROC_PERIOD: string; SMOOTH: string; MA_TYPE: string; SHIFT: string; BAND_PCT: string; PCT_K_PERIODS: string; PCT_K_SMOOTHING: string; PCT_K_DOUBLE_SMOOTHING: string; PCT_D_PERIODS: string; PCT_D_MA_TYPE: string; RATE_OF_CHANGE: string; SHORT_CYCLE: string; LONG_CYCLE: string; SIGNAL_PERIODS: string; LINE_WIDTH: string; LINE_STYLE: string; LINE_COLOR: string; LINE_ENABLED: string; FILL_ABOVE: string; FILL_BELOW: string; FILL_ENABLED: string; FAST: string; SLOW: string; VOLUME_DIVISOR: string; OFFSET_MULTIPLIER: string; MULTIPLIER: string; BOX_RATIO_SMOOTHING: string; ENVELOPE_PERCENTAGE: string; BAR_COUNT: string; Q_PERIODS: string; T_COUNT: string; V_FACTOR: string; FORECAST: string; INTERMEDIATE: string; VOLATILITY_PERIOD: string; BARS_REQUIRED_TO_PLOT: string; EMA1: string; EMA2: string; CONVERSION_PERIODS: string; BASE_PERIODS: string; LOGIN_SPAN2_PERIODS: string; DISPLACEMENT: string; LIMIT_VALUE: string; TIME_LINE_PERIOD: string; TIME_FRAME: string; ROWS_NUMBER: string; VA_PERCENT: string; STEP: string; SESSION_T0: string; SIZE: string; TIMEFRAME_VISIBILITY: string; }; } declare module FintaChart { } declare module FintaChart { /** * Represents factory of indicators. */ class IndicatorFactory { private static readonly _objFactory; /** * Gets known indicator types. */ static get knownTypes(): IterableIterator; /** * Adds indicator to the factory. */ static add(type: typeof Indicator): void; /** * Creates new indicator instance of specified type name. * * The second argument is overloaded: pass a `Chart` to attach the * indicator to it immediately, or pass a plain object to seed * parameter values (`{ period: 20, source: 'close' }`). Both forms * may be combined via the three-argument variant. * * @param typeName The type name of indicator. * @param chartOrParameters Either the chart instance, or a * parameters object applied via `updateParameters` after construction. * @param parameters Optional parameters when the second argument * already specifies a chart. * @return Indicator instance of given type. */ static create(typeName: string, chartOrParameters?: Chart | Record, parameters?: Record): Indicator; /** * Restores chart type from a previously saved state. * * @param state The saved indicator state. * @return Chart type instance. */ static restore(state: IIndicatorState): Indicator; } } declare module FintaChart { /** * Represents logic of external alert creation on chart indicator parameters * */ interface IIndicatorAlertsHandler { canCreateAlertOnIndicator(indicator: Indicator, chart: Chart): boolean; createAlertOnIndicator(indicator: Indicator, chart: Chart): void; } } declare module FintaChart { /** * Moving Average types. */ enum MovingAverageType { EXPONENTIAL = 0, HULL = 1, SIMPLE = 2, TRIANGULAR = 3, TEMA = 4, WEIGHTED = 5, VARIABLE = 6, WWS = 7, VIDYA = 8 } } declare module FintaChart { } declare module FintaChart { } declare module FintaChart { } declare module FintaChart { } declare module FintaChart { } declare module FintaChart { } declare module FintaChart { } declare module FintaChart { } declare module FintaChart { } declare module FintaChart { } declare module FintaChart { } declare module FintaChart { } declare module FintaChart { } declare module FintaChart { } declare module FintaChart { } declare module FintaChart { } declare module FintaChart { } declare module FintaChart { class TimeframeCheckboxesControl implements IIndicatorParameterControl { private _container; private _values; private _supportedTimeFrames; private _indicator; constructor(indicator: Indicator, initialValue: boolean); createHtmlElement(): Promise; values(): Record; onLocaleChanged(): Promise; private static getTimeFrameLocalizationKey; } } declare module FintaChart { } declare module FintaChart { } declare module FintaChart { } declare module FintaChart { } declare module FintaChart { } declare module FintaChart { } declare module FintaChart { /** * Represents DM indicator. * * @category Indicators */ class DM extends Indicator { static get type(): string; private _dmMinus; private _dmPlus; private _sumDmMinus; private _sumDmPlus; private _sumTr; private _tr; /** * The period. */ get period(): number; set period(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; getLocalizationKeys(): string[]; } } declare module FintaChart { /** * Represents ADL indicator. * * @category Indicators */ class ADL extends Indicator { static get type(): string; /** * The period. */ get period(): number; set period(value: number); protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents APZ indicator. * * @category Indicators */ class APZ extends Indicator { static get type(): string; private _ema1; private _emaEMA; private _emaRange; private _newPeriod; /** * The band %. */ get bandPct(): number; set bandPct(value: number); /** * The period. */ get period(): number; set period(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents EMA indicator. * * @category Indicators */ class EMA extends Indicator { static get type(): string; private _constant1; private _constant2; get inputDataRowName(): string; set inputDataRowName(value: string); /** * The period. */ get period(): number; set period(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents ATR indicator. * * @category Indicators */ class ATR extends Indicator { static get type(): string; /** * The period. */ get period(): number; set period(value: number); protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents SMA indicator. * * @category Indicators */ class SMA extends Indicator { static get type(): string; private _priorSum; private _sum; private _priorValidCount; private _validCount; get inputDataRowName(): string; set inputDataRowName(value: string); /** * The period. */ get period(): number; set period(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { const EncapsulationPeriod: { DAILY: string; YEARLY: string; MONTHLY: string; WEEKLY: string; }; const Interval: { DAILY: number; WEEKLY: number; MONTHLY: number; YEARLY: number; }; /** * Represents Encapsulation indicator. * * @category Indicators */ class Encapsulation extends Indicator { static get type(): string; private _changeSide; private _countDays; private _countHours; private _lastCalculatedBar; private _maxHigh; private _minLow; /** * The encapsulation period. */ get encapsulationPeriod(): string; set encapsulationPeriod(value: string); get showValuesInTitle(): boolean; set showValuesInTitle(value: boolean); protected subscribe(): void; protected unsubscribe(): void; remove(): void; protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; private dailyCalculation; private monthlyCalculation; private setShapePoints; private weeklyCalculation; private yearCalculation; } } declare module FintaChart { /** * Represents SUM indicator. * * @category Indicators */ class SUM extends Indicator { static get type(): string; private _priorSum; private _sum; get inputDataRowName(): string; set inputDataRowName(value: string); /** * The period. */ get period(): number; set period(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents CMO indicator. * * @category Indicators */ class CMO extends Indicator { static get type(): string; private _down; private _sumDown; private _sumUp; private _up; get inputDataRowName(): string; set inputDataRowName(value: string); /** * The period. */ get period(): number; set period(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents Maximum indicator. * * @category Indicators */ class MAXIMUM extends Indicator { static get type(): string; private _lastBar; private _lastMax; private _runningBar; private _runningMax; private _thisBar; get inputDataRowName(): string; set inputDataRowName(value: string); /** * The period. */ get period(): number; set period(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents Minimum indicator. * * @category Indicators */ class MINIMUM extends Indicator { static get type(): string; private _lastBar; private _lastMin; private _runningBar; private _runningMin; private _thisBar; get inputDataRowName(): string; set inputDataRowName(value: string); /** * The period. */ get period(): number; set period(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents ADIndex indicator. * * @category Indicators */ class ADIndex extends Indicator { /** * Gets instance type name. */ static get type(): string; private _dmMinus; private _dmPlus; private _sumDmMinus; private _sumDmPlus; private _sumTr; private _tr; /** * The period. */ get period(): number; set period(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents OBV indicator. * * @category Indicators */ class OBV extends Indicator { static get type(): string; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents ROC indicator. * * @category Indicators */ class ROC extends Indicator { static get type(): string; get inputDataRowName(): string; set inputDataRowName(value: string); /** * The period. */ get period(): number; set period(value: number); protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents Volume indicator. * * @category Indicators */ class VOLUME extends Indicator { static get type(): string; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents VMA indicator. * * @category Indicators */ class VMA extends Indicator { static get type(): string; private _cmo; private _sc; get inputDataRowName(): string; set inputDataRowName(value: string); /** * The period. */ get period(): number; set period(value: number); /** * The volatility period. */ get volatilityPeriod(): number; set volatilityPeriod(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents BOP indicator. * * @category Indicators */ class BOP extends Indicator { static get type(): string; private _bop; private _sma; /** * The smooth value. */ get smooth(): number; set smooth(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents PPO indicator. * * @category Indicators */ class PPO extends Indicator { static get type(): string; private _emaFast; private _emaSlow; private _values0; private _emaSmooth; /** * The fast EMA period. */ get fast(): number; set fast(value: number); /** * The slow EMA period. */ get slow(): number; set slow(value: number); /** * The smooth value. */ get smooth(): number; set smooth(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents TSF indicator. * * @category Indicators */ class TSF extends Indicator { static get type(): string; private _avg; private _divisor; private _intercept; private _myPeriod; private _priorSumXY; private _priorSumY; private _slope; private _sum; private _sumX; private _sumX2; private _sumXY; private _sumY; private _windowClean; /** * The forecast. */ get forecast(): number; set forecast(value: number); get inputDataRowName(): string; set inputDataRowName(value: string); /** * The period. */ get period(): number; set period(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents TSI indicator. * * @category Indicators */ class TSI extends Indicator { static get type(): string; private _constant1; private _constant2; private _constant3; private _constant4; private _fastAbsEma; private _fastEma; private _slowAbsEma; private _slowEma; /** * The fast EMA period. */ get fast(): number; set fast(value: number); get inputDataRowName(): string; set inputDataRowName(value: string); /** * The slow EMA period. */ get slow(): number; set slow(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents PFE indicator. * * @category Indicators */ class PFE extends Indicator { static get type(): string; private _div; private _ema; private _pfeDataRows; private _singlePfeDataRows; get inputDataRowName(): string; set inputDataRowName(value: string); /** * The period. */ get period(): number; set period(value: number); /** * The smooth value. */ get smooth(): number; set smooth(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents WMA indicator. * * @category Indicators */ class WMA extends Indicator { static get type(): string; private _myPeriod; private _priorSum; private _priorWsum; private _sum; private _wsum; private _windowClean; get inputDataRowName(): string; set inputDataRowName(value: string); /** * The period. */ get period(): number; set period(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents HML indicator. * * @category Indicators */ class HML extends Indicator { static get type(): string; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents RSI indicator. * * @category Indicators */ class RSI extends Indicator { static get type(): string; private _avgDown; private _avgUp; private _constant1; private _constant2; private _constant3; private _down; private _smaDown; private _smaUp; private _up; get inputDataRowName(): string; set inputDataRowName(value: string); /** * The period. */ get period(): number; set period(value: number); /** * The smooth value. */ get smooth(): number; set smooth(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents MFI indicator. * * @category Indicators */ class MFI extends Indicator { static get type(): string; private _negative; private _positive; private _sumNegative; private _sumPositive; /** * The period. */ get period(): number; set period(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents ASI indicator. * * @category Indicators */ class ASI extends Indicator { static get type(): string; private _swingIndex; /** * The limit value. */ get limitValue(): number; set limitValue(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents CRS indicator. * * @category Indicators */ class CRS extends Indicator { static get type(): string; get inputDataRowName(): string; set inputDataRowName(value: string); get inputDataRowName2(): string; set inputDataRowName2(value: string); protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents EFI indicator. * * @category Indicators */ class EFI extends Indicator { static get type(): string; private _ema; protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; getLocalizationKeys(): string[]; } } declare module FintaChart { /** * Represents GRI indicator. * * @category Indicators */ class GRI extends Indicator { static get type(): string; private _max; private _min; /** * The period. */ get period(): number; set period(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents IMI indicator. * * @category Indicators */ class IMI extends Indicator { static get type(): string; private _dnSum; private _prevDnSum; private _prevUpSum; private _upSum; /** * The period. */ get period(): number; set period(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * The CCI indicator. * * @category Indicators */ class CCI extends Indicator { static get type(): string; private _sma; /** * The period. */ get period(): number; set period(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents RSS indicator. * * @category Indicators */ class RSS extends Indicator { static get type(): string; private _ema1; private _ema2; private _priceSpread; private _rs; private _rsi; private _sma; /** * The first EMA period. */ get ema1(): number; set ema1(value: number); /** * The second EMA period. */ get ema2(): number; set ema2(value: number); /** * The period. */ get period(): number; set period(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents HMA indicator. * * @category Indicators */ class HMA extends Indicator { static get type(): string; private _diffDataRows; private _wma1; private _wma2; private _wmaDiffDataRows; get inputDataRowName(): string; set inputDataRowName(value: string); /** * The period. */ get period(): number; set period(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents PNB indicator. * * @category Indicators */ class PNB extends Indicator { static get type(): string; protected onResetDefaults(): void; protected onInputTick(): void; getLocalizationKeys(): string[]; } } declare module FintaChart { /** * Represents TMA indicator. * * @category Indicators */ class TMA extends Indicator { static get type(): string; private _p1; private _p2; private _sma0; private _smaSource; private _sma; get inputDataRowName(): string; set inputDataRowName(value: string); /** * The period. */ get period(): number; set period(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents NVI indicator. * * @category Indicators */ class NVI extends Indicator { static get type(): string; get inputDataRowName(): string; set inputDataRowName(value: string); protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents PVI indicator. * * @category Indicators */ class PVI extends Indicator { static get type(): string; get inputDataRowName(): string; set inputDataRowName(value: string); protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents PVT indicator. * * @category Indicators */ class PVT extends Indicator { static get type(): string; get inputDataRowName(): string; set inputDataRowName(value: string); protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents TVI indicator. * * @category Indicators */ class TVI extends Indicator { static get type(): string; private _direction; private _lastDirection; private _tvi; get inputDataRowName(): string; set inputDataRowName(value: string); /** * The limit value. */ get limitValue(): number; set limitValue(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents TMF indicator. * * @category Indicators */ class TMF extends Indicator { static get type(): string; private _ema; private _ema2; private _high; private _low; /** * The period. */ get period(): number; set period(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents WWS indicator. * * @category Indicators */ class WWS extends Indicator { static get type(): string; get inputDataRowName(): string; set inputDataRowName(value: string); /** * The period. */ get period(): number; set period(value: number); protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents CFO indicator. * * @category Indicators */ class CFO extends Indicator { static get type(): string; private _tsf; get inputDataRowName(): string; set inputDataRowName(value: string); /** * The period. */ get period(): number; set period(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents EFT indicator. * * @category Indicators */ class EFT extends Indicator { static get type(): string; private _max; private _min; private _prevFish; private _prevValue1; private _value1; /** * The period. */ get period(): number; set period(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; getLocalizationKeys(): string[]; } } declare module FintaChart { /** * Represents PGO indicator. * * @category Indicators */ class PGO extends Indicator { static get type(): string; private _ema; private _sma; private _tr; /** * The period. */ get period(): number; set period(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents PNO indicator. * * @category Indicators */ class PNO extends Indicator { static get type(): string; private _bottom; private _top; protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents WAD indicator. * * @category Indicators */ class WAD extends Indicator { static get type(): string; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents RIND indicator. * * @category Indicators */ class RIND extends Indicator { static get type(): string; private _ema; private _max; private _min; private _stochRange; private _val1; /** * The period. */ get period(): number; set period(value: number); /** * The Q period. */ get periodQ(): number; set periodQ(value: number); /** * The smooth value. */ get smooth(): number; set smooth(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents DEMA indicator. * * @category Indicators */ class DEMA extends Indicator { static get type(): string; private _ema; private _emaEma; get inputDataRowName(): string; set inputDataRowName(value: string); /** * The period. */ get period(): number; set period(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents KAMA indicator. * * @category Indicators */ class KAMA extends Indicator { static get type(): string; private _diffDataRows; private _fastCF; private _slowCF; private _sum; /** * The fast smoothing constant. */ get fast(): number; set fast(value: number); /** * The slow smoothing constant. */ get slow(): number; set slow(value: number); /** * The period. */ get period(): number; set period(value: number); get inputDataRowName(): string; set inputDataRowName(value: string); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents DBox indicator. * * @category Indicators */ class DBox extends Indicator { static get type(): string; /** * The period. */ get period(): number; set period(value: number); protected onResetDefaults(): void; protected onInputTick(): void; getLocalizationKeys(): string[]; } } declare module FintaChart { /** * Represents TEMA indicator. * * @category Indicators */ class TEMA extends Indicator { static get type(): string; private _ema1; private _ema2; private _ema3; get inputDataRowName(): string; set inputDataRowName(value: string); /** * The period. */ get period(): number; set period(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents VWAP indicator. * * @category Indicators */ class VWAP extends Indicator { static get type(): string; /** * The period. */ get period(): number; set period(value: number); protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents TRIX indicator. * * @category Indicators */ class TRIX extends Indicator { static get type(): string; private _default; private _ema1; private _ema2; private _emaDefault; private _emaTriple; private _trixSignal; get inputDataRowName(): string; set inputDataRowName(value: string); /** * The period. */ get period(): number; set period(value: number); get multiplier(): number; set multiplier(value: number); /** * The signal period. */ get signalPeriod(): number; set signalPeriod(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents ADXR indicator. * * @category Indicators */ class ADXR extends Indicator { static get type(): string; private _adx; /** * The period. */ get period(): number; set period(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents FOSC indicator. * * @category Indicators */ class FOSC extends Indicator { static get type(): string; private _tsf; get inputDataRowName(): string; set inputDataRowName(value: string); /** * The period. */ get period(): number; set period(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents MACD indicator. * * @category Indicators */ class MACD extends Indicator { static get type(): string; private _constant1; private _constant2; private _constant3; private _constant4; private _constant5; private _constant6; private _fastEma; private _slowEma; /** * The fast EMA period. */ get fast(): number; set fast(value: number); get inputDataRowName(): string; set inputDataRowName(value: string); /** * The period. */ get period(): number; set period(value: number); /** * The slow EMA period. */ get slow(): number; set slow(value: number); /** * The smooth. */ get smooth(): number; set smooth(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents VROC indicator. * * @category Indicators */ class VROC extends Indicator { static get type(): string; private _sma; private _smaVolume; /** * The period. */ get period(): number; set period(value: number); /** * The smooth value. */ get smooth(): number; set smooth(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents RAVI indicator. * * @category Indicators */ class RAVI extends Indicator { static get type(): string; private _vidyaLong; private _vidyaShort; get inputDataRowName(): string; set inputDataRowName(value: string); /** * The long cycle. */ get longCycle(): number; set longCycle(value: number); /** * The short cycle. */ get shortCycle(): number; set shortCycle(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents VIDYA indicator. * * @category Indicators */ class VIDYA extends Indicator { static get type(): string; private _lr; get inputDataRowName(): string; set inputDataRowName(value: string); /** * The period. */ get period(): number; set period(value: number); /** * The R2 scale. */ get r2Scale(): number; set r2Scale(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents VOLMA indicator. * * @category Indicators */ class VOLMA extends Indicator { static get type(): string; private _ema; /** * The period. */ get period(): number; set period(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents ZLEMA indicator. * * @category Indicators */ class ZLEMA extends Indicator { static get type(): string; private _k; private _lag; private _oneMinusK; get inputDataRowName(): string; set inputDataRowName(value: string); /** * The period. */ get period(): number; set period(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents Range indicator. * * @category Indicators */ class Range extends Indicator { static get type(): string; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents Std. Dev indicator. * * @category Indicators */ class StdDev extends Indicator { static get type(): string; private _sumDataRows; get inputDataRowName(): string; set inputDataRowName(value: string); /** * The period. */ get period(): number; set period(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents Aroon indicator * * @category Indicators */ class Aroon extends Indicator { static get type(): string; private _runningMax; private _runningMaxBar; private _runningMin; private _runningMinBar; /** * The period. */ get period(): number; set period(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents Momentum indicator. * * @category Indicators */ class Momentum extends Indicator { static get type(): string; get inputDataRowName(): string; set inputDataRowName(value: string); /** * The period. */ get period(): number; set period(value: number); protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents Stochastics indicator. * * @category Indicators */ class Stochastics extends Indicator { static get type(): string; private _d; private _den; private _fastK; private _k; private _max; private _min; private _nom; private _smaFastK; private _smaK; /** * The %D period. */ get periodD(): number; set periodD(value: number); /** * The %K period. */ get periodK(): number; set periodK(value: number); /** * The smoothing period. */ get smooth(): number; set smooth(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents Stochastics Fast indicator. * * @category Indicators */ class StochasticsFast extends Indicator { static get type(): string; private _d; private _den; private _k; private _max; private _min; private _nom; private _smaK; /** * The %D period. */ get periodD(): number; set periodD(value: number); /** * The %K period. */ get periodK(): number; set periodK(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents MA Envelopes indicator. * * @category Indicators */ class MAEnvelopes extends Indicator { static get type(): string; private _ema; private _hma; private _sma; private _tema; private _tma; private _variable; private _vidya; private _wma; private _wws; /** * The envelope percentage. */ get envelopePercentage(): number; set envelopePercentage(value: number); get inputDataRowName(): string; set inputDataRowName(value: string); /** * The MA type. */ get maType(): number; set maType(value: number); /** * The period. */ get period(): number; set period(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents N Bars Down indicator. * * @category Indicators */ class NBarsDown extends Indicator { static get type(): string; private _barDown; private _lowerHigh; private _lowerLow; /** * The bars count. */ get barCount(): number; set barCount(value: number); protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents Volume Up Down indicator. * * @category Indicators */ class VolumeUpDown extends Indicator { static get type(): string; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents N Bars Up indicator. * * @category Indicators */ class NBarsUp extends Indicator { static get type(): string; private _barUp; private _higherHigh; private _higherLow; /** * The bars count. */ get barCount(): number; set barCount(value: number); protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents Log Change indicator. * * @category Indicators */ class LogChange extends Indicator { static get type(): string; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents Bollinger indicator. * * @category Indicators */ class Bollinger extends Indicator { static get type(): string; private _sma; private _stdDev; /** * The standard deviation. */ get numStdDev(): number; set numStdDev(value: number); /** * The period. */ get period(): number; set period(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; getLocalizationKeys(): string[]; } } declare module FintaChart { /** * Represents Arron Oscillator indicator. * * @category Indicators */ class AroonOscillator extends Indicator { static get type(): string; /** * The period. */ get period(): number; set period(value: number); protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents Typical Price indicator. * * @category Indicators */ class TypicalPrice extends Indicator { static get type(): string; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents Median Price indicator. * * @category Indicators */ class MedianPrice extends Indicator { static get type(): string; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents Weighted Close indicator. * * @category Indicators */ class WeightedClose extends Indicator { static get type(): string; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents Swing index indicator. * * @category Indicators */ class SwingIndex extends Indicator { static get type(): string; private _a; private _b; private _c; private _ct; private _cy; private _ht; private _k; private _lt; private _ot; private _oy; private _r; /** * The limit value. */ get limitValue(): number; set limitValue(value: number); protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents Elder Thermometer indicator. * * @category Indicators */ class ElderThermometer extends Indicator { static get type(): string; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents Historical Volatility indicator. * * @category Indicators */ class HistoricalVolatility extends Indicator { static get type(): string; private _barHistory; private _stdDev; private _stdDataRows; get inputDataRowName(): string; set inputDataRowName(value: string); /** * The period. */ get period(): number; set period(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents Market Facilitation Index indicator. * * @category Indicators */ class MarketFacilitationIndex extends Indicator { static get type(): string; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents Performance Index indicator. * * @category Indicators */ class PerformanceIndex extends Indicator { static get type(): string; private _firstPrice; get inputDataRowName(): string; set inputDataRowName(value: string); protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents McGinley Dynamic indicator. * * @category Indicators */ class McGinleysDynamic extends Indicator { static get type(): string; private _ema; get inputDataRowName(): string; set inputDataRowName(value: string); /** * The period. */ get period(): number; set period(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents Linear Regression indicator. * * @category Indicators */ class LinearRegression extends Indicator { static get type(): string; get inputDataRowName(): string; set inputDataRowName(value: string); /** * The period. */ get period(): number; set period(value: number); protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents Center Of Gravity indicator. * * @category Indicators */ class CenterOfGravity extends Indicator { static get type(): string; get inputDataRowName(): string; set inputDataRowName(value: string); /** * The period. */ get period(): number; set period(value: number); protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents Coppock Curve indicator. * * @category Indicators */ class CoppockCurve extends Indicator { static get type(): string; private _roc; private _roc1; private _dataRows; private _wma; get inputDataRowName(): string; set inputDataRowName(value: string); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents True Range indicator. * * @category Indicators */ class TrueRange extends Indicator { static get type(): string; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents Linear Regression Forecast indicator. * * @category Indicators */ class LinearRegressionForecast extends Indicator { static get type(): string; get inputDataRowName(): string; set inputDataRowName(value: string); /** * The period. */ get period(): number; set period(value: number); protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents Linear Regression Slope indicator. * * @category Indicators */ class LinearRegressionSlope extends Indicator { static get type(): string; get inputDataRowName(): string; set inputDataRowName(value: string); /** * The period. */ get period(): number; set period(value: number); protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents Linear Regression Intercept indicator. * * @category Indicators */ class LinearRegressionIntercept extends Indicator { static get type(): string; get inputDataRowName(): string; set inputDataRowName(value: string); /** * The period. */ get period(): number; set period(value: number); protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents HIGH LOW Bands indicator. * * @category Indicators */ class HighLowBands extends Indicator { static get type(): string; private _vidyaClose; private _vidyaHigh; private _vidyaLow; /** * The period. */ get period(): number; set period(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents Elder Ray indicator. * * @category Indicators */ class ElderRay extends Indicator { static get type(): string; private _ema; private _hma; private _sma; private _tema; private _tma; private _variable; private _vidya; private _wma; private _wws; /** * The MA type. */ get maType(): number; set maType(value: number); /** * The period. */ get period(): number; set period(value: number); getLocalizationKeys(): string[]; protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; private maIndicator; } } declare module FintaChart { /** * Represents Stoch. RSI indicator. * * @category Indicators */ class StochRSI extends Indicator { static get type(): string; private _max; private _min; private _rsi; get inputDataRowName(): string; set inputDataRowName(value: string); /** * The period. */ get period(): number; set period(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents Deviation to MA indicator. * * @category Indicators */ class DeviationToMA extends Indicator { static get type(): string; /** * The period. */ get period(): number; set period(value: number); protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents Chaikin Money Flow indicator. * * @category Indicators */ class ChaikinMoneyFlow extends Indicator { static get type(): string; private _moneyFlow; private _sumMoneyFlow; private _sumVolume; /** * The period. */ get period(): number; set period(value: number); get multiplier(): number; set multiplier(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents Chaikin Volatility indicator. * * @category Indicators */ class ChaikinVolatility extends Indicator { static get type(): string; private _ema; /** * The MA period. */ get maPeriod(): number; set maPeriod(value: number); /** * The ROC period. */ get rocPeriod(): number; set rocPeriod(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents Chaikin Oscillator indicator. * * @category Indicators */ class ChaikinOscillator extends Indicator { static get type(): string; private _cummulative; private _emaFast; private _emaSlow; private _moneyFlow; /** * The fast EMA period. */ get fast(): number; set fast(value: number); /** * The slow EMA period. */ get slow(): number; set slow(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents Price Oscillator indicator. * * @category Indicators */ class PriceOscillator extends Indicator { static get type(): string; private _emaFast; private _emaSlow; private _emaSmooth; private _smoothEma; /** * The fast EMA period. */ get fast(): number; set fast(value: number); /** * The slow EMA period. */ get slow(): number; set slow(value: number); /** * The smooth value. */ get smooth(): number; set smooth(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents Donchian Channel indicator. * * @category Indicators */ class DonchianChannel extends Indicator { static get type(): string; private _max; private _min; /** * The period. */ get period(): number; set period(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents Key Reversal Down indicator. * * @category Indicators */ class KeyReversalDown extends Indicator { static get type(): string; private _max; /** * The period. */ get period(): number; set period(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * The Key Reversal Up indicator. * * @category Indicators */ class KeyReversalUp extends Indicator { static get type(): string; private _min; /** * The period. */ get period(): number; set period(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents Ease of Movement indicator. * * @category Indicators */ class EaseOfMovement extends Indicator { static get type(): string; private _ema; private _emv; private _boxRatio; private _smoothedBoxRatio; /** * The smooth value. */ get smooth(): number; set smooth(value: number); /** * The volume divisor. */ get volumeDivisor(): number; set volumeDivisor(value: number); /** * The box ratio smoothing period. */ get boxRatioSmoothing(): number; set boxRatioSmoothing(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents Volume Oscillator indicator. * * @category Indicators */ class VolumeOscillator extends Indicator { static get type(): string; private _smaFast; private _smaSlow; private _emaFast; private _emaSlow; /** * The fast SMA period. */ get fast(): number; set fast(value: number); /** * The period. */ get period(): number; set period(value: number); /** * The slow SMA period. */ get slow(): number; set slow(value: number); /** * The maType period. */ get maType(): number; set maType(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents Williams R indicator. * * @category Indicators */ class WilliamsR extends Indicator { static get type(): string; private _max; private _min; /** * The period. */ get period(): number; set period(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents Keltner Channel indicator. * * @category Indicators */ class KeltnerChannel extends Indicator { static get type(): string; private _diff; private _smaDiff; private _smaTypical; /** * The offset multiplier. */ get offsetMultiplier(): number; set offsetMultiplier(value: number); /** * The period. */ get period(): number; set period(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents Ultimate Oscillator indicator. * * @category Indicators */ class UltimateOscillator extends Indicator { static get type(): string; private _buyingPressure; private _constant1; private _constant2; private _constant3; private _sumBpFast; private _sumBpIntermediate; private _sumBpSlow; private _sumTrFast; private _sumTrIntermediate; private _sumTrSlow; private _trueRange; /** * The fast SUM period. */ get fast(): number; set fast(value: number); /** * The intermediate SUM period. */ get intermediate(): number; set intermediate(value: number); /** * The slow SUM period. */ get slow(): number; set slow(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { const IchimokuColor: { tenka: string; kijun: string; chikou: string; senkouA: string; senkouB: string; belowFill: string; aboveFill: string; }; enum IchimokuDataRowsName { TENKA = "Tenkan Sen", KIJUN = "Kijun Sen", CHIKOU = "Chikou Span", SENKOU_A = "Senkou Span A", SENKOU_B = "Senkou Span B" } /** * Represents Ichimoku indicator. * * @category Indicators */ class Ichimoku extends Indicator { static get type(): string; /** * The base line periods. */ get baseLinePeriods(): number; set baseLinePeriods(value: number); /** * The conversion line periods. */ get conversionLinePeriods(): number; set conversionLinePeriods(value: number); /** * The displacement. */ get displacement(): number; set displacement(value: number); /** * The logging span 2 periods. */ get loggingSpan2Periods(): number; set loggingSpan2Periods(value: number); protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { interface IMoonPhases { [phaseType: number]: IMoonPhase[]; } const MoonPhasesIndicatorParam: { GrowingMoonEnabled: string; WaningMoonEnabled: string; GrowingMoonColor: string; WaningMoonColor: string; FullMoonMarkEnabled: string; FullMoonMarkSize: string; FullMoonMarkColor: string; NewMoonMarkEnabled: string; NewMoonMarkSize: string; NewMoonMarkColor: string; }; /** * Represents Moon Phases indicator. * * @category Indicators */ class MoonPhases extends Indicator { static get type(): string; private _plot; private _moonPhases; private _moonPhaseCalculator; private get scaleCoordinateMapper(); get canChangePane(): boolean; get applyIndicator(): boolean; set applyIndicator(value: boolean); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; protected subscribe(): void; protected unsubscribe(): void; protected onBarsSet(event: IValueChangedEvent): void; protected onBarsInserted(event: IValueChangedEvent): void; protected onVisibilityChanged(visible: boolean): void; protected onParameterUpdated(changes: IIndicatorParameterChanges): void; dispose(): void; private getMoonPhases; private prependMoonPhases; private appendMoonPhases; private setMoonPhases; private updatePlotSettings; private onLastVisibleRecordChange; private getLastPhaseDate; } } declare module FintaChart { enum PatternsIndicatorScannerType { Fractals = "Fractals", ZigZags = "Zig Zags" } enum PatternsIndicatorFractalsDisplayType { DIAMOND = "Diamond", DOT = "Dot", ARROW = "Arrow" } const PatternsIndicatorParams: { ScannerType: string; ZigZagDeviation: string; ZigZagDepth: string; ZigZagBackstep: string; MinDistance: string; MaxDistance: string; FractalsPrecision: string; Confidence: string; PatternsToRecognize: string; }; /** * Represents patterns indicator. * * @category Indicators */ class PatternsIndicator extends Indicator { static get type(): string; size: number; fractalCalculator: FractalCalculator; zigZagCalculator: ZigZagCalculator; private _shapes; private _patterns; private _fractalsHash; private _patternsHash; private _fractals; private _minDistance; private _maxDistance; private _datesCount; private _lastHigh; private _lastLow; allPatterns: IPattern[]; private _patternToScan; private get scaleCoordinateMapper(); get canChangePane(): boolean; get applyIndicator(): boolean; set applyIndicator(value: boolean); get scannerType(): PatternsIndicatorScannerType; get zigZagDeviation(): number; get zigZagDepth(): number; get zigZagBackstep(): number; get fractalsPrecision(): number; get confidence(): number; get patternsToRecognize(): string[]; get defaultTheme(): any; protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; protected onVisibilityChanged(visible: boolean): void; protected onParameterUpdated(changes: IIndicatorParameterChanges): void; protected onThemeChanged(): void; private drawOnChartByFractals; private getDrawingTheme; paint(): void; private paintMarkers; private paintDiamondMarkers; private paintDotMarkers; private paintUpArrows; private paintDownArrows; /** * Show settings dialog */ showSettingsDialog(): void; dispose(): void; } } declare module FintaChart { const ZigZagIndicatorParams: { Deviation: string; Depth: string; Backstep: string; }; /** * Represents Zig Zag indicator. * * @category Indicators */ class ZigZagIndicator extends Indicator { static get type(): string; calculator: ZigZagCalculator; private _zigZags; private get scaleCoordinateMapper(); get canChangePane(): boolean; get applyIndicator(): boolean; set applyIndicator(value: boolean); get deviation(): number; get depth(): number; get backstep(): number; protected onResetDefaults(): void; onInitializeIndicator(): void; protected onInputTick(): void; paint(): void; } } declare module FintaChart { enum FractalsIndicatorFractalsDisplayType { DIAMOND = "Diamond", DOT = "Dot", ARROW = "Arrow" } const FractalsIndicatorParams: { Precision: string; }; /** * @category Indicators */ class FractalsIndicator extends Indicator { static get type(): string; private _fractals; private get scaleCoordinateMapper(); get canChangePane(): boolean; get applyIndicator(): boolean; set applyIndicator(value: boolean); get precision(): number; size: number; calculator: FractalCalculator; constructor(); protected onResetDefaults(): void; onInitializeIndicator(): void; protected onInputTick(): void; paint(): void; private paintMarkers; private paintUpArrows; private paintDownArrows; } } declare module FintaChart { /** * @description Provides model of Visible Range Profiles indicator * * @export * @class VisibleRangeProfiles * @extends {Indicator} */ class VisibleRangeProfiles extends Indicator { private _plot; /** * @description Get instance type name * * @readonly * @static * @property {string} instanceTypeName * @memberof VisibelRangeProfiles */ static get type(): string; /** * @description Get show values in title * * @property {boolean} showValuesInTitle * @memberof VisibleRangeProfiles */ get showValuesInTitle(): boolean; /** * @description Set show values in title * * @property {boolean} showValuesInTitle * @memberof VisibleRangeProfiles */ set showValuesInTitle(value: boolean); /** * @description Get rows number value * * @property {number} rowsNumber * @memberof VisibleRangeProfiles */ get rowsNumber(): number; /** * @description Set rows number value * * @property {number} rowsNumber * @memberof VisibleRangeProfiles */ set rowsNumber(value: number); /** * @description Get VA percent value * * @property {number} VAPercent * @memberof VisibleRangeProfiles */ get VAPercent(): number; /** * @description Set VA percent value * * @property {number} VAPercent * @memberof VisibleRangeProfiles */ set VAPercent(value: number); /** * @description Get step value * * @property {number} step * @memberof VisibleRangeProfiles */ get step(): number; /** * @description Set step value * * @property {number} step * @memberof VisibleRangeProfiles */ set step(value: number); /** * @description Get size value * * @property {number} size * @memberof VisibleRangeProfiles */ get size(): number; /** * @description Set size value * * @property {number} size * @memberof VisibleRangeProfiles */ set size(value: number); /** * @description subscribe on events * * @protected * @memberof VisibleRangeProfiles */ protected subscribe(): void; /** * @description unsubscribe on events * * @protected * @memberof VisibelRangeProfiles */ protected unsubscribe(): void; /** * @description Callback ith new tick to update indicator calculations * * @memberof VisibleRangeProfiles */ onInputTick(): void; /** * @description Callback to initialize indicator * * @memberof VisibleRangeProfiles */ onInitializeIndicator(): void; /** * Get plots */ get plots(): Plot[]; /** * @description Callback to reset indicator settings to default state * * @memberof VisibleRangeProfiles */ onResetDefaults(): void; /** * @description Perform remove indicator * * @memberof VisibleRangeProfiles */ remove(): void; /** * @description Calculate Visible Range Profiles indicator values * * @memberof VisibleRangeProfiles */ private _calcVPVR; /** * @description Calculate segment intersection * @param {number} y1 * @param {number} y2 * @param {number} y3 * @param {number} y4 * @returns {number} Intersection * @memberof VisibleRangeProfiles */ private _calculateInter; private setSavedParameters; private setPlotTheme; private updatePlotTheme; } } declare module FintaChart { /** * @description Provides model of Daily Profiles indicator * * @export * @class DailyProfiles * @extends {Indicator} */ class DailyProfiles extends Indicator { private _plot; /** * @description Get instance type name * * @readonly * @static * @property {string} instanceTypeName * @memberof DailyProfiles */ static get type(): string; /** * @description Get show values in title * * @property {boolean} showValuesInTitle * @memberof DailyProfiles */ get showValuesInTitle(): boolean; /** * @description Set show values in title * * @property {boolean} showValuesInTitle * @memberof DailyProfiles */ set showValuesInTitle(value: boolean); /** * @description Get session start hour * * @property {number} sessionT0 * @memberof DailyProfiles */ get sessionT0(): number; /** * @description Set session start hour * * @property {boolean} sessionT0 * @memberof DailyProfiles */ set sessionT0(value: number); /** * @description Get rows number value * * @property {number} rowsNumber * @memberof DailyProfiles */ get rowsNumber(): number; /** * @description Set rows number value * * @property {number} rowsNumber * @memberof DailyProfiles */ set rowsNumber(value: number); /** * @description Get VA percent value * * @property {number} VAPercent * @memberof DailyProfiles */ get VAPercent(): number; /** * @description Set VA percent value * * @property {number} VAPercent * @memberof DailyProfiles */ set VAPercent(value: number); /** * @description Get step value * * @property {number} step * @memberof DailyProfiles */ get step(): number; /** * @description Set step value * * @property {number} step * @memberof DailyProfiles */ set step(value: number); /** * @description Get size value * * @property {number} size * @memberof VisibleRangeProfiles */ get size(): number; /** * @description Set size value * * @property {number} size * @memberof VisibleRangeProfiles */ set size(value: number); /** * @description subscribe on events * * @protected * @memberof DailyProfiles */ protected subscribe(): void; /** * @description unsubscribe on events * * @protected * @memberof DailyProfiles */ protected unsubscribe(): void; /** * @description Callback ith new tick to update indicator calculations * * @memberof DailyProfiles */ onInputTick(): void; /** * @description Callback to initialize indicator * * @memberof DailyProfiles */ onInitializeIndicator(): void; /** * Get plots */ get plots(): Plot[]; /** * @description Callback to reset indicator settings to default state * * @memberof DailyProfiles */ onResetDefaults(): void; /** * @description Perform remove indicator * * @memberof DailyProfiles */ remove(): void; /** * @description Calculate Daily Profiles indicator values * * @memberof DailyProfiles */ private _calcVPSV; /** * @description Calculate segment intersection * @param {number} y1 * @param {number} y2 * @param {number} y3 * @param {number} y4 * @returns {number} Intersection * @memberof DailyProfiles */ private _calculateInter; private setPlotTheme; private updatePlotTheme; } } declare module FintaChart { /** * Represents Trend indicator. * * @category Indicators */ class Trend extends Indicator { static get type(): string; private _emaLow; private _prevVerticalScaleRange; private _verticalScaleRange; get inputDataRowName(): string; set inputDataRowName(value: string); /** * The period. */ get period(): number; set period(value: number); protected onInitializeIndicator(): void; protected onResetDefaults(): void; protected onInputTick(): void; } } declare module FintaChart { /** * Represents indicator context menu configuration. * */ interface IIndicatorContextMenuConfig extends IContextMenuConfig { indicator: Indicator; } /** * Provides model of indicator context menu * */ class IndicatorContextMenu extends ContextMenu { static readonly MenuItem: { about: string; settings: string; applyIndicator: string; showParams: string; showLabels: string; showTitleValues: string; visible: string; delete: string; mergeUp: string; mergeDown: string; unmergeUp: string; unmergeDown: string; moveToPrice: string; lineLevels: string; }; private static container; /** * Creates an instance of IndicatorContextMenu. * * @param targetDomObject * @param config */ constructor(targetDomObject: HTMLElement, config: IIndicatorContextMenuConfig); private applyText; private initMenu; private static toggleClass; } } declare module FintaChart { } declare module FintaChart { } declare module FintaChart { /** * */ interface IIndicatorsOverviewProvider { getTemplate(indicatorName: string, locale?: string): string; getTemplatesConfig(locale?: string): IIndicatorsOverviewProviderConfig[]; } interface IIndicatorsOverviewProviderConfig { id: string; name: string; description: string; url: string; setting: string[]; } } declare module FintaChart { } declare module FintaChart { type SearchInstrumentPredicate = (query: string, exchange?: string) => Promise; interface VolumeRules { min: number; max: number; step: number; unitsPerInput: number; } /** * Represents chart instrument */ interface IInstrument { /** * Instrument id */ id: string; /** * Instrument symbol name */ symbol: string; /** * Instrument company name */ company?: string; /** * Instrument exchange name */ exchange?: string; /** * Instrument datafeed */ datafeed?: string; /** * Instrument type */ type?: string; /** * Instrument tick size */ tickSize?: number; pricePrecision?: number; mappingId?: string; mappings?: unknown; provider?: string; /** * Instrument contract size */ contractSize?: number; /** * Instrument base currency */ baseCurrency?: string; /** * Instrument quote currency */ currency?: string; /** * Instrument kind */ kind?: string; } class Instrument { static all(): Promise; static filter(symbol: string, filter: string[], page: number, size: number): Promise; static filterById(id: string): Promise; static equals(left: IInstrument, right: IInstrument): boolean; static normalizeTickSize(tickSize: number): number; } } declare module FintaChart { type GetAllExchanges = () => string[]; class Exchange { static all(): string[]; } } declare module FintaChart { class InstrumentChangePopup { private _chart; private _isShown; private _element; private _inp_search; private _resultContainer; private _currentText; private _noResults; private _resultsCount; private _selectedFilters; private _page; private _size; private _isLoad; constructor(chart: Chart); show(value: string): Promise; hide(): void; private highlightDropDownItem; private _loadTemplate; private _initializePopup; private _initFields; private _subscribeEvents; private _setValue; private _getInstrumentBySymbol; private _generateListElement; private generateExchangeFilters; private _highlightHTMLText; private _searchTextPositions; private _getInputValue; private _getInstruments; private _generateSearchResults; private _search; private _scrollTopList; } } declare module FintaChart { } declare module FintaChart { } declare module FintaChart { } declare module FintaChart { interface ICompareInstrumentHandlerState { /** * base index */ baseIndex: number; /** * Represents base source */ baseSource: CompareInstrumentSource; /** * Represents Instrument options */ instrumentOptions: IInstrumentCompareSettingsOptions[]; /** * Previous vertical scale state */ previousStateVerticalScale: IVerticalAxisState; } /** * Represents comparing theme handler * */ interface ICompareInstrumentTheme { /** * Represents line color */ lineColor?: string; /** * Represents line style */ lineStyle?: string; /** * Line width */ lineWidth?: number; /** * visible */ visible?: boolean; } /** * */ enum CompareInstrumentSource { OPEN = ".open", HIGH = ".high", LOW = ".low", CLOSE = ".close" } /** * Represents instrument comparison handler * */ class CompareInstrumentHandler implements IBasePriceHolder, IStateable, IDisposable { private readonly _chart; private _basePrice; private _instrumentsCompare; private _options; /** * Creates an instance of CompareInstrumentHandler. * * @param chart */ constructor(chart: Chart); /** * Get base index */ get baseIndex(): number; set baseIndex(value: number); /** * Get base price */ get basePrice(): number; /** * Get base source */ get baseSource(): CompareInstrumentSource; set baseSource(value: CompareInstrumentSource); /** * Get chart */ get chart(): Chart; /** * Get instrument compare */ get instrumentsCompare(): InstrumentCompareSettings[]; /** * Get pane */ get pane(): Pane; /** * Get load more history complete */ get loadMoreHistoryComplete(): boolean; /** * Cancels comparing * * @param instrumentsCompare */ cancelComparing(...instrumentsCompare: (InstrumentCompareSettings | InstrumentCompareSettings[])[]): void; /** * Compares * * @param instance */ compare(instance: InstrumentCompareSettings): void; /** * Creates instance * * @param instrument * @param source * @param instrumentTheme */ createInstance(instrument: IInstrument, source?: CompareInstrumentSource, instrumentTheme?: ICompareInstrumentTheme): InstrumentCompareSettings; dispose(): void; restoreState(state: ICompareInstrumentHandlerState): void; saveState(): ICompareInstrumentHandlerState; /** * Refreshes * * @param updateInstruments */ refresh(updateInstruments?: boolean): void; private applyPercentageVerticalScale; private calculateDataRows; private cancelPercentageVerticalScale; private onMoreHistoryRequest; private onTimeFrameChange; private subscribeEvents; private unsubscribeEvents; private updateHoverRecord; private updateInstruments; } } declare module FintaChart { /** * Represents Instrument Compare Settings Config * */ interface IInstrumentCompareSettingsConfig extends IInstrumentCompareSettingsOptions { /** * Instrument Compare Settings handler instrument comparison */ handlerInstrumentComparison: CompareInstrumentHandler; } /** * Represents Instrument Compare Settings Options * */ interface IInstrumentCompareSettingsOptions { /** * Allow about dialog */ allowAboutDialog?: boolean; /** * Allow check scale vertical floating label */ allowCheckVerticalAxisLabel?: boolean; /** * Allow settings dialog */ allowSettingsDialog?: boolean; /** * Instrument Compare Settings instrument */ instrument: IInstrument; /** * Instrument Compare Settings line color */ lineColor?: string; /** * Instrument Compare Settings line style */ lineStyle?: string; /** * Instrument Compare Settings line width */ lineWidth?: number; /** * Instrument Compare Settings plot */ plot?: IPaneObjectState; /** * Instrument Compare Settings plot theme */ plotTheme?: IPaneTheme & { visible?: boolean; }; /** * Is show title */ showTitle?: boolean; /** * Instrument Compare Settings source */ source: CompareInstrumentSource; /** * Is visible */ visible?: boolean; } /** * Provides model of Instrument Compare Settings * */ class InstrumentCompareSettings implements IDisposable, IStateable { /** * Instrument Compare Setting's defaults */ static readonly defaults: { allowSettingsDialog: boolean; allowAboutDialog: boolean; allowCheckVerticalAxisLabel: boolean; }; private readonly _pane; private _comparingDelta; private _currentBarsRequest; private _newBarsRequest; private _options; private _plot; private _titleContextMenu; private _titleControls; private _titleParameters; private _handlerInstrumentComparison; private _lastCatchUpAttempt; private _isCatchingUp; /** * Get Instrument Compare Setting's allow about dialog */ get allowAboutDialog(): boolean; set allowAboutDialog(value: boolean); /** * Get Instrument Compare Setting's allow check scale vertical floating label */ get allowCheckVerticalAxisLabel(): boolean; set allowCheckVerticalAxisLabel(value: boolean); /** * Get Instrument Compare Setting's allow settings dialog */ get allowSettingsDialog(): boolean; set allowSettingsDialog(value: boolean); /** * Get Instrument Compare Setting's chart */ get chart(): Chart; /** * Get Instrument Compare Setting's instrument */ get instrument(): IInstrument; /** * Get Instrument Compare Setting's line color */ get lineColor(): string; set lineColor(value: string); /** * Get Instrument Compare Setting's line style */ get lineStyle(): string; set lineStyle(value: string); /** * Get Instrument Compare Setting's line width */ get lineWidth(): number; set lineWidth(value: number); /** * Get Instrument Compare Setting's pane */ get pane(): Pane; /** * Get Instrument Compare Setting's plot */ get plot(): LinePlot; /** * Get Instrument Compare Setting's ready load more history */ get readyLoadMoreHistory(): boolean; /** * Set Instrument Compare Setting's show scale vertical floating label */ set showVerticalAxisLabel(value: boolean); get showVerticalAxisLabel(): boolean; /** * Get Instrument Compare Setting's show title */ get showTitle(): boolean; set showTitle(value: boolean); /** * Get Instrument Compare Setting's source */ get source(): CompareInstrumentSource; set source(value: CompareInstrumentSource); /** * Get Instrument Compare Setting's visible */ get visible(): boolean; set visible(value: boolean); /** * Get sanitized symbol * * @return {string} */ private get sanitizedSymbol(); /** * Creates an instance of InstrumentCompareSettings. * * @param config */ constructor(config: IInstrumentCompareSettingsConfig); /** * Initializes compare */ initializeCompare(): void; /** * Calculates data rows * * @param baseMasterPrice * @param fromIndex * @param toIndex */ calculateDataRows(baseMasterPrice: number | null, fromIndex: number, toIndex: number, isComparer?: boolean): boolean; dispose(): void; private removeDataRows; restoreState(state: IInstrumentCompareSettingsOptions): void; /** * On more history requests */ onMoreHistoryRequest(): void; /** * On time frame changes */ onTimeFrameChange(): void; saveState(): IInstrumentCompareSettingsOptions; /** * Shows Instrument Compare Setting's dialog */ showSettingsDialog(): void; /** * Toggles Instrument Compare Setting's visibility * * @param visibility */ toggleVisibility(visibility: HTMLElement): void; /** * Refreshes Instrument Compare Settings */ refresh(): void; /** * Updates hover record * * @param record */ updateHoverRecord(record?: number): void; /** * Updates Instrument Compare Setting's title controls visibility */ updateTitleControlsVisibility(): void; /** * Updates Instrument Compare Setting's visibility */ updateVisibility(): void; private initPaneTitle; private init; private requestBars; private requestMoreBars; private requestCatchUpBars; private sendBarsRequest; private setValues; private synchronize; private updateTitle; } } declare module FintaChart { /** * Represents Compare Context Menu Config * */ export interface ICompareInstrumentContextMenuConfig extends IContextMenuConfig { /** * Compare Context Menu Config instrument compare settings */ instrumentCompareSettings: InstrumentCompareSettings; } enum CompareInstrumentContextMenuItem { SETTINGS = "settings", SHOW_FLOATING_LABELS = "showLabels", VISIBLE = "visible", DELETE = "delete" } /** * Provides model of Compare Context Menu * */ export class CompareInstrumentContextMenu extends ContextMenu { private static container; /** * Compare Context Menu's menu item */ static MenuItem: typeof CompareInstrumentContextMenuItem; /** * Creates an instance of CompareInstrumentContextMenu. * * @param targetDomObject * @param config */ constructor(targetDomObject: HTMLElement, config: ICompareInstrumentContextMenuConfig); private init; private static toggleClass; } export {}; } declare module FintaChart { } declare module FintaChart { /** * Represents pane config */ interface IPaneConfig { /** * Options */ options?: any; /** * Pane container */ panesContainer: PanesContainer; } /** * Represents pane theme */ interface IPaneTheme { /** * Dots */ dots: IFillTheme; /** * Grid */ grid: IStrokeTheme; /** * Title */ title: ITextTheme; /** * Watermark */ watermark: IPaneWatermarkTheme; } enum PaneMoveDirection { NONE = "none", HORIZONTAL = "horizontal", VERTICAL = "vertical", ANY = "any" } enum PaneMoveKind { NORMAL = "normal", AUTOSCALED = "autoscaled" } /** * Describes the payload of the click events fired by a pane and by the chart. * * Delivered as the `value` field of the event object: * `chart.on(ChartEvent.CLICKED, e => console.log(e.value.price, e.value.date))` */ interface IChartClickInfo { /** * The pane the click happened in. */ pane: Pane; /** * Whether the clicked pane is the main (price) pane. */ isPrimaryPane: boolean; /** * The date under the click position. */ date: Date; /** * The formatted date, as shown on the horizontal axis. */ dateText: string; /** * The index of the bar (record) under the click position. * May be out of the data range when clicking the empty space right of the last bar. */ bar: number; /** * The value of the pane's main vertical scale under the click position. * On the primary pane this is the price, on an indicator pane it is the indicator value. */ price: number; /** * The formatted price, as shown on the vertical axis. */ priceText: string; /** * The click x coordinate, in chart coordinates. */ x: number; /** * The click y coordinate, relative to the clicked pane. */ y: number; /** * The original DOM event. */ nativeEvent: Event; } const PaneEvent: { THEME_CHANGED: string; X_GRID_VISIBLE_CHANGED: string; Y_GRID_VISIBLE_CHANGED: string; PLOT_ADDED: string; PLOT_REMOVED: string; SHAPE_ADDED: string; OBJECT_ADDED: string; SHAPE_REMOVED: string; OBJECT_REMOVED: string; DOUBLE_CLICKED: string; CONTEXT_MENU: string; CLICKED: string; }; let formatConfig: IPaneTitleMenuConfig | undefined; /** * Represents Pane state enum */ const enum PaneState { /** * Normal state */ NORMAL = 0, /** * Maximized state */ MAXIMIZED = 1 } interface ITradingSessionRange { market: string; startPreSession: string; startSession: string; endSession: string; endAfterSession: string; timezone?: string; } /** * Bar-info title/card control (the rendered OHLC / volume widgets on a pane). */ interface IBarInfoControl { rootDiv: HTMLElement; symbol?: HTMLElement; symbolTitle?: HTMLElement; date?: HTMLElement; open: HTMLElement; high: HTMLElement; low: HTMLElement; close: HTMLElement; dataRows: IBarDataRows; ltpValue?: HTMLElement; volume?: HTMLElement; volumeBarFill?: HTMLElement; volumeHistBars?: HTMLElement[]; segments?: HTMLElement[]; indicators?: HTMLElement; sparkline?: HTMLCanvasElement; footer?: HTMLElement; change?: HTMLElement; changePercent?: HTMLElement; isCard?: boolean; draggable?: IDraggableController | null; } /** * Persisted state of a pane. */ interface IPaneState { options?: IPaneOptions; verticalScales?: IVerticalAxisState[]; verticalAxes?: unknown[]; verticalScale?: unknown; objects?: unknown[]; } /** * Config passed to the draggable pane-title initializer. */ interface IPaneTitleMenuConfig { chart: Chart; showOnClick?: boolean; onItemSelected?: (menuItem: HTMLElement) => void; onFormatCostil?: () => void; } /** * Represents pane */ class Pane extends HtmlControl implements IStateable { private static readonly WATERMARK_ORIGINAL_WIDTH; private static readonly WATERMARK_ORIGINAL_HEIGHT; private static readonly WATERMARK_SCALE; private readonly _panesContainer; private _barInfoControls; private _braProgressLine; private _components; private _contentFrame; private _controls; private _layer; private _objects; private _options; private _verticalAxes; private _settings; private _titleNeedsUpdate; private _toggleIndicatorTitles; private _targetSubscriptions; private _optimizeRefresh; private _watermark; private chartContextMenu; private tradingContextMenu; /** * @class * @ignore */ set _stateof(value: string); /** * Get default layout template */ get defaultLayoutTemplate(): IPaneTheme; /** * Get chart */ get chart(): Chart; /** * Get compare instruments */ get compareInstruments(): InstrumentCompareSettings[]; /** * Get components */ get components(): IPaneHtmlComponent[]; /** * Get content frame */ get contentFrame(): Bounds; /** * Get formatter */ get formatter(): INumberFormatter; set formatter(value: INumberFormatter); /** * Get height ratio */ get heightRatio(): number; set heightRatio(ratio: number); /** * Get indicators */ get indicators(): Indicator[]; /** * Get layer */ get layer(): CanvasLayer; /** * Get max height ratio */ get maxHeightRatio(): number; set maxHeightRatio(ratio: number); /** * Get min height ratio */ get minHeightRatio(): number; set minHeightRatio(ratio: number); /** * Get move direction */ get moveDirection(): PaneMoveDirection; set moveDirection(direction: PaneMoveDirection); /** * Get move name */ get moveKind(): PaneMoveKind; set moveKind(value: PaneMoveKind); /** * Objaects */ get objects(): IPaneObject[]; /** * Get pane padding */ get panePadding(): IPadding; set panePadding(value: IPadding); /** * Get panes container */ get panesContainer(): PanesContainer; /** * Gets plots */ get plots(): Plot[]; /** * Get scale coordinate mapper */ get coordinateMapper(): ScaleCoordinateMapper; /** * Get vertical scale */ get verticalAxis(): VerticalAxis; /** * Get vertical scales */ get verticalAxes(): VerticalAxis[]; /** * Get shapes */ get shapes(): Shape[]; /** * Get shapes */ get shapesByInstrument(): Shape[]; get positions(): PositionBar[]; get orders(): OrderBar[]; get alerts(): AlertBar[]; /** * Get show compare titles */ get showCompareTitles(): boolean; set showCompareTitles(value: boolean); /** * Get show indicator titles */ get showIndicatorTitles(): boolean; set showIndicatorTitles(value: boolean); /** * Get state */ get state(): PaneState; set state(value: PaneState); /** * Get theme */ get theme(): IPaneTheme; set theme(value: IPaneTheme); /** * Get title div */ get titleDiv(): HTMLElement; /** * Get visible */ get visible(): boolean; set visible(value: boolean); /** * Get grid x */ get gridX(): boolean; set gridX(visible: boolean); /** * Set grid y */ set gridY(visible: boolean); get gridY(): boolean; get isPreservingAutoScaling(): boolean; /** * Creates an instance of Pane. * * @param config */ constructor(config: IPaneConfig); /** * Adds component * * @param component */ addComponent(component: IPaneHtmlComponent): void; /** * Adds objects * * @param objects */ addObjects(objects: IPaneObject | IPaneObject[]): any; /** * Attaches an indicator to this specific pane. * * Pins the indicator's pane before `chart.addIndicators(...)` runs * the auto-routing, so the indicator lands here regardless of its * `isOverlay` declaration. Use to force an overlay-style indicator * onto a separate pane, or to drop an oscillator-style one onto * the price pane. * * @param indicator Indicator instance to add. * @return The added indicator. */ addIndicator(indicator: Indicator): Indicator; /** * Adds a single shape to the pane (convenience alias for * `addShapes` when working with one shape at a time). * * @param shape Shape instance to add. */ addShape(shape: Shape): void; /** * Adds plots * * @param plots */ addPlot(plots: Plot | Plot[]): any; /** * Adds shapes * * @param shapes */ addShapes(shapes: Shape | Shape[]): any; /** * Returns auto scaled min max * * @param verticalScale */ autoScaledMinMax(verticalScale: VerticalScale): IMinMax; /** * Returns is object contains * * @param object */ containsObject(object: IPaneObject): boolean; /** * Returns is plot contains * * @param plot */ containsPlot(plot: Plot): boolean; /** * Returns is shape contains * * @param shape */ containsShape(shape: Shape): boolean; dispose(): void; paint(): void; /** * Returns true when a shape is fully outside the visible frame and * safe to skip. Extrapolated shapes (lines/rays) and selected shapes * are never culled since they can extend across the viewport. * Uses bounds when available (accurate for text/balloon), otherwise * falls back to points X-check with original buffer (frame.width) to * avoid culling shapes whose visual extends beyond points. */ private isShapeOffscreen; /** Shape types that extend beyond their points and must not be culled. */ private static NON_CULLABLE_SHAPES; static pGrid: number; static pObjects: number; static pIndicators: number; static pHover: number; static pWatermark: number; /** * Executes shapes * * @param shapes */ executeShapes(shapes: Shape | Shape[]): any; /** * Force removes shapes * * @param shapes */ forceRemoveShapes(shapes?: Shape | Shape[]): any; /** * Formats value * * @param value */ formatValue(value: number): string; /** * Formats a volume value in a compact form (e.g. 1.03M, 12.4K). * * @param value */ formatVolume(value: number): string; /** * Returns index * * @return */ getIndex(): number; /** * Returns scale coordinate mapper * * @param verticalScale * @return */ getCoordinateMapper(verticalScale: VerticalScale): ScaleCoordinateMapper; /** * Returns vertical scale * * @param verticalScale * @return */ getVerticalAxis(verticalScale: VerticalScale): VerticalAxis; /** * Returns get shapes between dates * * @param startDate * @param endDate * @return */ getShapesBetweenDates(startDate: Date, endDate: Date): Shape[]; onEvent(event: IWindowEvent): boolean; hitTest(point: IPoint): boolean; resize(frame: Bounds): void; restoreState(state: IPaneState): void; /** * Returns min max * * @param startIndex * @param count * @param verticalScale * @return */ minMax(startIndex: number, count: number, verticalScale: VerticalScale): IMinMax; /** * Returns preferred scale vertical width * * @param chartScale * @return */ preferredVerticalScaleWidth(chartScale: VerticalScale): number; /** * Removes component * * @param component */ removeComponent(component: IPaneHtmlComponent): void; /** * Removes objects * * @param objects */ removeObjects(objects?: IPaneObject | IPaneObject[]): any; /** * Removes plots * plots */ removePlot(plots: Plot | Plot[]): any; /** * Removes shapes * * @param shapes */ removeShapes(shapes?: Shape | Shape[]): any; /** * Renders bar progress * * @param visible * @param countRects * @param intervalInMs * @param coloredBars * @return */ paintBarProgress(visible: boolean, countRects: number, intervalInMs: number, coloredBars: boolean): void; /** * Renders triangle for last bar * * @param visible * @param coloredBars * @return */ paintTriangleForLastBar(visible: boolean, coloredBars: boolean): void; /** * Renders triangle for last bar * * @param visible * @param coloredBars * @return */ paintLineForLastBar(visible: boolean, coloredBars: boolean): void; saveState(): IPaneState; /** * Sets height ratio * * @param ratio */ setHeightRatio(ratio: number): void; /** * Refreshes scale async */ refreshScaleAsync(): void; /** * Refreshes async * * @param makeAutoScale */ refreshAsync(makeAutoScale?: boolean): void; /** * Shows chart type format dialog */ showChartTypeFormatDialog(): void; /** * Undoes shapes * * @param shapes */ unExecuteShapes(shapes?: Shape | Shape[]): void; /** * Refreshes */ refresh(): void; /** * Updates hover record * * @param record * @return */ private _lastHoverKey; updateHoverRecord(record?: number): void; /** * Fills the OHLC card indicator rows for the hovered record. * * @param control The card's bar-info control. * @param record The hovered record index. */ private renderOhlcCardIndicators; /** * Renders the live graphics of an OHLC info card: the volume bar (as a * fraction of the max visible volume) and the price sparkline (the last * N closes up to the hovered record). * * @param control The card's bar-info control. * @param record The hovered record index. * @param color The up/down colour for the current bar. */ private renderOhlcCardGraphics; /** * Draws a price sparkline onto a canvas, scaling to its CSS size and * device pixel ratio for a crisp line. */ private drawSparkline; preserveAutoScaling(): void; cancelAutoScaling(): void; verticalAxisLabelMaxWidth(verticalAxis: VerticalAxis): number; applyLogoWatermark(): void; protected createContainer(): HTMLElement; protected initMotionEvents(): MotionEventArray; /** * Subscribes */ protected subscribe(): void; protected unsubscribe(): void; private onOptimizeRefreshCallback; private setupLayoutTheme; private paintGridLines; private invoke; /** * Subscribes to events fired with this pane as their target * (e.g. `PaneEvent.PLOT_ADDED` from this specific pane, not any). * * Routes through the chart's event emitter and filters by * `event.target === this`. * * @param events Space-delimited event name(s). * @param handler Listener invoked with the matching event. */ on(events: string, handler: IEventHandler): Pane; /** * Unsubscribes from events previously registered via `on`. */ off(events?: string, handler?: IEventHandler): Pane; private getHeight; private getWidth; private onClick; /** * Fires PaneEvent.CLICKED and ChartEvent.CLICKED with the date and the value * under the click position. * * @param event */ private invokeClickEvent; onContextMenu(motionEvent: MotionEvent, event: IWindowEvent): void; private onDoubleClick; private onMouseHover; private onMove; private onMouseWheel; private onPinchZoom; private onClickInternal; private initInstrumentPaneTitle; private initPaneTitle; private initDraggablePaneTitle; private initOHLCCard; private layoutHtmlElements; private motionHitTest; private updateInstrument; private writeWatermark; private _tradingSessionHoursParameters; private _visualizeAfterMarketHours; private _visualizePreMarketHours; private _visualizeCloseMarketHours; private _roundMarketSessionByTimeframe; private _fillMarketArea; private _getMinutes; } } declare module FintaChart { /** * Represents Pane Html Component */ interface IPaneHtmlComponent extends IHtmlComponent { /** * Pane Html Component pane */ pane: Pane; } /** * Represents Pane Html Component Config */ interface IPaneHtmlComponentConfig { /** * Pane Html Component Config pane */ pane?: Pane; } /** * Provides model of Pane Html Component */ abstract class PaneHtmlComponent extends HtmlComponent implements IPaneHtmlComponent { private _pane; /** * Get Pane Html Component chart */ get chart(): Chart; /** * Get Pane Html Component pane */ get pane(): Pane; set pane(value: Pane); /** * Creates an instance of PaneHtmlComponent. * * @param config */ constructor(config?: IPaneHtmlComponentConfig); dispose(): void; /** * On Pane Html Component pane changing */ protected onPaneChanging(): void; /** * On Pane Html Component pane changed */ protected onPaneChanged(): void; /** * Subscribes Pane Html Component */ protected subscribe?(): void; /** * Unsubscribes Pane Html Component */ protected unsubscribe?(): void; } } declare module FintaChart { /** * Represents base pane */ interface IPaneObject extends IDisposable, IStateable { /** * Chart */ chart: Chart; /** * Pane */ pane: Pane; /** * Scale coordinate mapper */ coordinateMapper: ScaleCoordinateMapper; /** * scale vertical */ verticalScale: VerticalScale; /** * Tooltip */ tooltip: Tooltip; zIndex: number; visible: boolean; paintVerticalAxisLabels(): void; getVerticalAxisLabelMaxWidth(): number; paint(): void; } /** * Represents Pane base config */ interface IPaneObjectConfig { /** * Options */ options?: IPaneObjectOptions; } /** * Represents Pane base Options */ interface IPaneObjectOptions { /** * Scale vertical index */ verticalScaleIndex: number; /** * Visible */ visible: boolean; /** * Z-index */ zIndex: number; } /** * Represents pane base state */ interface IPaneObjectState { /** * Options */ options?: IPaneObjectOptions; /** * Pane index */ paneIndex?: number; /** * Scale vertical index */ verticalScaleIndex?: number; /** * Tooltip */ tooltip?: ITooltipState; } /** * Represents pane base */ abstract class PaneObject extends Eventable implements IPaneObject, IDisposable { private _pane; private _prevCursor; private _verticalScale; private _tooltip; private _options; /** * Creates an instance of PaneObject. * * @param config */ protected constructor(config?: IPaneObjectConfig); protected get options(): TOptions; protected set options(value: TOptions); /** * Get chart */ get chart(): Chart; /** * Get pane */ get pane(): Pane; set pane(value: Pane); /** * Get pane scale vertical */ get verticalAxis(): VerticalAxis; /** * Get scale coordinate mapper */ get coordinateMapper(): ScaleCoordinateMapper; /** * Get scale vertical */ get verticalScale(): VerticalScale; set verticalScale(value: VerticalScale); /** * Get tooltip */ get tooltip(): Tooltip; set tooltip(tooltip: Tooltip); /** * Get visible */ get visible(): boolean; set visible(value: boolean); /** * Get z-index */ get zIndex(): number; set zIndex(value: number); /** * Get render */ protected get renderer(): IRenderer; /** * Adds chart css class * * @param cssClass */ addChartCssClass(cssClass: string): void; /** * Changes cursor * * @param cursorCssClass */ changeCursor(cursorCssClass?: string): void; dispose(): void; /** * Paints */ paint(): void; /** * Draws scale vertical floating labels */ paintVerticalAxisLabels(): void; getVerticalAxisLabelMaxWidth(): number; /** * Hide tooltip */ hideTooltip(): void; saveState(): IPaneObjectState; restoreState(state: IPaneObjectState): void; /** * Removes chart css class * * @param cssClass */ removeChartCssClass(cssClass: string): void; private mapColorsToStrings; /** * Shows tooltip * * @param point * @return */ showTooltip(point: IPoint): void; /** * Handles pane changes * * @param oldValue */ protected onPaneChanged(oldValue: Pane): void; /** * Handles vertical scale changes * * @param oldValue */ protected onVerticalScaleChanged(oldValue: VerticalScale): void; /** * Handles visibility changes * * @param oldValue */ protected onVisibleChanged(oldValue: boolean): void; /** * Sets options * * @param key * @param value * @param valueChangedEventName */ protected setOption(key: string, value: any, valueChangedEventName?: string): void; } } declare module FintaChart { /** * Pane container state */ interface IPanesContainerState { /** * Default height ration */ defaultHeightRatio?: number; /** * Pane padding */ panePadding?: IPadding; /** * Panes */ panes?: IPaneState[]; } /** * Represents Pane container */ class PanesContainer extends ChartHtmlControl implements IStateable { private _options; private _panes; private _panesContentFrame; private _splitters; /** * Creates an instance of PanesContainer. * * @param config */ constructor(config: IChartHtmlControlConfig); /** * Get default height ration */ get defaultHeightRatio(): number; set defaultHeightRatio(value: number); /** * Get pane padding */ get panePadding(): IPadding; set panePadding(value: IPadding); /** * Get panes */ get panes(): Pane[]; /** * Panes content frame */ get panesContentFrame(): Bounds; saveState(): IPanesContainerState; restoreState(state: IPanesContainerState): void; /** * Adds pane * * @param index * @param heightRatio * @param reduceHeightPrimaryPane * @return */ addPane(index?: number, heightRatio?: number, reduceHeightPrimaryPane?: boolean): Pane; dispose(): void; paint(): void; /** * Finds pane at * * @param y * @return */ findPaneAt(y: number): Pane; onEvent(event: IWindowEvent): boolean; resize(frame: IBounds): void; /** * Returns layout scale pane * * @param panesFrame * @return */ layoutScalePane(panesFrame: Bounds): Bounds; /** * Update layout split pane * * @param splitter */ layoutSplitterPanes(splitter: IPaneSplitter): void; /** * Move panes * * @param pane * @param offset */ movePane(pane: Pane, offset: number): void; /** * Remove pane * * @param selectedPane */ removePane(selectedPane: number | Pane): void; /** * Refreshes auto scale async */ refreshAutoScaleAsync(): void; /** * Sets pane height ratio * * @param pane * @param ratio */ setPaneHeightRatio(pane: Pane, ratio: number): void; /** * Returns total pane height * * @return */ totalPanesHeight(): number; protected createContainer(): HTMLElement; protected initMotionEvents(): MotionEventArray; protected subscribe(): void; protected unsubscribe(): void; private adjustHeightRatiosToEncloseNewRatio; private availableHeightRatio; private onMouseHover; private mouseHoverHitTest; private updateSplitters; private layoutMaxPane; private layoutNormalPanes; } } declare module FintaChart { } declare module FintaChart { interface IPaneSplitter extends IHtmlControl { /** * The top pane. */ readonly topPane: Pane; /** * The bottom pane. */ readonly bottomPane: Pane; /** * Invalidates splitter theme. */ invalidateTheme(): void; /** * Sets panes. * * @param top The top pane. * @param bottom The bottom pane. */ panes(top: Pane, bottom: Pane): void; } /** * Represents pane splitter */ class PaneSplitter extends HtmlControl implements IPaneSplitter { private _bottomPane; private _isMoving; private _needsTheme; private _prevChartState; private _topPane; static get height(): number; get topPane(): Pane; get bottomPane(): Pane; /** * The parent chart. */ private get chart(); panes(top: Pane, bottom: Pane): void; invalidateTheme(): void; hitTest(point: IPoint): boolean; resize(frame: Bounds): void; protected createContainer(): HTMLElement; protected initMotionEvents(): MotionEventArray; private applyTheme; private onMouseHover; private onMove; private startMove; private stopMove; private move; } } declare module FintaChart { /** * Represents break line config */ interface IBreakLinesConfig extends IPaneObjectConfig { /** * Break lines handler */ handler: BreakLinesHandler; } /** * Represents break lines */ interface IBreakLines extends IPaneObject { } /** * Represents break lines */ class BreakLines extends PaneObject implements IBreakLines { private readonly _handler; /** * Creates an instance of BreakLines. * * @param config */ constructor(config: IBreakLinesConfig); paint(): void; } } declare module FintaChart { type BreakLinesDatePredicate = (date: Date) => boolean; /** * Represents time part */ interface ITimePart { /** * Hours */ hours: number; /** * Minutes */ minutes: number; } /** * Represents break line handler config */ interface IBreakLinesHandlerConfig extends IChartComponentConfig { /** * Date filter */ dateFilter?: BreakLinesDatePredicate; /** * Theme */ theme?: IStrokeTheme; /** * Time */ time?: ITimePart; /** * Visible */ visible?: boolean; } /** * Represents brake lines handler */ interface IBreakLinesHandler extends IChartComponent { /** * Date filter */ dateFilter?: BreakLinesDatePredicate; /** * Theme */ theme: IStrokeTheme; /** * Time */ time: ITimePart; /** * Visible */ visible: boolean; } /** * Represents brake lines handler */ class BreakLinesHandler extends ChartComponent implements IBreakLinesHandler { private readonly _breakLines; private _time; theme: IStrokeTheme; dateFilter: BreakLinesDatePredicate; /** * Creates an instance of BreakLinesHandler. * * @param config */ constructor(config: IBreakLinesHandlerConfig); /** * Get pane */ get pane(): Pane; get time(): ITimePart; set time(value: ITimePart); get visible(): boolean; set visible(value: boolean); /** * Initializes visual dimensions */ InitializeVisualDimensions(): void; } } declare module FintaChart { /** * Represents pickup column theme */ interface IPickupColumnTheme { /** * Fill */ fill: IFillTheme; } /** * Represents pickup column config */ interface IPickupColumnConfig { /** * Date */ date: Date; /** * Theme */ theme?: IPickupColumnTheme; } /** * Represents pickup column */ class PickupColumn extends PaneObject { private readonly _date; theme: IPickupColumnTheme; /** * Get default layout template */ get defaultLayoutTemplate(): IPickupColumnTheme; /** * Get date */ get date(): Date; /** * Creates an instance of PickupColumn. * * @param config */ constructor(config: IPickupColumnConfig); paint(): void; dispose(): void; /** * Checks date * * @param date * @return */ checkDate(date: Date): boolean; } } declare module FintaChart { type TBarColumn = number | Date | IBar; /** * Represents pickup column item */ interface IPickupColumnItem { /** * Column */ column: TBarColumn; /** * Theme */ theme?: IPickupColumnTheme; } type TPickupColumn = TBarColumn | IPickupColumnItem; /** * Represents pickup column handler */ class PickupColumnHandler extends Control { private _chart; private _pickupColumns; private _visible; /** * Creates an instance of PickupColumnHandler. * * @param chart */ constructor(chart: Chart); /** * Get chart */ get chart(): Chart; /** * Get pane */ get pane(): Pane; /** * Get pickup columns */ get pickupColumns(): PickupColumn[]; /** * Get visible */ get visible(): boolean; set visible(value: boolean); /** * Adds columns * * @param columns */ add(...columns: (TPickupColumn)[]): void; /** * Removes columns * * @param columns */ remove(...columns: (TBarColumn)[]): void; dispose(): void; protected initMotionEvents(): MotionEventArray; private addColumn; private removeColumn; private clickHitTest; private onClick; private findIndex; private toggle; } } declare module FintaChart { /** * Represents pricing line config */ export interface IPriceLineConfig extends IPaneObjectConfig { /** * Stretch */ stretch?: boolean; /** * Point */ point?: IDataPoint; /** * Theme */ theme?: IStrokeTheme; /** * Visible */ visible?: boolean; } /** * Represents pricing line */ export interface IPriceLine extends IPaneObject { /** * Stretch */ stretch: boolean; /** * Point */ point: DataPoint; /** * Theme */ theme: IStrokeTheme; } /** * Represents pricing line option */ interface IPriceLineOptions extends IPaneObjectOptions { /** * Stretch */ stretch: boolean; /** * Point */ point: DataPoint; /** * Theme */ theme: IStrokeTheme; } /** * Pricing line */ export class PriceLine extends PaneObject implements IPriceLine { /** * Get stretch */ get stretch(): boolean; set stretch(value: boolean); /** * Get point */ get point(): DataPoint; set point(value: DataPoint); /** * Get theme */ get theme(): IStrokeTheme; set theme(value: IStrokeTheme); /** * Creates an instance of PriceLine. * * @param config */ constructor(config: IPriceLineConfig); paint(): void; restoreState(state: IPaneObjectState): void; } export {}; } declare module FintaChart { /** * Describes price spread theme. */ interface IPriceSpreadTheme { /** * The ask line theme. */ ask?: { line?: IStrokeTheme; label?: { fill?: IFillTheme; text?: ITextTheme; }; }; /** * The bid line theme. */ bid?: { line?: IStrokeTheme; label?: { fill?: IFillTheme; text?: ITextTheme; }; }; } /** * Represents price spread config */ interface IPriceSpreadConfig extends IPaneObjectConfig { /** * Ask */ ask?: number; /** * Bid */ bid?: number; /** * Theme */ theme?: IPriceSpreadTheme; } /** * Represents price spread */ interface IPriceSpread extends IPaneObject { /** * Ask */ ask: number; /** * Bid */ bid: number; /** * Theme */ theme: IPriceSpreadTheme; } /** * Represents price spread options */ interface IPriceSpreadOptions extends IPaneObjectOptions { /** * Ask */ ask?: number; /** * Bid */ bid?: number; /** * Theme */ theme?: IPriceSpreadTheme; } /** * Represents price spread */ class PriceSpread extends PaneObject implements IPriceSpread { /** * Get ask */ get ask(): number; set ask(value: number); /** * Get bid */ get bid(): number; set bid(value: number); /** * Get theme */ get theme(): IPriceSpreadTheme; set theme(value: IPriceSpreadTheme); /** * Creates an instance of PriceSpread. * * @param config */ constructor(config?: IPriceSpreadConfig); paint(): void; paintVerticalAxisLabels(): void; } } declare module FintaChart { /** * Represents price spread handler config */ interface IPriceSpreadHandlerConfig extends IChartComponentConfig { /** * Ask */ ask?: number; /** * Bid */ bid?: number; /** * Theme */ theme?: IPriceSpreadTheme; } /** * Represents price spread handler */ interface IPriceSpreadHandler extends IChartComponent { /** * Ask */ ask: number; /** * Bid */ bid: number; /** * Theme */ theme: IPriceSpreadTheme; /** * Visible */ visible: boolean; } /** * Represents price spread handler */ class PriceSpreadHandler extends ChartComponent implements IPriceSpreadHandler { private _priceSpread; /** * Creates an instance of PriceSpreadHandler. * * @param config */ constructor(config: IPriceSpreadHandlerConfig); /** * Get ask */ get ask(): number; set ask(value: number); /** * Get bid */ get bid(): number; set bid(value: number); /** * Get pane */ get pane(): Pane; /** * Get theme */ get theme(): IPriceSpreadTheme; set theme(value: IPriceSpreadTheme); /** * Get visible */ get visible(): boolean; set visible(value: boolean); /** * Initializes visual dimensions */ InitializeVisualDimensions(): void; } } declare module FintaChart { /** * Represents Pane Watermark Theme */ interface IPaneWatermarkTheme { /** * Pane Watermark Theme's text */ text: ITextTheme; } /** * Provides model of Pane Watermark */ abstract class PaneWatermark extends PaneHtmlComponent { protected createContainer(): HTMLElement; } } declare module FintaChart { /** * Represents Instrument Watermark Theme */ interface IInstrumentWatermarkTheme { /** * Instrument Watermark Theme's details */ details: ITextTheme; /** * Instrument Watermark Theme's symbol */ symbol: ITextTheme; } /** * Provides model of Instrument Watermark */ class InstrumentWatermark extends PaneWatermark { /** * Instrument Watermark's theme */ theme: IInstrumentWatermarkTheme; /** * Retrieves Instrument Watermark's default layout template */ defaultLayoutTemplate(): IInstrumentWatermarkTheme; /** * Applies Instrument Watermark's text */ applyText(): void; applyTheme(): void; refresh(): void; protected createContainer(): HTMLElement; protected subscribe(): void; protected unsubscribe(): void; } } declare module FintaChart { /** * Represents Text Watermark Config */ interface ITextWatermarkConfig extends IPaneHtmlComponentConfig { /** * Text Watermark Config text */ text?: string; /** * Text Watermark Config theme */ theme?: IPaneWatermarkTheme; } /** * Provides model of Text Watermark */ class TextWatermark extends PaneWatermark { /** * Text Watermark's text */ text: string; /** * Text Watermark's theme */ theme: IPaneWatermarkTheme; /** * Get Text Watermark's default layout template */ get defaultLayoutTemplate(): IPaneWatermarkTheme; /** * Creates an instance of TextWatermark. * * @param config */ constructor(config?: ITextWatermarkConfig); applyTheme(): void; refresh(): void; /** * Applies Text Watermark's text */ private applyText; } } declare module FintaChart { } declare module FintaChart { /** * @category Market events */ enum CalendarEventVolatility { VERY_LOW = 1, LOW = 2, MEDIUM = 3, HIGH = 4, VERY_HIGH = 5 } /** * @category Market events */ enum MarketEventType { ECONOMICAL = 0, SIMPLE = 1 } /** * @category Market events */ interface IMarketEvent { id: string; title: string; time: number; type: MarketEventType; groupingId: string; volatility: CalendarEventVolatility; iconUrl: string; priority?: number; } /** * @category Market events */ interface IEconomicalMarketEvent extends IMarketEvent { actual: string; consensus: string; previous: string; } } declare module FintaChart { /** * @category Market events */ interface IMarketEventPopupBuilder { createPopupElement(event: IMarketEvent, chart: Chart): Promise; } } declare module FintaChart { /** * @category Market events */ interface IMarketEventsRequest { instrument: IInstrument; fromDate: number; toDate: number; } /** * @category Market events */ class MarketEventsDatafeed { protected eventsManager: MarketEventsManager; private _requestId; init(eventsManager: MarketEventsManager): void; loadEvents(params: IMarketEventsRequest): Promise; setEvents(events: IMarketEvent[]): void; addEvents(events: IMarketEvent[]): void; updateEvents(events: IMarketEvent[]): void; removeEvents(eventIds: string[]): void; protected load(params: IMarketEventsRequest): Promise; } } declare module FintaChart { } declare module FintaChart { } declare module FintaChart { /** * @category Market events */ enum CalendarEventsVisibilityMode { ALL = 0, FUTURE = 1, NONE = 2 } /** * @category Market events */ interface IMarketEventsManagerConfig { chart: Chart; visibilityMode?: CalendarEventsVisibilityMode; } interface IMarketEventsManagerState { visibilityMode: CalendarEventsVisibilityMode; } /** * @category Market events */ class MarketEventsManager implements IDisposable, IStateable { private _config; private readonly _chart; private _events; private _eventsGroups; private _visibleEventsGroups; private _selectedEventsGroupId; private _calendarEventsGroupDrawing; private _visibilityMode; get visibilityMode(): CalendarEventsVisibilityMode; set visibilityMode(value: CalendarEventsVisibilityMode); get eventsDatafeed(): MarketEventsDatafeed; get chart(): Chart; get events(): IMarketEvent[]; constructor(config: IMarketEventsManagerConfig); dispose(): void; saveState(): IMarketEventsManagerState; restoreState(state: IMarketEventsManagerState): void; setEvents(events: IMarketEvent[]): void; addEvents(events: IMarketEvent[]): void; removeEvents(eventIds: string[]): void; updateEvents(events: IMarketEvent[]): void; clear(): void; private setEventsInternal; handleEvent(event: IWindowEvent): boolean; private onNewBarsAppended; private onMoreBarsLoaded; private onNewBarsSet; private onChartTypeApplied; private onVisibilityModeChange; private setGroupsToDrawing; private stackGroups; private static sortGroupsByPriority; private subscribe; private onSelectedGroupChange; private onPaneMaximized; private onReplayModeStartRecord; private onReplayModeStopped; private setSelectedGroup; private combineEventsToGroups; private constructEventsGroup; private getEventsGroupDate; private getVisibleEventsGroups; private needShowGroup; } } declare module FintaChart { } declare module FintaChart { interface IBarCountdown extends IDisposable { shouldShow(): boolean; text(): string; } class BarCountdown implements IBarCountdown { private readonly _interval; private readonly _chart; private _lastText; constructor(chart: Chart); shouldShow(): boolean; text(): string; dispose(): void; private static currentTime; private static format; } } declare module FintaChart { interface IChartSnapshotHandler extends IChartComponent { /** * Returns snapshot file name. * * @return Snapshot file name. */ name(): string; /** * Saves chart snapshot. */ save(): void; /** * Saves chart snapshot to clipboard. */ saveToClipboard(): void; } /** * Represents handler to create chart snapshot. */ class ChartSnapshotHandler extends ChartComponent implements IChartSnapshotHandler { name(): string; save(): void; saveToClipboard(): void; private writeBlobToClipboard; private fallbackDownload; private showChartMessage; /** * Composites the chart's own canvas layers into one bitmap. * Far cheaper than serializing the whole DOM. Returns null when * no canvases are found so the caller can fall back. */ private compositeCanvasLayers; private createSnapshot; private saveImage; /** * Returns a human-readable reason why the clipboard cannot be used, * or `null` when a clipboard write may be attempted. */ private clipboardUnavailableReason; private addBorders; private trimTransparentMargins; private loadImage; } } declare module FintaChart { /** * Describes theme of the object's hover marker. */ interface IHoverMarkerTheme { /** * The fill theme. */ fill: IFillTheme; /** * The border theme. */ line: IStrokeTheme; } /** * Describes object's hover marker. */ interface IHoverMarker extends IChartComponent { /** * The theme. */ readonly paintTheme: IHoverMarkerTheme; /** * The theme. */ theme: IHoverMarkerTheme; /** * The width of the marker. */ radius: number; /** * Paints hover marker. * * @param renderer The renderer. * @param point The point to render marker at. */ paint(renderer: IRenderer, point: IPoint | IPoint[]): void; } /** * Describes hover marker configuration. */ interface IHoverMarkerConfig { /** * The parent chart. */ chart: Chart; /** * The theme. */ theme?: IHoverMarkerTheme; /** * The width. */ radius?: number; /** * The width. */ width?: number; } /** * Represents object's hover marker. */ class HoverMarker extends ChartComponent implements IHoverMarker { theme: IHoverMarkerTheme; radius: number; width: number; /** * Get hover dots brush's default layout template */ get paintTheme(): IHoverMarkerTheme; /** * Creates an instance of [[HoverMarker]]. * * @param config The hover marker configuration. */ constructor(config: IHoverMarkerConfig); paint(renderer: IRenderer, points: IPoint | IPoint[]): void; private paintMarker; } } declare module FintaChart { /** * Describes chart state handler. */ interface IChartStateHandler extends IChartComponent { /** * The flag that indicates whether the state should be loaded automatically. */ autoLoad: boolean; /** * The flag that indicates whether the state should be saved automatically. */ autoSave: boolean; /** * Saves chart state. * * @return Promise. */ save(): Promise; /** * Loads chart state. * * @return Promise that is resolved to the flag that indicates whether the state has been loaded successfully. */ load(): Promise; /** * Clears saved chart state. * * @return Promise. */ clear(): Promise; } } declare module FintaChart { /** * Describes chart state handler that works with local storage. */ interface ILocalStorageChartStateHandlerConfig extends IChartComponentConfig { /** * The flag that indicates whether chart state should be stored automatically. */ autoSave?: boolean; /** * The flag that indicates whether chart state should be loaded automatically. */ autoLoad?: boolean; } /** * Represents chart state handler that works with local storage. */ class LocalStorageChartStateHandler extends ChartComponent implements IChartStateHandler { autoLoad: boolean; autoSave: boolean; private _boundOnBeforeUnload; /** * Creates an instance of [[LocalStorageChartStateHandler]]. * * @param config The configuration of chart state handler. */ constructor(config?: ILocalStorageChartStateHandlerConfig); save(): Promise; load(): Promise; clear(): Promise; protected subscribe(): void; protected unsubscribe(): void; private static makeKey; private autoSaveState; } } declare module FintaChart { } declare module FintaChart { /** * */ class RestrictionHandler extends EventEmitter implements IDisposable { private _chart; private get allowedIndicatorsLeft(); private get allowedDrawingsLeft(); get allowInstruments(): boolean; get allowTimeFrames(): boolean; get allowDrawings(): boolean; get allowIndicators(): boolean; get allowMoreHistoryRequest(): boolean; get allowChartTypes(): boolean; constructor(chart: Chart); checkLicense(): void; dispose(): void; private subscribe; private unsubscribe; private onTimeoutElapsed; private raiseRestrictionsChangedEvent; } } declare module FintaChart { /** * Chart-theme shaped bar style, as emitted by a script (`SetBarStyle`). * The keys intentionally match `theme.plot.bar.candle.upCandle`, so the * object can be sent through as-is. * * @category Indicators */ interface IScriptBarStyleTheme { /** * Candle body / bar fill. */ fill?: { fillEnabled?: boolean; fillColor?: string; }; /** * Candle body outline. `enabled` is accepted as an alias of * `strokeEnabled`. */ border?: { strokeEnabled?: boolean; enabled?: boolean; strokeColor?: string; width?: number; }; /** * Candle wick (high / low shadow). */ shadow?: { strokeEnabled?: boolean; enabled?: boolean; strokeColor?: string; width?: number; }; /** * Alias of {@link IScriptBarStyleTheme.shadow} - the name the script * backend uses for the same thing. */ wick?: { strokeEnabled?: boolean; enabled?: boolean; strokeColor?: string; width?: number; }; } /** * A single bar repaint emitted by a script (`SetBarStyle`). * * The bar is addressed by its timestamp - never by its position in the * chart - so the override survives history loading and conflation. * Colors are given either flat (`fillColor` / `outlineColor` / `wickColor`) * or as a chart-theme shaped `theme` object; flat values win. * * A style with no usable fill color means "this bar is not painted" and * removes a previously applied override (see * {@link Indicator.upsertBarStyles}). * * @category Indicators */ interface IScriptBarStyle { /** * Bar timestamp: a `Date`, epoch milliseconds (epoch seconds when * below 1e11) or a parseable date string. */ time?: Date | number | string; /** * Alias of {@link IScriptBarStyle.time}, matching the backend payload. */ timestamp?: Date | number | string; /** * Candle body / bar color. */ fillColor?: string | null; /** * Candle body outline color. Defaults to `fillColor`. */ outlineColor?: string | null; /** * Candle wick color. Defaults to `fillColor`. */ wickColor?: string | null; /** * Outline width, px. Defaults to 1. */ outlineWidth?: number; /** * Wick width, px. Defaults to 1. */ wickWidth?: number; /** * Chart-theme shaped alternative to the flat colors above. */ theme?: IScriptBarStyleTheme; } /** * Normalized bar override used while painting. * * @category Indicators */ interface IBarStyleOverride { /** * Identity of the visual style, used to batch bars into a single path. */ key: string; /** * Candle body / bar color. */ fillColor: string; /** * Candle body theme (`fill` / `border` / `shadow`), ready for * `IRenderer.fillStroke`. */ candleTheme: any; /** * Stroke theme for bar (OHLC / HLC / HL) chart types. */ barTheme: IStrokeTheme; } /** * Direction of a script supplied background gradient. * * @category Indicators */ type ScriptGradientDirection = 'toTop' | 'toBottom' | 'toLeft' | 'toRight' | 'toTopLeft' | 'toTopRight' | 'toBottomLeft' | 'toBottomRight'; /** * Where a script supplied background is painted. * * - `pane` - the pane the script's plots live on (default); * - `price` - the primary (price) pane, wherever the script lives; * - `chart` - the whole chart backdrop, panes and splitters included. * * @category Indicators */ type ScriptPanelTarget = 'pane' | 'price' | 'chart'; /** * Background override emitted by a script (`SetPanelStyle`). One per * script - the last call wins. * * @category Indicators */ interface IScriptPanelStyle { /** * Paint target. Defaults to `pane`. */ target?: ScriptPanelTarget; /** * 1..4 gradient stops. A single color is a flat fill, an empty array * resets to the theme. * * `colors[0]` is where the gradient starts (the bottom for `toTop`). */ colors: string[]; /** * Gradient direction. Defaults to `toTop`. Unknown values fall back * to `toTop`. */ direction?: ScriptGradientDirection; /** * Explicit angle in degrees (CSS convention: 0 = up, clockwise). * Overrides {@link IScriptPanelStyle.direction} when set. */ angle?: number | null; /** * Optional stop positions in `[0..1]`, one per color. */ stops?: number[]; } /** * Per-bar color overrides supplied by running scripts, keyed by bar * timestamp and owned by the indicator that emitted them. * * Overrides are never serialized into the chart state: they live exactly * as long as the script that produced them. When several scripts paint the * same bar, the one registered last wins. * * @category Indicators */ class ScriptBarStyleRegistry { private _owners; private _resolved; /** * Whether any bar is currently overridden. */ get hasStyles(): boolean; /** * Returns the override for a bar, addressed by epoch milliseconds. */ get(time: number): IBarStyleOverride | null; /** * Replaces the whole set of overrides owned by `owner`. * * @return Whether anything changed (i.e. a repaint is needed). */ set(owner: any, styles: IScriptBarStyle[] | null): boolean; /** * Adds or replaces single bars owned by `owner`, keeping the rest. * A style that paints nothing removes the override of that bar. * * @return Whether anything changed (i.e. a repaint is needed). */ upsert(owner: any, styles: IScriptBarStyle[] | null): boolean; /** * Drops every override owned by `owner`. * * @return Whether anything changed (i.e. a repaint is needed). */ remove(owner: any): boolean; /** * Drops every override. */ clear(): void; private static styleTime; private static sameStyles; private indexOf; private resolved; } /** * Background overrides supplied by running scripts. * * Each override is resolved to a DOM layer - the chart backdrop or a pane * container - so the user theme is never mutated and the gradient never * reaches the saved chart state. When two scripts target the same layer, * the one registered last wins; removing it restores the previous owner, * or the theme when there is none. * * @category Indicators */ class ScriptPanelStyleRegistry { private _chart; private _entries; private _painted; /** * Creates an instance of ScriptPanelStyleRegistry. * * @param chart */ constructor(chart: Chart); /** * Registers (or updates) the background owned by `owner`. A `null` * style - or one without colors - removes it. */ set(owner: any, style: IScriptPanelStyle | null | undefined): void; /** * Drops the background owned by `owner`. */ remove(owner: any): void; /** * Drops every background and restores the theme. */ clear(): void; /** * Re-resolves every background and writes it to the DOM. Cheap and * idempotent - call it after a theme change or when an indicator * moved to another pane. */ apply(): void; private indexOf; private targetElement; private resetElement; } } declare module FintaChart { /** * Represents Scrollbar Config */ interface IScrollbarConfig { /** * Scrollbar Config chart */ chart?: Chart; /** * Scrollbar Config parent */ parent: HTMLElement; } /** * Provides model of Scrollbar */ class Scrollbar { private _chart; private _scrollbar; private _scrollingPane; private _scrollingPaneMinWidth; private _scrollingPaneWidth; private _isLocked; private _draggableController; private _resizableController; /** * The parent chart. */ get chart(): Chart; set chart(value: Chart); /** * The outer height. */ get outerHeight(): number; /** * Creates an instance of [[Scrollbar]]. * * @param config The configuration. */ constructor(config: IScrollbarConfig); /** * Resizes scrollbar. */ resize(): void; /** * Appends scrollbar to specified container. * * @param container The container to append scrollbar to. */ appendTo(container: HTMLElement): void; lock(): void; private init; animateScrollingToLastBar(): void; private updateChart; private subscribe; private unsubscribe; private refresh; } } declare module FintaChart { /** * Represents undo redo actions controller. */ class UndoRedoController { private readonly _maxCommands; private _commands; private _currentCommand; /** * Adds specified command. * * @param command The command. */ add(command: CommandBase): void; /** * Removes all commands. */ clear(): void; /** * Undoes specified number of operations. * * @param count The number of operations to undo. */ undo(count: number): void; /** * Redoes specific number of commands. * * @param count The number of commands to redo. */ redo(count: number): void; /** * Stores command. * * @param command The command to store. */ private store; /** * Executes current command. */ private execute; } } declare namespace FintaChart { /** * Describes waiting bar. */ interface IWaitingBar extends IDisposable { /** * Shows waiting bar. */ show(): void; /** * Hides waiting bar. */ hide(): void; } /** * Represents waiting bar. */ class WaitingBar implements IWaitingBar { private readonly _chart; private _container; private _isShown; /** * Creates an instance of [[WaitingBar]]. * * @param chart The chart. */ constructor(chart: Chart); dispose(): void; show(): void; hide(): void; private init; } } declare module FintaChart { enum WindowMode { NORMAL = "normal", FULL_SCREEN = "full-screen", FULL_WINDOW = "full-window" } interface IWindowModeHandler extends IChartComponent { /** * The current window mode. */ readonly mode: WindowMode; /** * The previous window mode. */ readonly prevMode: WindowMode; /** * Resizes chart in full window/screen mode. */ resize(): void; /** * Switches to specified window mode. * * @param mode The window mode. */ changeMode(mode: WindowMode): void; } class WindowModeHandler extends ChartComponent implements IWindowModeHandler { private _isSelfRaisedEvent; private _mode; private _preFullWindowSize; private _preFullWindowOffset; private _prevMode; private _boundOnFullScreenChanged; private _boundOnWindowResize; constructor(config: IChartComponentConfig); private get isInFullWindowMode(); get mode(): WindowMode; get prevMode(): WindowMode; resize(): void; changeMode(mode: WindowMode): void; protected subscribe(): void; protected unsubscribe(): void; private enterFullWindow; private exitFullWindow; private enterFullScreen; private exitFullScreen; private onFullScreenChange; private updateDropdown; private toggleWindowMode; } } declare module FintaChart { /** * Describes zoom control theme. */ interface IZoomAreaTheme { /** * The zoom rectangle border theme. */ border: IStrokeTheme; /** * The zoom rectangle fill theme. */ fill: IFillTheme; } enum ZoomMode { DATE_RANGE = "dateRange", BOUNDS = "bounds", ADJUST_OHLC = "adjustOHLC", ADJUST_All = "adjustAll" } interface IZoomAreaConfig { zoomMode: ZoomMode; } interface IZoomArea extends IControl { /** * The pane. */ pane: Pane; /** * The zoom mode. */ zoomMode: ZoomMode; /** * The zoom rectangle theme. */ theme: IZoomAreaTheme; /** * Cancels zoom. */ cancel(): void; } /** * Provides model of Zoom In Area Component */ class ZoomArea extends Control { private _controls; private _movePoint; private _paneHeight; private _paneTop; private _points; private _startPoint; theme: IZoomAreaTheme; pane: Pane; zoomMode: ZoomMode; private get chart(); private get container(); private get paintTheme(); constructor(config?: IZoomAreaConfig); cancel(): void; dispose(): void; paint(): void; hitTest(point: IPoint): boolean; protected initMotionEvents(): MotionEventArray; private createControls; private makeVisible; private applyTheme; private addPoint; private onMouseClick; private onMouseMove; private moveTo; private startZoom; private finishZoom; private updateScales; } } declare module FintaChart { /** * @category Patterns */ interface IPattern { ID: string; userfriendName: string; recognize: (points: number[]) => number; } /** * @category Patterns */ class Pattern { static baseRecognize(array: number[], config: Record): number; } } declare module FintaChart { /** * @category Patterns */ interface IPatternRecognitionResult { recognitionResult: number; patternName: string; ID: string; } } declare module FintaChart { /** * @category Patterns */ class ABatPattern { static userfriendName: string; static ID: string; static config: Record; static recognize(array: number[]): number; } } declare module FintaChart { /** * @category Patterns */ class ABCDPattern { static userfriendName: string; static ID: string; static recognize(array: number[]): number; } } declare module FintaChart { /** * @category Patterns */ class AButterflyPattern { static userfriendName: string; static ID: string; static config: Record; static recognize(array: number[]): number; } } declare module FintaChart { /** * @category Patterns */ class ACrabPattern { static userfriendName: string; static ID: string; static config: Record; static recognize(array: number[]): number; } } declare module FintaChart { /** * @category Patterns */ class AGartleyPattern { static userfriendName: string; static ID: string; static config: Record; static recognize(array: number[]): number; } } declare module FintaChart { /** * @category Patterns */ class AltABCDPattern { static userfriendName: string; static ID: string; static recognize(array: number[]): number; } } declare module FintaChart { /** * @category Patterns */ class AltBatPattern { static userfriendName: string; static ID: string; static config: Record; static recognize(array: number[]): number; } } declare module FintaChart { /** * @category Patterns */ class AltSharkPattern { static userfriendName: string; static ID: string; static config: Record; static recognize(array: number[]): number; } } declare module FintaChart { /** * @category Patterns */ class BatPattern { static userfriendName: string; static ID: string; static config: Record; static recognize(array: number[]): number; } } declare module FintaChart { /** * @category Patterns */ class ButterflyPattern { static userfriendName: string; static ID: string; static config: Record; static recognize(array: number[]): number; } } declare module FintaChart { /** * @category Patterns */ class CrabPattern { static userfriendName: string; static ID: string; static config: Record; static recognize(array: number[]): number; } } declare module FintaChart { /** * @category Patterns */ class CypherPattern { static userfriendName: string; static ID: string; static config: Record; static recognize(array: number[]): number; } } declare module FintaChart { /** * @category Patterns */ class DeepCrabPattern { static userfriendName: string; static ID: string; static config: Record; static recognize(array: number[]): number; } } declare module FintaChart { /** * @category Patterns */ class DeepKingsCrownPattern { static userfriendName: string; static ID: string; static config: Record; static recognize(array: number[]): number; } } declare module FintaChart { /** * @category Patterns */ class FiveZeroPattern { static ID: string; static config: Record; static userfriendName: string; static recognize(array: number[]): number; } } declare module FintaChart { /** * @category Patterns */ class GartleyPattern { static userfriendName: string; static ID: string; static config: Record; static recognize(array: number[]): number; } } declare module FintaChart { /** * @category Patterns */ class HeadAndShouldersPattern { static userfriendName: string; static ID: string; static recognize(array: number[]): number; } } declare module FintaChart { /** * @category Patterns */ class KingsCrownPattern { static userfriendName: string; static ID: string; static recognize(array: number[]): 0 | 100; } } declare module FintaChart { /** * @category Patterns */ class MaxBatPattern { static userfriendName: string; static ID: string; static config: Record; static recognize(array: number[]): number; } } declare module FintaChart { /** * @category Patterns */ class MaxButterflyPattern { static userfriendName: string; static ID: string; static config: Record; static recognize(array: number[]): number; } } declare module FintaChart { /** * @category Patterns */ class MaxGartleyPattern { static userfriendName: string; static ID: string; static config: Record; static recognize(array: number[]): number; } } declare module FintaChart { /** * @category Patterns */ class ShallowKingsCrownPattern { static userfriendName: string; static ID: string; static config: Record; static recognize(array: number[]): number; } } declare module FintaChart { /** * @category Patterns */ class SharkPattern { static userfriendName: string; static ID: string; static config: Record; static recognize(array: number[]): number; } } declare module FintaChart { /** * @category Patterns */ class FractalCalculator { calculateOnArrays(highValues: number[], lowValues: number[], startIndex?: number, limit?: number): IFractal[]; calculateHighLevelFractals(fractals: IFractal[], level: number): any[]; } } declare module FintaChart { /** * @category Patterns */ enum FractalMode { FRACTAL_MODE_NONE = 0, FRACTAL_MODE_UP = 1, FRACTAL_MODE_DOWN = 2 } /** * @category Patterns */ interface IFractal { mode: FractalMode; index: number; value: number; position: number; } /** * @category Patterns */ class ZigZagCalculator { calculateOnArrays(highSeries: number[], lowSeries: number[], deviation: number, depth: number, backstep: number, skipLast?: boolean): IFractal[]; } } declare module FintaChart { /** * Represents plot options * * @category Plots */ interface IPlotOptions extends IPaneObjectOptions { /** * Enable scale vertical labels */ enableVerticalAxisLabels: boolean; /** * Keeps the plot out of the vertical auto scale calculation. * * The plot is still painted, but its values never widen the value range * of the scale it is bound to. Intended for plots whose values are not * comparable with the rest of the scale (e.g. a custom script overlay * that reports zeros on the price pane), where letting them participate * would squash the primary data and, because the same range gates * zoom/scroll, lock the axis. */ excludeFromAutoScale: boolean; /** * Stretch pricing lines */ stretchPricingLines: boolean; /** * Hoverable */ hoverable: boolean; /** * Hovered */ hovered: boolean; /** * isVolume */ isVolume: boolean; /** * Plot style */ plotStyle: string; /** * Selectable */ selectable: boolean; /** * Selected */ selected: boolean; /** * Show pricing lines */ showPricingLines: boolean; /** * Number of bars to project into the future beyond the last real bar. * Lines are drawn with a dashed style. */ projectionBarsCount?: number; /** * Projection formula type: * - 'trend' (default): linear extrapolation by last two points: Y = Y_last + deltaY * N * - 'flat': horizontal extension Y = Y_last * - 'damped': Y_i = Y_{i-1} + deltaY * gamma^i, gamma in (0.8..0.95) * - 'regression': linear regression Y = a + b*X over last N bars * - 'sma': iterative SMA Y_future = avg(k) over real_or_future values * - 'polynomial': quadratic Y = a*i^2 + b*i + c over last N bars */ projectionType?: string; /** * Damping coefficient gamma for 'damped' projection (0.8..0.95, default 0.9) */ projectionDamping?: number; /** * Period for regression / polynomial fits (default 20) */ projectionRegressionPeriod?: number; /** * Period for SMA projection (default 14) */ projectionSmaPeriod?: number; } /** * Represents plot config * * @category Plots */ interface IPlotConfig extends IPaneObjectConfig { /** * Data rows */ dataRows?: DataRows | DataRows[]; /** * Hoverable */ hoverable?: boolean; /** * Hovered */ hovered?: boolean; /** * Pane */ pane?: Pane; /** * Plot style */ plotStyle?: string; /** * Plot type */ plotType?: PlotType; /** * Scale vertical */ verticalScale?: VerticalScale; /** * Selectable */ selectable?: boolean; /** * Selected */ selected?: boolean; /** * Theme */ theme?: any; /** * Z-index */ zIndex?: number; verticalAxisLabel?: IVerticalAxisLabel; } /** * Represents Plot paint parameters * * @category Plots */ interface IPlotPaintParameters { /** * Dates */ dates: Date[]; /** * End index */ endIndex: number; /** * Renderer */ renderer: IRenderer; /** * Scale coordinate mapper */ scaleCoordinateMapper: ScaleCoordinateMapper; /** * Start column */ startColumn: number; /** * Start index */ startIndex: number; /** * Theme */ theme: any; /** * Values */ values: number[]; } /** * Represents plot bar paint parameters * * @category Plots */ interface IBarPlotPaintParameters extends IPlotPaintParameters { /** * Close */ close: number[]; /** * Dates */ dates: Date[]; /** * High */ high: number[]; /** * Low */ low: number[]; /** * Open */ open: number[]; /** * Conflation step — draw every Nth bar when sub-pixel. */ step: number; } /** * Represents plot defaults * * @category Plots */ interface IPlotDefaults { /** * Plot style */ plotStyle: string; } /** * @category Plots */ const PlotType: { INDICATOR: PlotType; CHART_TYPE: PlotType; USER: PlotType; }; type PlotType = 'indicator' | 'ChartType' | 'user'; /** * @category Plots */ namespace PlotEvent { const DATA_ROWS_CHANGED = "plotDataRowsChanged"; const PANE_CHANGED = "plotPaneChanged"; const THEME_CHANGED = "plotThemeChanged"; const STYLE_CHANGED = "plotStyleChanged"; const ENABLE_AXIS_LABELS = "plotEnableAxisLabelsChanged"; const SHOW_VALUE_LINES_CHANGED = "plotShowPricingLinesChanged"; const STRETCH_VALUE_LINES_CHANGED = "plotStretchPricingLinesChanged"; const VISIBLE_CHANGED = "plotVisibleChanged"; const VALUE_SCALE_CHANGED = "plotVerticalScaleChanged"; const BASE_VALUE_CHANGED = "plotBaseValueChanged"; const SELECTED_CHANGED = "plotSelectedValueChanged"; const HOVERED_CHANGED = "plotHoveredValueChanged"; const CONTEXT_MENU = "chartPlotContextMenu"; } /** * Represents plot * * @category Plots */ abstract class Plot extends PaneObject implements IChartObject { static defaults: IPlotDefaults; private _dataRows; private _motionEvents; private _selected; private _theme; protected verticalAxisLabel: IVerticalAxisLabel; hovered: boolean; /** * Is auto scale */ isAutoScale: boolean; /** * Plot theme key */ protected plotThemeKey: string; /** * Plot type */ private readonly _plotType; /** * Get default layout template */ get defaultLayoutTemplate(): any; /** * Get can hover */ get canHover(): boolean; /** * Get can select */ get canSelect(): boolean; /** * Set data rows */ get dataRows(): DataRows[]; set dataRows(value: DataRows[]); /** * Get enable scale vertical labels */ get enableVerticalAxisLabels(): boolean; set enableVerticalAxisLabels(value: boolean); /** * Get stretch pricing license */ get stretchPricingLines(): boolean; set stretchPricingLines(value: boolean); /** * Get hoverable */ get hoverable(): boolean; set hoverable(value: boolean); /** * Get plot style */ get plotStyle(): string; set plotStyle(value: string); /** * Get plot type */ get plotType(): PlotType; /** * Get selectable */ get selectable(): boolean; set selectable(value: boolean); /** * Get selected */ get selected(): boolean; set selected(value: boolean); /** * Get show pricing lines */ get showPricingLines(): boolean; set showPricingLines(value: boolean); /** * Get theme */ get theme(): any; set theme(value: any); /** * Get selectable */ get isVolume(): boolean; set isVolume(value: boolean); /** * Get is excluded from the vertical auto scale calculation */ get excludeFromAutoScale(): boolean; set excludeFromAutoScale(value: boolean); /** * Creates an instance of Plot. * * @param config */ constructor(config?: IPlotConfig); /** * draws scale vertical floating labels */ paintVerticalAxisLabels(): void; getVerticalAxisLabelMaxWidth(): number; protected paintPricingLines(lastValue: number, lastRecordIndex: number, theme: IStrokeTheme): void; /** * Finds data row * * @param rowMarker * @return */ findDataRows(rowMarker: string): DataRows; /** * Handles event * * @param event * @return */ handleEvent(event: IWindowEvent): boolean; /** * Hovers */ hover(): void; /** * Returns min max values * * @param startIndex * @param count * @return */ minMaxValues(startIndex: number, count: number): IMinMax; /** * Selects */ select(): void; /** * Sets data rows * * @param dataRows */ setDataRows(dataRows: DataRows | DataRows[]): void; /** * hover silent */ silentHover(): void; /** * Select silent */ silentSelect(): void; getPricePoint(): number; /** * Returns bar paint parameters * * @return */ protected barPaintParameters(): IBarPlotPaintParameters; /** * Visualizes hover dots brush */ protected paintHoverMarker(): void; /** * Visualizes hovered * * @param oldTheme * @return */ protected paintHovered(oldTheme: any): any; /** * Returns hover dots brush width * * @param theme * @return */ protected hoverMarkerWidth(theme: any): number; /** * Handles pane changes * * @param oldValue */ protected onPaneChanged(oldValue: Pane): void; /** * handles scale vertical changes * * @param oldValue */ protected onVerticalScaleChanged(oldValue: VerticalScale): void; /** * Handles visibility changes * * @param oldValue */ protected onVisibleChanged(oldValue: boolean): void; /** * Returns paint value parameters * * @return */ protected valuePaintParameters(): IPlotPaintParameters; /** * Hits test * * @param point * @return */ protected hitTest(point: IPoint): boolean; protected verticalAxisLabelTheme(): IVerticalAxisLabelTheme; private onMouseHover; private onContextMenu; private onDoubleClick; private onMouseHoverInternal; private initMotionEvents; } } declare module FintaChart { /** * Represents Plot area * * @category Plots */ class AreaPlot extends Plot { paint(): void; /** * Draws area * * @param isAbove * @param theme * @return */ drawArea(isAbove: boolean, theme: any): void; private addValue; private paintOneColorArea; private getIntersectionPoints; } } declare module FintaChart { /** * @category Plots */ interface IArrowPlotConfig { value: number; date: Date; } /** * @category Plots */ interface IArrowsPlotConfig { upArrows: IArrowPlotConfig[]; downArrows: IArrowPlotConfig[]; } /** * @category Plots */ interface IArrowsPlotTheme { arrowUp: { fill: IFillTheme; stroke: IStrokeTheme; }; arrowDown: { fill: IFillTheme; stroke: IStrokeTheme; }; } /** * @category Plots */ class ArrowsPlot extends Plot { headRatio: number; tailRatio: number; private _arrowSize; private _arrows; get theme(): IArrowsPlotTheme; get showValueMarkers(): boolean; get enableVerticalAxisLabels(): boolean; get arrowSize(): ISize; set arrowSize(size: ISize); paint(): void; setArrows(arrows: IArrowsPlotConfig): void; clear(): void; private paintArrows; } } declare module FintaChart { /** * Represents plot bar config * * @category Plots */ interface IBarPlotConfig extends IPlotConfig { /** * Column width ratio */ columnWidthRatio?: number; /** * Min width */ minWidth?: number; } /** * Represents plot bar defaults * * @category Plots */ interface IBarPlotDefaults extends IPlotDefaults { /** * Column width ratio */ columnWidthRatio: number; /** * Min width */ minWidth: number; } /** * @category Plots */ namespace PlotEvent { const COLUMN_WIDTH_RATIO_CHANGED = "plotColumnWidthRatioChanged"; const MIN_WIDTH_CHANGED = "plotMinWidthChanged"; } const ChartTypeNames: { OHLC: string; COLORED_OHLC: string; HLC: string; COLORED_HLC: string; HL: string; COLORED_HL: string; CANDLE: string; HOLLOW_CANDLE: string; HEIKIN_ASHI: string; RENKO: string; RANGE_BAR: string; LINE_BREAK: string; POINT_AND_FIGURE: string; KAGI: string; CANDLE_VOLUME: string; EQUI_VOLUME: string; EQUI_VOLUME_SHADOW: string; LINE: string; AREA: string; }; /** * Represents plot bar * * @category Plots */ class BarPlot extends Plot { /** * Style */ static readonly Style: typeof ChartTypeNames; /** * Defaults */ static readonly defaults: IBarPlotDefaults; /** * Get column width ratio */ get columnWidthRatio(): number; set columnWidthRatio(value: number); /** * Get min width */ get minWidth(): number; set minWidth(value: number); /** * Creates an instance of BarPlot. * * @param config */ constructor(config?: IBarPlotConfig); paint(): void; /** * Draws scale vertical floating labels */ paintVerticalAxisLabels(): void; getVerticalAxisLabelMaxWidth(): number; /** * Script supplied per-bar overrides for this plot, or `null` when * there are none. Only the chart-type plot honours them: bars live on * the price pane, wherever the script's own plots are. */ private scriptBarStyleLookup; private scriptBarStyle; /** * Groups the overridden bars of the visible range by style, so each * color still costs a single path instead of a path per bar. */ private scriptBarStyleGroups; private isScriptStyledBar; private paintBars; private paintBarItems; private paintBrickItems; private paintBricks; private paintCandleItems; private paintCandles; private paintColoredBarItems; private paintColoredBars; private paintEquiVolumeCandles; private paintEquiVolumeItems; private paintEquiVolumeShadowCandles; private paintEquiVolumeShadowItems; private paintHollowCandleItems; private paintHollowCandles; private paintKagi; private paintKagiItems; private paintVolumeCandles; private paintVolumeCandlesItems; private getLabelFillColor; private labelTheme; } } declare module FintaChart { /** * @category Plots */ enum HistogramBars { UP_BAR = 0, DOWN_BAR = 1, MEAN_BAR = 2 } /** * Represents plot histogram config * * @category Plots */ interface IHistogramPlotConfig extends IPlotConfig { /** * Base value */ baseValue?: number; /** * Column width ratio */ columnWidthRatio?: number; /** * Min column width */ minColumnWidth?: number; } /** * Represents plot histogram defaults * * @category Plots */ interface IHistogramPlotDefaults extends IPlotDefaults { /** * Base value */ baseValue: number; /** * Column width ratio */ columnWidthRatio: number; /** * Min width */ minWidth: number; } enum PlotHistogramStyle { LINE = "line", COLORED_LINE = "coloredLine", COLORED_BAR_LINE = "coloredBarLine", COLORED_MEAN_BAR_LINE = "coloredMeanBarLine", COLUMN = "column", COLORED_COLUMN = "coloredColumn", BYDATES = "bydates" } /** * Public alias matching the name used in documentation * (`FintaChart.HistogramPlotStyle.COLORED_COLUMN`). Resolves to the * same enum values as `PlotHistogramStyle` and `HistogramPlot.Style`. */ const HistogramPlotStyle: typeof PlotHistogramStyle; /** * Represents plot histogram * * @category Plots */ class HistogramPlot extends Plot { /** * Style */ static readonly Style: typeof PlotHistogramStyle; /** * Defaults */ static readonly defaults: IHistogramPlotDefaults; /** * Get base value */ get baseValue(): number; set baseValue(value: number); /** * Get column width ratio */ get columnWidthRatio(): number; set columnWidthRatio(value: number); /** * Get min column width */ get minColumnWidth(): number; set minColumnWidth(value: number); /** * Creates an instance of HistogramPlot. * * @param config */ constructor(config?: IHistogramPlotConfig); paint(): void; /** * Draws scale vertical floating labels */ paintVerticalAxisLabels(): void; private paintByDatesLines; private paintColoredBarLines; private paintColoredColumns; private paintColoredLines; private paintColumns; private paintLines; private setupVerticalAxisLabelTheme; } } declare module FintaChart { /** * Represents plot line * * @category Plots */ class LinePlot extends Plot { /** * Style */ static readonly Style: any; /** * Defaults */ static readonly defaults: IPlotDefaults; /** * Creates an instance of LinePlot. * * @param config */ constructor(config?: IPlotConfig); paint(): void; private paintAreaLine; private paintSimpleLine; private paintStepLine; private paintSmoothedAreaLine; private paintSmoothShape; private paintSmoothedSimpleLine; private paintProjectionLine; } } declare module FintaChart { import MoonPhaseType = FintaChart.MoonPhaseType; interface IMoonPhase { date: Date; type: MoonPhaseType; } interface IMoonPhasePlotSettings { showFullMoonMark: boolean; showNewMoonMark: boolean; fullMoonMarkColor: string; newMoonMarkColor: string; fullMoonMarkSize: number; newMoonMarkSize: number; showGrowingMoonOverlay: boolean; showWaningMoonOverlay: boolean; growingMoonOverlayColor: string; waningMoonOverlayColor: string; } const DefaultMoonPhasePlotSettings: IMoonPhasePlotSettings; /** * @category Plots */ class MoonPhasePlot extends Plot { private _settings; set settings(value: IMoonPhasePlotSettings); private _moonPhaseOverlays; _moonPhases: IMoonPhases; get moonPhases(): IMoonPhases; set moonPhases(value: IMoonPhases); get fullMoonMarkSize(): number; get newMoonMarkSize(): number; get showValueMarkers(): boolean; get enableVerticalAxisLabels(): boolean; get defaultLayoutTemplate(): any; paint(): void; private paintPhases; private paintOverlays; private getMoonPhaseMarkFillColor; private getMoonPhaseOverlayFillColor; private getPhaseMarkCenterPoint; private getRecordsRangeMinMax; private calculateMoonPhaseOverlays; private getPhaseMarkRadius; private filterVisibleOverlays; private filterVisiblePhases; } } declare module FintaChart { /** * Represents plot point and figure * * @category Plots */ class PointAndFigurePlot extends BarPlot { private _boxSize; private _showSignals; private _showMonth; private _showTrend; private _applyGrid; dates: IBoxDateReversed[]; /** * Get box size */ get boxSize(): number; set boxSize(value: number); get showSignals(): boolean; set showSignals(value: boolean); get showMonth(): boolean; set showMonth(value: boolean); get showTrend(): boolean; set showTrend(value: boolean); get applyGrid(): boolean; set applyGrid(value: boolean); paint(): void; private findTrendEnd; private drawTrends; private getMonth; private drawTextInBox; private visualizeColumns; } } declare module FintaChart { /** * Describes point plot config. * * @category Plots */ export interface IPointPlotConfig extends IPlotConfig { /** * The size of the point. */ pointSize?: number; } /** * Describes point plot defaults. * * @category Plots */ export interface IPointPlotDefaults extends IPlotDefaults { /** * The size of the point. */ pointSize: number; } /** * @category Plots */ export namespace PlotEvent { const POINT_SIZE_CHANGED = "plotPointSizeChanged"; } enum PointPlotStyle { DOT = "dot" } /** * Represents point plot. * * @category Plots */ export class PointPlot extends Plot { /** * The point plot styles. */ static readonly Style: typeof PointPlotStyle; static readonly defaults: IPointPlotDefaults; /** * The size of the point. */ get pointSize(): number; set pointSize(value: number); /** * Initializes new instance of the [[PointPlot]] class. * * @param config The point plot configuration. */ constructor(config?: IPointPlotConfig); paint(): void; } export {}; } declare module FintaChart { /** * @description Represents Volume Profile * @export * @interface IVolumeProfile */ interface IVolumeProfile { maxv: number; rows: IVolumeRows[]; POC: IPOCValue; VA: number[]; size: number; } /** * @description Represents Daily Profile * @export * @interface IDayilyProfile * @extends {IVolumeProfile} */ interface IDayilyProfile extends IVolumeProfile { t0: number; t1: number; high: number; low: number; } /** * @description Represents Volume Profile Rows * @export * @interface IVolumeRows */ interface IVolumeRows { h: number; l: number; b: number; s: number; v: number; } /** * @description Represents Volume Profile Point Of Control * @export * @interface IPOCValue */ interface IPOCValue { i: number; val: number; } /** * @description Represents Coordinate * @export * @interface ICoordinate */ interface ICoordinate { x1: number; y1: number; x2: number; y2: number; } const PlotRowStyle: { RANGE: string; DAILY: string; HEATMAP: string; }; /** * @description Represents Row Histogram Plot * @export * @class * @extends {Plot} */ class RowHistogramPlot extends Plot { _volumeProfile: IVolumeProfile; _dailyProfile: IDayilyProfile[]; _heatmap: any; /** * @description Set volume profile value * @property {IVolumeProfile} volumeProfile * @memberof RowHistogramPlot */ set volumeProfile(value: IVolumeProfile); /** * @description Get volume profile value * @property {IVolumeProfile} volumeProfile * @memberof RowHistogramPlot */ get volumeProfile(): IVolumeProfile; /** * @description Set daily profile value * @property {IDayilyProfile} dailyProfile * @memberof RowHistogramPlot */ set dailyProfile(value: IDayilyProfile[]); /** * @description Get daily profile value * @property {IDayilyProfile} dailyProfile * @memberof RowHistogramPlot */ get dailyProfile(): IDayilyProfile[]; set heatmap(value: any); get heatmap(): any; /** * @description Get show value markers * @property {boolean} showValueMarkers * @memberof RowHistogramPlot */ get showValueMarkers(): boolean; /** * @description Get enable scale vertical labels * @property {boolean} enableScaleVerticalLabels * @memberof RowHistogramPlot */ get enableScaleVerticalLabels(): boolean; /** * @description Creates an instance of Plot. * @constructor * @param {IPlotConfig} [config] * @memberof RowHistogramPlot */ constructor(config?: IPlotConfig); /** * @description Paints * @memberof RowHistogramPlot */ paint(): void; /** * @description Draw daily rows * * @memberof RowHistogramPlot */ private _drawDailyRows; /** * @description Draw rows * * @memberof RowHistogramPlot */ private _drawRows; /** * @description Draw reversed rows * @param {IDayilyProfile} dayliProfile * @memberof RowHistogramPlot */ private _drawReverseRows; /** * @description Draw line * @param {number} ym * @param {number} right * @param {number} left * @memberof RowHistogramPlot */ private _drawLine; /** * @description Draw rectangle background * @param {ICoordinate} coordinate * @memberof RowHistogramPlot */ private _drawRectBackground; private _drawHeatmap; private _calculateInterColor; } } declare module FintaChart { interface IHorizontalAxisConfig { horizontalScale: HorizontalScale; cssClass: string | null; visible?: boolean; } /** * Provides model of Scale Horizontal Pane */ class HorizontalAxis extends HtmlControl { private static TRANSPARENT; private readonly _cssClass; private readonly _isVisible; private readonly _scale; private _layer; private _isLocked; /** * Get trend Scale Horizontal Pane's chart */ get chart(): Chart; /** * Get trend Scale Horizontal Pane's css class */ get cssClass(): string; /** * Get trend Scale Horizontal Pane's layer */ get layer(): CanvasLayer; /** * Get trend Scale Horizontal Pane's scale horizontal */ get scale(): HorizontalScale; /** * Get trend Scale Horizontal Pane's visible */ get visible(): boolean; /** * Creates an instance of HorizontalAxis. * * @param config */ constructor(config: IHorizontalAxisConfig); /** * Setups Scale Horizontal Pane's layout theme */ setupLayoutTheme(): void; /** * Clears Scale Horizontal Pane's pane */ clearPane(): void; /** * Pains Scale Horizontal Pane */ paint(): void; hitTest(point: IPoint): boolean; resize(frameInChart: Bounds, isTopPane?: boolean): void; /** * Retrieves Scale Horizontal Pane's layout pane * * @param frameInChart * @param isTopPane * @return Scale Horizontal Pane's layout pane */ layoutPane(frameInChart: Bounds, isTopPane: boolean): Bounds; lock(): void; protected createContainer(): HTMLElement; protected initMotionEvents(): MotionEventArray; private clientHeight; private onDoubleClick; private onMove; private onMouseWheel; private onPinchZoom; } } declare module FintaChart { /** * Represents Scale Horizontal options */ interface IHorizontalScaleConfig extends IChartComponentConfig { autoScrollName?: HorizontalAxisAutoScrollKind; } interface IHorizontalScaleOptions { theme?: unknown; allowPartialRecords?: boolean; autoScrollMode?: HorizontalAxisAutoScrollMode; autoScrollName?: HorizontalAxisAutoScrollKind; firstVisibleRecord?: number; lastVisibleRecord?: number; minVisibleRecords?: number; maxVisibleRecords?: number; majorTickMarkLength?: number; minorTickMarkLength?: number; height?: number; rightAdditionalSpaceRatio?: number; scrollName?: string; textPadding?: IPadding; useManualHeight?: boolean; zoomMode?: string; zoomName?: string; } /** * Represents Scale Horizontal State */ interface IHorizontalScaleState { /** * Scale Horizontal State's allow partial records */ allowPartialRecords: boolean; /** * Scale Horizontal State's allow scroll name */ autoScrollName: HorizontalAxisAutoScrollKind; /** * Scale Horizontal State's first visible record */ firstVisibleRecord: number; /** * Scale Horizontal State's formatter */ formatter: IDateTimeFormatterState; /** * Scale Horizontal State's height */ height: number; /** * Scale Horizontal State's last visible record */ lastVisibleRecord: number; /** * Scale Horizontal State's major tick mark length */ majorTickMarkLength: number; /** * Scale Horizontal State's maximum visible records */ maxVisibleRecords: number; /** * Scale Horizontal State's minimum visible records */ minVisibleRecords: number; /** * Scale Horizontal State's minor tick mark length */ minorTickMarkLength: number; /** * Scale Horizontal State's right additional space ratio */ rightAdditionalSpaceRatio: number; /** * Scale Horizontal State's scale adapter */ scaleAdapter: IHorizontalAxisAdapterState; /** * Scale Horizontal State's scroll mode */ scrollMode: HorizontalAxisAutoScrollMode; /** * Scale Horizontal State's scroll name */ scrollName: string; /** * Scale Horizontal State's text padding */ textPadding: IPadding; /** * Scale Horizontal State's theme */ theme: unknown; /** * Scale Horizontal State's use manual height */ useManualHeight: boolean; /** * Scale Horizontal State's zoom mode */ zoomMode: string; /** * Scale Horizontal State's zoom name */ zoomName: string; } /** * The scroll behaviour of the horizontal axis. */ enum HorizontalAxisScrollKind { /** * Scrolls without any specific behaviour. */ NORMAL = "normal", /** * Applies automatic axis scaling during scrolling. */ AUTOSCALED = "autoscaled" } /** * The zoom behaviour of the horizontal axis. */ enum HorizontalAxisZoomKind { /** * Zooms without any specific behaviour. */ NORMAL = "normal", /** * Applies automatic axis scaling during zooming. */ AUTOSCALED = "autoscaled" } /** * The zoom mode of the horizontal axis. */ const HorizontalAxisZoomMode: { /** * Pins center of the chart and zooms both sides equally. */ PIN_CENTER: string; /** * Pins left side of the chart and zooms right side only. */ PIN_LEFT: string; /** * Pins right side of the chart and zooms left side only. */ PIN_RIGHT: string; /** * Pins current mouse position and zooms both sides. */ PIN_MOUSE: string; }; /** * The data rows update kind. */ enum DataRowsUpdateKind { /** * Existing bar has been updated with a new tick. */ TICK = 0, /** * New bar has been added. */ NEW_BAR = 1 } /** * The auto scrolling behaviour of the horizontal axis. */ enum HorizontalAxisAutoScrollKind { /** * Automatic scrolling is disabled. */ NONE = "none", /** * Scrolls automatically when new hidden bar appears on the right side. */ HIDDEN_BAR = "hidden_bar", /** * Automatic scrolling is always enabled. */ ALWAYS = "always" } /** * The auto scrolling mode of the horizontal axis. */ enum HorizontalAxisAutoScrollMode { /** * Scrolls axis automatically when new bar appears. */ NEW_BAR = "new_bar", /** * Scrolls axis automatically when new tick appears. */ TICK = "tick" } /** * Represents Scale Horizontal */ class HorizontalScale extends ChartComponent implements IStateable { private readonly _topAxis; private readonly _bottomAxis; private readonly _scaleCoordinateMapper; private _monospacedColumnWidth; private _firstVisibleIndex; private _lastVisibleIndex; private _maxVisibleBars; private _moreHistoryRequested; private _options; private _axisAdapter; private _scaleCoordinateMapperFrame; private _scrollOnRecordsCount; private _wasAutoscale; private _horizontalScaleCoordinateMapper; private _isLocked; private _initialVisibleRange; /** * Scale Horizontal's formatter */ private formatter; columnWidthResolver: IColumnWidthProvider; /** * Get Scale Horizontal's default layout template */ get defaultLayoutTemplate(): any; /** * Get Scale Horizontal's allow partial records */ get allowPartialRecords(): boolean; set allowPartialRecords(value: boolean); /** * Get Scale Horizontal's auto scroll mode */ get autoScrollMode(): HorizontalAxisAutoScrollMode; set autoScrollMode(value: HorizontalAxisAutoScrollMode); /** * Get Scale Horizontal's auto scroll name */ get autoScrollKind(): HorizontalAxisAutoScrollKind; set autoScrollKind(value: HorizontalAxisAutoScrollKind); /** * Get Scale Horizontal's top pane */ get topAxis(): HorizontalAxis; /** * Get Scale Horizontal's bottom pane */ get bottomAxis(): HorizontalAxis; /** * Get Scale Horizontal's top pane css class */ get topAxisCssClass(): string; /** * Get Scale Horizontal's bottom pane css class */ get bottomAxisCssClass(): string; /** * Get Scale Horizontal's top pane visible */ get topAxisVisible(): boolean; /** * Get Scale Horizontal's bottom pane visible */ get bottomAxisVisible(): boolean; /** * Get Scale Horizontal's column width */ get monospacedColumnWidth(): number; /** * Get Scale Horizontal's columns count */ get columnsCount(): number; /** * Get Scale Horizontal's first visible index */ get firstVisibleIndex(): number; /** * Get Scale Horizontal's last visible index */ get lastVisibleIndex(): number; /** * Get Scale Horizontal's first visible record */ get firstVisibleRecord(): number; set firstVisibleRecord(record: number); /** * Get Scale Horizontal's last visible record */ get lastVisibleRecord(): number; set lastVisibleRecord(value: number); /** * Get Scale Horizontal's minimum visible records */ get minVisibleRecords(): number; set minVisibleRecords(value: number); /** * Get Scale Horizontal's maximum visible records */ get maxVisibleRecords(): number; set maxVisibleRecords(value: number); /** * Get Scale Horizontal's maximum allowed record */ get maxAllowedRecord(): number; /** * * Set Scale Horizontal's maximum bars visible */ get maxVisibleBars(): number; set maxVisibleBars(count: number); /** * Get Scale Horizontal's visible date range */ get visibleDateRange(): IMinMax; /** * Get Scale Horizontal's major tick mark length */ get majorTickHeight(): number; set majorTickHeight(value: number); /** * Get Scale Horizontal's minor tick mark length */ get minorTickHeight(): number; set minorTickHeight(value: number); /** * Get Scale Horizontal's manual height */ get manualHeight(): number; set manualHeight(value: number); /** * Get Scale Horizontal's right additional space ratio */ get rightAdditionalSpaceRatio(): number; set rightAdditionalSpaceRatio(value: number); /** * Get Scale Horizontal's scale adapter */ get axisAdapter(): IHorizontalAxisAdapter; set axisAdapter(value: IHorizontalAxisAdapter); get horizontalScaleCoordinateMapper(): IHorizontalScaleCoordinateMapper; /** * Get Scale Horizontal's scale coordinate mapper */ get scaleCoordinateMapper(): ScaleCoordinateMapper; /** * Get Scale Horizontal's scale coordinate mapper frame */ get scaleCoordinateMapperFrame(): Bounds; /** * Get Scale Horizontal's scroll name */ get scrollKind(): string; set scrollKind(value: string); /** * Get Scale Horizontal's scroll on records count */ get scrollOnRecordsCount(): number; set scrollOnRecordsCount(count: number); /** * Get Scale Horizontal's text padding */ get textPadding(): IPadding; set textPadding(value: IPadding); /** * Get Scale Horizontal's theme */ get theme(): unknown; set theme(value: unknown); /** * Get Scale Horizontal's use manual height */ get useManualHeight(): boolean; set useManualHeight(value: boolean); /** * Get Scale Horizontal's zoom mode */ get zoomMode(): string; set zoomMode(value: string); /** * Set Scale Horizontal's zoom name */ get zoomKind(): string; set zoomKind(value: string); get locale(): string; set locale(value: string); /** * Gets whether a pinch zoom gesture is in progress */ get isTouchZooming(): boolean; /** * Creates an instance of HorizontalScale. * * @param config */ constructor(config: IHorizontalScaleConfig); /** * Scale Horizontal's canvas start x * * @return Scale Horizontal's canvas start x */ canvasStartX(): number; /** * Handles Scale Horizontal's zoom * * @param pixels * @param multiplier */ onZoom(pixels: number, multiplier?: number): void; /** * Handles Scale Horizontal's scroll * * @param pixels */ onScroll(pixels: number): void; /** * Retrieves Scale Horizontal's text paint bounds * * @return Scale Horizontal's text paint bounds */ textPaintBounds(): IBounds; /** * Applies Scale Horizontal's auto scale * * @param name */ applyAutoScroll(name: DataRowsUpdateKind): void; /** * Auto scales Scale Horizontal's */ autoScale(): void; /** * Can sets visible Scale Horizontal's records * * @param record * @return Can sets visible Scale Horizontal's records */ canSetVisibleRecord(record: number): boolean; /** * Clears Scale Horizontal */ clear(): void; /** * Paints Scale Horizontal - optimized: avoid duplicate draw for selected shapes already handled in Pane.paint, * and skip shapes not matching current instrument. */ paint(): void; /** * Formats Scale Horizontal date * * @param date * @return Formatted Scale Horizontal date */ formatDate(date: Date): string; /** * Retrieves Scale Horizontal date data rows * * @return Scale Horizontal date data rows */ getDateDataRows(): DataRows; /** * Handles Scale Horizontal events * * @param event * @return is handled Scale Horizontal events */ onEvent(event: IWindowEvent): boolean; /** * Initializes Scale Horizontal visual dimensions * * @param frame * @param scaleCoordinateMapperFrame */ InitializeVisualDimensions(frame: Bounds, scaleCoordinateMapperFrame: Bounds): void; /** * Retrieves Scale Horizontal's layout scale pane * * @param chartFrame * @return Scale Horizontal's layout scale pane */ layout(chartFrame: Bounds): Bounds; saveState(): IHorizontalScaleState; restoreState(state: IHorizontalScaleState): void; /** * Makes Scale Horizontal's auto scale * * @return Makes Scale Horizontal's auto scale */ shouldAutoScale(): boolean; /** * On complete more history request */ onCompleteMoreHistoryRequest(): void; /** * Requests Scale Horizontal's more history if need */ private requestMoreBars; /** * Scrolls Scale Horizontal's on pixels * * @param pixels * @return Is scrolled */ scrollOnPixels(pixels: number): boolean; /** * Scrolls Scale Horizontal's on records * * @param records * @return Is scrolled */ scrollOnRecords(records: number): boolean; /** * Refreshes Scale Horizontal's auto scale async */ refreshAutoScaleAsync(): void; private _optimizeRefresh; /** * Refreshes Scale Horizontal's async * * @param autoScale */ refreshAsync(autoScale?: boolean): void; /** * Zooms Scale Horizontal's on pixels * * @param leftPixels * @param rightPixels * @return Is zoomed */ zoomOnPixels(leftPixels: number, rightPixels?: number): boolean; /** * Zooms Scale Horizontal's on records * * @param leftRecords * @param rightRecords * @return Is zoomed */ zoomOnRecords(leftRecords: number, rightRecords?: number): boolean; setHorizontalScaleCoordinateMapper(mapper: IHorizontalScaleCoordinateMapper): void; getColumnWidth(record: number): number; lock(): void; onTimezoneChanged(): void; /** * Applies pinch zoom anchored at the gesture midpoint * * @param scale The scale relative to gesture start. * @param centerX The gesture midpoint x, in scale coordinates. */ /** * Applies pinch zoom anchored at the gesture midpoint * * @param scale The scale relative to gesture start. * @param anchorRatio The midpoint position across the plot, from 0 to 1. */ handlePinchZoom(scale: number, anchorRatio: number): void; /** * Reset touch zoom state */ resetTouchZoom(): void; protected subscribe(): void; protected unsubscribe(): void; private updateCoordinateMapper; private autoScroll; private refresh; } } declare module FintaChart { /** * Represents Scale Vertical Pane Config */ interface IVerticalAxisConfig { /** * Scale Vertical Pane Config custom format */ customFormat?: string; /** * Scale Vertical Pane Config decimal digits */ decimalDigits?: number; /** * Scale Vertical Pane Config major tick mark length */ majorTickMarkLength?: number; /** * Scale Vertical Pane Config maximum allowed value */ maxAllowedValue?: number; /** * Scale Vertical Pane Config maximum allowed value ratio */ maxAllowedValueRatio?: number; /** * Scale Vertical Pane Config maximum allowed range ratio */ maxValueRangeRatio?: number; /** * Scale Vertical Pane Config maximum visible value */ maxVisibleValue?: number; /** * Scale Vertical Pane Config minimum allowed value */ minAllowedValue?: number; /** * Scale Vertical Pane Config minimum allowed value ratio */ minAllowedValueRatio?: number; /** * Scale Vertical Pane Config minimum value offset */ minValueOffset?: number; /** * Scale Vertical Pane Config minimum value range ratio */ minValueRangeRatio?: number; /** * Scale Vertical Pane Config minimum visible value */ minVisibleValue?: number; /** * Scale Vertical Pane Config minor tick mark length */ minorTickMarkLength?: number; /** * Scale Vertical Pane Config name */ name?: ScaleKind; /** * Scale Vertical Pane Config padding */ padding?: IPadding; /** * Scale Vertical Pane Config pane */ pane: Pane; /** * Scale Vertical Pane Config range */ range?: object; } /** * Represents Scale Vertical Pane options */ interface IVerticalAxisOptions { theme?: unknown; autoScaleMultiplier?: number; disablePaddings?: boolean; minorTickMarkLength?: number; majorTickMarkLength?: number; minAllowedValue?: number; maxAllowedValue?: number; minAllowedValueRatio?: number; maxAllowedValueRatio?: number; minValueRangeRatio?: number; maxValueRangeRatio?: number; minVisibleValue?: number; maxVisibleValue?: number; name?: ScaleKind; padding?: { left: number; top: number; right: number; bottom: number; }; range?: IMinMax; } /** * Represents Scale Vertical Pane State */ interface IVerticalAxisState { /** * Scale Vertical Pane State's formatter */ formatter: INumberFormatterState; /** * Scale Vertical Pane State's options */ options: IVerticalAxisOptions; /** * Scale Vertical Pane State's scale adapter */ scaleAdapter: IVerticalAxisAdapterState; } enum ScaleKind { LINEAR = "linear", LOGARITHMIC = "logarithmic" } /** * Provides model of Scale Vertical Pane */ class VerticalAxis extends Control implements IStateable { private readonly _pane; private readonly _coordinateMapper; private _formatter; private _leftContentFrame; private _leftFrame; private _maxValueRange; private _minValueRange; private _options; private _rightContentFrame; private _rightFrame; private _scaleAdapter; private _coordinateMapperFrame; private _range; get range(): IMinMax; set range(value: IMinMax); /** * Get Scale Vertical Pane's default layout template */ get defaultLayoutTemplate(): any; /** * Get Scale Vertical Pane's auto scale multiplayer */ get autoScaleMultiplier(): number; set autoScaleMultiplier(value: number); /** * Get disable paddings for scale */ get disablePaddings(): boolean; set disablePaddings(value: boolean); /** * Get Scale Vertical Pane's chart */ get chart(): Chart; /** * Get Scale Vertical Pane's chart scale vertical */ get verticalScale(): VerticalScale; /** * Get Scale Vertical Pane's formatter */ get formatter(): INumberFormatter; set formatter(value: INumberFormatter); /** * Get Scale Vertical Pane's left frame */ get leftFrame(): Bounds; /** * Get Scale Vertical Pane's minor tick mark length */ get minorTickLength(): number; set minorTickLength(value: number); /** * Get Scale Vertical Pane's major tick mark length */ get majorTickLength(): number; set majorTickLength(value: number); /** * Get Scale Vertical Pane's maximum allowed value */ get minAllowedValue(): number; set minAllowedValue(value: number); /** * Get Scale Vertical Pane's maximum allowed value */ get maxAllowedValue(): number; set maxAllowedValue(value: number); /** * Get Scale Vertical Pane's maximum allowed value ratio */ get minAllowedValueRatio(): number; set minAllowedValueRatio(value: number); /** * Get Scale Vertical Pane's maximum allowed value ratio */ get maxAllowedValueRatio(): number; set maxAllowedValueRatio(value: number); /** * Get Scale Vertical Pane's minimum value range */ get minValueRange(): number; set minValueRange(value: number); /** * Get Scale Vertical Pane's maximum value range */ get maxValueRange(): number; set maxValueRange(value: number); /** * Get Scale Vertical Pane's minimum value range ratio */ get minValueRangeRatio(): number; set minValueRangeRatio(value: number); /** * Get Scale Vertical Pane's maximum value range ratio */ get maxValueRangeRatio(): number; set maxValueRangeRatio(value: number); /** * Get Scale Vertical Pane's minimum visible value */ get minVisibleValue(): number; set minVisibleValue(value: number); /** * Get Scale Vertical Pane's maximum visible value */ get maxVisibleValue(): number; set maxVisibleValue(value: number); /** * Get Scale Vertical Pane's name */ get kind(): ScaleKind; set kind(value: ScaleKind); /** * Get Scale Vertical Pane's padding */ get padding(): IPadding; /** * Get Scale Vertical Pane's pane */ get pane(): Pane; /** * Get Scale Vertical Pane's right frame */ get rightFrame(): Bounds; /** * Get Scale Vertical Pane's scale adapter */ get scaleAdapter(): IVerticalAxisAdapter; set scaleAdapter(value: IVerticalAxisAdapter); /** * Get Scale Vertical Pane's scale coordinate mapper */ get coordinateMapper(): ScaleCoordinateMapper; /** * Get Scale Vertical Pane's scale coordinate mapper frame */ get coordinateMapperFrame(): Bounds; /** * Get Scale Vertical Pane's theme */ get theme(): unknown; set theme(value: unknown); /** * Creates an instance of VerticalAxis. * * @param config */ constructor(config: IVerticalAxisConfig); /** * Auto scales Scale Vertical Pane */ autoScale(): void; /** * Auto scales all Scale Vertical Pane * * @param minimum * @param maximum */ autoScaleAll(minimum: number, maximum: number): void; /** * Clips Scale Vertical Pane * * @return Is Scale Vertical Pane clip */ clip(): boolean; dispose(): void; /** * Paints Scale Vertical Pane */ paint(): void; /** * Formats Scale Vertical Pane value * * @param value * @return Formatted Scale Vertical Pane value */ formatValue(value: number): string; hitTest(point: IPoint): boolean; resize(frame: Bounds): void; saveState(): IVerticalAxisState; restoreState(state: IVerticalAxisState): void; /** * Makes Scale Vertical Pane auto scale * * @return Scale Vertical Pane auto scale is made */ makeAutoScale(): boolean; /** * Retrieves Scale Vertical Pane's preferred width * * @return Scale Vertical Pane's preferred width */ preferredWidth(): number; /** * Scrolls Scale Vertical Pane on pixels * * @param pixels * @return Scrolled Scale Vertical Pane on pixels */ scrollOnPixels(pixels: number): boolean; /** * Scrolls Scale Vertical Pane on value * * @param valueOffset * @return Scrolled Scale Vertical Pane on value */ scrollOnValue(valueOffset: number): boolean; /** * Sets Scale Vertical Pane's formatters decimal digits * * @param decimalDigits */ setFormattersDecimalDigits(decimalDigits: number): void; /** * Refreshes Scale Vertical Pane's scale async */ refreshScaleAsync(): void; /** * Refreshes Scale Vertical Pane's auto scale all async * * @param minimum * @param maximum */ refreshAutoScaleAllAsync(minimum: number, maximum: number): void; /** * Zooms Scale Vertical Pane on pixels * * @param pixels * @return Zoomed Scale Vertical Pane on pixels */ zoomOnPixels(pixels: number): boolean; /** * Zooms Scale Vertical Pane on value * * @param valueOffset * @return Zoomed Scale Vertical Pane on value */ zoomOnValue(valueOffset: number): boolean; zoomOrScrollWithUpdate(offset: number, func: (value: number) => void): void; protected initMotionEvents(): MotionEventArray; private canSetVisibleValueRange; private onDoubleClick; private onMouseWheel; private onMove; private index; private layoutContentFrames; private updateFormatter; private valueOffset; } } declare module FintaChart { /** * Represents Scale Vertical Container Config */ interface IVerticalAxisPaneConfig { /** * Scale Vertical Container Config css class */ cssClass: string; /** * Scale Vertical Container Config scale vertical */ verticalScale: VerticalScale; /** * Scale Vertical Container Config visible */ visible?: boolean; } /** * Provides model of Scale Vertical Container */ class VerticalAxisPane extends HtmlControl { private static TRANSPARENT; private readonly _cssClass; private readonly _verticalScale; private _isVisible; /** * Get Scale Vertical Container's chart */ get chart(): Chart; /** * Get Scale Vertical Container's content size */ get contentSize(): ISize; /** * Get Scale Vertical Container's css class */ get cssClass(): string; /** * Get Scale Vertical Container's scale vertical */ get verticalScale(): VerticalScale; /** * Get Scale Vertical Container's size */ get size(): ISize; /** * Get Scale Vertical Container's visible */ get visible(): boolean; set visible(value: boolean); /** * Creates an instance of VerticalAxisPane. * * @param config */ constructor(config: IVerticalAxisPaneConfig); /** * Setups Scale Vertical Container's layout theme */ setupLayoutTheme(): void; /** * Retrieves Scale Vertical Container's width * * @return Scale Vertical Container's width */ getWidth(): number; resize(frame: Bounds, isLeftPane?: boolean): Bounds; protected createContainer(): HTMLElement; } } declare module FintaChart { /** * Represents Scale Vertical Config */ interface IVerticalScaleOptions { showLeftPane?: boolean; showRightPane?: boolean; width?: number; useManualWidth?: boolean; } interface IVerticalScaleConfig extends IChartComponentConfig { /** * Represents Scale Vertical Config show left pane */ showLeftPane?: boolean; /** * Represents Scale Vertical Config show right pane */ showRightPane?: boolean; /** * Represents Scale Vertical Config use manual width */ useManualWidth?: boolean; /** * Represents Scale Vertical Config width */ width?: number; } /** * Provides model of Scale Vertical */ class VerticalScale extends ChartComponent implements IStateable { private _leftAxis; private _rightAxis; private _options; /** * Get Scale Vertical's index */ get index(): number; /** * Get Scale Vertical's left pane */ get leftAxis(): VerticalAxisPane; /** * Get Scale Vertical's right pane */ get rightAxis(): VerticalAxisPane; /** * Get Scale Vertical's left pane css class */ get leftAxisCssClass(): string; /** * Get Scale Vertical's right pane css class */ get rightAxisCssClass(): string; /** * Get Scale Vertical's left pane visible */ get leftAxisVisible(): boolean; set leftAxisVisible(value: boolean); /** * Get Scale Vertical's right pane visible */ get rightAxisVisible(): boolean; set rightAxisVisible(value: boolean); /** * Get Scale Vertical's manual width */ get manualWidth(): number; set manualWidth(value: number); /** * * Get Scale Vertical's use manual width */ get useManualWidth(): boolean; set useManualWidth(value: boolean); /** * Creates an instance of VerticalScale. * * @param config */ constructor(config: IVerticalScaleConfig); dispose(): void; /** * Initializes Scale Vertical's dimensions * * @param frame * @return Scale Vertical's dimensions */ InitializeVisualDimensions(frame: Bounds): Bounds; saveState(): IVerticalScaleOptions; restoreState(state: IVerticalScaleOptions): void; } } declare module FintaChart { /** * Describes major tick on horizontal axis. * */ interface IHorizontalAxisMajorTick { /** * The tick's date. */ date: Date; /** * The text. */ text: string; /** * The text alignment. */ textAlign: TextAlign; /** * The x position of the text. */ textX: number; /** * The x position of the tick. */ x: number; } /** * Describes minor tick on horizontal axis. * */ interface IHorizontalAxisMinorTick { /** * The x position of the tick. */ x: number; } /** * */ interface IHorizontalAxisAdapterDefaults { showVirtualDates: boolean; } /** * Describes config of the horizontal scale adapter. * */ interface IHorizontalAxisAdapterConfig { } /** * Describes horizontal scale adapter state. * */ interface IHorizontalAxisAdapterState { /** * The adapter type name. */ type: string; /** * The horizontal scale adapter options. */ options: IHorizontalAxisAdapterOptions; } /** * Describes horizontal scale adapter. * */ interface IHorizontalAxisAdapter extends IStateable { /** * The array of major ticks. */ majorTicks: IHorizontalAxisMajorTick[]; /** * The array of minor ticks. */ minorTicks: IHorizontalAxisMinorTick[]; /** * Resets axis adapter properties to default values. */ resetToDefaults(): void; /** * Normalizes Scale Horizontal Adapter * * @param scale */ createTicks(scale: HorizontalScale): void; onTimezoneChanged(scale: HorizontalScale): void; onLocaleChanged(scale: HorizontalScale, locale: string): void; } /** * Provides model of Scale Horizontal Adapter * */ abstract class HorizontalAxisAdapterBase implements IHorizontalAxisAdapter { /** * Get type name. */ static get type(): string; static readonly defaults: IHorizontalAxisAdapterDefaults; private _majorTicks; private _minorTicks; /** * The default adapter properties. */ protected get defaults(): IHorizontalAxisAdapterDefaults; get majorTicks(): IHorizontalAxisMajorTick[]; get minorTicks(): IHorizontalAxisMinorTick[]; /** * Creates an instance of HorizontalAxisAdapter. * * @param config */ constructor(config?: IHorizontalAxisAdapterConfig); abstract saveState(): IHorizontalAxisAdapterState; abstract restoreState(state: IHorizontalAxisAdapterState): void; abstract resetToDefaults(): void; createTicks(scale: HorizontalScale): void; onTimezoneChanged(scale: HorizontalScale): void; onLocaleChanged(scale: HorizontalScale, locale: string): void; /** * Normalizes Scale Horizontal Adapter's major ticks * * @param scale */ protected abstract createMajorTicks?(scale: HorizontalScale): void; /** * Normalizes Scale Horizontal Adapter's minor ticks * * @param ticksCount */ protected createMinorTicks(ticksCount?: number): void; } } declare module FintaChart { /** * Describes horizontal scale adapter options. * */ interface IHorizontalAxisAdapterOptions { showVirtualDates: boolean; } /** * Provides model of Scale Horizontal Adapter * */ abstract class HorizontalAxisAdapter extends HorizontalAxisAdapterBase { protected options: TOptions; /** * Get Scale Horizontal Adapter's show virtual dates */ get showVirtualDates(): boolean; set showVirtualDates(value: boolean); resetToDefaults(): void; saveState(): IHorizontalAxisAdapterState; restoreState(state: IHorizontalAxisAdapterState): void; } } declare module FintaChart { } declare module FintaChart { /** * Represents Scale Vertical Major Tick * */ interface IVerticalAxisMajorTick { /** * Scale Vertical Major Tick's text */ text: string; /** * Scale Vertical Major Tick's value */ value: number; /** * Scale Vertical Major Tick's y */ y: number; } /** * Represents Scale Vertical Minor Tick * */ interface IVerticalAxisMinorTick { /** * Scale Vertical Minor Tick's y */ y: number; } /** * Represents Scale Vertical Adapter State * */ interface IVerticalAxisAdapterState { type: string; /** * Scale Vertical Adapter State's options */ options: IVerticalAxisAdapterOptions; } /** * Provides model of Scale Vertical Adapter * */ interface IVerticalAxisAdapter extends IStateable { /** * Scale Vertical Adapter's major ticks */ readonly majorTicks: IVerticalAxisMajorTick[]; /** * Scale Vertical Adapter's minor ticks */ readonly minorTicks: IVerticalAxisMinorTick[]; /** * Scale Vertical Adapter's divider */ divider: number; /** * Scale Vertical Adapter's million marker */ marker: string; /** * Normalizes Scale Vertical Adapter * * @param axis */ createTicks(axis: VerticalAxis): any; /** * Updates Scale Vertical Adapter;s formatter * * @param precision */ updateFormatter(precision: number): any; } } declare module FintaChart { /** * Represents Scale Vertical Adapter Options * */ interface IVerticalAxisAdapterOptions { /** * Scale Vertical Adapter Options divider */ divider: number; /** * Scale Vertical Adapter Options price precision */ precision?: number; /** * Scale Vertical Adapter Options million marker */ marker: string; } } declare module FintaChart { } declare module FintaChart { } declare module FintaChart { } declare module FintaChart { } declare module FintaChart { } declare module FintaChart { } declare module FintaChart { /** * Represents Base Price Holder * */ interface IBasePriceHolder { /** * Base Price Holder price */ basePrice: number; } } declare module FintaChart { /** * Represents Scale Horizontal Static Adapter Config * */ export interface IStaticHorizontalAxisAdapterConfig extends IHorizontalAxisAdapterConfig { /** * Scale Horizontal Static Adapter Config major ticks */ majorTicks?: { minOffset?: number; }; /** * Scale Horizontal Static Adapter Config minor ticks */ minorTicks?: { count?: number; }; } /** * Represents Scale Horizontal Static Adapter Options */ interface IStaticHorizontalAxisAdapterOptions extends IHorizontalAxisAdapterOptions { /** * Scale Horizontal Static Adapter Options major ticks */ majorTicks?: { minOffset?: number; }; /** * Scale Horizontal Static Adapter Options minor ticks */ minorTicks?: { count?: number; }; } /** * Represents Shape Trend Channel Config * */ export interface IStaticHorizontalAxisAdapterDefaults extends IHorizontalAxisAdapterDefaults { /** * Scale Horizontal Static Adapter Config major ticks */ majorTicks: { minOffset: number; }; /** * Scale Horizontal Static Adapter Config minor ticks */ minorTicks: { count: number; }; } /** * Provides model of Scale Horizontal Static Adapter */ export class StaticHorizontalAxisAdapter extends HorizontalAxisAdapter { static get type(): string; static readonly defaults: IStaticHorizontalAxisAdapterDefaults; private _formatter; private _preCreatedMajorTicks; /** * Creates an instance of StaticHorizontalAxisAdapter. * * @param config */ constructor(config?: IStaticHorizontalAxisAdapterConfig); /** * Get Scale Horizontal Static Adapter's minimum labels offset */ get minLabelsOffset(): number; set minLabelsOffset(value: number); /** * Get Scale Horizontal Static Adapter's minor ticks count */ get minorTicksCount(): number; set minorTicksCount(value: number); createTicks(scale: HorizontalScale): void; onTimezoneChanged(scale: HorizontalScale): void; onLocaleChanged(scale: HorizontalScale, locale: string): void; protected createMajorTicks(scale: HorizontalScale): void; protected createMinorTicks(): void; private preCreateMajorTicks; private labelText; } export {}; } declare module FintaChart { } declare module FintaChart { /** * */ interface IColumnWidthProvider { getRecordColumnWidth(record: number): number; calculate(): any; } } declare module FintaChart { } declare module FintaChart { /** * Represents coordinate mapper. */ class ScaleCoordinateMapper { horizontalMapper: IHorizontalScaleCoordinateMapper; verticalMapper: IVerticalScaleCoordinateMapper; get horizontalScale(): HorizontalScale; get verticalAxis(): VerticalAxis; /** * Creates an instance of [[ScaleCoordinateMapper]]. * * @param horizontalMapper The horizontal scale mapper. * @param verticalMapper The verticalScaleMapper. */ constructor(horizontalMapper?: IHorizontalScaleCoordinateMapper, verticalMapper?: IVerticalScaleCoordinateMapper); /** * Retrieves Scale Coordinate Mapper's column by date * * @param date * @return Scale Coordinate Mapper's column by date */ columnByDate(date: Date): number; /** * Retrieves Scale Coordinate Mapper's column by record * * @param record * @param isIntegral * @return Scale Coordinate Mapper's column by record */ columnByRecord(record: number, isIntegral?: boolean): number; /** * Retrieves Scale Coordinate Mapper's column by x * * @param x * @param isIntegral * @return Scale Coordinate Mapper's column by x */ columnByX(x: number, isIntegral?: boolean): number; /** * Retrieves Scale Coordinate Mapper's date by column * * @param column * @return Scale Coordinate Mapper's date by column */ dateByColumn(column: number): Date; /** * Retrieves Scale Coordinate Mapper's date by record * * @param record * @return Scale Coordinate Mapper's date by record */ dateByRecord(record: number): Date; /** * Retrieves Scale Coordinate Mapper's date by x * * @param x * @return Scale Coordinate Mapper's date by x */ dateByX(x: number): Date; /** * Retrieves Scale Coordinate Mapper's record by column * * @param column * @param isIntegral * @return Scale Coordinate Mapper's record by column */ recordByColumn(column: number, isIntegral?: boolean): number; /** * Retrieves Scale Coordinate Mapper's record by date * * @param date * @return Scale Coordinate Mapper's record by date */ recordByDate(date: Date): number; /** * Retrieves Scale Coordinate Mapper's record by x * * @param x * @param isIntegral * @return Scale Coordinate Mapper's record by x */ recordByX(x: number, isIntegral?: boolean): number; /** * Retrieves Scale Coordinate Mapper's volume by y * * @param y * @return Scale Coordinate Mapper's volume by y */ valueByY(y: number): number; /** * Retrieves Scale Coordinate Mapper's x by column * * @param column * @param isColumnIntegral * @param isXIntegral * @return Scale Coordinate Mapper's x by column */ xByColumn(column: number, isColumnIntegral?: boolean, isXIntegral?: boolean): number; /** * Retrieves Scale Coordinate Mapper's x by date * * @param date * @param isIntegral * @return Scale Coordinate Mapper's x by date */ xByDate(date: Date, isIntegral?: boolean): number; /** * Retrieves Scale Coordinate Mapper's x by record * * @param record * @param isIntegral * @param isXIntegral * @return Scale Coordinate Mapper's x by record */ xByRecord(record: number, isIntegral?: boolean, isXIntegral?: boolean): number; /** * Retrieves Scale Coordinate Mapper's y by value * * @param value * @return Scale Coordinate Mapper's y by value */ yByValue(value: number): number; } } declare module FintaChart { /** * Describes coordinate mapper for horizontal scale. */ interface IHorizontalScaleCoordinateMapper { /** * The scale. */ readonly scale: HorizontalScale; /** * Refreshes calculations. */ refresh(): void; /** * Calculates column number corresponding to the specified date. * * @param date The date. * @return Column number corresponding to a given date. */ columnByDate(date: Date): number; /** * Calculates column number corresponding to the specified record. * * @param record The record number. * @param isIntegral The flag that indicates whether integral column should be returned. * @return Column number corresponding to a given record. */ columnByRecord(record: number, isIntegral?: boolean): number; /** * Calculates column number corresponding to the specified x coordinate. * * @param x The x coordinate. * @param isIntegral The flag that indicates whether integral column should be returned. * @return Column number corresponding to a given x coordinate. */ columnByX(x: number, isIntegral?: boolean): number; /** * Calculates date corresponding to the specified column. * * @param column The column number. * @return Date corresponding to a given column. */ dateByColumn(column: number): Date; /** * Calculates date corresponding to the specified record. * * @param record The record number. * @return Date corresponding to a given record. */ dateByRecord(record: number): Date; /** * Calculates date corresponding to the specified x coordinate. * * @param x The x coordinate. * @return Date corresponding to a given x coordinate. */ dateByX(x: number): Date; /** * Calculates record corresponding to the specified column. * * @param column The column number. * @param isIntegral The flag that indicates whether integral record should be returned. * @return Record corresponding to a given column. */ recordByColumn(column: number, isIntegral?: boolean): number; /** * Calculates record corresponding to the specified date. * * @param date The date. * @return Record corresponding to a given date. */ recordByDate(date: Date): number; /** * Calculates record corresponding to the specified x coordinate. * * @param x The x coordinate. * @param isIntegral The flag that indicates whether integral record should be returned. * @return Record corresponding to a given x coordinate. */ recordByX(x: number, isIntegral?: boolean): number; /** * Calculates x coordinate corresponding to the specified column. * * @param column The column number. * @param isColumnIntegral The flag that indicates whether column is integral. * @param isXIntegral The flag that indicates whether integral x should be returned. * @return x coordinate corresponding to a given column. */ xByColumn(column: number, isColumnIntegral?: boolean, isXIntegral?: boolean): number; /** * Calculates x coordinate corresponding to the specified date. * * @param date The date. * @param isIntegral The flag that indicates whether integral x should be returned. * @return x coordinate corresponding to a given date. */ xByDate(date: Date, isIntegral?: boolean): number; /** * Calculates x coordinate corresponding to the specified record. * * @param record The record number. * @param isColumnIntegral The flag that indicates whether column is integral. * @param isXIntegral The flag that indicates whether integral x should be returned. * @return x coordinate corresponding to a given record. */ xByRecord(record: number, isColumnIntegral?: boolean, isXIntegral?: boolean): number; } } declare module FintaChart { interface IVerticalScaleCoordinateMapper { axis: VerticalAxis; /** * Retrieves Scale Coordinate Mapper's y by value * * @param value * @return Scale Coordinate Mapper's y by value */ yByValue(value: number): number; /** * Retrieves Scale Coordinate Mapper's volume by y * * @param y * @return Scale Coordinate Mapper's volume by y */ valueByY(y: number): number; } class VerticalScaleCoordinateMapper implements IVerticalScaleCoordinateMapper { axis: VerticalAxis; private _lastValidMin; private _lastValidMax; constructor(axis: VerticalAxis); valueByY(y: number): number; yByValue(value: number): number; private static log; private _validateAndAssignMinMax; } } declare module FintaChart { /** * Represents coordinate mapper for the scale with monospaced columns. */ class MonospacedColumnCoordinateMapper implements IHorizontalScaleCoordinateMapper { private readonly _scale; get scale(): HorizontalScale; /** * Initializes a newly created instance with specified scale. * * @param scale The scale. */ constructor(scale: HorizontalScale); refresh(): void; columnByDate(date: Date): number; columnByRecord(record: number, isIntegral?: boolean): number; columnByX(x: number, isIntegral?: boolean): number; dateByColumn(column: number): Date; dateByRecord(record: number): Date; dateByX(x: number): Date; recordByColumn(column: number, isIntegral?: boolean): number; recordByDate(date: Date): number; recordByX(x: number, isIntegral?: boolean): number; xByColumn(column: number, isColumnIntegral?: boolean, isXIntegral?: boolean): number; xByDate(date: Date, isIntegral?: boolean): number; xByRecord(record: number, isIntegral?: boolean, isXIntegral?: boolean): number; } } declare module FintaChart { class VolumeBasedCoordinateMapper extends MonospacedColumnCoordinateMapper { private _centers; refresh(): void; columnByX(x: number, isIntegral?: boolean): number; recordByX(x: number, isIntegral?: boolean): number; xByColumn(column: number, isColumnIntegral?: boolean, isXIntegral?: boolean): number; private calculateCenters; } } declare module FintaChart { /** * Represents Scale Horizontal Floating Label */ interface IHorizontalAxisLabel { /** * Scale Horizontal Floating Label's theme */ theme: IHorizontalAxisLabelTheme; /** * Paints Scale Horizontal Floating Label * * @param date * @param scale */ paint(date: Date, scale: HorizontalScale): void; } /** * Represents Scale Horizontal Floating Label Theme */ interface IHorizontalAxisLabelTheme { /** * Scale Horizontal Floating Label Theme's fill */ fill: IFillTheme; /** * Scale Horizontal Floating Label Theme's stroke */ stroke: IStrokeTheme; /** * Scale Horizontal Floating Label Theme's text */ text: ITextTheme; } /** * Provides model of Scale Horizontal Floating Label */ class HorizontalAxisLabel implements IHorizontalAxisLabel { theme: IHorizontalAxisLabelTheme; paint(date: Date, scale: HorizontalScale): void; } } declare module FintaChart { /** * Represents Scale Vertical Floating Label */ interface IVerticalAxisLabel { /** * Scale Vertical Floating Label's text offset */ textOffset: number; /** * Scale Vertical Floating Label's theme */ theme: IVerticalAxisLabelTheme; /** * Paints Scale Vertical Floating Label * * @param value * @param axis * @param theme */ paint(value: number | DataPoint, axis: VerticalAxis, theme?: IVerticalAxisLabelTheme): void; width(value: number | DataPoint, axis: VerticalAxis, theme?: IVerticalAxisLabelTheme): number; } /** * Represents Scale Vertical Floating Label Theme */ interface IVerticalAxisLabelTheme { /** * Scale Vertical Floating Label Theme's fill */ fill: IFillTheme; /** * Scale Vertical Floating Label Theme's line */ line?: IStrokeTheme; /** * Scale Vertical Floating Label Theme's text */ text: ITextTheme; } /** * Represents Scale Vertical Floating Label Defaults */ interface IVerticalAxisLabelDefaults { /** * Scale Vertical Floating Label Default's text offset */ textOffset: number; /** * Scale Vertical Floating Label Default's border radius */ borderRadius: number; } /** * Provides model of Scale Vertical Floating Label */ class VerticalAxisLabel implements IVerticalAxisLabel { /** * Scale Vertical Floating Label's defaults */ static defaults: IVerticalAxisLabelDefaults; private _textOffset; private _borderRadius; private _text; theme: IVerticalAxisLabelTheme; /** * Get Scale Vertical Floating Label's text offset */ get textOffset(): number; set textOffset(value: number); /** * Get Scale Vertical Floating Label's border radius */ get borderRadius(): number; set borderRadius(value: number); paint(value: number, axis: VerticalAxis, theme?: IVerticalAxisLabelTheme): void; width(value: number, axis: VerticalAxis, theme?: IVerticalAxisLabelTheme): number; protected paintLabel(axis: VerticalAxis, y: number, theme: IVerticalAxisLabelTheme, isLeft: boolean): void; private static paintShape; private paintTextOnLeft; private paintTextOnRight; } } declare module FintaChart { } declare module FintaChart { /** * Represents shape config */ interface IShapeConfig extends IPaneObjectConfig { /** * Creates point behavior */ createPointBehavior?: IPointBehavior; /** * Is shape hoverable */ hoverable?: boolean; /** * Is shape locked */ locked?: boolean; /** * Shape's magnet mode */ magnetMode?: string; /** * Shape's magnet point */ magnetPoint?: string; /** * Shape's point */ point?: IDataPoint; /** * Shape's points */ points?: IPoint[]; /** * Is shape resizable */ resizable?: boolean; /** * Is shape selectable */ selectable?: boolean; /** * Shape's tag */ tag?: string; /** * Shape's theme */ theme?: any; id?: string; } /** * Represents shape options */ interface IShapeOptions extends IPaneObjectOptions { /** * Creates point behavior */ createPointBehavior: IPointBehavior; /** * Shape's current visual points */ currentPoints: DataPoint[]; /** * Is shape hoverable */ hoverable: boolean; /** * is shape locked */ locked: boolean; /** * Shape's magnet mode */ magnetMode: string; /** * Shape's magnet point */ magnetPoint: string; /** * Shape's visual data points */ points: DataPoint[]; /** * Shape's radius */ radius: number; /** * Is shape removable */ removable: boolean; /** * Is shape resizable */ resizable: boolean; /** * Is shape selectable */ selectable: boolean; /** * Shape's tag */ tag?: string; /** * Shape's theme */ theme: any; instrument: IInstrument; } /** * Represents shape state */ interface IShapeState extends IPaneObjectState { /** * The name of shape type. */ type: string; /** * Specifies current active magnet mode */ magnetMode: string; } /** * Represents shape defaults */ interface IShapeDefaults { /** * Create point behavior */ createPointBehavior: IPointBehavior; /** * Shape's z-index */ zIndex: number; hoveredSizeIncrement: number; } namespace ShapeEvent { const PANE_CHANGED = "shapePaneChanged"; const VALUE_SCALE_CHANGED = "shapeVerticalScaleChanged"; const VISIBLE_CHANGED = "shapeVisibleChanged"; const POINTS_CHANGED = "shapePointsChanged"; const LOCKED_CHANGED = "shapeLockedChanged"; const RESIZABLE_CHANGED = "shapeResizableChanged"; const HOVERABLE_CHANGED = "shapeHoverableChanged"; const SELECTABLE_CHANGED = "shapeSelectableChanged"; const HOVERED_CHANGED = "shapeHoveredChanged"; const SELECTED_CHANGED = "shapeSelectedChanged"; const THEME_CHANGED = "shapeThemeChanged"; const DRAG_STARTED = "shapeDragStarted"; const DRAG_FINISHED = "chartChreateShapeManuallyDragFinished"; const DOUBLE_CLICK = "chartShapeDoubleClick"; const CONTEXT_MENU = "chartShapeContextMenu"; } const MagnetPoint: { BAR: string; HIGH: string; LOW: string; OPEN: string; CLOSE: string; }; const MagnetMode: { NONE: string; ALWAYS: string; NEAR: string; }; const ShapeDragPoint: { NONE: any; ALL: number; MOVE_POINT1: number; MOVE_POINT2: number; }; const ShapeCursorClass: { create: string; move: string; resize: string; resizeEW: string; resizeNS: string; resizeNESW: string; resizeNWSE: string; pointer: string; POINTER: string; GRAB: string; }; const minPointsDistance = 5; /** * Provides model of Shape * * @category Shapes */ abstract class Shape extends PaneObject implements IChartObject, ICloneable { private _id; private _cachedDefaultTemplate; private _cachedDefaultTemplateRef; private _cartesianPointsCache; private _cartesianPointsCacheKey; get id(): string | null; /** * Get name on instance type */ static get type(): string; /** * Get shape's subtype name */ static get subType(): string; /** * Shape's defaults */ static defaults: IShapeDefaults; /** * Get theme of the shape from local storage */ getLocalShapeTheme(): any; private static _localThemeBatchCount; private static _pendingLocalThemes; static beginLocalThemeBatch(): void; static endLocalThemeBatch(): void; /** * Update theme of the shape in local storage */ updateLocalShapeTheme(theme: any): void; /** * Batched update - reads localStorage once, merges all themes, writes once. * Used by Chart.theme setter to avoid N sync writes. */ static flushLocalThemes(updates: Record): void; private _contextMenu; private _createMotionEventClick; private _createMoveMotionEvent; private _lastCreatePoint; private _motionEvents; private _prevCrossHairType; private _shapeState; private _savable; /** * Shape's drag point */ protected dragPoint: number; /** * Is shape hovered */ private _hovered; /** * Is shape selected */ private _selected; /** * Shape's start points */ private _startPoints; /** * Shape's tag */ private _tag; /** * Is shape in paint mode */ isInPaintMode: boolean; /** * Creates an instance of Shape. * * @param config */ constructor(config?: IShapeConfig); private get contextMenu(); /** * Get shape's current theme or default theme if current theme is not set */ get defaultLayoutTemplate(): any; /** * Get default theme of shape - cached per chart.theme reference. * Avoids deep clone on every paint (was called per shape per frame). */ get defaultTemplate(): any; /** * Get is shape can hover */ get canHover(): boolean; /** * Get is shape can move */ get canMove(): boolean; /** * Get is shape can be removed */ get canRemove(): boolean; /** * Get is shape can resize */ get canResize(): boolean; /** * Get is shape can be selected */ get canSelect(): boolean; /** * Get shape's instance type name */ get type(): string; /** * Get create point behavior */ get createPointBehavior(): IPointBehavior; set createPointBehavior(value: IPointBehavior); /** * Get shape's current vial points */ get currentPoints(): DataPoint[]; set currentPoints(value: DataPoint[]); /** * Get is shape can hover */ get hoverable(): boolean; set hoverable(value: boolean); /** * Get is shape hovered */ get hovered(): boolean; set hovered(value: boolean); /** * Get is shape locked */ get locked(): boolean; set locked(value: boolean); /** * Get shape's magnet mode */ get magnetMode(): string; set magnetMode(value: string); /** * Get shape's magnet point */ get magnetPoint(): string; set magnetPoint(value: string); /** * Get shape's required points count */ get requiredPointsCount(): number; /** * Get is shape can be removed */ get removable(): boolean; set removable(value: boolean); /** * Get is shape can resize */ get resizable(): boolean; set resizable(value: boolean); /** * Get is shape can be selected */ get selectable(): boolean; set selectable(value: boolean); /** * Get is shape selected */ get selected(): boolean; set selected(value: boolean); /** * Get shape's tag */ get tag(): string; set tag(value: string); /** * Get shape's theme */ get theme(): object; set theme(value: object); /** * Get shape's instrument */ get instrument(): IInstrument; set instrument(value: IInstrument); /** * The collection of shape's points. */ get points(): DataPoint[]; set points(value: DataPoint[]); /** * Get is shape can be saved */ get savable(): boolean; set savable(value: boolean); /** * Get motion events handler */ get createMotionEventClick(): ClickMotionEvent; setDefaultColorValues(themeObj?: Record, path?: string[]): void; private _setDefaultColorValuesInternal; setDefaultValuesToColoredObjects(themeObj: Record): void; /** * Get shape's defaults */ protected get defaults(): IShapeDefaults; /** * Get is shape can handle events */ protected get canHandleEvents(): boolean; /** * Finishes shape create manually */ finishNewShape(): void; /** * Handle shape create manually motion event click * * @param motionEvent * @param event */ onNewShapeClick(motionEvent: ClickMotionEvent, event: IWindowEvent): void; /** * Defines shape's drag point * * @param dragPoint */ defineDragPoint(dragPoint: number): void; /** * Appends visual data points to shape * * @param point * @return Pints list */ appendVisualDataPoint(point: IDataPoint): DataPoint[]; /** * Retrieves shape bounds * * @return Null */ bounds(): IBounds; private _invalidateCartesianCache; /** * Retrieves shape's cartesian point * * @param index * @return Cartesian point */ cartesianPoint(index: number): IPoint; /** * Retrieves shape's cartesian points - cached per frame. * Cache key includes points identity + mapper position; invalidated on point mutations. * Avoids 2-3 allocations per shape per mousemove/paint. */ cartesianPoints(): IPoint[]; clone(): Shape; dispose(): void; /** * Draws horizontal scale floating labels */ drawHorizontalScaleLabels(): void; /** * Draws vertical scale floating labels */ paintVerticalAxisLabels(): void; /** * Handles event * * @param event * @return Is event handled */ handleEvent(event: IWindowEvent): boolean; /** * Hits test * * @param point * @return Is test hits */ hitTest(point: IPoint): boolean; /** * Hover hit test * * @param point * @return Is test hits */ hoverHitTest(point: IPoint): boolean; /** * Hover shape */ hover(): void; restoreState(state: IShapeState): void; /** * Retrieves points localization keys * * @returnLocalization keys */ pointsLocalizationKeys(): string[]; /** * Removes shape * * @return Is shape removed */ remove(): boolean; saveState(): IShapeState; /** * Selects shape */ select(): void; /** * Refreshes chart async */ refreshAsyncChart(): void; /** * Refreshes pane async */ refreshAsyncPane(): void; /** * Sets shape visual data points * * @param points */ setVisualDataPoints(points: IDataPoint | IDataPoint[]): void; /** * Sets visual data points with createTicks * * @param points */ setVisualDataPointsWithNormalize(points: IPoint[]): void; /** * Shows shape's settings dialog */ showSettingsDialog(): void; /** * Starts create shape manually */ startNewShape(): void; /** * Translates shape * * @param dx * @param dy */ translate(dx: number, dy: number): void; /** * Refreshes pane */ refreshPane(): void; /** * Resetting state of motions to initial fo current shape */ resetMotions(): void; handleChartLocaleChange(locale: string): void; moveHorizontally(offset: number): void; moveVertically(offset: number): void; adjustBarsCountForTimeframe(): void; /** * @description Visualize hover dots brushes * @protected * @param {(IPoint | IPoint[])} points * @memberof Shape */ protected _visualizeHoverDotsBrushs(points: IPoint | IPoint[]): void; /** * @description Visualize hover dots brushes if selected * @protected * @param {(IPoint | IPoint[])} points * @memberof Shape */ protected _visualizeHoverDotsBrushsIfSelected(points: IPoint | IPoint[]): void; /** * @description Retrieves hover dots brush width * @protected * @param {*} theme * @returns {number} Width * @memberof Shape */ protected _getHoverDotsBrushWidth(theme: any): number; /** * @description Get shape's visual data points * @property {DataPoint[]} visualDataPoints * @memberof Shape */ get visualDataPoints(): DataPoint[]; /** * Paints highlighted points. * * @param points The highlighted points. */ protected paintHighlightedPoints(points: IPoint | IPoint[]): void; /** * Visualize hover dots brushes if selected * * @param points */ protected paintHighlightedPointsIfNeeded(points: IPoint | IPoint[]): void; /** * Visualize hovered shape * * @param oldTheme * @return Theme */ protected paintHovered(oldTheme: any): any; /** * Retrieves hover dots brush width * * @param theme * @return Width */ protected getHoverMarkerWidth(theme: any): number; /** * Handles motion event context menu * * @param motionEvent * @param event */ protected onContextMenu(motionEvent: MotionEvent, event: IWindowEvent): void; /** * Handles motion event double click */ protected onDoubleClick(): void; /** * Handles motion event mouse hover * * @param motionEvent * @param event * @return Is handled */ protected onMouseHover(motionEvent: MouseHoverMotionEvent, event: IWindowEvent): boolean; /** * Handles motion event pencil device * * @param motionEvent * @param event * @return Is handed */ protected onMove(motionEvent: MoveMotionEvent, event: IWindowEvent): boolean; /** * Handles create shape manually move motion event * * @param motionEvent * @param event */ protected onNewShapeMove(motionEvent: MouseHoverMotionEvent, event: IWindowEvent): void; /** * Handles create shape manually point * * @param point * @return Is handled */ protected onNewShapePoint(point: IDataPoint): boolean; /** * Retrieves is shape large enough * * @return Is shape large enough */ protected isLargeEnough(): boolean; /** * Retrieves shape's magnetize point * * @param point * @return Magnetize point */ protected magnetizePoint(point: IPoint): IPoint; /** * Normalizes create shape manually point * * @param point * @return Manually point */ protected normalizeNewShapePoint(point: IPoint): DataPoint; /** * On hoverable changed */ protected onHoverableChanged(): void; /** * On pane changed * * @param oldValue */ protected onPaneChanged(oldValue: Pane): void; /** * On vertical scale changed * * @param oldValue */ protected onVerticalScaleChanged(oldValue: VerticalScale): void; /** * On selected changed */ protected onSelectedChanged(): void; /** * On visible changed * * @param oldValue */ protected onVisibleChanged(oldValue: boolean): void; /** * Retrieves option value * * @param key * @return Option value */ protected optionValue(key: string): any; /** * Shows settings control drag pane */ protected showSettingsPane(): void; /** * Sets current points * * @param points */ protected setCurrentPoints(points: IPoint[]): void; protected movePoint(pointIndex: number, location: IPoint): void; protected shouldTransformOnMove(event: IWindowEvent): void; protected handleHotkeyTransform(event: IWindowEvent, shapeType: string, hotkeyType: ChartHotkeyType, applyTransformation: (shape: Shape, isHotkeyEnabled: boolean) => void): void; private canMagnetizeToPoint; private onClick; private onPress; private onMouseHoverInternal; private onMoveInternal; private processMoveStep; private initMotionEvents; private clickHitTest; private moveHitTest; private isMoving; private shouldMagnetizeLastPoint; } } declare module FintaChart { /** * Provides model of Shape Container */ class ShapeFactory { private static _objFactory; /** * Get chart available shapes */ static get knownTypes(): IterableIterator; /** * Adds shape to the factory. * * @param type The shape type. */ static add(type: typeof Shape): void; /** * Creates new shape instance of specified type name. * * @param typeName The type name of the shape. * @return Shape instance of given type. */ static create(typeName: string): Shape; /** * Restores shape from a previously saved state. * * @param state The saved shape state. * @return Shape instance. */ static restore(state: string | IShapeState): Shape; } } declare module FintaChart { /** * Represents abstract shape command. */ abstract class ShapeCommand extends Command { /** * The shape. */ protected shape: Shape; /** * The shape's pane index. */ protected paneIndex: number; /** * The parent chart. */ protected get chart(): Chart; /** * Initializes new instance of the [[ShapeCommand]] class. * * @param pane The pane. * @param shape The shape. */ constructor(pane: Pane, shape: Shape); abstract execute(): void; abstract rollback(): void; /** * Applies pane to the shape and executor. */ protected applyPane(): void; } } declare module FintaChart { /** * Represents command to add shape. */ class AddShapeCommand extends ShapeCommand { execute(): void; rollback(): void; } } declare module FintaChart { /** * Represents command to delete shape. */ class DeleteShapeCommand extends ShapeCommand { execute(): void; rollback(): void; } } declare module FintaChart { /** * Represents command to delete all shapes. */ class DeleteShapesCommand extends Command { /** * The list of shapes. */ private readonly _shapes; /** * Initializes new instance of the [[DeleteShapesCommand]] class. * * @param pane The pane. * @param shapes The list of shapes. */ constructor(pane: Pane, shapes: Shape[]); execute(): void; rollback(): void; } } declare module FintaChart { /** * Represents command to drag shape. */ class DragShapeCommand extends ShapeCommand { /** * The new position points. */ private readonly _newPoints; /** * The old position points. */ private readonly _oldPoints; /** * Initializes new instance of the [[DragShapeCommand]] class. * * @param pane The pane. * @param shape The shape. * @param oldPoints The old position points. */ constructor(pane: Pane, shape: Shape, oldPoints: DataPoint[]); execute(): void; rollback(): void; } } declare module FintaChart { /** * Represents command to update shape. */ class UpdateShapeCommand extends ShapeCommand { /** * Contains new changes */ private _newChanges; /** * Contains old Changes */ private _oldChanges; /** * Creates an instance of UpdateShapeCommand. * * @param executor * @param shape * @param changes */ constructor(executor: Pane, shape: Shape, changes: PropertyChangeEvent[]); execute(): void; rollback(): void; } } declare module FintaChart { /** * Base class for shapes that require multiple points and can be finished with Enter key. * Provides common functionality for shapes like Polyline and Polygon. * * @category Shapes */ abstract class MultiPointShape extends Shape { private _enterPressHandler; private static _instances; private static _globalHandler; private static _ensureGlobalHandler; private static _removeGlobalHandlerIfEmpty; constructor(config: IShapeConfig); dispose(): void; /** * Shows tooltip with instructions on how to finish the shape. * Can be overridden by subclasses for custom tooltip positioning. * * @param points - Array of points to determine tooltip position */ protected showInfoTooltip(points: IPoint[]): void; /** * Checks if the shape has been finished (no tracking point). * * @param points - All points including tracking point * @returns True if shape is finished */ protected isShapeFinished(points: IPoint[]): boolean; private listenOnEnterPress; private unsubscribeOnEnterPress; private finishShapeOnEnterPress; } } declare module FintaChart { const FibonacciLevelTextHorPosition: { LEFT: string; CENTER: string; RIGHT: string; }; const FibonacciLevelTextVerPosition: { TOP: string; MIDDLE: string; BOTTOM: string; }; const FibonacciLevelLineExtension: { NONE: string; LEFT: string; RIGHT: string; TOP: string; BOTTOM: string; BOTH: string; }; /** * Represents fibonacci level */ interface IFibonacciLevel { /** * Fibonacci level theme */ theme?: IFibonacciLevelTheme; /** * Fibonacci level value */ value: number; /** * Fibonacci level visibility */ visible?: boolean; } /** * Represents fibonacci level theme */ interface IFibonacciLevelTheme { /** * Fibonacci level theme fill */ fill?: IFillTheme; /** * Fibonacci level theme line */ line?: IStrokeTheme; /** * Fibonacci level theme text */ text?: ITextTheme; } /** * Represents fibonacci base config */ interface IFibonacciShapeConfig extends IShapeConfig { /** * Fibonacci base config levels */ levels: IFibonacciLevel[]; } /** * Represents shape fibonacci base defaults */ interface IFibonacciShapeDefaults extends IShapeDefaults { /** * Shape fibonacci base defaults level text horizontal position */ levelTextHorPosition?: string; /** * Shape fibonacci base defaults level text vertical position */ levelTextVerPosition?: string; /** * Shape fibonacci base defaults levels */ levels?: IFibonacciLevel[]; /** * Shape fibonacci base defaults show level backgrounds */ showLevelBackgrounds?: boolean; /** * Shape fibonacci base defaults show level lines */ showLevelLines?: boolean; /** * Shape fibonacci base defaults show level percents */ showLevelPercents?: boolean; /** * Shape fibonacci base defaults show level prices */ showLevelPrices?: boolean; /** * Shape fibonacci base defaults show level values */ showLevelValues?: boolean; /** * Shape fibonacci base defaults show trend line */ showTrendLine?: boolean; } namespace ShapeEvent { const LEVELS_CHANGED = "shapeLevelsChanged"; const SHOW_TREND_LINE_CHANGED = "shapeShowTrendLineChanged"; const SHOW_LEVEL_LINES_CHANGED = "shapeShowLevelLinesChanged"; const SHOW_LEVEL_BACKGROUNDS_CHANGED = "shapeShowLevelBackgroundsChanged"; const SHOW_LEVEL_VALUES_CHANGED = "shapeShowLevelValuesChanged"; const SHOW_LEVEL_PRICES_CHANGED = "shapeShowLevelPricesChanged"; const SHOW_LEVEL_PERCENTS_CHANGED = "shapeShowLevelPercentsChanged"; const LEVEL_TEXT_HOR_POSITION_CHANGED = "shapeLevelTextHorPositionChanged"; const LEVEL_TEXT_VER_POSITION_CHANGED = "shapeLevelTextVerPositionChanged"; const LEVEL_LINES_EXTENSION_CHANGED = "shapeLevelLinesExtensionChanged"; const REVERSE_CHANGED = "shapeReverseChanged"; } /** * Provides model of Shape Fibonacci Base * * @category Shapes */ abstract class FibonacciShape extends Shape { static get subType(): string; static defaults: IFibonacciShapeDefaults; /** * Shape Fibonacci Base text offset */ protected textOffset: number; /** * Creates an instance of FibonacciShape. * * @param config */ constructor(config?: IFibonacciShapeConfig); protected get defaults(): IFibonacciShapeDefaults; /** * Get shape's level text horizontal position */ get levelTextHorPosition(): string; set levelTextHorPosition(value: string); /** * Get shape's level text vertical position */ get levelTextVerPosition(): string; set levelTextVerPosition(value: string); /** * Get shape's levels */ get levels(): IFibonacciLevel[]; set levels(value: IFibonacciLevel[]); /** * Set default levels color values as default */ setDefaultLevelValues(): void; /** * Set trendLine stroke color as default */ setDefaultTrendLineColor(): void; /** * Updates only a single value of a theme in a local storage */ updateLocalValue(key: string, value: unknown): void; /** * Get is shows shape's level background */ get showLevelBackgrounds(): boolean; set showLevelBackgrounds(value: boolean); /** * Get is shows shape's level lines */ get showLevelLines(): boolean; set showLevelLines(value: boolean); /** * Get is shows shape's level percents */ get showLevelPercents(): boolean; set showLevelPercents(value: boolean); /** * Get is shows shape's level prices */ get showLevelPrices(): boolean; set showLevelPrices(value: boolean); /** * Get is shows shape's level values */ get showLevelValues(): boolean; set showLevels(value: boolean); /** * Get is shows shape's trend line */ get showTrendLine(): boolean; set showTrendLine(value: boolean); pointsLocalizationKeys(): string[]; showSettingsDialog(): void; /** * Adjusts x with text offset * * @param x * @return Adjusted x value */ protected adjustXWithTextOffset(x: number): number; /** * Adjusts y with text offset * * @param y * @return Adjusted y value */ protected adjustYWithTextOffset(y: number): number; /** * Applies text position */ protected applyTextPosition(): void; protected paintHovered(oldTheme: any): any; /** * Formats level value * * @param level * @return Formatted level value */ protected formatLevelValue(level: IFibonacciLevel): string; /** * Formats price at y * * @param y * @return Formatted price */ protected formatPriceAtY(y: number): string; /** * Checks is level visible * * @param level * @return Is level visible */ protected isLevelVisible(level: IFibonacciLevel): boolean; /** * Retrieves level value offset from horizontal position * * @param levelTheme * @param theme * @return Value offset from horizontal position */ protected levelValueOffsetFromHorPosition(levelTheme: IFibonacciLevelTheme, theme: any): number; /** * Retrieves level value offset from vertical position * * @param levelTheme * @param theme * @return Value offset from horizontal position */ protected levelValueOffsetFromVerPosition(levelTheme: IFibonacciLevelTheme, theme: any): number; /** * Retrieves text base line from vertical position * * @return Text base line from vertical position */ protected textBaselineFromVerPosition(): TextBaseline; private graphicsTextAlign; } } declare module FintaChart { /** * Provides model of Shape Fibonacci Arcs * * @category Shapes */ class FibonacciArcsShape extends FibonacciShape { static get type(): string; get requiredPointsCount(): number; bounds(): IBounds; paint(): void; hitTest(point: IPoint): boolean; protected onMove(motionEvent: MoveMotionEvent, event: IWindowEvent): boolean; } } declare module FintaChart { /** * Provides model of Shape Fibonacci Ellipses * * @category Shapes */ class FibonacciEllipsesShape extends FibonacciShape { static get type(): string; get requiredPointsCount(): number; bounds(): IBounds; paint(): void; hitTest(point: IPoint): boolean; protected onMove(motionEvent: MoveMotionEvent, event: IWindowEvent): boolean; } } declare module FintaChart { /** * Represents shape fibonacci extensions defaults */ interface IFibonacciExtensionsShapeDefaults extends IFibonacciShapeDefaults { /** * Fibonacci extensions defaults level lines extension */ levelLinesExtension: string; /** * Fibonacci extensions defaults reverse */ reverse: boolean; } /** * Provides model of Shape Fibonacci Extensions * * @category Shapes */ class FibonacciExtensionsShape extends FibonacciShape { static get type(): string; static defaults: IFibonacciExtensionsShapeDefaults; protected get defaults(): IFibonacciExtensionsShapeDefaults; get requiredPointsCount(): number; /** * Get level lines extension */ get levelLinesExtension(): string; set levelLinesExtension(value: string); /** * Get reverse */ get reverse(): boolean; set reverse(value: boolean); bounds(): IBounds; paint(): void; hitTest(point: IPoint): boolean; pointsLocalizationKeys(): string[]; protected adjustXWithTextOffset(x: number): number; protected onMove(motionEvent: MoveMotionEvent, event: IWindowEvent): boolean; private levelTextAlign; private linesXRange; private valueTextX; } } declare module FintaChart { /** * Provides model of Shape Fibonacci Fan * * @category Shapes */ class FibonacciFanShape extends FibonacciShape { static get type(): string; static defaults: IFibonacciShapeDefaults; get requiredPointsCount(): number; bounds(): IBounds; paint(): void; hitTest(point: IPoint): boolean; protected onMove(motionEvent: MoveMotionEvent, event: IWindowEvent): boolean; } } declare module FintaChart { /** * Represents shape fibonacci retracements defaults */ interface IFibonacciRetracementsShapeDefaults extends IFibonacciShapeDefaults { /** * Fibonacci retracements defaults level lines extension */ levelLinesExtension: string; /** * Fibonacci retracements defaults reverse */ reverse: boolean; } /** * Provides model of Shape Fibonacci Retracements * * @category Shapes */ class FibonacciRetracementsShape extends FibonacciShape { static get type(): string; static defaults: IFibonacciRetracementsShapeDefaults; protected get defaults(): IFibonacciRetracementsShapeDefaults; get requiredPointsCount(): number; /** * Get shape's level lines extension */ get levelLinesExtension(): string; set levelLinesExtension(value: string); /** * Get shape's revers */ get reverse(): boolean; set reverse(value: boolean); cartesianPoints(): IPoint[]; bounds(): IBounds; paint(): void; hitTest(point: IPoint): boolean; protected adjustXWithTextOffset(x: number): number; protected onMove(motionEvent: MoveMotionEvent, event: IWindowEvent): boolean; onNewShapeClick(motionEvent: ClickMotionEvent, event: IWindowEvent): void; protected onNewShapeMove(motionEvent: MouseHoverMotionEvent, event: IWindowEvent): void; private levelTextAlign; private levelTextX; private linesXRange; } } declare module FintaChart { /** * Represents Shape Fibonacci Time Zones Defaults */ interface IFibonacciTimeZonesShapeDefaults extends IFibonacciShapeDefaults { /** * Shape Fibonacci Time Zones Defaults level lines extension */ levelLinesExtension: string; } /** * Provides model of Shape Fibonacci Time Zones * * @category Shapes */ class FibonacciTimeZonesShape extends FibonacciShape { static get type(): string; static defaults: IFibonacciTimeZonesShapeDefaults; protected get defaults(): IFibonacciTimeZonesShapeDefaults; get requiredPointsCount(): number; /** * Get shape's level lines extension */ get levelLinesExtension(): string; set levelLinesExtension(value: string); bounds(): IBounds; paint(): void; hitTest(point: IPoint): boolean; protected onMove(motionEvent: MoveMotionEvent, event: IWindowEvent): boolean; private linesYRange; } } declare module FintaChart { } declare module FintaChart { /** * Represents circle shape. * * @category Shapes */ class CircleShape extends Shape { static get type(): string; get requiredPointsCount(): number; bounds(): IBounds; paint(): void; hitTest(point: IPoint): boolean; pointsLocalizationKeys(): string[]; protected onMove(motionEvent: MoveMotionEvent, event: IWindowEvent): boolean; private highlightedPoints; private updateCursor; private getCursorClass; } } declare module FintaChart { /** * Represents cyclic lines shape. * * @category Shapes */ class CyclicLinesShape extends Shape { static get type(): string; private _isDirectionRight; private _shapePoints; get requiredPointsCount(): number; bounds(): IBounds; paint(): void; hitTest(point: IPoint): boolean; pointsLocalizationKeys(): string[]; protected onMove(motionEvent: MoveMotionEvent, event: IWindowEvent): boolean; private calculateXPoints; } } declare module FintaChart { /** * Provides model of Shape Ellipse * * @category Shapes */ class EllipseShape extends Shape { private _makeCircle; static get type(): string; get requiredPointsCount(): number; set makeCircle(isCircle: boolean); bounds(): IBounds; paint(): void; hitTest(point: IPoint): boolean; pointsLocalizationKeys(): string[]; protected onMove(motionEvent: MoveMotionEvent, event: IWindowEvent): boolean; protected shouldTransformOnMove(event: IWindowEvent): void; private normalizePoints; private highlightedPoints; private updateCursor; private getCursorClass; } } declare module FintaChart { /** * Represents free hand shape. * * @category Shapes */ class FreeHandShape extends Shape { static get type(): string; private _shapePoints; get requiredPointsCount(): number; bounds(): IBounds; paint(): void; hitTest(point: IPoint): boolean; protected onNewShapeMove(motionEvent: MouseHoverMotionEvent, event: any): void; protected onNewShapePoint(point: IDataPoint): boolean; private _lastFreeHandAppend; private appendNormalizePoint; } } declare module FintaChart { /** * Describes horizontal line shape defaults. */ interface IHorizontalLineShapeDefaults extends IShapeDefaults { /** * Represents Shape Horizontal Line Defaults show vertical scale floating label */ showVerticalAxisLabel: boolean; } /** * Represents horizontal line shape. * * @category Shapes */ class HorizontalLineShape extends Shape { static get type(): string; static defaults: IHorizontalLineShapeDefaults; protected get defaults(): IHorizontalLineShapeDefaults; /** * Get is shows vertical scale floating label */ get showVerticalAxisLabel(): boolean; set showVerticalAxisLabel(value: boolean); bounds(): IBounds; paint(): void; paintVerticalAxisLabels(): void; hitTest(point: IPoint): boolean; } /** * Convenience constructor for a horizontal price line. * * Accepts the shorthand `{ value, stroke: { color, width } }` form * documented in the quick-start guide and translates it into the * canonical Shape config (`{ point: { value }, theme: { line: ... } }`). * Falls through unchanged for already-canonical configs. */ class HorizontalLine extends HorizontalLineShape { constructor(config?: any); private static normalize; } } declare module FintaChart { /** * Describes horizontal line shape defaults. */ interface IHorizontalRayShapeDefaults extends IShapeDefaults { /** * Represents Shape Horizontal Line Defaults show vertical scale floating label */ showVerticalAxisLabel: boolean; /** * Default reverse direction setting */ reverse: boolean; /** * Default magnet mode */ magnetMode: string; /** * Default magnet point */ magnetPoint: string; } /** * Represents horizontal line shape. * * @category Shapes */ class HorizontalRayShape extends Shape { static get type(): string; static defaults: IHorizontalRayShapeDefaults; protected get defaults(): IHorizontalRayShapeDefaults; /** * Get is shows vertical scale floating label */ get showVerticalAxisLabel(): boolean; set showVerticalAxisLabel(value: boolean); /** * Get reverse direction setting */ get reverse(): boolean; set reverse(value: boolean); /** * Get magnet mode for price level snapping */ get magnetMode(): string; set magnetMode(value: string); /** * Get magnet point (which price level to snap to) */ get magnetPoint(): string; set magnetPoint(value: string); bounds(): IBounds; paint(): void; paintVerticalAxisLabels(): void; hitTest(point: IPoint): boolean; } } declare module FintaChart { /** * Represents line segment shape. * * @category Shapes */ class LineSegmentShape extends Shape { static get type(): string; get requiredPointsCount(): number; bounds(): IBounds; paint(): void; hitTest(point: IPoint): boolean; pointsLocalizationKeys(): string[]; protected onMove(motionEvent: MoveMotionEvent, event: IWindowEvent): boolean; } } declare module FintaChart { /** * Represents polygon shape. * * @category Shapes */ class PolygonShape extends MultiPointShape { static get type(): string; get requiredPointsCount(): number; bounds(): IBounds; paint(): void; hitTest(point: IPoint): boolean; protected onMove(motionEvent: MoveMotionEvent, event: IWindowEvent): boolean; protected onNewShapePoint(point: IDataPoint): boolean; } } declare module FintaChart { /** * Represents polyline shape. * * @category Shapes */ class PolylineShape extends MultiPointShape { static get type(): string; get requiredPointsCount(): number; bounds(): IBounds; paint(): void; hitTest(point: IPoint): boolean; protected onMove(motionEvent: MoveMotionEvent, event: IWindowEvent): boolean; protected onNewShapePoint(point: IDataPoint): boolean; } } declare module FintaChart { /** * Describes ray shape defaults. */ interface IRayShapeDefaults extends IShapeDefaults { /** * Default magnet mode */ magnetMode: string; /** * Default magnet point */ magnetPoint: string; } class RayShape extends Shape { static get type(): string; static defaults: IRayShapeDefaults; protected get defaults(): IRayShapeDefaults; get requiredPointsCount(): number; /** * Get magnet mode for price level snapping */ get magnetMode(): string; set magnetMode(value: string); /** * Get magnet point (which price level to snap to) */ get magnetPoint(): string; set magnetPoint(value: string); bounds(): IBounds; paint(): void; hitTest(point: IPoint): boolean; pointsLocalizationKeys(): string[]; protected onMove(motionEvent: MoveMotionEvent, event: IWindowEvent): boolean; calculateRayEndPoint(p0: IPoint, p1: IPoint): IPoint; } } declare module FintaChart { /** * Represents extended line shape. * * @category Shapes */ class ExtendedLineShape extends Shape { static get type(): string; get requiredPointsCount(): number; bounds(): IBounds; paint(): void; hitTest(point: IPoint): boolean; pointsLocalizationKeys(): string[]; protected onMove(motionEvent: MoveMotionEvent, event: IWindowEvent): boolean; private calcualteExtendedLineStartPoint; private calculateExtendedLineEndPoint; } } declare module FintaChart { /** * Represents rectangular shape. * * @category Shapes */ class RectangleShape extends Shape { private _makeSquare; static get type(): string; get requiredPointsCount(): number; set makeSquare(isSquare: boolean); bounds(): IBounds; paint(): void; hitTest(point: IPoint): boolean; pointsLocalizationKeys(): string[]; finishNewShape(): void; defineDragPoint(dragPoint: number): void; protected onMove(motionEvent: MoveMotionEvent, event: IWindowEvent): boolean; protected shouldTransformOnMove(event: IWindowEvent): void; private highlightedPoints; private normalizePoints; private updateCursor; private getCursorClass; } } declare module FintaChart { /** * Represents triangle shape. * * @category Shapes */ class TriangleShape extends Shape { static get type(): string; get requiredPointsCount(): number; bounds(): IBounds; paint(): void; hitTest(point: IPoint): boolean; pointsLocalizationKeys(): string[]; protected onMove(motionEvent: MoveMotionEvent, event: IWindowEvent): boolean; } } declare module FintaChart { /** * Describes vertical line shape options. */ interface IVerticalLineShapeOptions extends IShapeOptions { /** * Shape Vertical Line Options shows scale horizontal floating label */ showHorizontalScaleLabel: boolean; } /** * Describes vertical line shape defaults. */ interface IVerticalLineShapeDefaults extends IShapeDefaults { /** * Shape Vertical Line Defaults shows scale horizontal floating label */ showHorizontalScaleLabel: boolean; } /** * Represents vertical line shape. * * @category Shapes */ class VerticalLineShape extends Shape { static get type(): string; static defaults: IVerticalLineShapeDefaults; protected get defaults(): IVerticalLineShapeDefaults; /** * Get is show scale horizontal floating label */ get showHorizontalScaleLabel(): boolean; set showHorizontalScaleLabel(value: boolean); bounds(): IBounds; paint(): void; drawHorizontalScaleLabels(): void; hitTest(point: IPoint): boolean; protected onMove(motionEvent: MoveMotionEvent, event: IWindowEvent): boolean; } } declare module FintaChart { /** * Represents shape balloon config */ interface IBalloonShapeConfig extends IShapeConfig { /** * Shape balloon config anchor size */ anchorSize?: number; /** * Shape balloon config corder radius */ corderRadius?: number; /** * Shape balloon config text */ text: string; /** * Shape balloon config theme */ theme?: IBalloonShapeTheme; } /** * Represents shape balloon theme */ interface IBalloonShapeTheme { /** * Shape balloon theme fill */ fill: IFillTheme; /** * Shape balloon theme line */ line: IStrokeTheme; /** * Shape balloon theme text */ text: ITextTheme; } /** * Represents shape balloon defaults */ interface IBalloonShapeDefaults extends IShapeDefaults { /** * Shape balloon defaults anchor size */ anchorSize: ISize; /** * Shape balloon defaults corder radius */ cornerRadius: number; } /** * Provides model of Shape Balloon * * @category Shapes */ class BalloonShape extends Shape { static get type(): string; static defaults: IBalloonShapeDefaults; private _leftTopPoint; private _lines; private _rightBottomPoint; /** * Creates an instance of BalloonShape. * * @param config */ constructor(config?: IBalloonShapeConfig); protected get defaults(): IBalloonShapeDefaults; /** * Get balloon's anchor size */ get anchorSize(): ISize; set anchorSize(value: ISize); /** * Get balloon's corner radius */ get cornerRadius(): number; set cornerRadius(value: number); /** * Get balloon's text */ get text(): string; set text(value: string); finishNewShape(): void; bounds(): IBounds; paint(): void; hitTest(point: IPoint): boolean; restoreState(state: IShapeState): void; pointsLocalizationKeys(): string[]; protected paintHovered(oldTheme: any): any; private updateLines; } } declare module FintaChart { /** * Represents shape image config */ interface IImageShapeConfig extends IShapeConfig { /** * Shape image config size */ size?: ISize; /** * Shape image config url */ url: string; } namespace ShapeEvent { const URL_CHANGED = "shapeUrlChanged"; } /** * Provides model of Shape Image * * @category Shapes */ class ImageShape extends Shape { static get type(): string; private _image; /** * Creates an instance of ImageShape. * * @param config */ constructor(config?: IImageShapeConfig); /** * Get image's actual size */ get actualSize(): ISize; /** * Get image's size */ get size(): ISize; set size(value: ISize); /** * Get image's url */ get url(): string; set url(value: string); finishNewShape(): void; bounds(): IBounds; paint(): void; hitTest(point: IPoint): boolean; restoreState(state: IShapeState): void; pointsLocalizationKeys(): string[]; protected onMove(motionEvent: MoveMotionEvent, event: IWindowEvent): boolean; private labelPoints; private reloadImage; private updateCursor; private getCursorClass; } } declare module FintaChart { /** * Represents shape measure defaults */ interface IMeasureShapeDefaults extends IShapeDefaults { /** * Shape measure defaults corder radius */ cornerRadius: number; } const MeasureShapeArrowMode: { START: string; END: string; BOTH: string; }; /** * Provides model of Shape Measure * * @category Shapes */ class MeasureShape extends Shape { static get type(): string; static defaults: IMeasureShapeDefaults; private _isXDirectionInverted; private _isYDirectionInverted; private _isResizing; private _textBars; private _xDirection; private _yDirection; private _textPeriodicity; private _isPositiveValues; private _isPositiveRecordsCount; protected get defaults(): IMeasureShapeDefaults; /** * Get measure's corder radius */ get cornerRadius(): number; set cornerRadius(value: number); get requiredPointsCount(): number; bounds(): IBounds; paint(): void; hitTest(point: IPoint): boolean; pointsLocalizationKeys(): string[]; protected onMove(motionEvent: MoveMotionEvent, event: IWindowEvent): boolean; private visualizeArrow; private visualizeArrowHeadLine; private visualizeRoundRect; private duration; private highlightedPoints; private normalizePoints; private updateCursor; private getCursorClass; } } declare module FintaChart { /** * Provides model of Shape Measure Tool * * @category Shapes */ class MeasureToolShape extends Shape { static get type(): string; private _infoControls; get requiredPointsCount(): number; finishNewShape(): void; bounds(): IBounds; paint(): void; remove(): boolean; private createInfoControls; private visualizeInfo; private visualizeValues; } } declare module FintaChart { /** * Represents Shape Text Config */ interface ITextShapeConfig extends IShapeConfig { /** * Shape Text Config text */ text: string; /** * Shape Text Config theme */ theme?: ITextShapeTheme; } /** * Represents Shape Text Options */ interface ITextShapeOptions extends IShapeOptions { /** * Shape Text Options text */ text: string; } /** * Represents Shape Text Theme */ interface ITextShapeTheme { /** * Shape Text Theme theme */ text: ITextTheme; } namespace ShapeEvent { const TEXT_CHANGED = "shapeTextChanged"; } /** * Provides model of Shape Text * * @category Shapes */ class TextShape extends Shape { static get type(): string; private _parsed; layoutOffsetY: number; /** * Creates an instance of TextShape. * * @param config */ constructor(config?: ITextShapeConfig); /** * Get text */ get text(): string; set text(value: string); finishNewShape(): void; cartesianPoint(index: number): IPoint; bounds(): IBounds; paint(): void; hitTest(point: IPoint): boolean; restoreState(state: IShapeState): void; pointsLocalizationKeys(): string[]; protected paintHovered(oldTheme: any): any; private get baseTextTheme(); private updateLines; private deriveRunTheme; private measureLineWidth; } } declare module FintaChart { export enum BarMarkerPosition { AUTO = "auto", ABOVE = "above", BELOW = "below" } export enum BarMarkerKind { DOT = "dot", ARROW_UP = "arrowUp", ARROW_DOWN = "arrowDown", ARROW_AUTO = "arrowAuto", SQUARE = "square", DIAMOND = "diamond", STAR = "star", CROSS = "cross", LINE = "line" } export interface BarMarkerNeighbor { x: number; yMarker: number; color: string; lineWidth: number; } export enum BarMarkerAnchor { HIGH = "high", LOW = "low", OPEN = "open", CLOSE = "close", POINT = "point" } export enum BarMarkerColor { AUTO = "auto", RED = "#ec5a58", GREEN = "#26a69a", ORANGE = "#f7931a", BLUE = "#2196f3", YELLOW = "#fdd835", PURPLE = "#ab47bc", WHITE = "#ffffff", CUSTOM = "custom" } interface IBarMarkerFields { position?: BarMarkerPosition; marker?: BarMarkerKind; markerColor?: BarMarkerColor; customMarkerColor?: string; gradientFrom?: string; gradientTo?: string; anchorSource?: BarMarkerAnchor; offsetY?: number; badgeBorderRadius?: number; badgeBorderColor?: string; badgeBorderWidth?: number; backgroundColor?: string; textColor?: string; connectLines?: boolean; neighborSearchRange?: number; } export interface IBarMarkerShapeConfig extends ITextShapeConfig, IBarMarkerFields { } export interface IBarMarkerShapeOptions extends ITextShapeOptions, IBarMarkerFields { } export interface IBarMarkerShapeDefaults extends IShapeDefaults, Required { text: string; } /** * Represents a dot (or arrow) with text attached to a bar from above or below. * Uses the Shape Text behavior: click to place on a bar, then edit the text in the settings dialog. * * @category Shapes */ export class BarMarkerShape extends TextShape { static get type(): string; static get subType(): string; static defaults: IBarMarkerShapeDefaults; constructor(config?: IBarMarkerShapeConfig); protected get defaults(): IBarMarkerShapeDefaults; private get chartTypeName(); private get isLineOrAreaChart(); private get isPointAndFigureChart(); /** * Returns the bar data rows appropriate for the current chart type. * For P&F charts, returns the calculated P&F data rows so markers * align with the P&F grid instead of the raw OHLC data. */ private getBarDataRows; private get opts(); /** Reads an option falling back to defaults; `nullish` = use `??` instead of `||`. */ private opt; /** Writes an option and triggers a repaint. */ private setOpt; private _positionExplicitlySet; get position(): BarMarkerPosition; set position(value: BarMarkerPosition); get marker(): BarMarkerKind; set marker(value: BarMarkerKind); private _anchorExplicitlySet; get anchorSource(): BarMarkerAnchor; set anchorSource(value: BarMarkerAnchor); get offsetY(): number; set offsetY(value: number); get badgeBorderRadius(): number; set badgeBorderRadius(value: number); get badgeBorderColor(): string; set badgeBorderColor(value: string); get badgeBorderWidth(): number; set badgeBorderWidth(value: number); get backgroundColor(): string; set backgroundColor(value: string); get textColor(): string; set textColor(value: string); get connectLines(): boolean; set connectLines(value: boolean); get neighborSearchRange(): number; set neighborSearchRange(value: number); private _colorExplicitlySet; get markerColor(): BarMarkerColor; set markerColor(value: BarMarkerColor); get customMarkerColor(): string; set customMarkerColor(value: string); get gradientFrom(): string; set gradientFrom(value: string); get gradientTo(): string; set gradientTo(value: string); get resizable(): boolean; set resizable(_value: boolean); get magnetMode(): string; set magnetMode(_value: string); get magnetPoint(): string; set magnetPoint(_value: string); get text(): string; set text(value: string); /** * Returns the text with dynamic macros resolved: {price} {open} {high} {low} * {close} {volume} {time} (HH:mm) {date} (YYYY-MM-DD). */ get resolvedText(): string; finishNewShape(): void; bounds(): IBounds; paint(): void; hitTest(point: IPoint): boolean; /** Draws the badge background/border and the label text. */ private paintBadge; /** Paints connecting lines to neighboring LINE BarMarkerShapes. */ private paintConnections; private resolvedMarkerKind; private getMarkerLayoutForConnection; /** Resolves ARROW_AUTO to the actual arrow kind based on bar position. */ private resolveMarkerKind; /** * Resolves the final marker color: explicit user choice (preset/custom) wins, * otherwise falls back to auto-detection from the candle direction. */ private resolveMarkerColor; /** * Resolves anchor value when only a subset of OHLC data is available * (e.g. Line/Area charts or P&F columns that lack full OHLC). */ private resolveAnchorValue; private resolveGradient; /** * Resolves position, color and anchor value for a bar. * User-set position/anchorSource win over auto-detection from candle direction. */ private getBarDetails; /** * Line / Area charts expose a single closing price per record. * The marker is always placed at the close value, above the line. */ private getLineOrAreaBarDetails; /** * Snaps the shape point to the nearest bar on creation: * X is aligned to the bar center, Y is placed above high (or below low) * depending on the bar direction. */ private snapToBar; /** Computes pixel layout of the marker relative to its bar for the current frame. */ private markerLayout; protected magnetizePoint(point: IPoint): IPoint; } export {}; } declare module FintaChart { /** * @category Shapes */ abstract class PatternShape extends Shape { static patternRedColor: string; static patternGreenColor: string; static patternPinkColor: string; static patternBlueColor: string; static patternBlackColor: { dark: string; white: string; }; static patternBlack70Color: { dark: string; white: string; }; static patternBlack40Color: { dark: string; white: string; }; protected precalculatedPatterns: IPatternRecognitionResult[]; protected localizedPatternNames: { [patternId: string]: string; }; constructor(); setPrecalculatedPatterns(precalculatedPatterns: IPatternRecognitionResult[]): void; protected canBePattern(points: IPoint[]): boolean; protected getAllowedPatterns(theme: any, patterns: IPattern[]): IPattern[]; protected draw5PointsPatterLabels(points: IPoint[], textTheme: ITextTheme, theme: any, _patterns: IPatternRecognitionResult[]): boolean; protected draw5PointsPriceLabels(points: IPoint[], textTheme: ITextTheme, lineTheme: IStrokeTheme, pattern: IPatternRecognitionResult): void; protected draw4PointsPatterLabels(points: IPoint[], textTheme: ITextTheme, theme: any, _patterns: IPatternRecognitionResult[]): boolean; protected drawTextLabel(text: string, x: number, y: number, textTheme: ITextTheme, lineTheme: IStrokeTheme, isRect?: boolean): void; handleChartLocaleChange(locale: string): void; protected localizePatternNames: () => void; } } declare module FintaChart { interface IABCDPatternShapeTheme { line: IStrokeTheme; additionalLine: IStrokeTheme; fill: IFillTheme; text: ITextTheme; bearishLabelColor: string; bullishLabelColor: string; confidence: number; patterns: { [patternId: string]: any; }; } /** * @category Shapes */ class ABCDPatternShape extends PatternShape { static get type(): string; private _patterns; private _patternsHash; private _defaultLevels; private _defaultFill; get requiredPointsCount(): number; paint(): void; hitTest(point: IPoint): boolean; hoverHitTest(point: IPoint): boolean; drawLevelsForPattern(pattern: any, theme: IABCDPatternShapeTheme): void; drawLevels(_levels: any[], _fills: any[], theme: IABCDPatternShapeTheme): void; protected onMove(motionEvent: MoveMotionEvent, event: IWindowEvent): boolean; private static getLetterByIndex; } } declare module FintaChart { /** * @category Shapes */ class ABCDLabelPatternShape extends PatternShape { static get type(): string; private _shapePoints; get requiredPointsCount(): number; paint(): void; protected onMove(motionEvent: MoveMotionEvent, event: IWindowEvent): boolean; hitTest(point: IPoint): boolean; private static getLetterByIndex; } } declare module FintaChart { interface IElliottWaveTheme { text: ITextTheme; line: IStrokeTheme; bearishLabelColor: string; bullishLabelColor: string; confidence: number; "5-0": { strokeColor: string; fillColor: string; enabled: boolean; }; } /** * Provides model of ElliottWave * * @category Shapes */ class ElliottWavePatternShape extends PatternShape { static get type(): string; static defaultLevels5_0: any[]; static defaultFill5_0: any[]; private _patterns; private _patternsHash; get requiredPointsCount(): number; protected onMove(motionEvent: MoveMotionEvent, event: IWindowEvent): boolean; bounds(): IBounds; paint(): void; hitTest(point: IPoint): boolean; hoverHitTest(point: IPoint): boolean; drawLevelsForPattern(pattern: IPattern, theme: IElliottWaveTheme): void; drawLevels5_0(_levels: any[], _fills: any[], theme: IElliottWaveTheme): void; } } declare module FintaChart { /** * @category Shapes */ class HeadAndShouldersPatternShape extends PatternShape { private _defaultLevels; private _defaultFill; private needTofillArea1; private needTofillArea2; private dragging; private _labels; private _patterns; private _patternsHash; private _localizeLabels; static get type(): string; get requiredPointsCount(): number; protected onMove(motionEvent: MoveMotionEvent, event: IWindowEvent): boolean; paint(): void; private drawTextLabels; private calculateCrossPoint; private isPointInLine; drawLevelsForPattern(pattern: any, theme: any): void; drawLevels(_levels: any, _fills: any, theme: any): void; handleChartLocaleChange(locale: string): void; hitTest(point: IPoint): boolean; hoverHitTest(point: IPoint): boolean; protected onPaneChanged(oldValue: Pane): void; } } declare module FintaChart { /** * @category Shapes */ class KingsCrownPatternShape extends PatternShape { private _labels; private _patterns; private _patternsHash; private _localizeLabels; static get type(): string; get requiredPointsCount(): number; protected onMove(motionEvent: MoveMotionEvent, event: IWindowEvent): boolean; paint(): void; private fillArea; private drawAdditionalLines; private drawAdditionalLabels; private drawTipLabels; private getLetterByIndex; hitTest(point: IPoint): boolean; hoverHitTest(point: IPoint): boolean; handleChartLocaleChange(locale: string): void; protected onPaneChanged(oldValue: Pane): void; } } declare module FintaChart { /** * @category Shapes */ class NumberLabelPatternShape extends PatternShape { private _drawingPoints; private _firstPointAdded; static get type(): string; get requiredPointsCount(): number; paint(): void; hitTest(point: IPoint): boolean; protected onMove(motionEvent: MoveMotionEvent, event: IWindowEvent): boolean; } } declare module FintaChart { interface ITrianglePatternTheme { line: IStrokeTheme; fill: IFillTheme; text: ITextTheme; } /** * @category Shapes */ class TrianglePatternShape extends PatternShape { static get type(): string; get requiredPointsCount(): number; protected onMove(motionEvent: MoveMotionEvent, event: IWindowEvent): boolean; paint(): void; hitTest(point: IPoint): boolean; private drawTriangle; private drawTextLabels; private getLetterByIndex; } } declare module FintaChart { interface IXABCDPatternLevel { level: number | string; strokeColor: string | { dark: string; white: string; }; width: number; lineStyle: string; label: string; strokeEnabled?: boolean; fillColor?: string | { dark: string; white: string; }; } interface IXABCDPatternFill { level1: number | string; level2: number | string; fillColor: string; } interface IXABCDPatternTheme { line: IStrokeTheme; additionalLine: IStrokeTheme; fill: IFillTheme; text: ITextTheme; bearishLabelColor: string; bullishLabelColor: string; confidence: number; patterns: { [patternId: string]: any; }; } /** * @category Shapes */ class XABCDPatternShape extends PatternShape { private _patterns; private _patternsHash; private _defaultLevelsBat; private _defaultFillBat; private _defaultLevelsAltBat; private _defaultFillAltBat; private _defaultLevelsGartley; private _defaultFillGartley; private _defaultLevelsMaxGartley; private _defaultFillMaxGartley; private _defaultLevelsAGartley; private _defaultFillAGartley; private _defaultLevelsCrab; private _defaultFillCrab; private _defaultLevelsACrab; private _defaultFillACrab; private _defaultLevelsButterfly; private _defaultFillButterfly; private _defaultLevelsAButterfly; private _defaultFillAButterfly; private _defaultLevelsCypher; private _defaultFillCypher; private _defaultLevelsShark; private _defaultFillShark; private _defaultLevels5_0; private _defaultFill5_0; static get type(): string; get requiredPointsCount(): number; protected onMove(motionEvent: MoveMotionEvent, event: IWindowEvent): boolean; paint(): void; drawLevelsForPattern(pattern: IPatternRecognitionResult, theme: IXABCDPatternTheme): void; drawLevels(_levels: any[], _fills: any[], _theme: IXABCDPatternTheme): void; drawLevels5_0(_levels: any[], _fills: any[], _theme: IXABCDPatternTheme): void; hitTest(point: IPoint): boolean; hoverHitTest(point: IPoint): boolean; private drawTextLabels; private getLetterByIndex; } } declare module FintaChart { } declare module FintaChart { /** * Describes simple shape config. */ interface ISimpleShapeConfig extends IShapeConfig { /** * The size. */ size?: ISize; } /** * Describes simple shape defaults. */ interface ISimpleShapeDefaults extends IShapeDefaults { /** * The size. */ size: ISize; } namespace ShapeEvent { const SIZE_CHANGED = "shapeSizeChanged"; } /** * Represents simple shape. * * @category Shapes */ abstract class SimpleShape extends Shape { static get subType(): string; static defaults: ISimpleShapeDefaults; /** * Creates an instance of SimpleShape. */ constructor(config?: ISimpleShapeConfig); protected get defaults(): ISimpleShapeDefaults; /** * The size. */ get size(): ISize; set size(value: ISize); hitTest(point: IPoint): boolean; pointsLocalizationKeys(): string[]; } } declare module FintaChart { /** * Describes abstract arrow shape config. */ interface IArrowBaseShapeConfig extends ISimpleShapeConfig { /** * The arrow head ratio. */ headRatio?: number; /** * The arrow tail ratio. */ tailRatio?: number; } /** * Describes abstract arrow shape defaults. */ interface IArrowBaseShapeDefaults extends ISimpleShapeDefaults { /** * The arrow head ratio. */ headRatio: number; /** * The arrow tail ratio. */ tailRatio: number; } namespace ShapeEvent { const ARROW_HEAD_RATIO_CHANGED = "shapeArrowHeadRatioChanged"; const ARROW_TAIL_RATIO_CHANGED = "shapeArrowTailRatioChanged"; } /** * Represents abstract arrow shape. * * @category Shapes */ abstract class ArrowBaseShape extends SimpleShape { static defaults: IArrowBaseShapeDefaults; /** * The arrow angle. */ protected angle: number; /** * Creates an instance of ArrowBaseShape. * * @param config */ constructor(config?: IArrowBaseShapeConfig); protected get defaults(): IArrowBaseShapeDefaults; /** * The arrow head ratio. */ get headRatio(): number; set headRatio(value: number); /** * The arrow tail ratio. */ get tailRatio(): number; set tailRatio(value: number); paint(): void; pointsLocalizationKeys(): string[]; private paintSize; } } declare module FintaChart { /** * Represents down arrow shape. * * @category Shapes */ class ArrowDownShape extends ArrowBaseShape { static get type(): string; bounds(): IBounds; } } declare module FintaChart { /** * Represents left arrow shape. * * @category Shapes */ class ArrowLeftShape extends ArrowBaseShape { static get type(): string; /** * Creates an instance of ArrowLeftShape. * * @param config */ constructor(config?: IArrowBaseShapeConfig); bounds(): IBounds; } } declare module FintaChart { /** * Represents right arrow shape. * * @category Shapes */ class ArrowRightShape extends ArrowBaseShape { static get type(): string; /** * Creates an instance of ArrowRightShape. * * @param config */ constructor(config?: IArrowBaseShapeConfig); bounds(): IBounds; } } declare module FintaChart { /** * Represents arrow shape. * * @category Shapes */ class ArrowShape extends ArrowBaseShape { static get type(): string; get requiredPointsCount(): number; bounds(): IBounds; paint(): void; hitTest(point: IPoint): boolean; pointsLocalizationKeys(): string[]; protected onMove(motionEvent: MoveMotionEvent, event: IWindowEvent): boolean; private paintWidth; } } declare module FintaChart { /** * Represents up arrow shape. * * @category Shapes */ class ArrowUpShape extends ArrowBaseShape { static get type(): string; /** * Creates an instance of ArrowUpShape. * * @param config */ constructor(config?: IArrowBaseShapeConfig); bounds(): IBounds; } } declare module FintaChart { /** * Represents diamond shape. * * @category Shapes */ class DiamondShape extends SimpleShape { static get type(): string; static defaults: ISimpleShapeDefaults; bounds(): IBounds; paint(): void; private paintSize; } } declare module FintaChart { /** * Describes dot shape config. */ interface IDotShapeConfig extends IShapeConfig { /** * The dot radius. */ radius: number; } /** * Describes dot shape defaults. */ interface IDotShapeDefaults extends IShapeDefaults { /** * The dot radius. */ radius: number; } namespace ShapeEvent { const DOT_RADIUS_CHANGED = "shapeDotRadiusChanged"; } /** * Represents dot shape. * * @category Shapes */ class DotShape extends Shape { static get type(): string; static get subType(): string; static defaults: IDotShapeDefaults; /** * Creates an instance of DotShape. * * @param config */ constructor(config?: IDotShapeConfig); protected get defaults(): IDotShapeDefaults; /** * The dot radius. */ get radius(): number; set radius(value: number); bounds(): IBounds; paint(): void; hitTest(point: IPoint): boolean; pointsLocalizationKeys(): string[]; private paintRadius; } } declare module FintaChart { /** * Describes note shape config. */ interface INoteShapeConfig extends IShapeConfig { /** * The label text. */ label: string; } /** * Describes note shape options. */ interface INoteShapeOptions extends IShapeOptions { /** * The label text. */ label: string; } /** * Describes note shape defaults. */ interface INoteShapeDefaults extends IShapeDefaults { /** * The label text. */ label: string; } /** * Represents note shape. * * @category Shapes */ class NoteShape extends Shape { static get type(): string; static defaults: INoteShapeDefaults; private _radius; /** * Creates an instance of NoteShape. * * @param config */ constructor(config?: INoteShapeConfig); protected get defaults(): INoteShapeDefaults; /** * The label text. */ get label(): string; set label(value: string); bounds(): IBounds; paint(): void; hitTest(point: IPoint): boolean; pointsLocalizationKeys(): string[]; private paintRadius; } } declare module FintaChart { /** * Represents square shape. * * @category Shapes */ class SquareShape extends SimpleShape { static get type(): string; static defaults: ISimpleShapeDefaults; bounds(): IBounds; paint(): void; private paintBounds; } } declare module FintaChart { interface IPositionShapeState extends IShapeState { centerLine: number; targetLine: number; showTarget: boolean; staticLabels: boolean; } /** * Provides model of PositionShape * * @category Shapes */ abstract class PositionShape extends Shape { private _centerLine; private _targetLine; private _direction; private _showTarget; private _staticLabels; abstract get isShort(): boolean; get requiredPointsCount(): number; get showTarget(): boolean; set showTarget(value: boolean); get staticLabels(): boolean; set staticLabels(value: boolean); get entry(): number; get target1(): number; get target2(): number; get stop(): number; get centerLine(): number; get targetLine(): number; bounds(): IBounds; paint(): void; hitTest(point: IPoint): boolean; pointsLocalizationKeys(): string[]; protected onMove(motionEvent: MoveMotionEvent, event: IWindowEvent): boolean; finishNewShape(): void; saveState(): IPositionShapeState; restoreState(state: IPositionShapeState): void; paintVerticalAxisLabels(): void; private drawTopBallon; private renderCandlesOverHit; private moveObject; private validateTargetLine; private labelPoints; private normalizePoints; private updateCursor; private getCursorClass; private setTargetLine; private setTargetLineDefault; private visualizeRoundRect; } } declare module FintaChart { /** * Provides model of LongPositionShape * * @category Shapes */ class LongPositionShape extends PositionShape { static get type(): string; get isShort(): boolean; } } declare module FintaChart { /** * Provides model of ShortPositionShape * * @category Shapes */ class ShortPositionShape extends PositionShape { static get type(): string; get isShort(): boolean; } } declare module FintaChart { interface IPositionShapeSettingsConfig { /** * Chart */ chart: Chart; /** * Shape */ shape: PositionDrawingShape; } /** * Provides settings dialog for Position shape * * @category Shapes */ class PositionShapeSettings extends Dialog { private _tabs; private _tabItemsContainer; private _tabPanesContainer; private _lineColorInput; private _lineColorPicker; private _lineStyleInput; private _lineWidthInput; private _buyColorInput; private _sellColorInput; private _input_textColor; private _input_textFont; private _input_textSize; private _showPriceLabels; private _compactStatsMode; private _alwaysShowStats; private _chk_showPriceLabelsHTMLObj; private _chk_compactStatsModeHTMLObj; private _chk_alwaysShowStatsHTMLObj; private _chk_visibilityCheckboxes; private _accountSize; private _lotSize; private _riskPercentage; private _leverage; private _profitTicks; private _profitPrice; private _stopTicks; private _stopPrice; private _entryPrice; private _input_accountSizeHTMLObj; private _input_lotSizeHTMLObj; private _input_leverageHTMLObj; private _input_riskPercentageHTMLObj; private _input_profitTicksHTMLObj; private _input_profitPriceHTMLObj; private _input_stopTicksHTMLObj; private _input_stopPriceHTMLObj; private _input_entryPriceHTMLObj; private _visibilityConfig; constructor(container: HTMLElement); show(config: IPositionShapeSettingsConfig): void; hide(): void; /** * Resets settings to defaults */ resetToDefaults(): void; private init; private initFields; private initContainers; private initStyleInputs; private initCheckboxInputs; private initNumericInputs; private initNumericControls; private initColorPickers; private initApplyBtn; private initResetButton; private initVisibilityControls; private apply; private createShapeTheme; private getLineProperties; private getActiveRowProperties; private getTextProperties; private getNumericProperties; private collectPropertyChanges; private applyChangesToShape; private setValues; private setVisualInputsValues; private setDialogFields; private setShapeConfig; private setCheckboxesValues; private setInputsFields; private onProfitTicksChange; private onProfitPriceChange; private onStopTicksChange; private onStopPriceChange; private onEntryPriceChanged; private handleLevelTicksChange; private handleLevelPriceChange; private getRelatedInputField; private updateLevel; private applyEntryChange; private calculateTicksFromPrice; private calculatePriceFromTicks; private validatePrice; private setDefaultConfigValues; private setDefaultVisibilityConfig; } } declare module FintaChart { interface IPositionDrawingShapeState extends IShapeState { entry: number; stopLoss: number; takeProfit: number; quantity: number; isLong: boolean; riskReward?: number; pnl?: string; points: IPositionPoint[]; widthInBars: number; initialTimeframe?: { periodicity: string; interval: number; widthInBars: number; leftDate: Date; rightDate: Date; }; } interface IPositionCalculations { riskRewardRatio: number; risk: number; riskPercentage: number; reward: number; rewardPercentage: number; quantity: number; profitAmount: number; lossAmount: number; riskPips: number; rewardPips: number; calculatedStop: number; calculatedTarget: number; accountTooSmall: boolean; minLotSize: number; } interface IPositionDrawingShapeState extends IShapeState { entry: number; stopLoss: number; takeProfit: number; quantity: number; isLong: boolean; riskReward?: number; pnl?: string; points: IPositionPoint[]; widthInBars: number; initialTimeframe?: { periodicity: string; interval: number; widthInBars: number; leftDate: Date; rightDate: Date; }; } interface ITimeFrameVisibilityConfig { minutes: boolean; hours: boolean; days: boolean; months: boolean; years: boolean; custom: boolean; } interface IPositionDrawingShapeConfig extends IShapeConfig { visibilityConfig?: ITimeFrameVisibilityConfig; } interface IPositionShapeOptions extends IShapeOptions { /** * Shape position base defaults show prices labels */ showPriceLabels: boolean; /** * Shape position compact stats mode */ compactStatsMode: boolean; /** * Shape always show statistic */ alwaysShowStats: boolean; /** * Shape account size */ accountSize: number; /** * Shape lot size */ lotSize?: number; /** * Shape risk percentage (display-only — no longer drives Qty) */ riskPercentage?: number; /** * Account leverage used to size the position: Qty = (accountSize * leverage) / entryPrice */ leverage?: number; } interface IPositionShapeDefaults extends IShapeDefaults { /** * Shape position base defaults show prices labels */ showPriceLabels: boolean; /** * Shape position compact stats mode */ compactStatsMode: boolean; /** * Shape always show statistic */ alwaysShowStats: boolean; /** * Shape account size */ accountSize: number; /** * Shape lot size */ lotSize: number; /** * Shape risk percentage */ riskPercentage: number; /** * Account leverage used to size the position: Qty = (accountSize * leverage) / entryPrice */ leverage: number; /** * Shape visibility config */ visibilityConfig: ITimeFrameVisibilityConfig; /** * Account currency */ accountCurrency: string; /** * Shape risk unit */ riskUnit: string; } interface IPositionPoint { time: Date; price: number; barIndex?: number; } namespace ShapeEvent { const PRICE_LABELS_CHANGED = "priceLabelsChanged"; const COMPACT_MODE_CHANGED = "compactModeChanged"; const ALWAYS_SHOW_STATS_CHANGED = "alwaysShowStatsChanged"; const VISIBILITY_CONFIG_CHANGED = "visibilityConfigChanged"; const ACCOUNT_TOO_SMALL_CHANGED = "accountTooSmallChanged"; } abstract class PositionDrawingShape extends Shape { private _entry; private _stopLoss; private _takeProfit; private _widthInBars; protected readonly profitColor = "#22B496"; protected readonly lossColor = "#DC4453"; protected readonly darkColor = "#131722"; protected readonly grayColor = "#666666"; private _initialLeftEdge?; private _positionState; protected _points: IPositionPoint[]; private _dragStartPosition?; private _dragStartPoints?; private _initialTimeframe?; private _initialWidthInBars?; private _accountTooSmall; static defaults: IPositionShapeDefaults; protected get defaults(): IPositionShapeDefaults; static get type(): string; static get subType(): string; abstract get isLong(): boolean; get entry(): number; get stopLoss(): number; get takeProfit(): number; get showPriceLabels(): boolean; set showPriceLabels(value: boolean); get compactStatsMode(): boolean; set compactStatsMode(value: boolean); get alwaysShowStats(): boolean; set alwaysShowStats(value: boolean); get accountSize(): number; set accountSize(value: number); get riskPercentage(): number; set riskPercentage(value: number); get lotSize(): number; set lotSize(value: number); get leverage(): number; set leverage(value: number); get visibilityConfig(): ITimeFrameVisibilityConfig; set visibilityConfig(value: ITimeFrameVisibilityConfig); setCustomPoints(points: IPositionPoint[]): void; getCustomPoints(): IPositionPoint[]; get tickSizeCount(): number; saveState(): IPositionDrawingShapeState; cartesianPoints(): IPoint[]; paint(): void; bounds(): Bounds; hitTest(point: IPoint): boolean; showSettingsDialog(): void; adjustBarsCountForTimeframe(): void; /** * Override restoreState to handle custom properties specific to PositionDrawingShape */ restoreState(state: IShapeState): void; handleEvent(event: IWindowEvent): boolean; paintVerticalAxisLabels(): void; protected shouldBeVisible(): boolean; protected onNewShapePoint(point: IDataPoint): boolean; protected onMove(motionEvent: MoveMotionEvent, event: IWindowEvent): boolean; protected onContextMenu(motionEvent: MotionEvent, event: IWindowEvent): void; private handleDragStart; private handleDragContinue; private handlePriceLevelDrag; private handleEntryPointDrag; private handleStopLossDrag; private handleTakeProfitDrag; private handleRightWidthDrag; private handleLeftWidthDrag; private tryDetectPointHandles; private tryDetectWidthHandles; private tryDetectShapeMovement; private handleShapeMovement; private adjustWidthFromLeft; private handleDragFinish; private getTimeframeInMs; private paintZones; private paintEntryLine; private paintStopLoss; private paintTakeProfit; private isValidStopLoss; private isValidTakeProfit; private calculatePositionValues; private priceFromPoint; private getCurrentMarketPrice; private paintPositionInfo; private isValidEntry; private isCandleCrossingPrice; private resetPositionState; private findEntryCandle; private setPositionExecution; private checkExecution; private checkPositionState; private paintExecutionPoint; private addOpacity; private getShapeWidth; private decimalPlaces; private findClosestBarIndex; /** * Check if the current timeframe matches the initial timeframe */ private isSameTimeframe; /** * Calculate the new width in bars based on timeframe ratio */ private calculateNewWidthInBars; /** * Re-snap the entry point to maintain proper positioning in the new timeframe * Uses intelligent snapping to minimize time shifts */ private resnapEntryPointToNewTimeframe; /** * Find the best snap match using intelligent hierarchy: exact → close → aggressive */ private findBestSnapMatch; /** * Find exact time match within 1 second tolerance */ private findExactTimeMatch; /** * Find close time match within 30 minutes tolerance */ private findCloseTimeMatch; private getSnappedBarTime; private addInitialTimeframe; private setAutoStopLossAndTakeProfit; private showEnhancedContextMenu; private createLimitOrder; } } declare module FintaChart { class LongDrawingShape extends PositionDrawingShape { static get type(): string; get isLong(): boolean; } } declare module FintaChart { interface MultiArrowShapeTheme { line: IStrokeTheme; text: ITextTheme; } class MultiArrowUpShape extends ArrowUpShape { static get type(): string; _count: number; _labelText: string; _theme: MultiArrowShapeTheme; _paddingY: number; get labelText(): string; set labelText(text: string); get count(): number; set count(count: number); get theme(): MultiArrowShapeTheme; set theme(theme: MultiArrowShapeTheme); get paddingY(): number; set paddingY(value: number); constructor(config?: IArrowBaseShapeConfig); paint(): void; defaultTheme(): MultiArrowShapeTheme; } } declare module FintaChart { class MultiArrowDownShape extends ArrowDownShape { static get type(): string; _count: number; _labelText: string; _theme: MultiArrowShapeTheme; _paddingY: number; get labelText(): string; set labelText(text: string); get count(): number; set count(count: number); get theme(): MultiArrowShapeTheme; set theme(theme: MultiArrowShapeTheme); get paddingY(): number; set paddingY(value: number); constructor(config?: IArrowBaseShapeConfig); paint(): void; defaultTheme(): MultiArrowShapeTheme; } } declare module FintaChart { class ShortDrawingShape extends PositionDrawingShape { static get type(): string; get isLong(): boolean; } } declare module FintaChart { /** * Provides model of Shape Andrews Pitchfork * * @category Shapes */ class AndrewsPitchforkShape extends Shape { static get type(): string; get requiredPointsCount(): number; bounds(): IBounds; paint(): void; hitTest(point: IPoint): boolean; pointsLocalizationKeys(): string[]; protected onMove(motionEvent: MoveMotionEvent, event: IWindowEvent): boolean; } } declare module FintaChart { /** * Represents Shape Error Channel Defaults */ interface IErrorChannelShapeDefaults extends IShapeDefaults { /** * Shape Error Channel Defaults range ratio */ rangeRatio: number; } /** * Represents Shape Error Channel Options */ interface IErrorChannelShapeOptions { /** * Shape Error Channel Options range ratio */ rangeRatio?: number; } namespace ShapeEvent { const RANGE_RATIO_CHANGED = "shapeRangeRatioChanged"; } /** * Provides model of Shape Error Channel * * @category Shapes */ class ErrorChannelShape extends Shape { static get type(): string; static defaults: IErrorChannelShapeDefaults; private _shapePoints; protected get defaults(): IErrorChannelShapeDefaults; get requiredPointsCount(): number; /** * Get error channel's range ratio */ get rangeRatio(): number; set rangeRatio(value: number); finishNewShape(): void; bounds(): IBounds; paint(): void; hitTest(point: IPoint): boolean; pointsLocalizationKeys(): string[]; protected calculateShapePoints(points: IPoint[]): IPoint[]; protected onMove(motionEvent: MoveMotionEvent, event: IWindowEvent): boolean; private getMainLinePoints; private moveMainLineYPoint; } } declare module FintaChart { /** * Represents Shape Gann Fan Angle */ interface IGannFanAngle { /** * Shape Gann Fan Angle value */ value: number; } /** * Represents Shape Gann Fan Angle Defaults */ interface IGannFanShapeDefaults extends IShapeDefaults { /** * Shape Gann Fan Angle Defaults angles */ angles: IGannFanAngle[]; } namespace ShapeEvent { const ANGLES_CHANGED = "shapeAnglesChanged"; const SHOW_ANGLE_LINE_CHANGED = "shapeShowAngleLineChanged"; } /** * Provides model of Shape Gann Fan Angle * * @category Shapes */ class GannFanShape extends Shape { static get type(): string; static defaults: IGannFanShapeDefaults; private _shapePoints; protected get defaults(): IGannFanShapeDefaults; get requiredPointsCount(): number; /** * Get gann fan angle's angles */ get angles(): IGannFanAngle[]; set angles(value: IGannFanAngle[]); bounds(): IBounds; paint(): void; hitTest(point: IPoint): boolean; pointsLocalizationKeys(): string[]; protected onMove(motionEvent: MoveMotionEvent, event: IWindowEvent): boolean; private calculateShapePoints; } } declare module FintaChart { /** * Provides model of Shape Quadrant Lines * * @category Shapes */ class QuadrantLinesShape extends Shape { static get type(): string; private _shapePoints; get requiredPointsCount(): number; /** * Get quadrant lines shape points */ get shapePoints(): IPoint[][]; finishNewShape(): void; bounds(): IBounds; paint(): void; hitTest(point: IPoint): boolean; pointsLocalizationKeys(): string[]; protected calculateShapePoints(points: IPoint[]): IPoint[][]; protected onMove(motionEvent: MoveMotionEvent, event: IWindowEvent): boolean; private moveMainLineYPoint; } } declare module FintaChart { /** * Provides model of Shape Raff Regression * * @category Shapes */ class RaffRegressionShape extends Shape { static get type(): string; private _shapePoints; get requiredPointsCount(): number; finishNewShape(): void; bounds(): IBounds; paint(): void; hitTest(point: IPoint): boolean; pointsLocalizationKeys(): string[]; protected calculateShapePoints(points: IPoint[]): IPoint[]; protected onMove(motionEvent: MoveMotionEvent, event: IWindowEvent): boolean; private static calculateBoundsHeight; private getMainLinePoints; private moveMainLineYPoint; } } declare module FintaChart { /** * Provides model of Shape Speed Lines * * @category Shapes */ class SpeedLinesShape extends Shape { static get type(): string; private _extend; private _labelsPoints; private _shapePoints; get requiredPointsCount(): number; /** * Get speed lines extend */ get extend(): boolean; set extend(val: boolean); bounds(): IBounds; paint(): void; hitTest(point: IPoint): boolean; pointsLocalizationKeys(): string[]; protected onMove(motionEvent: MoveMotionEvent, event: IWindowEvent): boolean; private calculateShapePoints; } } declare module FintaChart { /** * Provides model of Shape Tirone Levels * * @category Shapes */ class TironeLevelsShape extends Shape { static get type(): string; private _shapePoints; get requiredPointsCount(): number; /** * Get tirone levels shape points */ get shapePoints(): IPoint[]; finishNewShape(): void; bounds(): IBounds; paint(): void; hitTest(point: IPoint): boolean; pointsLocalizationKeys(): string[]; protected calculateShapePoints(points: IPoint[]): IPoint[]; protected onMove(motionEvent: MoveMotionEvent, event: IWindowEvent): boolean; private getMainLinePoints; private moveMainLineYPoint; } } declare module FintaChart { /** * Represents Shape Trend Angle Defaults */ interface ITrendAngleShapeDefaults extends IShapeDefaults { /** * Shape Trend Angle Defaults radius */ radius: number; } /** * Provides model of Shape Trend Angle * * @category Shapes */ class TrendAngleShape extends Shape { static get type(): string; static defaults: ITrendAngleShapeDefaults; private _tanMax; private _tanMin; /** * Trend Angle's angle correction */ private _angleCorrection; /** * Trend Angle's arctan */ private _arctan; /** * Trend Angle's text offset */ private _textOffset; protected get defaults(): ITrendAngleShapeDefaults; get requiredPointsCount(): number; /** * Get trend angle's radius */ get radius(): number; set radius(value: number); bounds(): IBounds; paint(): void; hitTest(point: IPoint): boolean; protected onMove(motionEvent: MoveMotionEvent, event: IWindowEvent): boolean; private calculateAngle; private paintTrendAngle; } } declare module FintaChart { /** * Provides model of Shape Trend Channel * * @category Shapes */ class TrendChannelShape extends Shape { static get type(): string; get requiredPointsCount(): number; finishNewShape(): void; bounds(): IBounds; paint(): void; hitTest(point: IPoint): boolean; pointsLocalizationKeys(): string[]; protected onMove(motionEvent: MoveMotionEvent, event: IWindowEvent): boolean; } } declare module FintaChart { } declare module FintaChart { const PositionShapeContextMenuItem: { CREATE_LIMIT_ORDER: string; CLONE: string; DELETE: string; SETTINGS: string; }; class PositionShapeContextMenu extends ShapeContextMenu { private static _positionContainer; /** * Creates an instance of PositionShapeContextMenu. * * @param config The context menu configuration. * @param targetDomObject The target DOM element. */ constructor(config: IShapeContextMenu, targetDomObject?: HTMLElement); } } declare module FintaChart { } declare module FintaChart { interface IShapeTemplateState { [shapeType: string]: IShapeTemplate; } interface IShapeTemplate { [name: string]: any; } class ShapeTemplateSettings { private _container; private _initList; private _chart; private _selectedShape; private _currentListTemplates; private _setExternalValues; private _bodyClickHandler; set selectedShape(shape: Shape | null); get selectedShape(): Shape | null; get selectedShapeType(): string; constructor(container: HTMLElement, chart: Chart, setValues: (key?: string) => void); private init; private generateList; deleteTemplate(key: string): void; selectTemplate(key: string): void; /** Fixed-positions the dropdown so the pane cell does not clip it. */ private positionDropList; /** Clears inline fixed-positioning so the closed dropdown returns to flow. */ private resetDropListPosition; private resetFibonacciLevels; } } declare module FintaChart { } declare module FintaChart { /** * Represents shape settings drag pane options * */ interface IShapeSettingsDragPaneOptions extends IDragPaneConfig { /** * Chart */ chart: Chart; } /** * Provides model of Shape Settings Drag Pane * */ class ShapeSettingsDragPane extends DragPane { private _chart; private _shape; private _prevShape; private _shapeCloneButton; private _shapeDeleteButton; private _shapeFillControlColorPicker; private _shapeFillBuyControlColorPicker; private _shapeFillSellControlColorPicker; private _shapeLineControlColorPicker; private _shapeLineStyleSelect; private _shapeLineStyleSelectDropdown; private _shapeLineWidthSelect; private _shapeLineWidthSelectDropdown; private _shapeSettingsButton; private _shapeTemplateButton; private _shapeSizeSelect; private _shapeSizeSelectDropdown; private _shapeStickSelect; private _shapeLockButton; private _shapeTextControlColorPicker; private _shapeTextFontSelect; private _shapeTextFontSelectDropdown; private _shapeTextSizeSelect; private _shapeTextSizeSelectDropdown; private _stickModeActivated; private _continueDrawingMode; /** * Sets Chart */ set chart(value: Chart); /** * Creates an instance of shapeSettingsDragPane. * * @param options */ constructor(options?: IShapeSettingsDragPaneOptions); dispose(): void; hide(): void; show(shape?: Shape, continueDrawing?: boolean, finishing?: boolean): void; private executeUpdateCommand; private generateDeleteItem; private generateDuplicateItem; private generateFillColorItem; private generateFillBuyColorItem; private generateFillSellColorItem; private generateLineColorItem; private generateLineStyleItem; private generateLineWidthItem; private generateTextColorItem; private generateTextFontItem; private generateTextSizeItem; private generateLockItem; private generatePaneContainer; private generatePaneItem; private appendChildrenFrom; private generateSettingsItem; private generateSizeItem; private generateStickItem; private generateTemplateShapeItem; private onThemeChanged; private applyThemeChanges; private onChartChanged; private handleUIEvents; private onContainerClick; private hideAllPaneItems; private init; private initControls; private initHandlers; private onCloneButtonClicked; private onDeleteButtonClicked; private onLockButtonClicked; private syncLockUIAndDeleteAvailability; private replaceLockIcon; private changeDeletedButtonAvailability; private onFillColorChanged; private onBuyFillColorChanged; private onSellFillColorChanged; private onLineColorChanged; private onLineStyleChangedDropdown; private onLineWidthChangedDropdown; private onTextColorChanged; private onTextFontChanged; private onTextSizeChanged; private onSettingsButtonClicked; private onSizeChanged; private setFields; private showBaseShapeItems; private showFillOptionsPaneItems; private showTemplateItems; private showPositionFillOptionsPaneItems; private showLineOptionsPaneItems; private showSizeShapeItems; private showTextColorPaneItems; private showTextFontPaneItems; private showTextSizePaneItems; private stickModeHandle; private getShapeTheme; } } declare module FintaChart { /** * @description Represents Coordinate * @export * @interface ICoordinate */ interface ICoordinate { x1: number; y1: number; x2: number; y2: number; } /** * @description Provides model of Profile Drawing Tool * @export * @class ProfileDrawingTool * @extends {Shape} */ class ProfileDrawingTool extends Shape { step: number; rowsNumber: number; VAPercent: number; sizePercent: number; private VPFR; /** * @description Get name on instance type * * @readonly * @static * @property {string} instanceTypeName * @memberof ProfileDrawingTool */ static get type(): string; /** * @description Get shape's required points count * @property {number} requiredPointsCount * @readonly * @memberof ProfileDrawingTool */ get requiredPointsCount(): number; /** * @description Retrieves shape's bounds * @returns {IBounds} Shape's bounds * @memberof ProfileDrawingTool */ bounds(): IBounds; /** * @description Paints * @memberof ProfileDrawingTool */ paint(): void; /** * @description Hit tests shape * @param {IPoint} point * @returns {boolean} Is hit * @memberof ProfileDrawingTool */ hitTest(point: IPoint): boolean; /** * @description Retrieves points localization keys * @returns {string[]} Visual data points names * @memberof ProfileDrawingTool */ pointsLocalizationKeys(): string[]; /** * @description Calculate Profile Drawing Tool values * * @memberof ProfileDrawingTool */ private calculateVPFR; /** * @description Calculate segment intersection * @param {number} y1 * @param {number} y2 * @param {number} y3 * @param {number} y4 * @returns {number} Intersection * @memberof ProfileDrawingTool */ private calculateInter; /** * @description Draw profile drawing tool * * @memberof ProfileDrawingTool */ private drawVPFR; /** * @description Draw rectangle background * @param {ICoordinate} coordinate * @memberof ProfileDrawingTool */ private _drawRectBackground; /** * @description Draw rows * * @memberof ProfileDrawingTool */ private _drawRows; /** * @description Draw line * @param {number} ym * @param {number} right * @param {number} left * @memberof RowHistogramPlot */ private _drawLine; /** * @description Handles motion event pencil device * @protected * @param {MoveMotionEvent} motionEvent * @param {IWindowEvent} event * @returns {boolean} Is handled * @memberof ProfileDrawingTool */ protected _handleMotionEventPencilDevice(motionEvent: MoveMotionEvent, event: IWindowEvent): boolean; } } declare module FintaChart { /** * Describes chart template. */ interface IChartTemplate { /** * The unique template identifier. */ id: string; /** * The name of the template. */ name: string; /** * The state of the template. */ state: IChartTemplateState; } /** * Represents chart templates data provider. */ abstract class TemplatesDataProvider { private readonly _updateListeners; protected templates: IChartTemplate[]; protected constructor(); /** * Edits template * * @param id * @param newName * @return */ abstract editTemplate(id: string, newName: string): Promise; /** * Returns template by id * * @param id * @return */ abstract templateById(id: string): IChartTemplate; /** * Returns templates * * @return */ abstract templateList(): Promise; /** * Removes templates * * @param id * @return */ abstract removeTemplate(id: string): Promise; /** * Saves templates * * @param name * @param state * @return */ abstract saveTemplate(name: string, state: IChartTemplateState): Promise; subscribeOnUpdate(fn: (lists: IChartTemplate[]) => void): void; unsubscribeFromUpdate(fn: (lists: IChartTemplate[]) => void): void; notifyUpdateListeners(): void; } } declare module FintaChart { /** * Represents dummy templates file data provider * */ class DummyTemplatesFileDataProvider extends TemplatesDataProvider { private readonly localStorageTemplates; private _paths; /** * Creates an instance of DummyTemplatesFileDataProvider. * * @param paths The collection of paths to chart templates. */ constructor(paths: string[]); editTemplate(id: string | number, newName: string): Promise; templateById(id: string): IChartTemplate; templateList(): Promise; removeTemplate(id: string | number): Promise; saveTemplate(name: string, state: IChartTemplateState): Promise; private getTemplateListFromFiles; private updateTemplateListInLocalStorage; } } declare module FintaChart { /** * Enum of possible types checkbox presentation. * */ enum ButtonType { ACCEPT = "accept", CANCEL = "cancel", NONE = "none" } /** * */ interface IButtonChartTheme { button: { [key: string]: ICheckBoxTheme; }; } interface IButtonConfig { renderer: IRenderer; chartTheme: IButtonChartTheme; type?: ButtonType; options(): IButtonOptions; onClick?(): void; } /** * */ interface IButtonOptions { size: number; position: IPoint; theme?: IStrokeTheme; } /** * */ class Button extends Control { private readonly _renderer; private readonly _onClick; private readonly _options; private _type; private _theme; private _chartTheme; /** * Gets options of current object. */ get options(): IButtonOptions; /** * Gets/Sets type of checkbox. */ get type(): ButtonType; set type(value: ButtonType); /** * Gets/sets actual theme. */ get theme(): ICheckBoxTheme; set theme(value: ICheckBoxTheme); /** * Sets chart theme. */ set chartTheme(value: IButtonChartTheme); /** * Gets actual theme. */ get defaultTheme(): ICheckBoxTheme; constructor(config: IButtonConfig); paint(): void; dispose(): void; protected initMotionEvents(): MotionEventArray; private motionHitTest; private static onMouseHover; private static changeCursor; private onMove; } } declare module FintaChart { } declare module FintaChart { enum TradingToolState { NONE = 0, MOVING = 1 } const stTpRectWidth = 20; const orderTagRightMargin = 42; interface IOrderSizeOptions { position: IPoint; size: { width: number; height: number; }; } interface IOrderToolTheme { fill: IFillTheme; text: ITextTheme; line: IStrokeTheme; price: { fill: IFillTheme; text: ITextTheme; }; } abstract class TradingTool extends PaneObject { private _eventHandlers; private _motions; protected state: TradingToolState; locked: boolean; protected _dim: number | null; protected get canHandleEvents(): boolean; get canMove(): boolean; get dim(): number | null; /** * Visually dims the trading tool by multiplying its theme colors by `value`. * Pass `null` (or omit) to undim and restore the original theme. * @param value Number in (0, 1] or null to clear. */ setDimmed(value?: number | null): void; /** * Returns a deep clone of `src` with every `strokeColor` and `fillColor` * leaf multiplied by `value`. Used by subclasses inside `actualTheme` when * `_dim` is set. */ protected _dimThemeColors(src: T, value: number): T; private _dimWalk; protected constructor(); dispose(): void; protected onPaneChanged(oldValue: Pane): void; paint(): void; setNeedsUpdatePanel(): void; refresh(): void; protected initButtons(): Button[]; refreshPane(): void; remove(): boolean; handleEvent(event: IWindowEvent): boolean; hitTest(point: IPoint): boolean; private panHitTest; protected onDoubleClick(): boolean; private onMoveEvent; get contractSize(): number; getOrderQuantity(order: StopLoss | TakeProfit): number; drawOrder(order: StopLoss | TakeProfit, localizedText: string, isPosition: boolean): void; protected onMove(gesture: MoveMotionEvent, event: IWindowEvent): boolean; private calculateForexProfit; private formatProfitDescription; modifyThemeColor(color: string, opacity?: number): string; formatValue(value: number): number; protected getDisplayedBidAsk(fallbackPrice?: number): { bid: number; ask: number; }; private _initButtons; private initMotionEvents; protected _handleHoverGesture(gesture?: MouseHoverMotionEvent): boolean; protected _handleClickGesture(gesture?: MotionEvent, event?: IWindowEvent): boolean; protected _handleDoubleClickGesture(gesture?: MotionEvent, event?: IWindowEvent): boolean; private changeButtonsTheme; } } declare module FintaChart { enum OrderAction { BUY = "buy", SELL = "sell" } enum OrderKind { MARKET = "market", STOP = "stop", LIMIT = "limit", STOP_LIMIT = "stop-limit", TAKE_PROFIT = "take-profit", STOP_LOSS = "stop-loss" } enum OrderState { PENDING_SUBMIT = "pendingSubmit", PENDING_CANCEL = "pendingCancel", PENDING_REPLACE = "pendingReplace", SUBMITTED = "submitted", ACCEPTED = "accepted" } enum OrderTimeInForce { GOOD_TILL_DATE = "goodTillDate", DAY = "day", GOOD_TILL_CANCEL = "goodTillCanceled" } interface IOrder { id?: number | string; price?: number; stopPrice?: number; limitPrice?: number; lastPrice?: number; action?: OrderAction; kind?: OrderKind; quantity?: number; state?: OrderState; timeInForce?: OrderTimeInForce; date?: Date; takeProfit?: number; stopLoss?: number; parentPositionId?: number | string; } } declare module FintaChart { const OrderBarEvents: { ORDER_SETTINGS_CLICKED: string; ACCEPT_ORDER_CLICKED: string; CANCEL_ORDER_CLICKED: string; ORDER_PRICE_CHANGED: string; ORDER_DRAG: string; }; /** * Describes order bar theme */ interface IOrderBarTheme { /** * The order line theme. */ line: IStrokeTheme; /** * The order kind theme. */ name: { /** * The order kind text theme. */ text: ITextTheme; }; /** * The order price label theme. */ price: { /** * The order price label fill theme. */ fill: IFillTheme; /** * The order price label text theme. */ text: ITextTheme; }; /** * The order quantity theme. */ quantity: { /** * The order quantity text theme. */ text: ITextTheme; }; profit: { fill: IFillTheme; text: ITextTheme; }; fill: IFillTheme; shadow?: IShadowRenderingOptions; } interface IOrderBarConfig { order: IOrder; allowPriceChange?: boolean; } const textOffset = 15; const checkBoxSize = 10; const defaultZIndex = 300; const selectedZIndex = 301; const defaultLabelZIndex = 500; const selectedLabelZIndex = 501; const blur = 10; const priceTypeBadgeWidth = 22; const priceTypeBadgeGap = 5; const STOP_LIMIT_LIMIT_SUFFIX = "limit"; const STOP_LIMIT_STOP_SUFFIX = "stop"; class OrderBar extends TradingTool { private _config; get localizedKind(): string; get localizedAction(): string; get order(): IOrder; set order(value: IOrder); private _selected; set selected(value: boolean); get selected(): boolean; get theme(): IOrderBarTheme; set theme(value: IOrderBarTheme); get actualTheme(): IOrderBarTheme; setDimmed(value?: number | null): void; get defaultTheme(): IOrderBarTheme; _cancelButtonOptions: IButtonOptions; private _acceptedButtonOptions; /** * Gets/Sets profit of order bar. * @name profit * @type {number} */ private _profit; get profit(): number; set profit(value: number); /** * Gets/Sets stopLoss of order bar. * @name stopLossLine * @type {StopLoss} * @memberOf FintaChart.OrderBar# */ private _stopLossLine; get stopLossLine(): StopLoss; set stopLossLine(value: StopLoss); /** * Gets/Sets takeProfit of order bar. * @name takeProfitLine * @type {TakeProfit} * @memberOf FintaChart.OrderBar# */ private _takeProfitLine; get takeProfitLine(): TakeProfit; set takeProfitLine(value: TakeProfit); get fontSize(): number; get fontFamily(): string; private _stTpLine; get stTpLine(): STTP; set stTpLine(value: STTP); modifyOrder: boolean; _labelOptions: ILabelOptions; /** * Gets order label of order bar. * @name orderLabel * @type {OrderLabel} * @memberOf FintaChart.OrderBar# */ private _orderLabel; get orderLabel(): OrderLabel; /** * The width of order action. * @name actionTextWidth * @type {number} */ private _actionTextWidth; get actionTextWidth(): number; /** * The width of order bar kind. * @name kindTextWidth * @type {number} */ private _kindTextWidth; get kindTextWidth(): number; /** * The width of order bar quantity. * @name quantityTextWidth * @type {number} */ private _quantityTextWidth; get quantityTextWidth(): number; get orderQuantity(): number; /** * The width of order bar profit. * @name profitTextWidth * @type {number} */ private _profitTextWidth; get profitTextWidth(): number; private _forceExpanded; private _parentOrder?; get showlabel(): boolean; get priceType(): 'LP' | 'SP' | null; get priceTypeBadgeReservedWidth(): number; get isSelected(): boolean; private get _isExitChildOrder(); private _ensureParentLink; private get _shouldRenderCollapsedView(); private _getCollapsedLineTheme; private _expandChildOrders; get mouseHover(): boolean; set mouseHover(value: boolean); get textOffset(): number; dragFinished: boolean; private _valueMarker; get valueMarker(): VerticalAxisLabel; constructor(config: IOrderBarConfig); private _getLabelOptions; private _getCancelButtonOptions; private _getAcceptedButtonOptions; private _onCancelButtonClick; private _onAcceptButtonClick; protected _handleDoubleClickGesture(): boolean; protected _handleHoverGesture(gesture: MouseHoverMotionEvent): boolean; protected _handleClickGesture(gesture?: MotionEvent): boolean; protected _handleMotionEventPencilDevice(gesture: MoveMotionEvent, event: IWindowEvent): boolean; /** * @inheritdoc */ initButtons(): Button[]; /** * @inheritdoc */ hitTest(point: IPoint): boolean; setSelected(): void; /** * @inheritdoc */ paint(): void; private _paintPriceTypeBadge; finishModifyMode(): void; paintVerticalAxisLabels(): void; orderModifyStarted(): boolean; /** * @inheritdoc */ drawScaleVerticalFloatingLabels(): void; ordersHover(): boolean; refresh(localize?: boolean): Promise; private _updateTextWidth; isTPSLAllowedOnThisLine(): boolean; updateSTTP(): void; private _localizeValues; dispose(): Promise; private _changeOrderPosition; } } declare module FintaChart { interface IPosition { id: number | string; price: number; kind: PositionKind; quantity: number; instrumentId?: string; plText?: string; uplText?: string; stopLoss?: number; takeProfit?: number; } enum PositionKind { SHORT = "short", LONG = "long", FLAT = "flat" } } declare module FintaChart { /** * Describes position bar theme. */ interface IPositionBarTheme { /** * The position line theme. */ line: IStrokeTheme; /** * The position kind theme. */ kind: { /** * The theme of position kind text. */ text: ITextTheme; }; /** * The position price theme. */ price: { /** * The price fill theme. */ fill: IFillTheme; /** * The price text theme. */ text: ITextTheme; }; /** * The position quantity theme. */ quantity: { /** * The quantity text theme. */ text: ITextTheme; }; } interface IPositionBarConfig { position: IPosition; } const PositionBarEvents: { POSITION_ADDED: string; POSITION_REMOVED: string; CLOSE_POSITION_CLICKED: string; ADD_STOP_LOSS: string; ADD_TAKE_PROFIT: string; REMOVE_POSITION: string; }; class PositionBar extends TradingTool { _closeButtonOptions: IButtonOptions; _labelOptions: ILabelOptions; _cancelButtonOptions: IButtonOptions; dragFinished: boolean; textOffset: number; private _position; private _localizedKind; private _theme; private _valueMarker; private _mouseHover; private _positionLabel; private _stopLossLine; private _takeProfitLine; private _stTpLine; private _selected; /** * Instance text width for kind. */ private _kindTextWidth; /** * Instance text width for quantity. */ private _quantityTextWidth; /** * Gets/Set position. */ get position(): IPosition; set position(position: IPosition); /** * Gets/Sets stopLoss of position bar. */ get stopLossLine(): StopLoss; set stopLossLine(value: StopLoss); /** * Gets/Sets takeProfit of position bar. */ get takeProfitLine(): TakeProfit; set takeProfitLine(value: TakeProfit); /** * Gets/Sets Position StopLoss TakeProfit. */ get stTpLine(): PositionSLTP; set stTpLine(value: PositionSLTP); /** * Gets/Sets position selected state. */ set selected(value: boolean); get selected(): boolean; get isSelected(): boolean; /** * Gets/Sets position mouse hover. */ get mouseHover(): boolean; set mouseHover(value: boolean); /** * Gets/Sets position label. */ get positionLabel(): PositionLabel; get showlabel(): boolean; get positionQuantity(): number; /** * Gets current theme of position tool. */ get actualTheme(): IPositionBarTheme; setDimmed(value?: number | null): void; /** * Gets default theme of position tool. */ get defaultTheme(): IPositionBarTheme; get fontSize(): number; get valueMarker(): VerticalAxisLabel; constructor(config: IPositionBarConfig); private _onCancelButtonClick; private _getLabelOptions; private _getCloseButtonOptions; protected _handleHoverGesture(gesture: MouseHoverMotionEvent): boolean; protected initButtons(): Button[]; hitTest(point: IPoint): boolean; setSelected(): void; paint(): void; finishModifyMode(): void; orderModifyStarted(): boolean; ordersHover(): boolean; updateSLTP(): void; private _createPositionSLTP; drawScaleVerticalFloatingLabels(): void; refresh(localize?: boolean): Promise; private _fillArea; private _drawFillRectangle; private _updateTextWidth; private _localizeValues; private _subscribePositionRemove; dispose(): void; private onCloseClick; private updateTextWidth; private localize; } } declare module FintaChart { interface IPositionLabelConfig { positionBar: PositionBar; options(): ILabelOptions; onClick?(): void; } interface ILabelSizeConfig { height: number; width: number; } interface ILabelOptions { size: ILabelSizeConfig; position: IPoint; } class PositionLabel extends TradingTool { /** * Gets options of current object. * @name options * @type {ILabelOptions} */ get opt(): ILabelOptions; mouseHover: boolean; private _dragLabel; get dragLabel(): boolean; /** * Gets remove button of position bar. * @name removeButton * @type {Button} */ private _removeButton; get removeButton(): Button; set removeButton(value: Button); /** * Gets/Sets position selected state. */ set selected(value: boolean); get selected(): boolean; get position(): IPosition; private _closeBtnHover; private _selected; constructor(config: IPositionLabelConfig); protected _handleDoubleClickGesture(gesture: MoveMotionEvent, event: IWindowEvent): boolean; private _setSelected; private _changeCursorType; } } declare module FintaChart { class PositionSLTP extends TradingTool { get parentOrder(): PositionBar; set parentOrder(value: PositionBar); get kind(): string; private _stopLossChanged; private _takeProfitChanged; private _dragStartX; private _dragStartY; private _isDraggingStarted; private DRAG_THRESHOLD; _isTP: boolean; _isSL: boolean; _isTpDrag: any; settings: any; constructor(parent: PositionBar, isTP: boolean, isSL: boolean); protected _handleHoverGesture(gesture: MouseHoverMotionEvent): boolean; protected _handleMotionEventPencilDevice(gesture: MoveMotionEvent, event: IWindowEvent): boolean; private _detectTP; private _updateStopLossTakeProfit; /** * @inheritdoc */ hitTest(point: IPoint): boolean; /** * @inheritdoc */ paint(): void; dispose(): void; private _isPositionHasTpSl; } } declare module FintaChart { interface ILabelConfig { orderBar: OrderBar; options(): ILabelOptions; onClick?(): void; } interface ILabelSizeConfig { height: number; width: number; } interface ILabelOptions { size: ILabelSizeConfig; position: IPoint; } class OrderLabel extends TradingTool { /** * Gets options of current object. * @name options * @type {ILabelOptions} */ get opt(): ILabelOptions; mouseHover: boolean; private _dragLabel; get dragLabel(): boolean; /** * Gets remove button of order bar. * @name removeButton * @type {Button} */ private _removeButton; get removeButton(): Button; set removeButton(value: Button); private _closeBtnHover; private _elementPopup; private _isShownPopup; private _isTypeTPSL; constructor(config: ILabelConfig); protected _handleMotionEventPencilDevice(gesture: MoveMotionEvent, event: IWindowEvent): boolean; protected _handleDoubleClickGesture(gesture: MoveMotionEvent, event: IWindowEvent): boolean; paint(): void; paintVerticalAxisLabels(): void; private _changeCursorType; protected _detectQuantityClick(event: IWindowEvent): void; private _loadTemplate; private _initializePopup; hidePopup(): void; destroy(): void; } } declare module FintaChart { const STOP_LOSS = "stopLoss"; const StopLossEvents: { STOP_LOSS_SETTINGS_CLICKED: string; CANCEL_STOP_LOSS_CLICKED: string; REMOVE_STOP_LOSS: string; STOP_LOSS_PRICE_CHANGED: string; STOP_LOSS_DRAG: string; }; class StopLoss extends TradingTool { _cachedEntryPrice: number; _cachedTpSlPrice: number; _cachedQuantity: number; get localizedText(): string; get mouseHover(): boolean; set mouseHover(value: boolean); get drawMarker(): boolean; set drawMarker(value: boolean); /** * Gets/Sets theme of order bar. * @name theme * @type {IOrderBarTheme} */ get theme(): IOrderBarTheme; set theme(value: IOrderBarTheme); /** * Gets current theme of order bar. * @name actualTheme * @type {IOrderBarTheme} */ get actualTheme(): IOrderToolTheme; /** * Gets default theme of order bar. * @name defaultTheme * @type {IOrderBarTheme} */ get defaultTheme(): IOrderBarTheme | null; _cancelButtonOptions: IButtonOptions; get parentOrder(): OrderBar | PositionBar; set parentOrder(value: OrderBar | PositionBar); get price(): number; get action(): string; /** * Gets/Sets quantitty of stop loss. * @name quantity * @type {number} */ get quantity(): number; set quantity(value: number); sizeOptions: IOrderSizeOptions | null; private _closeBtnHover; constructor(parent: OrderBar | PositionBar, isPosition: boolean); protected _handleHoverGesture(gesture: MouseHoverMotionEvent): boolean; protected _handleClickGesture(): boolean; protected _handleMotionEventPencilDevice(gesture: MoveMotionEvent, event: IWindowEvent): boolean; /** * @inheritdoc */ initButtons(): Button[]; /** * @inheritdoc */ hitTest(point: IPoint): boolean; /** * @inheritdoc */ paint(): void; /** * @inheritdoc */ paintVerticalAxisLabels(): void; refresh(localize?: boolean): Promise; dispose(): void; } } declare module FintaChart { interface ISTTPOptions { positionTP: IPoint; positionSL: IPoint; size: { width: number; height: number; }; } class STTP extends TradingTool { get parentOrder(): OrderBar; set parentOrder(value: OrderBar); get action(): string; private _stopLossChanged; private _takeProfitChanged; private _dragStartX; private _dragStartY; private _isDraggingStarted; private DRAG_THRESHOLD; _isTP: boolean; _isSL: boolean; _isTpDrag: boolean | null; sizeOptions: ISTTPOptions | null; constructor(parent: OrderBar, isTP: boolean, isSL: boolean); paintVerticalAxisLabels(): void; protected _handleHoverGesture(gesture: MouseHoverMotionEvent): boolean; protected _handleMotionEventPencilDevice(gesture: MoveMotionEvent, event: IWindowEvent): boolean; private _isTakeProfitCreated; private _isStopLossCreated; private _getButtonAreas; private _isOnTakeProfitButton; private _isOnStopLossButton; private _detectTP; private _updateStopLossTakeProfit; /** * @inheritdoc */ hitTest(point: IPoint): boolean; /** * @inheritdoc */ paint(): void; dispose(): void; } } declare module FintaChart { const TAKE_PROFIT = "takeProfit"; const TakeProfitEvents: { TAKE_PROFIT_SETTINGS_CLICKED: string; CANCEL_TAKE_PROFIT_CLICKED: string; REMOVE_TAKE_PROFIT: string; TAKE_PROFIT_PRICE_CHANGED: string; TAKE_PROFIT_DRAG: string; }; class TakeProfit extends TradingTool { _cachedEntryPrice: number; _cachedTpSlPrice: number; _cachedQuantity: number; get localizedText(): string; get mouseHover(): boolean; set mouseHover(value: boolean); /** * Gets/Sets theme of order bar. * @name theme * @type {IOrderBarTheme} * @memberOf FintaChart.OrderBar# */ get theme(): IOrderBarTheme; set theme(value: IOrderBarTheme); /** * Gets current theme of order bar. * @name actualTheme * @type {IOrderBarTheme} */ get actualTheme(): IOrderToolTheme; /** * Gets default theme of order bar. * @name defaultTheme * @type {IOrderBarTheme} */ get defaultTheme(): IOrderBarTheme | null; _cancelButtonOptions: IButtonOptions; get parentOrder(): OrderBar | PositionBar; set parentOrder(value: OrderBar | PositionBar); get price(): number; get action(): string; sizeOptions: IOrderSizeOptions | null; private _drawMarker; get drawMarker(): boolean; set drawMarker(value: boolean); private _closeBtnHover; /** * Gets/Sets quantitty of stop loss. * @name quantity * @type {number} */ get quantity(): number; set quantity(value: number); constructor(parent: OrderBar | PositionBar, isPosition: boolean); protected _handleHoverGesture(gesture: MouseHoverMotionEvent): boolean; protected _handleClickGesture(): boolean; protected _handleMotionEventPencilDevice(gesture: MoveMotionEvent, event: IWindowEvent): boolean; /** * @inheritdoc */ initButtons(): Button[]; /** * @inheritdoc */ hitTest(point: IPoint): boolean; /** * @inheritdoc */ paint(): void; /** * @inheritdoc */ paintVerticalAxisLabels(): void; refresh(localize?: boolean): Promise; dispose(): void; } } declare module FintaChart { /** * @description Represents context menu item * @export * @interface IContextMenuItem */ interface IContextMenuItem { id: string; label: string; event?: IWindowEvent; subMenu?: IContextMenuItem[]; indicator?: IContextMenuIndicatorItem; } interface IContextMenuIndicatorItem { name: string; parameters: { period: number; source: string; }; value: number; plot: { seriesName: string; }; } type GetOrderSettingsType = () => IOrderSettings | null; interface IOrderSettings { [id: string]: { defaultQuantity: number; }; } interface SelectedObjConfig { price: number; kind: string; action?: string; id?: string | number; quantity?: number; } /** * @description Provides model of Trading Context Menu * @export * @class TradingContextMenu * @extends {ContextMenu} */ class TradingContextMenu extends ContextMenu { private static _container; private _menuItems; private _contextMenuEvent; private _contextMenuPlacingOrdersEnabled; private price; private closePrice; /** * @description Creates an instance of TradingContextMenu. * @constructor * @param {Chart} chart * @param {IContextMenuConfig} config * @param {HTMLElement} [targetDomObject] * @memberof TradingContextMenu */ constructor(chart: Chart, config: IContextMenuConfig, targetDomObject?: HTMLElement); _calculatePrices(event: IWindowEvent, scaleCoordinateMapper: ScaleCoordinateMapper): void; private _addIndicatorAlertMenuItem; getMenuList(): void; handleItemSelected(id: string, pane: Pane): void; handleEvent(event: IWindowEvent): void; setStopLossTakeProfitMenu(chart: Chart): void; private _formConfig; } } declare module FintaChart { enum AlertToolState { NONE = 0, MOVING = 1 } interface IAlert { id: string; name: string; message: string; value: number; valueLowBound?: number; } const rectWidth = 20; abstract class AlertTool extends PaneObject { private _eventHandlers; private _motions; private _motionsMarker; protected state: AlertToolState; locked: boolean; protected get canHandleEvents(): boolean; get canMove(): boolean; protected constructor(); dispose(): void; protected onPaneChanged(oldValue: Pane): void; paint(): void; setNeedsUpdatePanel(): void; refresh(): void; protected initButtons(): Button[]; refreshPane(): void; remove(): boolean; handleEvent(event: IWindowEvent): boolean; handleEventMarker(event: IWindowEvent): boolean; hitTest(point: IPoint): boolean; private panHitTest; protected onDoubleClick(): boolean; private onMoveEvent; protected onMove(gesture: MoveMotionEvent, event: IWindowEvent): boolean; modifyThemeColor(color: string, opacity?: number): string; formatValue(value: number): number; private _initButtons; private initMotionEvents; protected _handleHoverGestureMarker(gesture?: MouseHoverMotionEvent): boolean; protected _handleClickGestureMarket(gesture?: MotionEvent, event?: IWindowEvent): boolean; protected _handleHoverGesture(gesture?: MouseHoverMotionEvent): boolean; protected _handleClickGesture(gesture?: MotionEvent, event?: IWindowEvent): boolean; protected _handleDoubleClickGesture(): boolean; } } declare module FintaChart { interface IAlertLabelConfig { alertBar: AlertBar; options(): IAlertLabelOptions; onClick?(): void; onHover?(): void; } interface ILabelSizeConfig { height: number; width: number; } interface IAlertLabelOptions { size: ILabelSizeConfig; position: IPoint; show: boolean; } class AlertLabel extends AlertTool { private _onHover; /** * Gets options of current object. * @name options * @type {ILabelOptions} */ get opt(): ILabelOptions; mouseHover: boolean; private _dragLabel; get dragLabel(): boolean; /** * Gets remove button of order bar. * @name removeButton * @type {Button} */ private _removeButton; get removeButton(): Button; set removeButton(value: Button); private _closeBtnHover; private _isShownPopup; constructor(config: IAlertLabelConfig); protected _handleMotionEventPencilDevice(gesture: MoveMotionEvent, event: IWindowEvent): boolean; protected _handleDoubleClickGesture(): boolean; paint(): void; paintVerticalAxisLabels(): void; private _changeCursorType; destroy(): void; } } declare module FintaChart { const AlertBarEvents: { Alert_SETTINGS_CLICKED: string; ACCEPT_Alert_CLICKED: string; CANCEL_Alert_CLICKED: string; Alert_PRICE_CHANGED: string; Alert_DRAG: string; }; /** * Describes Alert bar theme */ interface IAlertBarTheme { text: ITextTheme; markerText: ITextTheme; line: IStrokeTheme; fill: IFillTheme; markerFill: IFillTheme; fillRect: IFillTheme; background: string; } interface IAlertBarConfig { Alert: IAlert; allowPriceChange?: boolean; } class AlertBar extends AlertTool { private _config; get Alert(): IAlert; set Alert(value: IAlert); private _selected; set selected(value: boolean); get selected(): boolean; get alertValue(): number; set alertValue(value: number); get theme(): IAlertBarTheme; set theme(value: IAlertBarTheme); get actualTheme(): IAlertBarTheme; get defaultTheme(): IAlertBarTheme; _cancelButtonOptions: IButtonOptions; private _acceptedButtonOptions; get fontSize(): number; get fontFamily(): string; modifyAlert: boolean; _labelOptions: ILabelOptions; /** * Gets Alert label of Alert bar. * @name AlertLabel * @type {AlertLabel} * @memberOf FintaChart.AlertBar# */ private _AlertLabel; get AlertLabel(): AlertLabel; /** * The width of Alert action. * @name actionTextWidth * @type {number} */ private _actionTextWidth; get actionTextWidth(): number; /** * The width of Alert bar kind. * @name messageTextWidth * @type {number} */ private _messageTextWidth; get messageTextWidth(): number; get showlabel(): boolean; get isSelected(): boolean; get mouseHover(): boolean; set mouseHover(value: boolean); get textOffset(): number; dragFinished: boolean; private _valueMarker; get valueMarker(): VerticalAxisLabel; isLowBound?: boolean; constructor(config: IAlertBarConfig, isLowBound?: boolean); private _getLabelOptions; private _getCancelButtonOptions; private _getAcceptedButtonOptions; private _onCancelButtonClick; private _onAcceptButtonClick; protected _handleDoubleClickGesture(): boolean; protected _handleClickGestureMarket(): boolean; protected _handleMotionEventPencilDevice(gesture: MoveMotionEvent, event: IWindowEvent): boolean; protected _handleHoverGesture(gesture: MouseHoverMotionEvent): boolean; protected _handleHoverGestureMarker(gesture: MouseHoverMotionEvent): boolean; showAlertId(): void; private _changeCursorType; /** * @inheritdoc */ initButtons(): Button[]; /** * @inheritdoc */ hitTest(point: IPoint): boolean; setSelected(): void; /** * @inheritdoc */ paint(): void; finishModifyMode(): void; paintVerticalAxisLabels(): void; AlertModifyStarted(): boolean; /** * @inheritdoc */ drawScaleVerticalFloatingLabels(): void; refresh(localize?: boolean): void; private _updateTextWidth; updateSTTP(): void; dispose(): void; private _changeAlertPosition; private _drawAlertLine; } } declare module FintaChart { interface IChartObject { readonly type?: string; hovered: boolean; selected: boolean; pane?: Pane; chart?: Chart; order?: OrderBar; alert?: AlertBar; } type DateTimezoneConverter = (date: Date) => Date; interface ITimezone { name: string; timezone: string; } /** * Represents chart config */ interface IChartConfig { /** * Chart Type Name */ chartType?: string; /** * Is chart auto save enable */ autoSave?: boolean; /** * Chart bars count */ barsCount?: number; /** * Chart container — either an already-resolved HTMLElement, or a CSS * selector string (for parity with the legacy jQuery-era API that the * HTML examples rely on: `container: '#chartContainer'`). */ container?: HTMLElement | string; /** * Cross hair type */ crossHair?: string; /** * Cross hair show bar offset */ showCrossHairBarOffset?: boolean; /** * Chart DataFeed */ datafeed?: IDatafeedBase; /** * Is chart in full window mode */ fullWindowMode?: boolean; /** * Chart height */ height?: number | string; /** * Is chart tool panel enabled */ enableToolPanes?: boolean; /** * Chart instrument */ instrument?: IInstrument; /** * Is chart hot keys enabled */ enableHotKeys?: boolean; /** * Is chart OHLC panel showed */ ohlcShowed?: boolean; /** * Is chart OHLC info card showed */ ohlcCardShowed?: boolean; /** * Scrollbar loaded event emitter */ onScrollbarLoaded?: () => void; /** * Toolbar loaded event emitter */ onToolbarLoaded?: () => void; /** * Is show chart scrollbar */ showScrollbar?: boolean; /** * Is show chart toolbar */ showToolbar?: boolean; /** * Is hide chart scroll to last bar */ hideScrollToLastBar?: boolean; /** * Chart state handler */ stateHandler?: IChartStateHandler; /** * Chart supported time frames */ supportedTimeFrames?: string[]; /** * Chart context menu items */ contextMenuItems?: IContextMenuItem[]; /** * Chart context menu placing orders enabled */ contextMenuPlacingOrdersEnabled?: boolean; /** * Chart template data provider */ templateDataProvider?: TemplatesDataProvider; /** * Chart indicators overview provider */ indicatorsOverviewProvider?: IIndicatorsOverviewProvider; /** * Provide restricted indicators based on external conditions */ indicatorsRestrictionsProvider?: IRestrictedIndicatorsProvider; /** * Chart theme */ theme?: any; /** * Chart time frame */ timeFrame?: ITimeFrame; /** * Chart time interval */ timeInterval?: number; /** * Chart width */ width?: number | string; addThemeClass?: boolean; marketEventPopupBuilder?: IMarketEventPopupBuilder; marketEventsDatafeed?: MarketEventsDatafeed; indicatorAlertsHandler?: IIndicatorAlertsHandler; tradeHandler?: ITradeHandlerCallback; useSmoothedLines?: boolean; showExecutionLabels?: boolean; showExecution?: boolean; dateTimezoneConverter?: (date: Date, timezone: string) => Date; searchInstruments?: SearchInstrumentPredicate; exchanges?: GetAllExchanges; tradingSession?: string; tradingSessionRange?: ITradingSessionRange; orderSettings?: GetOrderSettingsType; useExternalSearchInput?: boolean; showLogoWatermark?: boolean; useNewBrandedWatermark?: boolean; isChartWidget?: boolean; /** * Toolbar items to hide — array or map */ toolbarHiddenItems?: ToolbarHiddenItems; } /** * Represents chart options */ interface IChartOptions { /** * Chart type settings */ chartType: string; /** * Chart combination model settings */ combinationModel?: HotkeyCombination[]; /** * Is chart keyboard events enabled */ enableKeyboardEvents: boolean; /** * Is chart mouse events enabled */ enableMouseEvents: boolean; /** * Chart locale */ locale: string; /** * Is OHLC panel showed */ ohlcShowed?: boolean; /** * Is OHLC info card showed */ ohlcCardShowed?: boolean; /** * Is chart scroll enabled */ scrollEnabled: boolean; /** * Is show chart bar info in title */ showBarInfoInTitle: boolean; /** * Is show indicator legend/titles */ showIndicatorLegend?: boolean; /** * Is show chart instrument watermark */ showInstrumentWatermark: boolean; showLogoWatermark: boolean; useNewBrandedWatermark: boolean; /** * Is hide chart scroll to last bar */ hideScrollToLastBar: boolean; /** * Chart theme */ theme: any; userTheme?: any; /** * Is chart x grid showed */ gridX: boolean; /** * Is chart y grid showed */ gridY: boolean; /** * Is chart zoom enabled */ zoomEnabled: boolean; smoothLines: boolean; showExecutionLabels: boolean; showExecution: boolean; isChartWidget: boolean; /** * @description Is order label enabled * @type {boolean} * @memberof IChartOptions */ showOrdersLabel?: boolean; /** * @description Is order lines enabled * @type {boolean} * @memberof IChartOptions */ showOrdersLine?: boolean; /** * @description Trading session type * @type {string} * @memberof IChartOptions */ tradingSession?: string; tradingSessionRange?: ITradingSessionRange; } interface IRecordsState { firstVisibleRecord: number; lastVisibleRecord: number; recordsCount: number; } interface IChartState { chart: IChartOptions; chartType: IChartTypeState; crossHair: ICrossHairState; horizontalScale?: IHorizontalScaleState; verticalScales: unknown[]; panesContainer: IPanesContainerState; compareInstrumentHandler: ICompareInstrumentHandlerState; indicators: any; hotkeys: HotkeyCombination[]; shapes: IShapeState[]; marketEventsManager: IMarketEventsManagerState; tradingSession?: string; contextMenuPlacingOrdersEnabled: boolean; magnetMode: string; recordsState: IRecordsState; timezone?: ITimezone; showExecutionLabels?: boolean; showExecution?: boolean; } type ITradeHandlerCallback = (params: ITradeHandlerParams) => void; /** * Represents chart template state */ interface IChartTemplateState { /** * Template chart type */ chartType: IChartTypeState; /** * Template indicators list */ indicators: any[]; /** * Template theme */ theme?: IEnvironmentTheme; } interface ITradeHandlerParams { action: OrderAction; price: number; amount: number; orderKind: OrderKind; limitPrice: number; stopPrice: number; takeProfit?: number; stopLoss?: number; tif?: OrderTifEnum; tifDate?: string; } interface OrderFeaturesInterface { featuresByOrderType: Record; quantityUnit: string; } interface OrderTypeFeature { supportedTimeInForce: OrderTifEnum[]; } enum OrderTifEnum { Day = "day", Gtc = "gtc", Gtd = "gtd", Fok = "fok", Ioc = "ioc" } /** * Rendering quality: trades sharpness for paint speed on weak devices. */ enum RenderQuality { LOW = "low", MEDIUM = "medium", HIGH = "high" } /** * Provides model of min and max */ class MinMax { /** * Min number */ min: number; /** * Max number */ max: number; } enum ChartState { NORMAL = 0, RESIZING_PANES = 1, USER_SHAPE = 2, ZOOM_IN = 3 } const AdjustType: { BARS: number; BARSANDSHAPES: number; }; const ChartEvent: { WINDOW_MODE_CHANGED: string; TOOLBAR_LOADED: string; SCROLLBAR_LOADED: string; STATE_CHANGED: string; TIME_INTERVAL_CHANGED: string; INDICATOR_ADDED: string; INDICATOR_REMOVED: string; THEME_CHANGED: string; GLOBAL_THEME_CHANGED: string; CHART_TYPE_CHANGED: string; CHART_TYPE_APPLIED: string; HOVER_RECORD_CHANGED: string; SETS_DEFAULT_SETTINGS: string; INSTRUMENT_CHANGED: string; SYMBOL_ENTERED: string; TIME_FRAME_CHANGED: string; TIME_FRAME_DELETED: string; TIME_FRAME_ADDED: string; TIMEFRAME_LIST_UPDATED: string; CROSS_HAIR_CHANGED: string; STATE_LOADED: string; LOCALE_CHANGED: string; ENABLE_KEYBOARD_EVENTS_CHANGED: string; ENABLE_MOUSE_EVENTS_CHANGED: string; VALUE_SCALE_ADDED: string; VALUE_SCALE_REMOVED: string; USER_SHAPE_STARTED: string; USER_SHAPE_FINISHED: string; USER_SHAPE_CANCELLED: string; PANE_ADDED: string; PANE_REMOVED: string; DATE_SCALE_THEME_CHANGED: string; FIRST_VISIBLE_RECORD_CHANGED: string; LAST_VISIBLE_RECORD_CHANGED: string; MORE_HISTORY_REQUESTED: string; ZOOM_IN_STARTED: string; ZOOM_IN_FINISHED: string; ZOOM_IN_CANCELLED: string; SHOW_INSTRUMENT_WATERMARK_CHANGED: string; PICKUP_COLUMN_ADDED: string; PICKUP_COLUMN_REMOVED: string; BARS_SETTED: string; BARS_APPENDED: string; BARS_INSERTED: string; LAST_BAR_UPDATED: string; ADJUST_TYPE_CHANGED: string; VERTICAL_ADJUST_VALUE_CHANGED: string; PANE_MAXIMIZED: string; REPLAY_MODE_START_RECORD_SELECTED: string; REPLAY_MODE_STOPPED: string; STAY_IN_SHAPE_MODE_CHANGED: string; TIMEZONE_CHANGED: string; TICK: string; PANE_AUTOSCALE_PRESERVING_CHANGED: string; VERTICAL_SCALE_PANE_NAME_CHANGED: string; VERTICAL_SCALE_ADAPTER_CHANGED: string; CONTEXT_MENU_ITEM_SELECTED: string; TRADING_SESSION_UPDATE: string; OPEN_SEARCH_MODAL: string; CHANGE_FAVORITE_INDICATORS: string; CHANGE_SHAPE_TEMPLATES: string; MAGNET_MODE_CHANGED: string; SHOW_INDICATORS_DIALOG: string; SNAPSHOT_COPY_LINK: string; SNAPSHOT_COPY_IMAGE_FAILED: string; SNAPSHOT_TWEET_IMAGE: string; LAST_BID_CHANGED: string; LAST_ASK_CHANGED: string; LOCK_SHAPES_CHANGED: string; CHANGE_VISIBILITY_EXECUTION: string; ORDER_FEATURES_CHANGED: string; LOGO_WATERMARK_CLICKED: string; CLICKED: string; }; const DEFAULT_BARS_COUNT = 500; const DEFAULT_MORE_BARS_COUNT = 1000; const DEFAULT_QUANTITY = 1; interface IDateRangeSelection { startDate: Date | null; endDate: Date | null; } const version = "2.0.0"; enum AutoScalePanesKind { AllPanes = 0, PanesWithPreservingAutoScaling = 1 } type SelectedObject = IChartObject | OrderBar | AlertBar | PositionBar | PositionLabel; /** * Provides model of Chart */ class Chart extends EventEmitter implements IDisposable, IStateable { /** * Get current chart version */ static get version(): string; private readonly _optimization; private readonly _optimizeRefresh; private readonly _crossHair; private readonly _dataContext; private readonly _defaultState; private readonly _chartTypeHandler; private readonly _compareInstrumentHandler; private readonly _windowModeHandler; private readonly _hoverDotsBrush; private readonly _panesContainer; private readonly _pickupColumns; private readonly _priceSpread; private readonly _replayMode; private readonly _horizontalScale; private readonly _horizontalAxisLabel; private readonly _verticalAxisLabel; private readonly _sessionBreakLines; private _supportedTimeFrames; private readonly _handleWindowResizeEvent; private _rootResizeObserver; private _lastObservedWidth; private _lastObservedHeight; private _resizeRafPending; private _windowResizeRafPending; private _renderQuality; private readonly _indicatorAlertsHandler; private readonly _addThemeCssClass; private readonly _barCountdown; private readonly _timeFrameBarsManager; private readonly _marketEventsManager; private readonly _calendarEventPopupBuilder; private readonly _marketEventsDatafeed; private readonly _dateTimezoneConverter; private readonly _searchInstruments; private readonly _exchanges; private readonly _orderSettings; _orderFeatures: OrderFeaturesInterface; readonly scrollbar: Scrollbar; readonly toolbar: Toolbar; readonly tradeHandler: ITradeHandlerCallback; readonly datafeed: IDatafeedBase; toolbarHiddenItems?: ToolbarHiddenItems; /** Get hidden toolbar items as array */ getToolbarHiddenItems(): ToolbarItem[]; /** Set hidden toolbar items and update toolbar */ setToolbarHiddenItems(items: ToolbarHiddenItems): void; undoRedo: UndoRedoController; shapeSettings: ShapeSettingsDragPane; canLoadMoreBars: boolean; hoveredObject: IChartObject; private _isMoving; /** * True while a gesture (shape drag / chart scroll) is in progress. */ get isMoving(): boolean; set isMoving(value: boolean); _suppressMeasureTool: boolean; multiChartRootContainer: HTMLElement; preventMouseEvents: boolean; selectedObject: SelectedObject; showShapeTooltips: boolean; showShapes: boolean; hideScrollToLastBar: boolean; templatesDataProvider: TemplatesDataProvider; indicatorsOverviewProvider: IIndicatorsOverviewProvider; indicatorsRestrictionsProvider: IRestrictedIndicatorsProvider; _contextMenuItems: IContextMenuItem[]; _contextMenuPlacingOrdersEnabled: boolean; logoSrc: string; /** * Save image handler */ snapshotHandler: IChartSnapshotHandler; /** * State handler */ stateHandler: IChartStateHandler; restrictionHandler: RestrictionHandler; private _chartType; private _hotkeysHandler; private _adjustType; private _hotkeys; private _defaultHotkeys; private _container; private _cssSize; private _currentBarsRequest; private _hoverRecord; private _indicators; private _instrument; private _newBarsRequest; private _options; private _panesFrame; private _rootDiv; private _boundMouseEvents; private _boundOnLocalize; private _subscribedEvents; private _verticalScales; private _state; private _timeFrame; private _waiting; private _zoomComponent; private _stayInShapeMode; private isDisposed; private _demoModePopup; private _timeFrameChangePopup; private _instrumentChangePopup; private _isLocked; private _scriptBarStyles; private _scriptPanelStyles; private _showAlertId; private _favoriteIndicators; private _shapeTemplates; private static readonly _shapeTemplatesStorageKey; private static loadShapeTemplatesFromStorage; private static saveShapeTemplatesToStorage; private _magnetMode; private _lockShapes; private _pendingTimeFrameRangeClamp; private _pendingInstrumentChangeDateRange; private _pendingDateRangeSelection; private _dateRangeSelectionToken; private _lastBid; private _lastAsk; private _conversionRate; private _touchPanActive; private _touchPanLastX; private _gestureTimer; private _pinchActive; private _pinchWatchdog; private _touchScrollSpeed; get isTouchPanActive(): boolean; /** * Gets touch scroll speed, where 1 tracks the finger exactly */ get touchScrollSpeed(): number; set touchScrollSpeed(value: number); /** * Gets whether a pinch gesture owns the current touch sequence */ get isPinchActive(): boolean; /** * Marks pinch ownership so pan handlers stand down. * * @param active True while two touches drive a pinch. */ setPinchActive(active: boolean): void; /** * Caps repaint frequency during gestures (~30fps on mobile). */ private updateGestureRefresh; markGestureActive(): void; get conversionRate(): { ask: number; bid: number; symbol?: string; }; set conversionRate(value: { ask: number; bid: number; symbol?: string; }); get shapeTemplates(): IShapeTemplateState; set shapeTemplates(newShapeList: IShapeTemplateState); get favoriteIndicators(): string[]; set favoriteIndicators(list: string[]); get showOrdersLabel(): boolean; set showOrdersLabel(value: boolean); get showAlertId(): string | null; set showAlertId(id: string | null); get showOrdersLine(): boolean; set showOrdersLine(value: boolean); private _currency; get currency(): string; set currency(value: string); get locationOrigin(): string; set contextMenuItems(value: IContextMenuItem[]); get contextMenuItems(): IContextMenuItem[]; get orderSettings(): GetOrderSettingsType; set orderFeatures(value: OrderFeaturesInterface); get orderFeatures(): OrderFeaturesInterface; private _useExternalSearchInput; get useExternalSearchInput(): boolean; get instrumentModalBodyElement(): HTMLElement; get magnetMode(): string; set magnetMode(mode: string); get lockShapes(): boolean; set lockShapes(value: boolean); set lastBid(value: number); get lastBid(): number; set lastAsk(value: number); get lastAsk(): number; private _timezone; get timezone(): ITimezone | null; set timezone(data: ITimezone | null); constructor(config: IChartConfig); /** * Dev-only on-screen FPS / frame-time meter, shown only on localhost. * A small toggle button is placed at the right edge; clicking it starts * an independent rAF loop that measures the real display frame rate * (independent of the RefreshOptimizer throttle) during pan/zoom/hover. */ private setupFpsMeter; get isInReplayMode(): boolean; get dateTimezoneConverter(): DateTimezoneConverter; get smoothLines(): boolean; set smoothLines(value: boolean); get showExecutionLabels(): boolean; set showExecutionLabels(value: boolean); get showExecution(): boolean; set showExecution(value: boolean); get isChartWidget(): boolean; get isDestroyed(): boolean; get marketEventsDatafeed(): MarketEventsDatafeed; get calendarEventPopupBuilder(): IMarketEventPopupBuilder; get marketEventsManager(): MarketEventsManager; get timeFrameBarsManager(): TimeFrameBarsManager; /** * Get is chart stay in shape mode */ get stayInShapeMode(): boolean; set stayInShapeMode(value: boolean); get barCountDown(): IBarCountdown; /** * Get char keyboard handler */ get hotkeysHandler(): IHotkeysHandler; /** * Get chart adjust type */ get adjustType(): number; set adjustType(value: number); /** * Get chart type */ get chartType(): IChartType; set chartType(value: IChartType); /** * Applies chart type with optional date range * * @param typeName * @param dateRange */ applyChartType(typeName: string, dateRange?: { startDate: Date; endDate: Date; }): void; /** * new size chart by date range * @param range * @returns void */ private newSizeChart; /** * Get chart type name */ get chartTypeName(): string; set chartTypeName(value: string); /** * Get chart hot keys model */ get hotkeys(): HotkeyCombination[]; set hotkeys(combinations: HotkeyCombination[]); /** * Get chart default hot keys */ get defaultHotkeys(): HotkeyCombination[]; /** * Set chart default hot keys */ set defaultHotkeys(combinations: HotkeyCombination[]); /** * Get chart container element (native) */ get containerEl(): HTMLElement; /** * Get chart container */ get container(): HTMLElement; /** * Get chart cross hair */ get crossHair(): CrossHair; /** * Get chart cross hair type */ get crossHairType(): string; set crossHairType(value: string); /** * Get cross hair bar offset visibility */ get showCrossHairBarOffset(): boolean; /** * Set cross hair bar offset visibility */ set showCrossHairBarOffset(value: boolean); /** * Get chart css size */ get cssSize(): ICssSize; set cssSize(value: ICssSize); /** * Get chart data context */ get dataContext(): DataContext; /** * Get chart default state */ get defaultState(): IChartState; /** * Get chart fist bar visible index */ get firstVisibleIndex(): number; /** * Get chart fist bar visible record */ get firstVisibleRecord(): number; set firstVisibleRecord(value: number); /** * Get chart type handler */ get chartTypeHandler(): IChartTypeHandler; /** * Get chart instrument comparison handler */ get compareInstrumentHandler(): CompareInstrumentHandler; /** * Get chart window mode handler */ get windowModeHandler(): WindowModeHandler; /** * Get chart hover dots brush style */ get hoverDotsBrush(): HoverMarker; /** * Get chart hovered record */ get hoveredRecord(): number; /** * Get chart indicators */ get indicators(): Indicator[]; /** * Get chart instrument */ get instrument(): IInstrument; set instrument(value: IInstrument); /** * Get chart enable hot keys */ get hotkeysEnabled(): boolean; set hotkeysEnabled(value: boolean); /** * Get chart last visible bar index */ get lastVisibleIndex(): number; /** * Get chart last visible bar record */ get lastVisibleRecord(): number; set lastVisibleRecord(value: number); /** * Get chart locale */ get locale(): string; set locale(value: string); /** * Get chart primary pane */ get primaryPane(): Pane; /** * Alias for `primaryPane`. Both names appear across the public * documentation, so both are supported on the runtime. */ get mainPane(): Pane; /** * Get chart mouse events enabled */ get mouseEventsEnabled(): boolean; set mouseEventsEnabled(value: boolean); /** * Get is OHLC panel showed */ get ohlcShowed(): boolean; set ohlcShowed(value: boolean); /** * Get is OHLC info card showed */ get ohlcCardShowed(): boolean; set ohlcCardShowed(value: boolean); /** * Get chart panes */ get panes(): Pane[]; /** * Get chart panes container */ get panesContainer(): PanesContainer; /** * Get chart panes frame bounds */ get panesFrame(): Bounds; /** * Per-bar color overrides supplied by running scripts. Ephemeral: * they are dropped together with the script that owns them and never * reach the saved chart state. */ get scriptBarStyles(): ScriptBarStyleRegistry; /** * Background overrides supplied by running scripts. Painted on the * chart backdrop / pane containers, so the user theme stays intact. */ get scriptPanelStyles(): ScriptPanelStyleRegistry; /** * Get chart pickup column handler */ get pickupColumns(): PickupColumnHandler; /** * Get chart price spread */ get priceSpread(): PriceSpreadHandler; /** * Get chart records count */ get recordsCount(): number; /** * Get chart replay mode manager */ get replayMode(): ReplayModeManager; /** * Get chart root div element (native) */ get rootDivEl(): HTMLElement; /** * Get chart background div element (native) - the backdrop layer the * theme background is painted on, below every pane. */ get backgroundEl(): HTMLElement; /** * Get chart root div */ get rootDiv(): HTMLElement; /** * Get chart horizontal scale */ get horizontalScale(): HorizontalScale; /** * Get chart horizontal scale floating label */ get horizontalAxisLabel(): IHorizontalAxisLabel; /** * Get chart vertical scale */ get verticalScale(): VerticalScale; /** * Get chart vertical scale floating label */ get verticalAxisLabel(): IVerticalAxisLabel; /** * Get chart vertical scales */ get verticalScales(): VerticalScale[]; /** * Get is chart scroll enabled */ get scrollEnabled(): boolean; set scrollEnabled(value: boolean); /** * Get chart session break lines */ get sessionBreakLines(): BreakLinesHandler; /** * Get is chart bar info in title */ get showBarInfoInTitle(): boolean; set showBarInfoInTitle(value: boolean); /** * Get show indicator legend/titles */ get showIndicatorLegend(): boolean; /** * Set show indicator legend/titles across all panes */ set showIndicatorLegend(value: boolean); /** * Get is chart show instrument watermark */ get showInstrumentWatermark(): boolean; set showInstrumentWatermark(value: boolean); get showLogoWatermark(): boolean; get useNewBrandedWatermark(): boolean; /** * Get chart size */ get size(): ISize; set size(value: ISize); /** * Get chart state */ get state(): ChartState; set state(value: ChartState); /** * Set chart supported time frames */ get supportedTimeFrames(): string[]; /** * Get chart theme */ get theme(): any; set theme(value: any); private lockAndHideUnselectedVisualElements; get userTheme(): any; set userTheme(value: any); /** * Get chart time frame */ get timeFrame(): ITimeFrame; set timeFrame(timeFrame: ITimeFrame); /** * Get chart time interval */ get timeInterval(): number; set timeInterval(value: number); /** * Get chart toolbar */ get windowMode(): WindowMode; /** * Get is chart x grid */ get gridX(): boolean; set gridX(value: boolean); /** * Get is chart y grid */ get gridY(): boolean; set gridY(value: boolean); /** * Get is chart zoom enabled */ get zoomEnabled(): boolean; set zoomEnabled(value: boolean); /** * Rendering quality (sharpness vs paint speed). */ get renderQuality(): RenderQuality; set renderQuality(value: RenderQuality); /** * Maps render quality to the DPR cap and max visible bars. */ private applyRenderQualityCap; /** * Get trading session hours type */ get tradingSession(): string | undefined; /** * Set trading session hours range */ set tradingSession(value: string | undefined); /** * Get trading session hours range */ get tradingSessionRange(): ITradingSessionRange; /** * Set trading session hours range */ set tradingSessionRange(range: ITradingSessionRange); /** * Get chart zoom in area component */ get zoomComponent(): IZoomArea; private get readyLoadMoreHistory(); get indicatorAlertsHandler(): IIndicatorAlertsHandler; exchanges(): string[]; searchInstruments(query: string, exchange?: string): Promise; onTimezoneChanged(): void; exportChartData(): void; /** * Finish manually creating shape */ finishShape(): void; /** * Handle mouse event * * @param event * @return Is event handled */ static evtCount: number; static evtMs: number; onMouseEvents(event: Event): boolean; private onMouseEventsImpl; /** * Scrolling chart to real time arrow */ scrollToRealtimeArrow(): void; /** * Update hovered record * * @param x */ updateHoverRecord(x: number): void; /** * Add css class to root div * * @param cssClass */ addCssClass(cssClass: string): void; /** * Adds chart data rows * * @param dataRows * @param replaceIfExists * @return Chart data rows */ addDataRows(dataRows: string | DataRows, replaceIfExists?: boolean): DataRows; /** * Adds indicator or indicators * * @param indicators * @return Added indicator or added indicators */ addIndicators(indicators: number | number[] | Indicator | Indicator[] | IIndicatorState | IIndicatorState[]): Indicator | Indicator[]; /** * * Adds pane * * @param index * @param heightRatio * @param reducePrimaryPane * @return Added chart pane */ addPane(index?: number, heightRatio?: number, reducePrimaryPane?: boolean): Pane; /** * Creates a fresh pane below the existing ones and attaches the * given indicator to it, ignoring the indicator's `isOverlay` * preference. Convenience wrapper around `addPane` + * `Pane.addIndicator`. * * @param indicator The indicator instance to add. * @return The added indicator. */ addIndicatorInNewPane(indicator: Indicator): Indicator; /** * Adds vertical scale * * @param verticalScale * @return Added vertical scale */ addVerticalScale(verticalScale?: VerticalScale): VerticalScale; /** * Appends bars into chart * * @param bars */ appendBars(bars: IBar | IBar[]): void; /** * Applies chart template * * @param templateState */ applyTemplate(templateState: string | IChartTemplateState): void; /** * Setups layout theme */ setupLayoutTheme(): void; /** * Retrieves bar data rows * * @return */ barDataRows(): IBarDataRows; /** * Retrieves bars count between points * * @param startPoint * @param endPoint * @return Bars count between points */ barsBetweenPoints(startPoint: IPoint | IDataPoint, endPoint: IPoint | IDataPoint): number; /** * Cancels creating shape manually */ cancelShape(): void; /** * Cancels zoom in */ cancelZoom(): void; /** * Clears data rows * * @param dataRows */ clearDataRows(dataRows: string | DataRows): void; /** * Copies shape */ copyShape(shape?: Shape): void; /** * Getting currently selected shape * @return Shape */ getSelectedShape(): Shape; /** * Retrieves data range * * @param startDate * @param endDate * @return Data range */ dateRange(startDate?: Date, endDate?: Date): { startDate: Date; endDate: Date; } | undefined; /** * Shows the specified date range, loading missing history first and * optionally switching the time frame (used by the bottom-toolbar * date-range presets: 1D, 5D, ..., All). * * @param startDate Range start; `null` shows all available history. * @param endDate Range end; defaults to the last loaded bar. * @param timeFrame Optional time frame to switch to before applying the range. */ setVisibleDateRange(startDate: Date | null, endDate?: Date | null, timeFrame?: ITimeFrame): void; private estimateDateRangeBarsCount; private applyDateRangeSelection; private waitForBarsRequestComplete; /** * Alias for `dispose()`. Both names are documented across the * public guides; both are supported on the runtime. */ destroy(removeContainer?: boolean): void; /** * Destroys container * * @param removeContainer */ dispose(removeContainer?: boolean): void; /** * Paints horizontal scale and panes container */ static lastPaintMs: number; paint(): void; /** * Executes indicator or indicators * * @param indicators * @return Executed indicator or indicators */ executeIndicators(indicators: number | number[] | Indicator | Indicator[]): Indicator | Indicator[]; /** * Finds data rows * * @param rowMarker * @return Finded data row */ findDataRows(rowMarker: string): DataRows; /** * Finds pane by number * * @param y * @return Pane */ findPaneAt(y: number): Pane; /** * Retrieves bounds * * @return Bounds */ getBounds(): Bounds; /** * Retrieves chart template * * @return Chart template */ getChartTemplate(): IChartTemplateState; /** * Retrieves common data rows * * @returnBar data rows */ getCommonDataRows(): IBarDataRows; /** * Retrieves data rows * * @param name * @return Data rows */ getDataRows(name: string): DataRows; /** * Retrieves modified theme * * @param config * @return Modified Theme */ getModifiedTheme(config: IEnvironmentTheme): any; /** * Retrieves theme * * @return Theme */ getTheme(): IEnvironmentTheme; /** * Handles window Events */ subscribeWindowEvents(): void; /** * Hides waiting bar. */ hideWaitingBar(): void; /** * Hovers object * * @param obj * @return Is object hovered */ hoverObject(obj: IChartObject): boolean; /** * Initializes visual dimensions */ InitializeVisualDimensions(): void; /** * Loads indicators state * * @param state */ restoreIndicatorsState(state: string | IIndicatorState[]): void; /** * Removes orphaned panes (non-primary, no indicators, no savable * shapes). Panes claimed by `indicatorStates` via `paneIndex` are kept. * * @param indicatorStates States whose `paneIndex` marks panes to keep. * @return The number of panes removed. */ pruneEmptyPanes(indicatorStates?: IIndicatorState[]): number; /** * Loads shapes state * * @param state */ restoreShapesState(state: string | IShapeState[]): void; addTimeFrame(data: TimeFrame): void; deleteTimeFrame(data: TimeFrame, strTimeFrame: string): void; updateSupportedTimeFrames(list: string[]): void; restoreState(state: string | IChartState, preserveObjects?: boolean, toDefault?: boolean): void; restoreVisibleRange(recordsState: IRecordsState): void; /** * Localizes target element * * @param element */ localize(element?: HTMLElement): void; /** * Localizes text * * @param key * @param replace * @return localized text */ localizeText(key: string, replace?: object): Promise; /** * Merges indicators * * @param indicator1 * @param indicator2 * @return Merged indicator */ mergeIndicators(indicator1: Indicator, indicator2: Indicator): Indicator; /** * Pastes shape * @return Shape */ pasteShape(): Shape; /** * Retrieves primary bar of data row * * @param indexOrDate * @param symbol * @return Data row's primary bar */ primaryBar(indexOrDate: number | Date, symbol?: string): IBar; /** * Retrieves primary bar of symbol * * @param symbol * @return Primary bar of symbol */ primaryBarDataRows(symbol?: string): IBarDataRows; /** * Retrieves primary bar rows of symbol * * @param rowMarker * @param symbol * @return Primary bar rows of symbol */ primaryDataRows(rowMarker: string, symbol?: string): DataRows; /** * Retrieves record range * * @param firstRecord * @param lastRecord * @return Record range */ recordRange(firstRecord?: number, lastRecord?: number): any; /** * Removes applied indicator */ private removeAppliedIndicators; /** * Removes css class from chart root div * * @param cssClass */ removeCssClass(cssClass: string): void; /** * Removes data rows from data context * * @param dataRows */ removeDataRows(...dataRows: (string | DataRows)[]): void; /** * Removes indicator or indicators also removes panel without plots * * @param indicators * @param removePaneIfNoPlots */ removeIndicators(indicators?: Indicator | Indicator[], removePaneIfNoPlots?: boolean): void; /** * Removes vertical scale or scales * * @param verticalScale */ removeVerticalScale(verticalScale: VerticalScale | VerticalScale[]): void; /** * Removes shapes from all panes */ removeShapes(): void; /** * Requests more history bars */ requestMoreBars(): void; /** * Saves chart image. */ saveImage(): void; /** * Saves chart image to clipboard. */ saveImageToClipboard(): void; /** * Saves indicators state * * @return Indicators state */ saveIndicatorsState(): IIndicatorState[]; /** * Saves shapes state * * @return Shapes state */ saveShapesState(): IShapeState[]; saveState(): IChartState; /** * Scrolls chart on pixels * * @param pixels */ scrollPixels(pixels: number): void; /** * Scrolls chart on records * * @param records */ scrollRecords(records: number): void; /** * Selects object * * @param obj * @return If object selected */ selectObject(obj: SelectedObject): boolean; /** * Sends bars request to datafeed */ sendBarsRequest(): void; /** * Refreshes auto scale async */ refreshAutoScaleAsync(): void; /** * Refreshes auto scale all async */ refreshAutoScaleAllAsync(): void; /** * Refreshes layout */ refreshLayout(): void; /** * Refreshes chart sync * * @param makeAutoScale */ refreshAsync(makeAutoScale?: boolean): void; private _tickRefreshInterval; private _lastTickRefresh; private _tickRefreshTimer; private _restoreIndicatorsTimer; /** * Throttled refresh for the live-tick path so a busy feed cannot force * a full repaint every frame. User gestures still use refreshAsync. */ refreshOnTickAsync(): void; autoScalePanes(kind?: AutoScalePanesKind): void; /** * Sets chart window mode * * @param mode */ setWindowMode(mode: WindowMode): void; /** * Shows waiting bar */ showWaitingBar(): void; /** * Starts creating shape manually * * @param shape * @param allowEditing */ startShape(shape: Shape, allowEditing?: boolean): void; /** * Starts zooming. * * @param zoomMode The zoom mode. */ startZoom(zoomMode: ZoomMode): void; /** * Trims chart data rows * * @param maxLength */ trimDataRows(maxLength: number): void; /** * Un executes indicators * * @param indicators * @param removePaneIfNoPlots */ rollbackIndicators(indicators?: Indicator | Indicator[], removePaneIfNoPlots?: boolean): void; /** * Un handles window events */ unsubscribeWindowEvents(): void; /** * Refreshes chart * * @param updateInstruments */ static lastRefreshMs: number; static lastLayoutMs: number; static lastChartTypeMs: number; static lastHScaleMs: number; static lastPanesMs: number; refresh(updateInstruments?: boolean): void; /** * Triggers a repaint after direct property mutations (theme, * options, etc.) that don't go through their own setters. * Alias for `refresh()`. */ setNeedsUpdate(): void; /** * Alias for `refresh()`. Intended for resize / orientation-change * handlers in mobile and responsive embeddings. */ update(updateInstruments?: boolean): void; /** * refreshes indicators */ refreshIndicators(): void; /** * Refreshes indicators from a bar index, keeping earlier values. * * @param startIndex The first bar whose value changed. */ refreshIndicatorsFrom(startIndex: number): void; /** * Refreshes splitter * * @param splitter */ refreshSplitter(splitter: IPaneSplitter): void; /** * Retrieves visible data range * * @return Visible data range */ visibleDataRange(): { firstVisibleDataRecord: number; lastVisibleDataRecord: number; }; /** * Zooms chart on pixels * * @param pixels */ zoomPixels(pixels: number): void; /** * Zooms chart on records * * @param records */ zoomRecords(records: number): void; /** * Refresh component sizes like toolbars */ refreshSize(): void; lock(): void; showDemoModePopup(closable?: boolean): void; showTimeFrameChangePopup(value: string): void; showInstrumentChangePopup(value: string): void; hideInstrumentChangePopup(): void; updateOrderTPSL(orderId: string | number): void; addOrder(order: OrderBar): void; removeOrder(order: OrderBar): Promise; openContextMenu(motionEvent: MotionEvent, event: IWindowEvent): void; addAlert(alert: AlertBar): void; removeAlert(alertId: string): void; addPosition(order: PositionBar): void; removePosition(position: PositionBar): void; processTick(tick: ITick): void; scrollChartOneCandle(multiplier?: number): void; removeActiveClass(): void; private restoreVerticalScales; private onInstrumentChanged; private updateDecimalDigitsOnScale; private onLocalize; private onTimeFrameChanged; private clampDateRangeToTodayIfNeeded; private waitForReadyLoadMoreHistory; private layoutElements; private loadOptionsState; private onRefreshOptimizationCallback; private showDataInfo; private hideDataInfo; toggleDataInfo(show: boolean): void; /** * Resolves the root container that holds this chart's OHLC card, * accounting for the multi-chart / mobile layouts where `_rootDiv` * may not be an ancestor of the card element. */ private ohlcCardRootContainer; private showOhlcCard; /** * Places the OHLC card at (left, top) but clamps it so the whole card */ private clampOhlcCardPosition; private hideOhlcCard; toggleOhlcCardButton(show: boolean): void; setOhlcCardVariant(variant: string): void; private translateClonedShape; /** * Touch listeners must be non-passive to allow preventDefault. */ private static listenerOptions; /** * Mobile uses touch only; mouse events emulate after taps. */ private getInputEvents; /** * Switches input mode at runtime. * * @param mobile True to enable mobile (touch) input mode. */ setMobileInputMode(mobile: boolean): void; private subscribe; private unsubscribe; private pointHitShapes; private pointHitShapesForTouch; private bindTouchPan; } } declare const state: string; declare module FintaChart { /** * Supports cloning, which creates a new instance with the same values as an existing instance. * * @template T The type of the instance. */ interface ICloneable { /** * Creates a new object that is a copy of the current instance. * * @return A new object that is a copy of current instance. */ clone(): T; } } declare module FintaChart { type GetAllFilters = () => Promise; class Filters { static all(): Promise; } } declare module FintaChart { /** * Represents ATS indicator. * * @category Indicators */ class ATS extends Indicator { isBullSeries: boolean; isBoxPainted: boolean; trendDir: any; trendUp: any; trendDown: any; trendUpIndex: any; trendDownIndex: any; lastPaintedBoxMid: { x: any; y: any; }; lastPaintedBox: any; paintBoxValues: { high: any; low: any; recordX1: any; recordX2: any; trappedRangeHigh: any; trappedRangeLow: any; color: any; liqLines: any[]; }[]; trendsValues: any[]; boxToPaint: { high: any; low: any; recordX1: any; recordX2: any; trappedRangeHigh: any; trappedRangeLow: any; color: any; liqLines: any[]; }; trendsUpPaintValues: any[]; trendsDownPaintValues: any[]; recordsCount: number; prevRec: number; lastPaintedLiqLine: { recordX1: any; recordX2: any; y: any; type: any; }; isLiqLinePainted: boolean; paintRedInsteadOfGreen: boolean; prevBullSeries: any[]; prevPrevBullSeries: any[]; currentBullSeries: any[]; prevBearSeries: any[]; prevPrevBearSeries: any[]; currentBearSeries: any[]; static get type(): string; constructor(options?: IIndicatorOptions); protected onResetDefaults(): void; protected onInputTick(record: number): void; paint(): void; private paintExpLines; private paintBox; private paintLiqLine; private paintOrderBlockProjection; private paintTrendLines; private paintTrendDots; paintIntentLevelLines(): void; private getColorParam; private getIsEnabledParam; private resetPaintBoxValues; } }