Skip to content

Commit

Permalink
chore(jsdoc): small jsdoc fixes & improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
shadowplay1 committed Jan 4, 2024
1 parent 502a458 commit d701552
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 22 deletions.
39 changes: 22 additions & 17 deletions src/Giveaways.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ import { IDatabaseStructure } from './types/databaseStructure.interface'
*
* Type parameters:
*
* - `TDatabaseType` ({@link DatabaseType}) - The database type that will be used in the module.
* - `TDatabaseType` ({@link DatabaseType}) - The database type that is used.
* - `TDatabaseKey` ({@link string}, optional: defaults to `${string}.giveaways`) - The type of database key that will be used in database operations.
* - `TDatabaseValue` ({@link any}, optional: defaults to {@link IDatabaseStructure}) - The type of database content that will be used in database operations.
*
* @extends {Emitter<IGiveawaysEvents<TDatabaseType, TDatabaseKey, TDatabaseValue>>}
*
* @template TDatabaseType The database type that will be used in the module.
* @template TDatabaseType The database type that is used.
* @template TDatabaseKey The type of database key that will be used in database operations.
* @template TDatabaseValue The type of database content that will be used in database operations.
*/
Expand Down Expand Up @@ -988,7 +988,7 @@ export class Giveaways<
* @prop {string[]} entriesArray The array of user IDs of users that have entered the giveaway.
* @prop {IGiveawayMessageProps} messageProps The message data properties for embeds and buttons.
*
* @template TDatabaseType The database type that will be used in the module.
* @template TDatabaseType The database type that is used.
*/

/**
Expand Down Expand Up @@ -1367,45 +1367,50 @@ export class Giveaways<
*
* Type parameters:
*
* - `TDatabaseType` ({@link DatabaseType}) - The database type that will be used in the module.
*
* @typedef {object} IGiveawaysEvents<TDatabaseType>
* @prop {Giveaways<DatabaseType>} ready Emits when the {@link Giveaways} is ready.
* - `TDatabaseType` ({@link DatabaseType}) - The database type that is used.
* - `TDatabaseKey` ({@link string}, optional: defaults to `${string}.giveaways`) - The type of database key that will be used in database operations.
* - `TDatabaseValue` ({@link any}, optional: defaults to {@link IDatabaseStructure}) - The type of database content that will be used in database operations.
*
* @typedef {object} IGiveawaysEvents
* @prop {Giveaways<DatabaseType, TDatabaseKey, TDatabaseValue>} ready Emits when the {@link Giveaways} module is ready.
* @prop {void} databaseConnect Emits when the connection to the database is established.
* @prop {Giveaway<DatabaseType>} giveawayStart Emits when a giveaway is started.
* @prop {Giveaway<DatabaseType>} giveawayRestart Emits when a giveaway is rerolled.
* @prop {Giveaway<DatabaseType>} giveawayEnd Emits when a giveaway is rerolled.
* @prop {IGiveawayRerollEvent} giveawayReroll Emits when a giveaway is rerolled.
* @prop {Giveaway<DatabaseType>} giveawayStart Emits when the giveaway is started.
* @prop {Giveaway<DatabaseType>} giveawayRestart Emits when the giveaway is restarted.
* @prop {Giveaway<DatabaseType>} giveawayEnd Emits when the giveaway is ended.
* @prop {IGiveawayRerollEvent<DatabaseType>} giveawayReroll Emits when the giveaway winners are rerolled.
* @prop {IGiveawayEditEvent<DatabaseType>} giveawayEdit Emits when the giveaway info was edited.
*
* @template TDatabaseType The database type that will be used in the module.
* @template TDatabaseType The database type that is used.
* @template TDatabaseKey The type of database key that will be used in database operations.
* @template TDatabaseValue The type of database content that will be used in database operations.
*/

