add types to models

This commit is contained in:
wancat committed 2024-02-19 18:05:01 +08:00
1 parent 5489de2432
commit 9dc0b43737
16 files changed
+179 -73

No files matched your search

+10 -6
View File
@@ -1,9 +1,15 @@
import { Schema } from 'mongoose'
import conditionSchema from './condition.js'
import responseSchema from './response.js'
import hintSchema from './hint.js'
import { conditionSchema, ICondition } from './condition.js'
import { responseSchema, IResponse } from './response.js'
import { hintSchema, IHint } from './hint.js'
const commandResponderSchema = new Schema({
export interface ICommandResponder {
condition?: ICondition
responses: IResponse[]
hints?: IHint[]
}
export const commandResponderSchema = new Schema<ICommandResponder>({
condition: {
type: conditionSchema,
required: false,
@@ -15,5 +21,3 @@ const commandResponderSchema = new Schema({
})
commandResponderSchema.add(hintSchema)
export default commandResponderSchema