Type Alias: TikTokResult
TikTokResult =
VideoResult|ImageResult
Defined in: src/downloader/tiktok.ts:47
Overview
The TikTokResult type alias is a union type that represents the possible results from a TikTok data retrieval operation. It can either be a VideoResult or an ImageResult.
Usage
This type alias is useful when working with functions that return media content from TikTok, allowing developers to handle different types of content in a type-safe manner.
Example
function handleTikTokResult(result: TikTokResult): void {
if ('videoUrl' in result) {
console.log(`Video URL: ${result.videoUrl}`);
} else if ('imageUrl' in result) {
console.log(`Image URL: ${result.imageUrl}`);
}
}Related Types
VideoResult: Represents a video result from TikTok with properties related to video content.ImageResult: Represents an image result from TikTok with properties related to image content.
Last updated on