add interface for mongoose document optional properties

This commit is contained in:
Simon
2016-09-29 08:59:12 -04:00
parent 4bf0e3eec3
commit f3c98e74a0
+6 -3
View File
@@ -715,7 +715,7 @@ declare module "mongoose" {
* section document.js
* http://mongoosejs.com/docs/api.html#document-js
*/
class MongooseDocument {
class MongooseDocument implements MongooseDocumentOptionals {
/** Checks if a path is set to its default. */
$isDefault(path?: string): boolean;
@@ -870,8 +870,6 @@ declare module "mongoose" {
/** Hash containing current validation errors. */
errors: Object;
/** The string version of this documents _id. */
id?: string;
/** This documents _id. */
_id: any;
/** Boolean flag specifying if the document is new. */
@@ -880,6 +878,11 @@ declare module "mongoose" {
schema: Schema;
}
interface MongooseDocumentOptionals {
/** The string version of this documents _id. */
id?: string;
}
interface DocumentToObjectOptions {
/** apply all getters (path and virtual getters) */
getters?: boolean;