use types instead of interfaces

This commit is contained in:
Thomas Ruoff
2021-06-08 23:02:52 +02:00
parent dbe3904759
commit 498f212ee0
10 changed files with 56 additions and 71 deletions

View File

@@ -1,6 +1,6 @@
import * as mongoose from 'mongoose'
export interface Booker {
export type Booker = {
name: string
email: string
phone: string
@@ -9,12 +9,11 @@ export interface Booker {
city: string
}
export interface BookerDocument
extends Booker,
mongoose.SchemaTimestampsConfig,
mongoose.Document {}
export type BookerDocument = Booker &
mongoose.SchemaTimestampsConfig &
mongoose.Document
export interface BookerModel extends mongoose.Model<BookerDocument> {}
export type BookerModel = mongoose.Model<BookerDocument>
const BookerSchema = new mongoose.Schema<BookerDocument>(
{