klinecharts / KLineChart

📈Lightweight k-line chart that can be highly customized. Zero dependencies. Support mobile.(可高度自定义的轻量级k线图,无第三方依赖,支持移动端)

Home Page:https://klinecharts.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug] Typescript errors in options object

DeeeeLAN opened this issue · comments

Version

9.0.0-alpha7

Steps to Reproduce

const options: Options = {
  locale: '',
  timezone: '',
  styles: {
    grid: {
      show: true,
      horizontal: {
        show: true,
        size: 1,
        color: '#EDEDED',
        style: "dashed",
        dashedValue: [2, 2]
      },
    ...

On horizontal.style for example:

Type '"dashed"' is not assignable to type 'DeepPartial | undefined'.ts(2322)

I can't use a string directly, and I can't import LineType because it is a const enum.

Current Behavior

Typescript errors for all options fields that reference a const enum.

Expected Behavior

No typescript errors. :)

Environment

No response

Any additional comments?

No response

commented

Fixed it.