import {Document, Schema} from "mongoose"; export interface TypedDocument extends Document { toObject(): T; } export interface UpdateResult { ok: number; nModified: number; n: number; } export type BasicTypes = typeof Function|typeof Boolean|typeof Number|typeof String|typeof Object|any; export type MongoObj = T&TypedDocument; export interface BaseDocument { _id?: string; createdAt?: Date; updatedAt?: Date; } export const baseSchema = { _id: Schema.Types.ObjectId, createdAt: Date, updatedAt: Date, };