import { CommentThreadParts, VideoParts } from '../types/Parts'; import { Thumbnail, ISODuration, PageOptions, PaginatedResponse } from '../types'; import { YouTube, VideoUpdateResource, Caption } from '..'; import { Comment } from './comment'; import { youtube_v3 } from '@googleapis/youtube'; /** * A YouTube video. */ export declare class Video { /** * The name of the endpoint used for this entity. */ static endpoint: string; /** * The parts to request for this entity. */ static part: string; /** * The fields to request for this entity. */ static fields: string; /** * YouTube object that created the video. */ youtube: YouTube; /** * The raw data of the video. */ data: any; /** * Whether or not this is a full video object (would it be the same if we ran [Video.fetch](./Video#fetch) under the same conditions as last time?). */ full: boolean; /** * The ID of the video. */ id: string; /** * The title of the video. */ title: string; /** * The description of the video. */ description: string; /** * The thumbnails of the video. */ thumbnails: { default?: Thumbnail; medium?: Thumbnail; high?: Thumbnail; standard?: Thumbnail; maxres?: Thumbnail; }; /** * The tags of the video. */ tags: string[]; /** * The date the video was published. */ datePublished: Date; /** * The date the video was recorded. This is specified by the uploader. */ dateRecorded: Date; /** * Information on the channel that uploaded the video. */ channel: { id: string; name: string; }; /** * @ignore */ _length: ISODuration; /** * The minutes of the video. */ minutes: number; /** * The seconds of the video. */ seconds: number; /** * The url of the video. */ url: string; /** * The short url of the video, i.e. https://youtu.be/id */ shortUrl: string; /** * The number of likes the video has. */ likes: number; /** * The number of dislikes the video has. */ dislikes: number; /** * The number of views the video has. */ views: number; /** * Whether or not this video COULD BE private. True if the video might * be private, as you cannot check if playlist items are private. * * I would recommend that you try and fetch the video and catch an error * if it is from a playlist & marked as private. */ private: boolean; /** * The video's comments. Only defined when [Video.fetchComments](./Video#fetchcomments) is called. */ comments: PaginatedResponse; /** * The number of comments on the video. */ commentCount: number; /** * If this is a ongoing livestream, this is `live`. * If this is an upcoming livestream, this is `upcoming`. * If this is not a livestream, this is `false`. */ liveStatus: 'live' | 'upcoming' | false; /** * The video category associated with the video. */ category: string; /** * Properties to do with videos made for children. */ kids: { /** * Whether or not the video was made for children. */ madeForKids: boolean; /** * Whether or not the poster of the video marked it as made for kids. */ selfDeclaredMadeForKids: boolean; }; /** * The caption data associated with this video. Only available after running [Video.fetchCaptions](./Video#fetchcaptions). */ captions: Caption[]; /** * If this video was fetched from a playlist, this can be populated with a user-created note about the video. */ note: string; /** * The license this video falls under. */ license: 'creativeCommon' | 'youtube'; /** * The localized titles and descriptions of this video, if any. */ localizations: { [language: string]: { title?: string; description?: string; }; }; constructor(youtube: YouTube, data: youtube_v3.Schema$Video | youtube_v3.Schema$PlaylistItem | youtube_v3.Schema$SearchResult, full?: boolean); /** * @ignore */ private _init; /** * Posts a comment to the video. * Must be using an access token with correct scopes. * @param text The text of the comment. */ postComment(text: string): Promise; /** * Fetches this video from the API and reassigns this object to the new video object. * Only useful if `this.full` is false, or if you want updated video info. */ fetch(parts?: VideoParts): Promise; /** * Fetches the video's comments from the API and assigns them to [Video.comments](./Video#comments). * @param pageOptions The number of pages and maximum number of items per page. * Fetches the maximum number of items allowed by the API per page by default. * Set pages to a value {'<='}0 to fetch all. * @param parts The parts of the object to fetch (saves quota if you aren't using certain properties!) */ fetchComments(pageOptions?: PageOptions, order?: 'time' | 'relevance', parts?: CommentThreadParts): Promise>; /** * Gets the user's rating on the video. * Must be using an access token with correct scopes. */ getRating(): Promise<'like' | 'dislike' | 'none' | 'unspecified'>; /** * Likes the video. * Must be using an access token with correct scopes. */ like(): Promise; /** * Dislikes the video. * Must be using an access token with correct scopes. */ dislike(): Promise; /** * Removes the user's like/dislike on the video. * Must be using an access token with correct scopes. */ unrate(): Promise; /** * Reports the video for abuse. * Must be using an access token with correct scopes. * @param reasonId The reason for reporting. (IDs can be found [here](https://developers.google.com/youtube/v3/docs/videoAbuseReportReasons/list)) * @param secondaryReasonId An optional second reason for reporting. * @param comments Any additional information. * @param language The language that the reporter speaks. */ reportAbuse(reasonId: string, secondaryReasonId?: string, comments?: string, language?: string): Promise; /** * Deletes the video. * Must be using an access token with correct scopes. */ delete(): Promise; /** * Edits the video. * Must be using an access token with correct scopes. * **If your request does not specify a value for a property that already has a value, * the property's existing value will be deleted.** * @param video The updated video object. */ update(video: Omit): Promise