Comments (4)
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;
}
from mongoose-patch-history.
Thanks for you input! Looks good.
If I might ask for you opinion:
- Further enhance the types to support access on
patches
for eachmongoose.document
- Use this as a starting point to do a typescript rewrite of the code
This might be checked with @codepunkt too.
from mongoose-patch-history.
Hey there @danielbayerlein,
I created some types for my own use.
mongoose-patch-history.d.ts
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.
from mongoose-patch-history.
@vinerich I think both points make a lot of sense! Sounds like version 3 of mongoose-patch-history
.
from mongoose-patch-history.
Related Issues (20)
- mongoose 6.4.4 not work HOT 4
- Close version with latest changes HOT 2
- Patches are not deleted if I use deleteMany({}) HOT 1
- An in-range update of mongoose is breaking the build 🚨 HOT 28
- Cannot read property '$__' of undefined HOT 1
- An in-range update of fast-json-patch is breaking the build 🚨 HOT 4
- Usage of old mongoose index practice HOT 2
- Is there an option to track author of changes HOT 5
- An in-range update of mongoose is breaking the build 🚨 HOT 45
- Bluebird promises module is a run-time dependency!
- Is this repo still active? HOT 9
- Breaking change in new released version v1.4.0: MongoError: unknown top level operator: $push HOT 6
- Cannot perform an `add` operation at the desired path HOT 6
- findOneAndUpdate with options { new: true, rawResult: true } throws Error HOT 6
- Bug: With the plugin, updateOne hangs, if nothing was found HOT 8
- Timeout upon saving a new document HOT 7
- Adding lean() causes TypeError: document.data is not a function HOT 9
- Not capturing delete events. HOT 7
- Make name of internal data() method configurable
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mongoose-patch-history.