From e78a373ebde14e70fe267124d5b2fab542996de8 Mon Sep 17 00:00:00 2001 From: Kwabena Ampofo Date: Tue, 19 Apr 2022 16:01:24 -0400 Subject: [PATCH 1/4] docs(NODE-4158): Annotate BSON classes with a category --- src/binary.ts | 1 + src/code.ts | 1 + src/db_ref.ts | 1 + src/decimal128.ts | 1 + src/double.ts | 1 + src/int_32.ts | 1 + src/long.ts | 1 + src/map.ts | 5 ++++- src/max_key.ts | 1 + src/min_key.ts | 1 + src/objectid.ts | 1 + src/regexp.ts | 1 + src/symbol.ts | 1 + src/timestamp.ts | 5 ++++- tsdoc.json | 9 +++++++++ 15 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 tsdoc.json diff --git a/src/binary.ts b/src/binary.ts index 2b82893d..a99c72ed 100644 --- a/src/binary.ts +++ b/src/binary.ts @@ -25,6 +25,7 @@ export interface BinaryExtended { /** * A class representation of the BSON Binary type. * @public + * @category BSON */ export class Binary { _bsontype!: 'Binary'; diff --git a/src/code.ts b/src/code.ts index 1307d88d..d6703fa8 100644 --- a/src/code.ts +++ b/src/code.ts @@ -9,6 +9,7 @@ export interface CodeExtended { /** * A class representation of the BSON Code type. * @public + * @category BSON */ export class Code { _bsontype!: 'Code'; diff --git a/src/db_ref.ts b/src/db_ref.ts index 4097eec2..04d565f8 100644 --- a/src/db_ref.ts +++ b/src/db_ref.ts @@ -23,6 +23,7 @@ export function isDBRefLike(value: unknown): value is DBRefLike { /** * A class representation of the BSON DBRef type. * @public + * @category BSON */ export class DBRef { _bsontype!: 'DBRef'; diff --git a/src/decimal128.ts b/src/decimal128.ts index 3f8dc734..24d0e075 100644 --- a/src/decimal128.ts +++ b/src/decimal128.ts @@ -118,6 +118,7 @@ export interface Decimal128Extended { /** * A class representation of the BSON Decimal128 type. * @public + * @category BSON */ export class Decimal128 { _bsontype!: 'Decimal128'; diff --git a/src/double.ts b/src/double.ts index d7920641..5ea6cad5 100644 --- a/src/double.ts +++ b/src/double.ts @@ -8,6 +8,7 @@ export interface DoubleExtended { /** * A class representation of the BSON Double type. * @public + * @category BSON */ export class Double { _bsontype!: 'Double'; diff --git a/src/int_32.ts b/src/int_32.ts index d64f444f..b9f0349e 100644 --- a/src/int_32.ts +++ b/src/int_32.ts @@ -8,6 +8,7 @@ export interface Int32Extended { /** * A class representation of a BSON Int32 type. * @public + * @category BSON */ export class Int32 { _bsontype!: 'Int32'; diff --git a/src/long.ts b/src/long.ts index 6f79fae4..d3786e58 100644 --- a/src/long.ts +++ b/src/long.ts @@ -58,6 +58,7 @@ export interface LongExtended { /** * A class representing a 64-bit integer * @public + * @category BSON * @remarks * The internal representation of a long is the two given signed, 32-bit values. * We use 32-bit pieces because these are the size of integers on which diff --git a/src/map.ts b/src/map.ts index ba003296..2a390f1a 100644 --- a/src/map.ts +++ b/src/map.ts @@ -3,7 +3,10 @@ import { getGlobal } from './utils/global'; -/** @public */ +/** + * @public + * @category BSON + */ let bsonMap: MapConstructor; const bsonGlobal = getGlobal<{ Map?: MapConstructor }>(); diff --git a/src/max_key.ts b/src/max_key.ts index fcfc5bec..e809ee1f 100644 --- a/src/max_key.ts +++ b/src/max_key.ts @@ -6,6 +6,7 @@ export interface MaxKeyExtended { /** * A class representation of the BSON MaxKey type. * @public + * @category BSON */ export class MaxKey { _bsontype!: 'MaxKey'; diff --git a/src/min_key.ts b/src/min_key.ts index f1647fcb..421362fb 100644 --- a/src/min_key.ts +++ b/src/min_key.ts @@ -6,6 +6,7 @@ export interface MinKeyExtended { /** * A class representation of the BSON MinKey type. * @public + * @category BSON */ export class MinKey { _bsontype!: 'MinKey'; diff --git a/src/objectid.ts b/src/objectid.ts index e88e8333..231f20d7 100644 --- a/src/objectid.ts +++ b/src/objectid.ts @@ -26,6 +26,7 @@ const kId = Symbol('id'); /** * A class representation of the BSON ObjectId type. * @public + * @category BSON */ export class ObjectId { _bsontype!: 'ObjectID'; diff --git a/src/regexp.ts b/src/regexp.ts index 7151bec5..77e30e8c 100644 --- a/src/regexp.ts +++ b/src/regexp.ts @@ -22,6 +22,7 @@ export interface BSONRegExpExtended { /** * A class representation of the BSON RegExp type. * @public + * @category BSON */ export class BSONRegExp { _bsontype!: 'BSONRegExp'; diff --git a/src/symbol.ts b/src/symbol.ts index 10601b0c..312969bb 100644 --- a/src/symbol.ts +++ b/src/symbol.ts @@ -6,6 +6,7 @@ export interface BSONSymbolExtended { /** * A class representation of the BSON Symbol type. * @public + * @category BSON */ export class BSONSymbol { _bsontype!: 'Symbol'; diff --git a/src/timestamp.ts b/src/timestamp.ts index e6eb470f..9126fd8b 100644 --- a/src/timestamp.ts +++ b/src/timestamp.ts @@ -19,7 +19,10 @@ export interface TimestampExtended { }; } -/** @public */ +/** + * @public + * @category BSON + * */ export class Timestamp extends LongWithoutOverridesClass { _bsontype!: 'Timestamp'; diff --git a/tsdoc.json b/tsdoc.json new file mode 100644 index 00000000..4b24f789 --- /dev/null +++ b/tsdoc.json @@ -0,0 +1,9 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", + "tagDefinitions": [ + { + "syntaxKind": "block", + "tagName": "@category" + } + ] +} From 24bde6bdae2c85f3881f4a07355c33f1a0074269 Mon Sep 17 00:00:00 2001 From: Kwabena Ampofo Date: Wed, 20 Apr 2022 09:56:45 -0400 Subject: [PATCH 2/4] Change category names from 'BSON' to 'BSONType' --- src/binary.ts | 2 +- src/code.ts | 2 +- src/db_ref.ts | 2 +- src/decimal128.ts | 2 +- src/double.ts | 2 +- src/int_32.ts | 2 +- src/long.ts | 2 +- src/map.ts | 2 +- src/max_key.ts | 2 +- src/min_key.ts | 2 +- src/objectid.ts | 2 +- src/regexp.ts | 2 +- src/symbol.ts | 2 +- src/timestamp.ts | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/binary.ts b/src/binary.ts index a99c72ed..cb6c67c6 100644 --- a/src/binary.ts +++ b/src/binary.ts @@ -25,7 +25,7 @@ export interface BinaryExtended { /** * A class representation of the BSON Binary type. * @public - * @category BSON + * @category BSONType */ export class Binary { _bsontype!: 'Binary'; diff --git a/src/code.ts b/src/code.ts index d6703fa8..d4459c13 100644 --- a/src/code.ts +++ b/src/code.ts @@ -9,7 +9,7 @@ export interface CodeExtended { /** * A class representation of the BSON Code type. * @public - * @category BSON + * @category BSONType */ export class Code { _bsontype!: 'Code'; diff --git a/src/db_ref.ts b/src/db_ref.ts index 04d565f8..a46cd26d 100644 --- a/src/db_ref.ts +++ b/src/db_ref.ts @@ -23,7 +23,7 @@ export function isDBRefLike(value: unknown): value is DBRefLike { /** * A class representation of the BSON DBRef type. * @public - * @category BSON + * @category BSONType */ export class DBRef { _bsontype!: 'DBRef'; diff --git a/src/decimal128.ts b/src/decimal128.ts index 24d0e075..8c663198 100644 --- a/src/decimal128.ts +++ b/src/decimal128.ts @@ -118,7 +118,7 @@ export interface Decimal128Extended { /** * A class representation of the BSON Decimal128 type. * @public - * @category BSON + * @category BSONType */ export class Decimal128 { _bsontype!: 'Decimal128'; diff --git a/src/double.ts b/src/double.ts index 5ea6cad5..51bbf22d 100644 --- a/src/double.ts +++ b/src/double.ts @@ -8,7 +8,7 @@ export interface DoubleExtended { /** * A class representation of the BSON Double type. * @public - * @category BSON + * @category BSONType */ export class Double { _bsontype!: 'Double'; diff --git a/src/int_32.ts b/src/int_32.ts index b9f0349e..b3b5760c 100644 --- a/src/int_32.ts +++ b/src/int_32.ts @@ -8,7 +8,7 @@ export interface Int32Extended { /** * A class representation of a BSON Int32 type. * @public - * @category BSON + * @category BSONType */ export class Int32 { _bsontype!: 'Int32'; diff --git a/src/long.ts b/src/long.ts index d3786e58..1f78b2b9 100644 --- a/src/long.ts +++ b/src/long.ts @@ -58,7 +58,7 @@ export interface LongExtended { /** * A class representing a 64-bit integer * @public - * @category BSON + * @category BSONType * @remarks * The internal representation of a long is the two given signed, 32-bit values. * We use 32-bit pieces because these are the size of integers on which diff --git a/src/map.ts b/src/map.ts index 2a390f1a..548ce1be 100644 --- a/src/map.ts +++ b/src/map.ts @@ -5,7 +5,7 @@ import { getGlobal } from './utils/global'; /** * @public - * @category BSON + * @category BSONType */ let bsonMap: MapConstructor; diff --git a/src/max_key.ts b/src/max_key.ts index e809ee1f..0ff3d363 100644 --- a/src/max_key.ts +++ b/src/max_key.ts @@ -6,7 +6,7 @@ export interface MaxKeyExtended { /** * A class representation of the BSON MaxKey type. * @public - * @category BSON + * @category BSONType */ export class MaxKey { _bsontype!: 'MaxKey'; diff --git a/src/min_key.ts b/src/min_key.ts index 421362fb..f872b1eb 100644 --- a/src/min_key.ts +++ b/src/min_key.ts @@ -6,7 +6,7 @@ export interface MinKeyExtended { /** * A class representation of the BSON MinKey type. * @public - * @category BSON + * @category BSONType */ export class MinKey { _bsontype!: 'MinKey'; diff --git a/src/objectid.ts b/src/objectid.ts index 231f20d7..e612effd 100644 --- a/src/objectid.ts +++ b/src/objectid.ts @@ -26,7 +26,7 @@ const kId = Symbol('id'); /** * A class representation of the BSON ObjectId type. * @public - * @category BSON + * @category BSONType */ export class ObjectId { _bsontype!: 'ObjectID'; diff --git a/src/regexp.ts b/src/regexp.ts index 77e30e8c..efd56280 100644 --- a/src/regexp.ts +++ b/src/regexp.ts @@ -22,7 +22,7 @@ export interface BSONRegExpExtended { /** * A class representation of the BSON RegExp type. * @public - * @category BSON + * @category BSONType */ export class BSONRegExp { _bsontype!: 'BSONRegExp'; diff --git a/src/symbol.ts b/src/symbol.ts index 312969bb..1e82fc1c 100644 --- a/src/symbol.ts +++ b/src/symbol.ts @@ -6,7 +6,7 @@ export interface BSONSymbolExtended { /** * A class representation of the BSON Symbol type. * @public - * @category BSON + * @category BSONType */ export class BSONSymbol { _bsontype!: 'Symbol'; diff --git a/src/timestamp.ts b/src/timestamp.ts index 9126fd8b..651c5cf4 100644 --- a/src/timestamp.ts +++ b/src/timestamp.ts @@ -21,7 +21,7 @@ export interface TimestampExtended { /** * @public - * @category BSON + * @category BSONType * */ export class Timestamp extends LongWithoutOverridesClass { _bsontype!: 'Timestamp'; From bf18dd6c511f2319bcce9630bb418f0fbe211432 Mon Sep 17 00:00:00 2001 From: Kwabena Ampofo Date: Wed, 20 Apr 2022 10:10:47 -0400 Subject: [PATCH 3/4] Remove 'BSONType' annotation from 'map' class --- src/map.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/map.ts b/src/map.ts index 548ce1be..868d9aa3 100644 --- a/src/map.ts +++ b/src/map.ts @@ -5,7 +5,6 @@ import { getGlobal } from './utils/global'; /** * @public - * @category BSONType */ let bsonMap: MapConstructor; From c2df28abb7fc61a096c2204dc2b4619030fc76d8 Mon Sep 17 00:00:00 2001 From: Kwabena Ampofo Date: Wed, 20 Apr 2022 10:29:00 -0400 Subject: [PATCH 4/4] Make 'public' tag single line --- src/map.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/map.ts b/src/map.ts index 868d9aa3..ba003296 100644 --- a/src/map.ts +++ b/src/map.ts @@ -3,9 +3,7 @@ import { getGlobal } from './utils/global'; -/** - * @public - */ +/** @public */ let bsonMap: MapConstructor; const bsonGlobal = getGlobal<{ Map?: MapConstructor }>();