import { Video, Channel, Comment, Playlist, Subscription, VideoCategory, VideoAbuseReportReason, Language, Region, Caption, ChannelSection, VideoRating } from '..'; import { ChannelResolvable, VideoCategoryResolvable } from './Resolutions'; export declare const GETTABLE_CLASSES: (typeof Video | typeof Playlist | typeof Channel | typeof VideoCategory | typeof Comment | typeof Subscription | typeof Caption | typeof ChannelSection | typeof VideoRating)[]; export type ItemTypes = typeof GETTABLE_CLASSES[number]; export type ItemReturns = M extends true ? InstanceType : T extends any[] ? InstanceType[] : InstanceType; /** * An array containing every entity that is capable of returning a paginated response from the API. */ export declare const PAGINATED_CLASSES: (typeof Video | typeof Playlist | typeof Channel | typeof VideoCategory | typeof Comment | typeof Subscription | typeof VideoAbuseReportReason | typeof Language | typeof Region | typeof Caption | typeof ChannelSection | typeof VideoRating)[]; /** * @ignore */ export declare enum PaginatedItemType { VideoCategories = 0, VideoAbuseReportReasons = 1, Languages = 2, Regions = 3, VideoRatings = 4, PlaylistItems = 5, VideoComments = 6, CommentReplies = 7, Captions = 8, Playlists = 9, Subscriptions = 10, ChannelSections = 11 } /** * A union type of every entity that is capable of returning a paginated response from the API. */ export type PaginatedType = typeof PAGINATED_CLASSES[number]; /** * A union of every entity that is capable of returning a paginated response from the API. */ export type PaginatedInstance = InstanceType; /** * @ignore */ export type PaginatedItemOptions = { type: PaginatedItemType; mine?: boolean; id?: string; subId?: string; parts?: string[]; /** * Only valid for comments */ order?: 'time' | 'relevance'; } & PageOptions; /** * @ignore */ export type PaginatedRequestParams = { part: string; maxResults?: number; id?: string; videoId?: string; parentId?: string; textFormat?: string; playlistId?: string; channelId?: string; forChannelId?: string; regionCode?: string; pageToken?: string; mine?: boolean; hl?: string; order?: string; }; /** * When retrieving a paginated entity, use these options to specify number, size, and location of pages you are requesting. */ export type PageOptions = { /** * The number of pages to fetch. */ pages?: number; /** * The maximum number of items to include per page. */ maxPerPage?: number; /** * The token of the page to fetch, retrieved from a previous call to the method returning a PaginatedResponse. */ pageToken?: string; }; /** * A paginated response that can be navigated by providing the `nextPageToken` to a related function within * the [YouTube](/docs/api/Library-Exports/classes/YouTube) class to instruct it to retrieve the next page. */ export type PaginatedResponse = { /** * The items returned from the request to the YouTube API. */ items: T[]; prevPageToken?: string; /** * Provide this to a function within the [YouTube](/docs/api/Library-Exports/classes/YouTube) class to retrieve the next page * instead of the first page of items from the method. */ nextPageToken?: string; }; /** * A union of the searchable YouTube entities available via Popyt. */ export type SearchType = typeof Video | typeof Playlist | typeof Channel; /** * A generic intersection of the general search filters on YouTube and the filters for a specific entity. */ export type SearchFilters = { types?: T[]; order?: 'date' | 'rating' | 'relevance' | 'title' | 'videoCount' | 'viewCount'; } & (T extends typeof Video ? VideoSearchOptions : T extends typeof Playlist ? PlaylistSearchOptions : T extends typeof Channel ? ChannelSearchOptions : {}); /** * Generic type for the [YouTube#search()](/docs/api/Library-Exports/classes/YouTube#search) function. */ export type GenericSearchOptions = { /** * The filters to narrow down your YouTube search. */ searchFilters?: SearchFilters; /** * Use these options to specify number, size, and location of pages you are requesting. */ pageOptions?: PageOptions; }; /** * Generic type for the entity-specific search functions. */ export type EntitySearchOptions = { /** * The search filters to narrow down your YouTube search. */ searchFilters?: Omit, 'types'>; /** * Use these options to specify number, size, and location of pages you are requesting. */ pageOptions?: PageOptions; }; /** * @ignore */ export type InternalSearchOptions = SearchFilters & PageOptions & { searchTerm: string; }; /** * Filters to be used with [YouTube#search()](/docs/api/Library-Exports/classes/YouTube#search) * or [YouTube#searchVideos()](/docs/api/Library-Exports/classes/YouTube#searchvideos) */ export type VideoSearchOptions = { /** * Search for videos uploaded by a channel. */ channel?: ChannelResolvable; /** * Search for videos in a certain category (Film & Animation, Comedy, Drama, etc.) (must be an object or ID from the API, not a title of a category). */ videoCategory?: VideoCategoryResolvable; /** * Search for videos that are embeddable into external websites. */ videoEmbeddable?: boolean; /** * Search for ended, live, or upcoming livestreams. */ eventType?: 'completed' | 'live' | 'upcoming'; /** * Search specifically for TV shows or movies. */ videoType?: 'any' | 'episode' | 'movie'; videoCaption?: 'any' | 'closedCaption' | 'none'; /** * Search by latitude and longitude coordinates in the format (37.42307,-122.08427). */ location?: string; /** * See [Location](/docs/api/Library-Exports/type-aliases/VideoSearchOptions#location) * * Units are 'm', 'km', 'ft', and 'mi'. e.g. '5km'. No larger than 1000km. */ locationRadius?: string; }; /** * Filters to be used with [YouTube#search()](/docs/api/Library-Exports/classes/YouTube#search) * or [YouTube#searchPlaylists()](/docs/api/Library-Exports/classes/YouTube#searchplaylists) */ export type PlaylistSearchOptions = { channel?: ChannelResolvable; }; /** * Filters to be used with [YouTube#search()](/docs/api/Library-Exports/classes/YouTube#search) * or [YouTube#searchChannels()](/docs/api/Library-Exports/classes/YouTube#searchchannels) */ export type ChannelSearchOptions = { /** * Filter by TV shows */ channelType?: 'any' | 'show'; };