mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-07-02 21:52:48 +00:00
chore: fix invalid jsdoc comments
This commit is contained in:
@@ -7,29 +7,36 @@ class InteractionManager {
|
||||
#actions;
|
||||
|
||||
/**
|
||||
* @param {Actions} actions
|
||||
* @constructor
|
||||
* @param {import('../Actions')} actions
|
||||
*/
|
||||
constructor(actions) {
|
||||
this.#actions = actions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Likes a given video.
|
||||
* @param {string} video_id
|
||||
* @returns {Promise.<{ success: boolean; status_code: number; data: object; }>}
|
||||
*/
|
||||
/**
|
||||
* API response.
|
||||
*
|
||||
* @typedef {{ success: boolean, status_code: number, data: object }} Response
|
||||
*/
|
||||
|
||||
/**
|
||||
* Likes a given video.
|
||||
*
|
||||
* @param {string} video_id
|
||||
* @returns {Promise.<Response>}
|
||||
*/
|
||||
async like(video_id) {
|
||||
Utils.throwIfMissing({ video_id });
|
||||
const action = await this.#actions.engage('like/like', { video_id });
|
||||
return action;
|
||||
}
|
||||
|
||||
/**
|
||||
* Dislikes a given video.
|
||||
* @param {string} video_id
|
||||
* @returns {Promise.<{ success: boolean; status_code: number; data: object; }>}
|
||||
*/
|
||||
/**
|
||||
* Dislikes a given video.
|
||||
*
|
||||
* @param {string} video_id
|
||||
* @returns {Promise.<Response>}
|
||||
*/
|
||||
async dislike(video_id) {
|
||||
Utils.throwIfMissing({ video_id });
|
||||
const action = await this.#actions.engage('like/dislike', { video_id });
|
||||
@@ -38,8 +45,9 @@ class InteractionManager {
|
||||
|
||||
/**
|
||||
* Removes a like/dislike.
|
||||
*
|
||||
* @param {string} video_id
|
||||
* @returns {Promise.<{ success: boolean; status_code: number; data: object; }>}
|
||||
* @returns {Promise.<Response>}
|
||||
*/
|
||||
async removeLike(video_id) {
|
||||
Utils.throwIfMissing({ video_id });
|
||||
@@ -49,8 +57,9 @@ class InteractionManager {
|
||||
|
||||
/**
|
||||
* Subscribes to a given channel.
|
||||
*
|
||||
* @param {string} channel_id
|
||||
* @returns {Promise.<{ success: boolean; status_code: number; data: object; }>}
|
||||
* @returns {Promise.<Response>}
|
||||
*/
|
||||
async subscribe(channel_id) {
|
||||
Utils.throwIfMissing({ channel_id });
|
||||
@@ -60,8 +69,9 @@ class InteractionManager {
|
||||
|
||||
/**
|
||||
* Unsubscribes from a given channel.
|
||||
*
|
||||
* @param {string} channel_id
|
||||
* @returns {Promise.<{ success: boolean; status_code: number; data: object; }>}
|
||||
* @returns {Promise.<Response>}
|
||||
*/
|
||||
async unsubscribe(channel_id) {
|
||||
Utils.throwIfMissing({ channel_id });
|
||||
@@ -74,8 +84,7 @@ class InteractionManager {
|
||||
*
|
||||
* @param {string} video_id
|
||||
* @param {string} text
|
||||
*
|
||||
* @returns {Promise.<{ success: boolean; status_code: number; data: object; }>}
|
||||
* @returns {Promise.<Response>}
|
||||
*/
|
||||
async comment(video_id, text) {
|
||||
Utils.throwIfMissing({ video_id, text });
|
||||
@@ -85,14 +94,13 @@ class InteractionManager {
|
||||
|
||||
/**
|
||||
* Translates a given text using YouTube's comment translate feature.
|
||||
*
|
||||
*
|
||||
* @param {string} text
|
||||
* @param {string} target_language - an ISO language code
|
||||
* @param {object} [args] - optional arguments
|
||||
* @param {string} [args.video_id]
|
||||
* @param {string} [args.comment_id]
|
||||
*
|
||||
* @returns {Promise.<{ success: boolean; status_code: number; translated_content: string; data: object; }>}
|
||||
* @returns {Promise.<{ success: boolean, status_code: number, translated_content: string, data: object }>}
|
||||
*/
|
||||
async translate(text, target_language, args = {}) {
|
||||
Utils.throwIfMissing({ text, target_language });
|
||||
@@ -118,11 +126,10 @@ class InteractionManager {
|
||||
/**
|
||||
* Changes notification preferences for a given channel.
|
||||
* Only works with channels you are subscribed to.
|
||||
*
|
||||
*
|
||||
* @param {string} channel_id
|
||||
* @param {string} type - `PERSONALIZED` | `ALL` | `NONE`
|
||||
*
|
||||
* @returns {Promise.<{ success: boolean; status_code: number; data: object; }>}
|
||||
* @returns {Promise.<Response>}
|
||||
*/
|
||||
async setNotificationPreferences(channel_id, type) {
|
||||
Utils.throwIfMissing({ channel_id, type });
|
||||
|
||||
Reference in New Issue
Block a user