-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@types/mongoose-patch-history #95
Comments
Hey there @danielbayerlein,
declare module "mongoose-patch-history" {
import mongoose = require("mongoose");
export default function (schema: mongoose.Schema, opts: { mongoose: mongoose.Mongoose; name: string }): void;
} This is the easiest to get it working quickly. If you want to put some work in and provide typings I'd be happy to review them or extend the missing parts. Unfortunately I don't have that much time currently to implement them myself. |
More types added: declare module 'mongoose-patch-history' {
import type { Operation } from 'fast-json-patch';
import type { Schema } from 'mongoose';
export type MongoosePatchHistoryPatch = {
ops: Operation & { originalValue?: any; }[];
ref: Types.ObjectId;
date: Date;
};
export type MongoosePatchHistoryOptions = {
mongoose: Mongoose;
name: string;
removePatches?: boolean;
transforms?: [(name: string) => string, (name: string) => string];
includes?: Record<string, Record<string, unknown>>;
excludes?: string[];
trackOriginalValue?: boolean;
};
export default function (
schema: Schema,
options: MongoosePatchHistoryOptions,
): void;
} |
Thanks for you input! Looks good. If I might ask for you opinion:
This might be checked with @codepunkt too. |
@vinerich I think both points make a lot of sense! Sounds like version 3 of |
Has anyone created types for
mongoose-patch-history
? Or is something planned?The text was updated successfully, but these errors were encountered: