import type { Indicator } from "./indicators/Indicator"; import type { StockChart } from "./StockChart"; import type { XYSeries } from "../xy/series/XYSeries"; import { Modal, IModalSettings, IModalPrivate, IModalEvents } from "../../core/util/Modal"; import { ColorControl } from "./toolbar/ColorControl"; export interface ISettingsModalSettings extends IModalSettings { /** * The [[StockChart]] the modal belongs to. */ stockChart: StockChart; /** * Shows a "Reset to default" link, which puts back the values the fields * had when the modal was first opened for that indicator or series. * * @default true * @since 5.9.0 */ showResetLink?: boolean; /** * Line widths to choose from when editing a line series. * * @default [1, 2, 4, 10] * @since 5.11.2 */ strokeWidths?: number[]; } export interface ISettingsModalPrivate extends IModalPrivate { } export interface ISettingsModalEvents extends IModalEvents { /** * The modal was closed: saved, with the changed values in `settings`, or * canceled, with `settings` set to `null`. */ done: { settings?: any; settingsTarget?: Indicator | XYSeries; }; /** * The modal is about to build its fields. Changing the `settings` array * here changes which fields it shows. */ initstarted: { settings?: any; settingsTarget?: Indicator | XYSeries; }; } /** * The modal dialog where the settings of an indicator or series are edited. */ export declare class SettingsModal extends Modal { static className: string; static classNames: Array; _settings: ISettingsModalSettings; _privateSettings: ISettingsModalPrivate; _events: ISettingsModalEvents; protected _updatedSettings: { [index: string]: any; }; protected _settingsTarget?: Indicator | XYSeries; protected _colorControl?: ColorControl; protected _afterNew(): void; _beforeChanged(): void; /** * Opens the modal for an [[Indicator]], with a field for each of its * editable settings. * * @param target Indicator */ openIndicator(target: Indicator): void; /** * Opens the modal for a series, with fields for its colors (and line * width, for a line series). * * @param series Series */ openSeries(series: XYSeries): void; private initContent; private getDropdown; private getNumber; /** * Clamps a number input to its `data-min-value`/`data-max-value` and rounds to * an integer when `data-step` is `1`. Attribute-driven so it also works after * a mode dropdown retargets the input's bounds. Tolerant of missing / empty / * literal "null" attribute values. */ private _clampNumberInput; private getText; private getCheckbox; private getColor; /** * Closes the modal and dispatches `done` with the changed values. It does * not apply them; the Save button does that before closing. */ close(): void; /** * Closes the modal without applying any changes, and dispatches `done` * with `settings` set to `null`. */ cancel(): void; /** * Removes the modal's content. */ clear(): void; private _getSettingKey; } //# sourceMappingURL=SettingsModal.d.ts.map