-
-
Notifications
You must be signed in to change notification settings - Fork 277
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow to use mongoose typings without extending Document (#639)
Co-authored-by: Serhii Stotskyi <[email protected]> BREAKING CHANGE: increased mongoose version to 6.0.13 in order to use 4 generic types in `Model` type
- Loading branch information
Showing
8 changed files
with
152 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,28 @@ | ||
import { AccessibleFieldsModel, AccessibleFieldsDocument } from './accessible_fields'; | ||
import { AccessibleRecordModel } from './accessible_records'; | ||
import { AccessibleFieldDocumentMethods, AccessibleFieldsModel } from './accessible_fields'; | ||
import { AccessibleRecordModel, AccessibleRecordQueryHelpers } from './accessible_records'; | ||
|
||
export type AccessibleModel<T extends AccessibleFieldsDocument> = | ||
AccessibleRecordModel<T> & AccessibleFieldsModel<T>; | ||
export interface AccessibleModel< | ||
T, | ||
TQueryHelpers = unknown, | ||
TMethods = unknown, | ||
TVirtuals = unknown | ||
> | ||
extends | ||
AccessibleRecordModel<T, TQueryHelpers, TMethods & AccessibleFieldDocumentMethods<T>, TVirtuals>, | ||
AccessibleFieldsModel<T, TQueryHelpers & AccessibleRecordQueryHelpers< | ||
T, | ||
TQueryHelpers, | ||
TMethods & AccessibleFieldDocumentMethods<T>, | ||
TVirtuals | ||
>, TMethods, TVirtuals> | ||
{} | ||
|
||
export * from './accessible_records'; | ||
export * from './accessible_fields'; | ||
export * from './mongo'; | ||
export { accessibleRecordsPlugin } from './accessible_records'; | ||
export type { AccessibleRecordModel } from './accessible_records'; | ||
export { getSchemaPaths, accessibleFieldsPlugin } from './accessible_fields'; | ||
export type { | ||
AccessibleFieldsModel, | ||
AccessibleFieldsDocument, | ||
AccessibleFieldsOptions | ||
} from './accessible_fields'; | ||
export { toMongoQuery } from './mongo'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.