import type { FetchResult, YoutubeApiConfig, YoutubeListParams, YoutubeVideoNormalized, YoutubeVideoPage } from "../../types/index.js"; /** * Registers the YouTube APIs (`youtube` + keyless `youtubeFeed`) and * stores the default channel. Call once per app, server/build-time — * the API key must never ship to the browser. * * @param config - API key + default channel id. * * @example * ```ts * useInitYoutube({ apiKey: process.env.YOUTUBE_API_KEY!, channelId: "UC…" }); * const page = await useGetChannelVideos({ maxResults: 6 }); * ``` */ export declare function useInitYoutube(config: YoutubeApiConfig): void; /** * Returns a shallow copy of the YouTube config (safe to mutate locally). * * @returns The current `{ apiKey, channelId }`. */ export declare function useGetYoutubeConfig(): YoutubeApiConfig; /** * Builds the public channel RSS feed URL. Needs no API key and * costs zero quota — ideal for "latest videos" widgets. * * @param channelId - Channel id (`UC…`). * @returns Feed URL. */ export declare function useBuildYoutubeRssUrl(channelId: string): string; /** * Parses an ISO 8601 duration (`PT1H2M3S`) into seconds. * Pure and SSR-safe. * * @param input - Duration string from `contentDetails.duration`. * @returns Total seconds (`0` for invalid input). */ export declare function useParseIso8601Duration(input: string): number; /** * Resolves a channel id to its `uploads` playlist id (quota cost: 1 unit). * Prefer passing `playlistId` to `useGetChannelVideos` to skip this call. * * @param channelId - Channel id (defaults to the configured one). * @returns Safe Result with the uploads playlist id. */ export declare function useGetUploadsPlaylistId(channelId?: string): Promise>; /** * Lists channel videos via the quota-cheap path * (`channels` → `playlistItems`, never `search.list` which costs 100 units). * Call server/build-time and cache the response (1h) to share quota * across every repo using the same GCP project. * * @param params - Channel/playlist, page size (1–50) and page token. * @returns Safe Result with normalized videos + pagination. */ export declare function useGetChannelVideos(params?: YoutubeListParams): Promise>; /** * Enriches videos with duration and view count (`videos.list`, 1 unit). * * @param ids - Up to 50 video ids. * @returns Safe Result with enriched videos. */ export declare function useGetVideoDetails(ids: string[]): Promise>; /** * Parses a YouTube channel RSS feed (`feeds/videos.xml`) into normalized * videos. Pure and SSR-safe — no network, no DOM parser. * * @param xml - Raw feed XML. * @returns Normalized videos (newest first, as served by the feed). */ export declare function useParseYoutubeRss(xml: string): YoutubeVideoNormalized[]; /** * Fetches the keyless channel RSS feed and parses it. Zero quota, * limited to the latest ~15 videos with basic metadata. * * @param channelId - Channel id (defaults to the configured one). * @returns Safe Result with normalized videos. */ export declare function useGetChannelVideosRss(channelId?: string): Promise>; //# sourceMappingURL=youtube.service.d.ts.map