Models.ts 411 B

123456789101112131415
  1. import { Model, InferSchemaType, Schema } from "mongoose";
  2. import { AbcSchema } from "../schemas/abc";
  3. import { NewsSchema } from "../schemas/news";
  4. import { StationSchema } from "../schemas/station";
  5. export type Schemas = {
  6. abc: Schema<AbcSchema>;
  7. news: Schema<NewsSchema>;
  8. station: Schema<StationSchema>;
  9. };
  10. export type Models = Record<
  11. keyof Schemas,
  12. Model<InferSchemaType<Schemas[keyof Schemas]>>
  13. >;