{"version":3,"sources":["../src/chart.ts","../src/messages.ts"],"sourcesContent":["import {\n  type DXLinkChannel,\n  type DXLinkChannelMessage,\n  DXLinkChannelState,\n  type DXLinkChannelStateChangeListener,\n  type DXLinkError,\n  type DXLinkClient,\n  DXLinkLogLevel,\n  type DXLinkLogger,\n  Logger,\n} from '@dxfeed/dxlink-core'\n\nimport {\n  isChartInboundMessage,\n  type DXLinkIndiChartCandle,\n  type DXLinkIndiChartConfig,\n  type DXLinkIndiChartUpdateMessage,\n  type DXLinkIndiChartCandleSnapshotMessage,\n  type DXLinkIndiChartIndicatorsSnapshotMessage,\n  type DXLinkIndiChartIndicators,\n  type DXLinkIndiChartIndicatorsParameters,\n  type DXLinkIndiChartIndicatorsData,\n  type DXLinkIndiChartSetup,\n  type DXLinkIndiChartSetupMessage,\n  type DXLinkIndiChartSubscription,\n  type DXLinkIndiChartSubscriptionMessage,\n  type DXLinkIndiChartIndicatorsStates,\n} from './messages'\n\n// Listener for data updates (INDICHART_UPDATE) - no reset flag, reset is only in INDICHART_CANDLE_SNAPSHOT\nexport type DXLinkIndiChartUpdateListener = (\n  candles: DXLinkIndiChartCandle[],\n  indicators: DXLinkIndiChartIndicatorsData,\n  pending: boolean\n) => void\n\n// Listener for candle snapshots (INDICHART_CANDLE_SNAPSHOT)\nexport type DXLinkIndiChartCandleSnapshotListener = (\n  candles: DXLinkIndiChartCandle[],\n  reset: boolean,\n  pending: boolean\n) => void\n\n// Listener for indicator snapshots (INDICHART_INDICATORS_SNAPSHOT)\nexport type DXLinkIndiChartIndicatorsSnapshotListener = (\n  indicators: DXLinkIndiChartIndicatorsData,\n  pending: boolean\n) => void\n\nexport type DXLinkIndiChartIndicatorsStateListener = (\n  indicators: DXLinkIndiChartIndicatorsStates\n) => void\n\nexport interface DXLinkIndiChartSubscriptionState {\n  subscription: DXLinkIndiChartSubscription\n  indicatorsParameters: DXLinkIndiChartIndicatorsParameters\n}\n\n/**\n * dxLink Chart service.\n */\nexport interface DXLinkIndiChartRequester {\n  /**\n   * Unique identifier of the Chart channel.\n   */\n  readonly id: number\n\n  /**\n   * Get current channel of the Chart.\n   * Note: inaproppriate usage of the channel can lead to unexpected behavior.\n   * @see {DXLinkChannel}\n   */\n  getChannel(): DXLinkChannel\n\n  setSubscription(\n    subscription: DXLinkIndiChartSubscription,\n    indicatorsParameters: DXLinkIndiChartIndicatorsParameters\n  ): void\n\n  getSubscription(): DXLinkIndiChartSubscriptionState | null\n\n  setup(setup: DXLinkIndiChartSetup): void\n\n  getConfig(): DXLinkIndiChartConfig | null\n\n  getIndicators(): DXLinkIndiChartIndicatorsStates | null\n\n  /**\n   * Add a listener for the Chart data updates (INDICHART_UPDATE).\n   */\n  addUpdateListener(listener: DXLinkIndiChartUpdateListener): void\n  /**\n   * Remove a listener for the Chart data updates.\n   */\n  removeUpdateListener(listener: DXLinkIndiChartUpdateListener): void\n\n  /**\n   * Add a listener for the Chart candle snapshots (INDICHART_CANDLE_SNAPSHOT).\n   */\n  addCandleSnapshotListener(listener: DXLinkIndiChartCandleSnapshotListener): void\n  /**\n   * Remove a listener for the Chart candle snapshots.\n   */\n  removeCandleSnapshotListener(listener: DXLinkIndiChartCandleSnapshotListener): void\n\n  /**\n   * Add a listener for the Chart indicator snapshots (INDICHART_INDICATORS_SNAPSHOT).\n   */\n  addIndicatorsSnapshotListener(listener: DXLinkIndiChartIndicatorsSnapshotListener): void\n  /**\n   * Remove a listener for the Chart indicator snapshots.\n   */\n  removeIndicatorsSnapshotListener(listener: DXLinkIndiChartIndicatorsSnapshotListener): void\n\n  /**\n   * Add a listener for the Chart indicators state changes received from the channel.\n   */\n  addIndicatorsStateChangeListener(listener: DXLinkIndiChartIndicatorsStateListener): void\n  /**\n   * Remove a listener for the Chart indicators state changes received from the channel.\n   */\n  removeIndicatorsStateChangeListener(listener: DXLinkIndiChartIndicatorsStateListener): void\n\n  /**\n   * Close the Chart channel.\n   */\n  close(): void\n}\n\n/**\n * Options for the {@link DXLinkIndiChart} instance.\n */\nexport interface DXLinkIndiChartOptions {\n  /**\n   * Log level for the Chart.\n   */\n  logLevel: DXLinkLogLevel\n}\n\nconst SERVICE_NAME = 'INDICHART'\n\n/**\n * dxLink Indi Chart service implementation.\n */\nexport class DXLinkIndiChart implements DXLinkIndiChartRequester {\n  /**\n   * Unique identifier of the Chart channel.\n   */\n  public readonly id: number\n\n  private readonly updateListeners = new Set<DXLinkIndiChartUpdateListener>()\n  private readonly candleSnapshotListeners = new Set<DXLinkIndiChartCandleSnapshotListener>()\n  private readonly indicatorsSnapshotListeners =\n    new Set<DXLinkIndiChartIndicatorsSnapshotListener>()\n  private readonly indicatorsStateListeners = new Set<DXLinkIndiChartIndicatorsStateListener>()\n\n  private readonly logger: DXLinkLogger\n  private readonly channel: DXLinkChannel\n\n  private lastSubscriptionState: DXLinkIndiChartSubscriptionState | null = null\n  private lastSetup: DXLinkIndiChartSetup | null = null\n  private lastConfig: DXLinkIndiChartConfig | null = null\n\n  private indicators: DXLinkIndiChartIndicatorsStates | null = null\n\n  /**\n   * Allows to create {@link DXLinkIndiChart} instance with the specified {@link ChartContract} for the given {@link DXLinkWebSocketClient}.\n   */\n  constructor(client: DXLinkClient, indicators: DXLinkIndiChartIndicators) {\n    this.channel = client.openChannel(SERVICE_NAME, {\n      indicators,\n    })\n    this.id = this.channel.id\n    this.channel.addMessageListener(this.processMessage)\n    this.channel.addStateChangeListener(this.processStatus)\n    this.channel.addErrorListener(this.processError)\n\n    this.logger = new Logger(`${DXLinkIndiChart.name}#${this.id}`, DXLinkLogLevel.WARN)\n  }\n\n  getChannel = () => this.channel\n\n  getState = () => this.channel.getState()\n  addStateChangeListener = (listener: DXLinkChannelStateChangeListener) =>\n    this.channel.addStateChangeListener(listener)\n  removeStateChangeListener = (listener: DXLinkChannelStateChangeListener) =>\n    this.channel.removeStateChangeListener(listener)\n\n  addIndicatorsStateChangeListener = (listener: DXLinkIndiChartIndicatorsStateListener) =>\n    this.indicatorsStateListeners.add(listener)\n  removeIndicatorsStateChangeListener = (listener: DXLinkIndiChartIndicatorsStateListener) =>\n    this.indicatorsStateListeners.delete(listener)\n\n  setup = (setup: DXLinkIndiChartSetup) => {\n    this.lastSetup = setup\n\n    if (this.channel.getState() === DXLinkChannelState.OPENED) {\n      this.channel.send({\n        type: 'INDICHART_SETUP',\n        ...setup,\n      } satisfies DXLinkIndiChartSetupMessage)\n    }\n  }\n\n  getConfig = () => this.lastConfig\n\n  getIndicators = () => this.indicators\n\n  close = () => {\n    this.lastSetup = null\n    this.updateListeners.clear()\n    this.candleSnapshotListeners.clear()\n    this.indicatorsSnapshotListeners.clear()\n\n    this.channel.close()\n  }\n\n  setSubscription = (\n    subscription: DXLinkIndiChartSubscription,\n    indicatorsParameters: DXLinkIndiChartIndicatorsParameters\n  ) => {\n    this.lastSubscriptionState = {\n      subscription,\n      indicatorsParameters,\n    }\n\n    if (this.channel.getState() === DXLinkChannelState.OPENED) {\n      this.channel.send({\n        type: 'INDICHART_SUBSCRIPTION',\n        ...this.lastSubscriptionState,\n      } satisfies DXLinkIndiChartSubscriptionMessage)\n    }\n  }\n\n  getSubscription = () => this.lastSubscriptionState\n\n  removeIndicators = (indicators: string[]) => {\n    this.channel.send({\n      type: 'INDICHART_REMOVE_INDICATORS',\n      indicators,\n    })\n  }\n\n  addUpdateListener = (listener: DXLinkIndiChartUpdateListener) => {\n    this.updateListeners.add(listener)\n  }\n  removeUpdateListener = (listener: DXLinkIndiChartUpdateListener) => {\n    this.updateListeners.delete(listener)\n  }\n\n  addCandleSnapshotListener = (listener: DXLinkIndiChartCandleSnapshotListener) => {\n    this.candleSnapshotListeners.add(listener)\n  }\n  removeCandleSnapshotListener = (listener: DXLinkIndiChartCandleSnapshotListener) => {\n    this.candleSnapshotListeners.delete(listener)\n  }\n\n  addIndicatorsSnapshotListener = (listener: DXLinkIndiChartIndicatorsSnapshotListener) => {\n    this.indicatorsSnapshotListeners.add(listener)\n  }\n  removeIndicatorsSnapshotListener = (listener: DXLinkIndiChartIndicatorsSnapshotListener) => {\n    this.indicatorsSnapshotListeners.delete(listener)\n  }\n\n  /**\n   * Process message received in the channel.\n   */\n  private processMessage = (message: DXLinkChannelMessage) => {\n    // Parse message\n    if (isChartInboundMessage(message)) {\n      switch (message.type) {\n        case 'INDICHART_UPDATE':\n          return this.processUpdate(message)\n        case 'INDICHART_CANDLE_SNAPSHOT':\n          return this.processCandleSnapshot(message)\n        case 'INDICHART_INDICATORS_SNAPSHOT':\n          return this.processIndicatorsSnapshot(message)\n        case 'INDICHART_CONFIG': {\n          this.lastConfig = message\n          return\n        }\n        case 'INDICHART_INDICATORS': {\n          const indicators = message.indicators\n\n          if (this.indicators !== indicators) {\n            this.indicators = indicators\n\n            for (const listener of this.indicatorsStateListeners) {\n              listener(this.indicators)\n            }\n          }\n          return\n        }\n      }\n    }\n\n    this.logger.warn('Unknown message', message)\n  }\n\n  /**\n   * Process data updates received from the channel.\n   */\n  private processUpdate = (message: DXLinkIndiChartUpdateMessage) => {\n    for (const listener of this.updateListeners) {\n      try {\n        const { pending, candles, indicators } = message\n        listener(candles, indicators, Boolean(pending))\n      } catch (error) {\n        this.logger.error('Error in update listener', error)\n      }\n    }\n  }\n\n  /**\n   * Process candle snapshot received from the channel.\n   */\n  private processCandleSnapshot = (message: DXLinkIndiChartCandleSnapshotMessage) => {\n    for (const listener of this.candleSnapshotListeners) {\n      try {\n        const { reset, pending, candles } = message\n        listener(candles, Boolean(reset), Boolean(pending))\n      } catch (error) {\n        this.logger.error('Error in candle snapshot listener', error)\n      }\n    }\n  }\n\n  /**\n   * Process indicators snapshot received from the channel.\n   */\n  private processIndicatorsSnapshot = (message: DXLinkIndiChartIndicatorsSnapshotMessage) => {\n    for (const listener of this.indicatorsSnapshotListeners) {\n      try {\n        const { pending, indicators } = message\n        listener(indicators, Boolean(pending))\n      } catch (error) {\n        this.logger.error('Error in indicators snapshot listener', error)\n      }\n    }\n  }\n\n  /**\n   * Process channel status changes from the channel.\n   */\n  private processStatus = (processStatus: DXLinkChannelState) => {\n    switch (processStatus) {\n      case DXLinkChannelState.OPENED: {\n        return this.reconfigure()\n      }\n      case DXLinkChannelState.REQUESTED: {\n        return\n      }\n      case DXLinkChannelState.CLOSED:\n        // Destroy the channel if it is closed by the channel\n        return this.close()\n    }\n  }\n\n  /**\n   * Process error received from the channel.\n   */\n  private processError = (error: DXLinkError) => {\n    this.logger.error(`Error in channel: ${error.type}: ${error.message}`)\n  }\n\n  /**\n   * Reconfigure the CHART channel after the channel re-open.\n   */\n  private reconfigure() {\n    if (this.lastSubscriptionState) {\n      this.channel.send({\n        type: 'INDICHART_SUBSCRIPTION',\n        ...this.lastSubscriptionState,\n      } satisfies DXLinkIndiChartSubscriptionMessage)\n    }\n\n    if (this.lastSetup) {\n      this.channel.send({\n        type: 'INDICHART_SETUP',\n        ...this.lastSetup,\n      } satisfies DXLinkIndiChartSetupMessage)\n    }\n  }\n\n  /**\n   * Updates the indicators parameters without changing the subscription.\n   * @param indicatorsParameters New indicators parameters.\n   */\n  public updateIndicatorsParameters = (\n    indicatorsParameters: DXLinkIndiChartIndicatorsParameters\n  ) => {\n    if (this.lastSubscriptionState) {\n      this.lastSubscriptionState = {\n        ...this.lastSubscriptionState,\n        indicatorsParameters,\n      }\n\n      if (this.channel.getState() === DXLinkChannelState.OPENED) {\n        this.channel.send({\n          type: 'INDICHART_SUBSCRIPTION',\n          ...this.lastSubscriptionState,\n        } satisfies DXLinkIndiChartSubscriptionMessage)\n      }\n    } else {\n      this.logger.warn('Cannot update indicators parameters, subscription is not set')\n    }\n  }\n}\n","import type { DXLinkChannelMessage } from '@dxfeed/dxlink-core'\n\nexport interface DXLinkIndiChartIndicator {\n  readonly lang: string\n  readonly content: string\n}\n\nexport interface DXLinkIndiChartIndicators {\n  readonly [key: string]: DXLinkIndiChartIndicator\n}\n\nexport interface DXLinkIndiChartChannelParameters {\n  readonly indicators: DXLinkIndiChartIndicators\n}\n\nexport type JSONNumber = number | 'NaN' | 'Infinity' | '-Infinity'\n\nexport interface DXLinkIndiChartSubscription {\n  readonly symbol: string\n  readonly fromTime: number\n}\n\nexport interface DXLinkIndiChartIndicatorsParameters {\n  readonly [key: string]: {\n    readonly [key: string]: number | string | boolean\n  }\n}\n\nexport interface DXLinkIndiChartDoubleParameterMeta {\n  readonly name: string\n  readonly type: 'DOUBLE'\n  readonly defaultValue: JSONNumber\n  readonly value?: JSONNumber\n  readonly options?: (JSONNumber | string)[]\n  readonly min?: number\n  readonly max?: number\n  readonly step?: number\n}\n\nexport interface DXLinkIndiChartStringParameterMeta {\n  readonly name: string\n  readonly type: 'STRING'\n  readonly defaultValue: string\n  readonly value?: string\n  readonly options?: string[]\n}\n\nexport interface DXLinkIndiChartBoolParameterMeta {\n  readonly name: string\n  readonly type: 'BOOL'\n  readonly defaultValue: boolean\n  readonly value?: boolean\n}\n\nexport interface DXLinkIndiChartColorParameterMeta {\n  readonly name: string\n  readonly type: 'COLOR'\n  readonly defaultValue: DXLinkIndiChartColor\n  readonly value?: DXLinkIndiChartColor\n}\n\nexport interface DXLinkIndiChartSourceParameterMeta {\n  readonly name: string\n  readonly type: 'SOURCE'\n  readonly defaultValue: string\n  readonly value?: string\n  readonly options?: string[]\n}\n\nexport interface DXLinkIndiChartSessionParameterMeta {\n  readonly name: string\n  readonly type: 'SESSION'\n  readonly defaultValue: string\n  readonly value?: string\n  readonly options?: string[]\n  readonly timeZone?: string\n}\n\nexport interface DXLinkIndiChartEnumParameterMeta {\n  readonly name: string\n  readonly type: 'ENUM'\n  readonly defaultValue: string\n  readonly value?: string\n  readonly options?: string[]\n}\n\nexport type DXLinkIndiChartIndicatorParameterMeta =\n  | DXLinkIndiChartDoubleParameterMeta\n  | DXLinkIndiChartStringParameterMeta\n  | DXLinkIndiChartBoolParameterMeta\n  | DXLinkIndiChartColorParameterMeta\n  | DXLinkIndiChartSourceParameterMeta\n  | DXLinkIndiChartSessionParameterMeta\n  | DXLinkIndiChartEnumParameterMeta\n\nexport interface DXLinkIndiChartIndicatorEnabled {\n  readonly enabled: true\n  readonly inParameters: DXLinkIndiChartIndicatorParameterMeta[]\n  readonly outParameters: DXLinkIndiChartIndicatorParameterMeta[]\n}\n\nexport interface ScriptStackFrame {\n  column: number\n  functionName: string\n  line: number\n}\n\nexport interface ScriptError {\n  endColumn: number\n  endLine: number\n  message: string\n  scriptName: string\n  scriptStack: ScriptStackFrame[]\n  startColumn: number\n  startLine: number\n  type: string\n}\n\nexport interface DXLinkIndiChartIndicatorDisabled {\n  enabled: false\n  scriptError?: ScriptError\n  internalErrorMessage?: string\n}\n\nexport type DXLinkIndiChartIndicatorState =\n  DXLinkIndiChartIndicatorEnabled | DXLinkIndiChartIndicatorDisabled\n\nexport interface DXLinkIndiChartIndicatorsStates {\n  readonly [key: string]: DXLinkIndiChartIndicatorState\n}\n\nexport interface DXLinkIndiChartIndicatorsMessage {\n  readonly type: 'INDICHART_INDICATORS'\n  readonly indicators: DXLinkIndiChartIndicatorsStates\n}\n\nexport interface DXLinkIndiChartSubscriptionMessage {\n  readonly type: 'INDICHART_SUBSCRIPTION'\n  readonly subscription: DXLinkIndiChartSubscription\n  readonly indicatorsParameters: DXLinkIndiChartIndicatorsParameters\n}\n\nexport interface DXLinkIndiChartSetup {\n  readonly acceptAggregationPeriod: number\n  readonly acceptDataFormat: 'FULL'\n  readonly acceptCandleFields: string[]\n}\n\nexport interface DXLinkIndiChartSetupMessage extends DXLinkIndiChartSetup {\n  readonly type: 'INDICHART_SETUP'\n}\n\nexport interface DXLinkIndiChartConfig {\n  readonly aggregationPeriod: number\n  readonly dataFormat: 'FULL'\n  readonly candleFields: string[]\n}\n\nexport interface DXLinkIndiChartConfigMessage extends DXLinkIndiChartConfig {\n  readonly type: 'INDICHART_CONFIG'\n}\n\nexport interface DXLinkIndiChartCandle {\n  readonly eventSymbol: string\n  readonly index: number\n  readonly time: number\n  readonly open: JSONNumber\n  readonly high: JSONNumber\n  readonly low: JSONNumber\n  readonly close: JSONNumber\n  readonly volume: JSONNumber\n}\n\nexport interface DXLinkIndiChartColor {\n  readonly value: string\n  readonly alpha?: number\n}\n\n/**\n * Drawing style of a {@link DXLinkIndiChartSplinePoint}.\n *\n * The listed literals are the values currently produced by the server. The `(string & {})`\n * fallback keeps editor autocomplete for the known values while still allowing clients to\n * handle any future style the server may introduce.\n */\nexport type DXLinkIndiChartSplineStyle =\n  | 'LINE'\n  | 'STEPLINE'\n  | 'HISTOGRAM'\n  | 'CROSS'\n  | 'AREA'\n  | 'COLUMNS'\n  | 'CIRCLES'\n  | 'LINE_BREAK'\n  | 'AREA_BREAK'\n  | 'STEPLINE_BREAK'\n  | (string & {})\n\n/**\n * Drawing style of a {@link DXLinkIndiChartShapePoint}.\n *\n * The listed literals are the values currently produced by the server. The `(string & {})`\n * fallback keeps editor autocomplete for the known values while still allowing clients to\n * handle any future style the server may introduce.\n */\nexport type DXLinkIndiChartShapeStyle =\n  'TAG' | 'ARROW_UP' | 'ARROW_DOWN' | 'XCROSS' | 'CROSS' | 'BEACON' | 'CIRCLE' | (string & {})\n\n/**\n * Anchor location of a {@link DXLinkIndiChartShapePoint} on the chart.\n *\n * The listed literals are the values currently produced by the server. The `(string & {})`\n * fallback keeps editor autocomplete for the known values while still allowing clients to\n * handle any future location the server may introduce.\n */\nexport type DXLinkIndiChartShapeLocation =\n  'ABOVE_BAR' | 'BELOW_BAR' | 'TOP' | 'BOTTOM' | 'ABSOLUTE' | (string & {})\n\nexport interface DXLinkIndiChartSplinePoint {\n  readonly value: JSONNumber\n  readonly style?: DXLinkIndiChartSplineStyle\n  readonly offset?: number\n  readonly title?: string\n  readonly color?: DXLinkIndiChartColor\n  readonly overlay?: boolean\n}\n\n/**\n * Point of a `shape` series of a {@link DXLinkIndiChartCalculationResult}.\n */\nexport interface DXLinkIndiChartShapePoint {\n  readonly value: JSONNumber\n  readonly color?: DXLinkIndiChartColor\n  readonly textColor?: DXLinkIndiChartColor\n  readonly text?: string\n  readonly style?: DXLinkIndiChartShapeStyle\n  readonly offset?: number\n  readonly title?: string\n  readonly location?: DXLinkIndiChartShapeLocation\n  readonly overlay?: boolean\n}\n\n/**\n * Point of a `backgroundColor` or `barColor` series of a {@link DXLinkIndiChartCalculationResult}.\n * `color` is always present but may be `null` when the script produced no color for this point.\n */\nexport interface DXLinkIndiChartColorPoint {\n  readonly color: DXLinkIndiChartColor | null\n  readonly offset?: number\n  readonly title?: string\n  readonly numberOfLast?: number\n  readonly overlay?: boolean\n}\n\n/**\n * Result of an indicator calculation. Each series maps a series name to an array of points\n * that is index-aligned with the candles. Missing/padding points are represented as `null`.\n */\nexport interface DXLinkIndiChartCalculationResult {\n  readonly output?: { [seriesName: string]: (JSONNumber | null)[] }\n  readonly spline?: { [seriesName: string]: (DXLinkIndiChartSplinePoint | null)[] }\n  readonly backgroundColor?: { [seriesName: string]: (DXLinkIndiChartColorPoint | null)[] }\n  readonly barColor?: { [seriesName: string]: (DXLinkIndiChartColorPoint | null)[] }\n  readonly shape?: { [seriesName: string]: (DXLinkIndiChartShapePoint | null)[] }\n}\n\nexport interface DXLinkIndiChartIndicatorsData {\n  readonly [indicatorName: string]: DXLinkIndiChartCalculationResult\n}\n\n// New message type for candle snapshots\nexport interface DXLinkIndiChartCandleSnapshotMessage {\n  readonly type: 'INDICHART_CANDLE_SNAPSHOT'\n  readonly reset: boolean\n  readonly pending: boolean\n  readonly candles: DXLinkIndiChartCandle[]\n}\n\n// New message type for indicator snapshots\nexport interface DXLinkIndiChartIndicatorsSnapshotMessage {\n  readonly type: 'INDICHART_INDICATORS_SNAPSHOT'\n  readonly pending: boolean\n  readonly indicators: DXLinkIndiChartIndicatorsData\n}\n\n// Message type for data updates (no reset flag - reset is only in INDICHART_CANDLE_SNAPSHOT)\nexport interface DXLinkIndiChartUpdateMessage {\n  readonly type: 'INDICHART_UPDATE'\n  readonly pending: boolean\n  readonly candles: DXLinkIndiChartCandle[]\n  readonly indicators: DXLinkIndiChartIndicatorsData\n}\n\n// Renamed from INDICHART_INDICATORS_REMOVE to INDICHART_REMOVE_INDICATORS\nexport interface DXLinkIndiChartRemoveIndicatorsMessage {\n  readonly type: 'INDICHART_REMOVE_INDICATORS'\n  readonly indicators: string[]\n}\n\nexport type ChartInboundMessage =\n  | DXLinkIndiChartIndicatorsMessage\n  | DXLinkIndiChartConfigMessage\n  | DXLinkIndiChartUpdateMessage\n  | DXLinkIndiChartCandleSnapshotMessage\n  | DXLinkIndiChartIndicatorsSnapshotMessage\n\nexport type ChartOutboundMessage =\n  | DXLinkIndiChartSubscriptionMessage\n  | DXLinkIndiChartSetupMessage\n  | DXLinkIndiChartRemoveIndicatorsMessage\n\nexport const isChartInboundMessage = (\n  message: DXLinkChannelMessage\n): message is ChartInboundMessage =>\n  message.type === 'INDICHART_UPDATE' ||\n  message.type === 'INDICHART_INDICATORS' ||\n  message.type === 'INDICHART_CONFIG' ||\n  message.type === 'INDICHART_CANDLE_SNAPSHOT' ||\n  message.type === 'INDICHART_INDICATORS_SNAPSHOT'\n"],"mappings":";AAAA;AAAA,EAGE;AAAA,EAIA;AAAA,EAEA;AAAA,OACK;;;AC6SA,IAAM,wBAAwB,CACnC,YAEA,QAAQ,SAAS,sBACjB,QAAQ,SAAS,0BACjB,QAAQ,SAAS,sBACjB,QAAQ,SAAS,+BACjB,QAAQ,SAAS;;;ADnLnB,IAAM,eAAe;AAKd,IAAM,kBAAN,MAAM,iBAAoD;AAAA;AAAA;AAAA;AAAA,EAwB/D,YAAY,QAAsB,YAAuC;AAlBzE,SAAiB,kBAAkB,oBAAI,IAAmC;AAC1E,SAAiB,0BAA0B,oBAAI,IAA2C;AAC1F,SAAiB,8BACf,oBAAI,IAA+C;AACrD,SAAiB,2BAA2B,oBAAI,IAA4C;AAK5F,SAAQ,wBAAiE;AACzE,SAAQ,YAAyC;AACjD,SAAQ,aAA2C;AAEnD,SAAQ,aAAqD;AAiB7D,sBAAa,MAAM,KAAK;AAExB,oBAAW,MAAM,KAAK,QAAQ,SAAS;AACvC,kCAAyB,CAAC,aACxB,KAAK,QAAQ,uBAAuB,QAAQ;A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