-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add BSON interfaces to help enhance type safety of low level code
- Loading branch information
1 parent
399babc
commit 67872f2
Showing
2 changed files
with
32 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/** | ||
* Various interfaces for low level BSON types used within Iridium. | ||
*/ | ||
|
||
/** | ||
* Represents a low level BSON value with its included _bsontype property. | ||
*/ | ||
export interface Value { | ||
_bsontype: string; | ||
} | ||
|
||
/** | ||
* Represents a raw ObjectID object received from the database. | ||
*/ | ||
export interface ObjectID extends Value { | ||
id: string; | ||
} | ||
|
||
/** | ||
* Represents a raw Binary object received from the database. | ||
*/ | ||
export interface Binary extends Value { | ||
buffer: Buffer; | ||
} |
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