Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: cleanup jsdoc types #651

Merged
merged 3 commits into from
Nov 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading