mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-07 11:10:11 +08:00
add types to models
This commit is contained in:
1 parent
5489de2432
commit
9dc0b43737
16 files changed
+179
-73
No files matched your search
@@ -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
|
||||
Reference in new issue
Block a user