Commit 59193c4b authored by nanahira's avatar nanahira

fix type again

parent f71c4ca5
import { ModelClassType, ModelFieldDef, PrimaryKeyDef } from '../def'; import { ModelClassType, ModelFieldDef, PrimaryKeyDef } from '../def';
import { Keys, Tables } from 'koishi'; import { Keys } from 'cosmotype';
export interface MetadataArrayMap { export interface MetadataArrayMap {
ModelUnique: string | number; ModelUnique: string | number;
...@@ -9,7 +9,7 @@ export interface MetadataArrayMap { ...@@ -9,7 +9,7 @@ export interface MetadataArrayMap {
export interface MetadataMap { export interface MetadataMap {
ModelField: ModelFieldDef; ModelField: ModelFieldDef;
ModelTableName: Keys<Tables>; ModelTableName: Keys<any>;
ModelPrimaryKey: PrimaryKeyDef; ModelPrimaryKey: PrimaryKeyDef;
ModelForeignKey: [string, string]; ModelForeignKey: [string, string];
ChildModel: ModelClassType; ChildModel: ModelClassType;
......
...@@ -168,6 +168,8 @@ export class ModelRegistrar<Tables> { ...@@ -168,6 +168,8 @@ export class ModelRegistrar<Tables> {
if (!tableName) { if (!tableName) {
throw new Error(`Model of ${cls.name} is not defined`); throw new Error(`Model of ${cls.name} is not defined`);
} }
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
this.model.extend(tableName, ...registrar.getModelResult()); this.model.extend(tableName, ...registrar.getModelResult());
Object.assign( Object.assign(
this.model.tables[tableName].internal, this.model.tables[tableName].internal,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment