Javascript billboard.js:类型为';x轴类型';这些类型之间不兼容

Javascript billboard.js:类型为';x轴类型';这些类型之间不兼容,javascript,typescript,billboard.js,esm,Javascript,Typescript,Billboard.js,Esm,我得到一个错误: axis: { x: { type: "category" } }, 我找不到如何用另一种方法初始化类型。您能帮助我吗?将类别强制转换为常量以通知ts“category”是x轴类型的“category”|“index”|“log”|“timeseries”常量类型之一 The types of 'axis.x.type' are incompatible between these types. Type 'stri

我得到一个错误:

axis: {
    x: {
      type: "category"
    }
  },

我找不到如何用另一种方法初始化类型。您能帮助我吗?

将类别强制转换为
常量以通知ts
“category”
是x轴类型的
“category”|“index”|“log”|“timeseries”
常量类型之一

The types of 'axis.x.type' are incompatible between these types.
    Type 'string' is not assignable to type '"category" | "indexed" | "log" | "timeseries"'

请提供最小可复制示例
const options = {
  axis: {
    x: {
      type: "category" as const,
    },
  },
};