Bug?: 当导入 cache 之后 declare koishi Table 会让 cache Table 的类型也变成数据库的 Table
Seidko opened this issue · comments
Seidko commented
复现代码
import { Context } from 'koishi'
import type { } from '@koishijs/cache'
declare module 'koishi' {
interface Tables {
testTable: TestTable
}
}
interface TestTable {
id?: number
}
export function apply(ctx: Context) {
const cache = ctx.cache() // 这里的类型是数据库的 Table,而不是 cache 中的 Table
}
export const using = ['database', '__cache__'] as const
Shigma commented
Seidko commented
Shigma commented
2.0.0-alpha.0 版本已经解决此问题(因为删掉了相关 API)。