Skip to content

Commit

Permalink
docs: cleanup jsdoc types (#651)
Browse files Browse the repository at this point in the history
  • Loading branch information
trim21 authored Nov 29, 2023
1 parent 9fabf41 commit 5a0d2be
Showing 1 changed file with 41 additions and 41 deletions.
82 changes: 41 additions & 41 deletions server/services/clientGatewayService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,173 +42,173 @@ abstract class ClientGatewayService extends BaseService<ClientGatewayServiceEven
/**
* Adds torrents by file
*
* @param {Required<AddTorrentByFileOptions>} options - An object of options...
* @return {Promise<string[]>} - Resolves with an array of hashes of added torrents or rejects with error.
* @param options - An object of options...
* @return - Resolves with an array of hashes of added torrents or rejects with error.
*/
abstract addTorrentsByFile(options: Required<AddTorrentByFileOptions>): Promise<string[]>;

/**
* Adds torrents by URL
*
* @param {Required<AddTorrentByURLOptions>} options - An object of options...
* @return {Promise<string[]>} - Resolves with an array of hashes of added torrents or rejects with error.
* @param options - An object of options...
* @return - Resolves with an array of hashes of added torrents or rejects with error.
*/
abstract addTorrentsByURL(options: Required<AddTorrentByURLOptions>): Promise<string[]>;

/**
* Checks torrents
*
* @param {CheckTorrentsOptions} options - An object of options...
* @return {Promise<void>} - Rejects with error.
* @param options - An object of options...
* @return - Rejects with error.
*/
abstract checkTorrents({hashes}: CheckTorrentsOptions): Promise<void>;

/**
* Gets the list of contents of a torrent.
*
* @param {string} hash - Hash of torrent
* @return {Promise<TorrentContentTree>} - Resolves with TorrentContentTree or rejects with error.
* @param hash - Hash of torrent
* @return - Resolves with TorrentContentTree or rejects with error.
*/
abstract getTorrentContents(hash: TorrentProperties['hash']): Promise<Array<TorrentContent>>;

/**
* Gets the list of peers of a torrent.
*
* @param {string} hash - Hash of torrent
* @return {Promise<Array<TorrentPeer>>} - Resolves with an array of TorrentPeer or rejects with error.
* @param hash - Hash of torrent
* @return - Resolves with an array of TorrentPeer or rejects with error.
*/
abstract getTorrentPeers(hash: TorrentProperties['hash']): Promise<Array<TorrentPeer>>;

/**
* Gets the list of trackers of a torrent.
*
* @param {string} hash - Hash of torrent
* @return {Promise<Array<TorrentTracker>>} - Resolves with an array of TorrentTracker or rejects with error.
* @param hash - Hash of torrent
* @return - Resolves with an array of TorrentTracker or rejects with error.
*/
abstract getTorrentTrackers(hash: TorrentProperties['hash']): Promise<Array<TorrentTracker>>;

/**
* Moves torrents to specified destination path.
*
* @param {MoveTorrentsOptions} options - An object of options...
* @return {Promise<void>} - Rejects with error.
* @param options - An object of options...
* @return - Rejects with error.
*/
abstract moveTorrents(options: MoveTorrentsOptions): Promise<void>;

/**
* Reannounces torrents to trackers
*
* @param {ReannounceTorrentsOptions} options - An object of options...
* @return {Promise<void>} - Rejects with error.
* @param options - An object of options...
* @return - Rejects with error.
*/
abstract reannounceTorrents({hashes}: ReannounceTorrentsOptions): Promise<void>;

/**
* Removes torrents. Optionally deletes data of torrents.
*
* @param {DeleteTorrentsOptions} options - An object of options...
* @return {Promise<void>} - Rejects with error.
* @param options - An object of options...
* @return - Rejects with error.
*/
abstract removeTorrents(options: DeleteTorrentsOptions): Promise<void>;

/**
* Sets initial seeding mode of torrents
*
* @param {SetTorrentsInitialSeedingOptions} options - An object of options...
* @return {Promise<void>} - Rejects with error.
* @param options - An object of options...
* @return - Rejects with error.
*/
abstract setTorrentsInitialSeeding(options: SetTorrentsInitialSeedingOptions): Promise<void>;

/**
* Sets priority of torrents
*
* @param {SetTorrentsPriorityOptions} options - An object of options...
* @return {Promise<void>} - Rejects with error.
* @param options - An object of options...
* @return - Rejects with error.
*/
abstract setTorrentsPriority(options: SetTorrentsPriorityOptions): Promise<void>;

/**
* Sets sequential mode of torrents
*
* @param {SetTorrentsSequentialOptions} options - An object of options...
* @return {Promise<void>} - Rejects with error.
* @param options - An object of options...
* @return - Rejects with error.
*/
abstract setTorrentsSequential(options: SetTorrentsSequentialOptions): Promise<void>;

/**
* Sets tags of torrents
*
* @param {SetTorrentsTagsOptions} options - An object of options...
* @return {Promise<void>} - Rejects with error.
* @param options - An object of options...
* @return - Rejects with error.
*/
abstract setTorrentsTags(options: SetTorrentsTagsOptions): Promise<void>;

/**
* Sets trackers of torrents
*
* @param {SetTorrentsTrackersOptions} options - An object of options...
* @return {Promise<void>} - Rejects with error.
* @param options - An object of options...
* @return - Rejects with error.
*/
abstract setTorrentsTrackers(options: SetTorrentsTrackersOptions): Promise<void>;

/**
* Sets priority of contents of a torrent
*
* @param {string} hash - Hash of the torrent.
* @param {SetTorrentContentsPropertiesOptions} options - An object of options...
* @return {Promise<void>} - Rejects with error.
* @param hash - Hash of the torrent.
* @param options - An object of options...
* @return - Rejects with error.
*/
abstract setTorrentContentsPriority(hash: string, options: SetTorrentContentsPropertiesOptions): Promise<void>;

/**
* Starts torrents
*
* @param {StartTorrentsOptions} options - An object of options...
* @return {Promise<void>} - Rejects with error.
* @param options - An object of options...
* @return - Rejects with error.
*/
abstract startTorrents(options: StartTorrentsOptions): Promise<void>;

/**
* Stops torrents
*
* @param {StopTorrentsOptions} options - An object of options...
* @return {Promise<void>} - Rejects with error.
* @param options - An object of options...
* @return - Rejects with error.
*/
abstract stopTorrents(options: StopTorrentsOptions): Promise<void>;

/**
* Fetches the list of torrents
*
* @return {Promise<TorrentListSummary>} - Resolves with TorrentListSummary or rejects with error.
* @return - Resolves with TorrentListSummary or rejects with error.
*/
abstract fetchTorrentList(): Promise<TorrentListSummary>;

/**
* Fetches the transfer summary
*
* @return {Promise<TransferSummary>} - Resolves with TransferSummary or rejects with error.
* @return - Resolves with TransferSummary or rejects with error.
*/
abstract fetchTransferSummary(): Promise<TransferSummary>;

/**
* Gets session directory (where .torrent files are stored) of the torrent client
*
* @return {Promise<{path: string; case: 'lower' | 'upper'}>} - Resolves with path of session directory or rejects with error.
* @return - Resolves with path of session directory or rejects with error.
*/
abstract getClientSessionDirectory(): Promise<{path: string; case: 'lower' | 'upper'}>;

/**
* Gets settings of the torrent client
*
* @return {Promise<ClientSettings>} - Resolves with ClientSettings or rejects with error.
* @return - Resolves with ClientSettings or rejects with error.
*/
abstract getClientSettings(): Promise<ClientSettings>;

/**
* Sets settings of the torrent client
*
* @param {SetClientSettingsOptions} - Settings to be set.
* @return {Promise<void>} - Rejects with error.
* @param settings - Settings to be set.
* @return - Rejects with error.
*/
abstract setClientSettings(settings: SetClientSettingsOptions): Promise<void>;

Expand Down

0 comments on commit 5a0d2be

Please sign in to comment.