/**
* Giveaway reroll event object.
*
* Type parameters:
*
* - `TDatabaseType` ({@link DatabaseType}) - The database type that will be used in the module.
* - `TDatabaseType` ({@link DatabaseType}) - The database type that is used.
*
* @typedef {object} IGiveawayRerollEvent<TDatabaseType>
* @prop {Giveaway<DatabaseType>} giveaway Giveaway instance.
* @prop {string} newWinners Array of the new picked winners after reroll.
*
* @template TDatabaseType The database type that will be used in the module.
* @template TDatabaseType The database type that is used.
*/

/**
* Giveaway time change event object.
*
* Type parameters:
*
* - `TDatabaseType` ({@link DatabaseType}) - The database type that will be used in the module.
* - `TDatabaseType` ({@link DatabaseType}) - The database type that is used.
*
* @typedef {object} IGiveawayTimeChangeEvent
* @prop {string} time The time that affected the giveaway's length.
* @prop {Giveaway<DatabaseType>} giveaway Giveaway instance.
*
* @template TDatabaseType The database type that will be used in the module.
* @template TDatabaseType The database type that is used.
*/

/**
Expand Down Expand Up @@ -1671,7 +1676,7 @@ export class Giveaways<
/**
* Emits when the {@link Giveaways} module is ready.
* @event Giveaways#ready
* @param {Giveaways<DatabaseType>} giveaways Initialized {@link Giveaways} instance.
* @param {Giveaways<DatabaseType, TDatabaseKey, TDatabaseValue>} giveaways Initialized {@link Giveaways} instance.
*/

/**
Expand Down
4 changes: 2 additions & 2 deletions src/lib/Giveaway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ import { replaceGiveawayKeys } from '../structures/giveawayTemplate'
*
* Type parameters:
*
* - `TDatabaseType` ({@link DatabaseType}) - The database type that will be used in the module.
* - `TDatabaseType` ({@link DatabaseType}) - The database type that is used.
*
* @implements {Omit<IGiveaway, 'hostMemberID' | 'channelID' | 'guildID' | 'entriesArray'>}
* @template TDatabaseType The database type that will be used in the module.
* @template TDatabaseType The database type that is used.
*/
export class Giveaway<
TDatabaseType extends DatabaseType
Expand Down
2 changes: 1 addition & 1 deletion src/lib/giveaway.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { DiscordID } from '../types/misc/utils'
* @prop {string[]} entriesArray The array of user IDs of users that have entered the giveaway.
* @prop {IGiveawayMessageProps} messageProps The message data properties for embeds and buttons.
*
* @template TDatabaseType The database type that will be used in the module.
* @template TDatabaseType The database type that is used.
*/
export interface IGiveaway<
HostMemberID extends string = string,
Expand Down
4 changes: 2 additions & 2 deletions src/types/giveawaysEvents.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { IDatabaseStructure } from './databaseStructure.interface'
*
* Type parameters:
*
* - `TDatabaseType` ({@link DatabaseType}) - The database type that will be used in the module.
* - `TDatabaseType` ({@link DatabaseType}) - The database type that is used.
* - `TDatabaseKey` ({@link string}, optional: defaults to `${string}.giveaways`) - The type of database key that will be used in database operations.
* - `TDatabaseValue` ({@link any}, optional: defaults to {@link IDatabaseStructure}) - The type of database content that will be used in database operations.
*
Expand All @@ -24,7 +24,7 @@ import { IDatabaseStructure } from './databaseStructure.interface'
* @prop {IGiveawayRerollEvent<DatabaseType>} giveawayReroll Emits when the giveaway winners are rerolled.
* @prop {IGiveawayEditEvent<DatabaseType>} giveawayEdit Emits when the giveaway info was edited.
*
* @template TDatabaseType The database type that will be used in the module.
* @template TDatabaseType The database type that is used.
* @template TDatabaseKey The type of database key that will be used in database operations.
* @template TDatabaseValue The type of database content that will be used in database operations.
*/
Expand Down

0 comments on commit d701552

Please sign in to comment.