import YouTube from '..'; import { youtube_v3 } from '@googleapis/youtube'; /** * A caption track. */ export declare class Caption { /** * 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; /** * The YouTube object that created this caption track object. */ youtube: YouTube; /** * Whether or not this is a full caption track object. */ full: boolean; /** * The raw data of this caption track. */ data: any; /** * The ID of this caption track. */ id: string; /** * The ID of the [Video](./Video#) that this caption track is for. */ videoId: string; /** * When this caption track was last updated. */ lastUpdated: Date; /** * The kind of caption track this is (automatic speech recognition, forced due to foreign language, or standard). */ kind: 'ASR' | 'forced' | 'standard'; /** * The language that this caption track is written in. */ language: string; /** * The name of this caption track. */ name: string; /** * Whether the audio is a commentary/descriptive (alternate audio tracks), the primary audio track, or unknown. */ audioType: 'commentary' | 'descriptive' | 'primary' | 'unknown'; /** * Whether or not this caption track is for the deaf/hard of hearing. */ closedCaptions: boolean; /** * Whether or not this caption track uses large text for the vision-impaired. */ large: boolean; /** * Whether or not this caption track is written at a third-grade level (for language learners). */ easyReader: boolean; /** * Whether or not this caption track is a draft. If so, it won't be shown to users. */ draft: boolean; /** * Whether or not this caption track has been autosynced to the audio by YouTube. */ autoSynced: boolean; /** * The processing status of the caption track. */ status: 'failed' | 'serving' | 'syncing'; /** * If [Caption.status](./Caption#status) is `failed`, then this is populated with the reason failure. */ failureReason?: 'processingFailed' | 'unknownFormat' | 'unsupportedFormat'; constructor(youtube: YouTube, data: youtube_v3.Schema$Caption, full?: boolean); /** * @ignore */ private _init; /** * Fetches this caption from the API and reassigns this object to the new caption object. * Only useful if `this.full` is false, or if you want updated caption info. * Must be using an access token with correct scopes. */ fetch(): Promise; /** * Updates this caption. * Must be using an access token with correct scopes. * @param track The modified caption track to upload. * @param draft Whether or not the track is a draft. */ update(track?: Buffer, draft?: boolean): Promise; /** * Downloads this caption's track. * Must be using an access token with correct scopes. * @param format The file format to download the track in. * @param language The language to download the track in. */ download(format?: 'sbv' | 'scc' | 'srt' | 'ttml' | 'vtt', language?: string): Promise>; /** * Deletes the caption. * Must be using an access token with correct scopes. */ delete(): Promise; }