Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/okikio/inthistweet. ✨ Futuristic ✨ twitter image, gif and video downloader. Enter a Tweet URL, cli inthistweet.app
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147import type { ImageColorValue, MediaDetails } from "./media.ts";
export interface TwitterCard { card_platform?: CardPlatform; name: string; url: string; binding_values: BindingValues;}
export interface CardPlatform { platform: { audience: { name: string }; device: { name: string; version: string }; };}
export interface BindingValues { unified_card?: UnifiedCard; [key: string]: BindingValue | undefined;}
export interface BindingValue { string_value?: string; image_value?: ImageValue; image_color_value?: ImageColorValue; type: "IMAGE" | "STRING" | (string & {}); scribe_key?: string; user_value?: UserValue;}
export interface UnifiedCard extends BindingValue { string_value?: string; type: "STRING"}
export interface ImageValue { height: number; width: number; url: string;}
export interface UserValue { id_str: string; path: any[];}
// Represents the main structure of the unified_card dataexport interface UnifiedCardData { layout?: LayoutData; type?: string; // Example: "mixed_media_multi_dest_carousel_website" component_objects?: ComponentObjects; destination_objects: DestinationObjects; media_entities?: MediaEntities;}
// Layout data structureexport interface LayoutData { type: string; // Example: "swipeable" data: LayoutDataDetails;}
// Specific details within the layout dataexport interface LayoutDataDetails { slides: Array<Array<string>>; // Array of arrays containing component keys}
// Component objects within the unified_cardexport interface ComponentObjects { [key: string]: ComponentObject;}
// Individual component object (e.g., media, details)export interface ComponentObject { type: string; // Example: "media" or "details" data: ComponentData;}
// Data for each component objectexport interface ComponentData { // This structure will vary based on the type of the component // For media: { id: string, destination: string } // For details: { title: { content: string, is_rtl: boolean }, ... } [key: string]: any;}
// Destination objects referenced in componentsexport interface DestinationObjects { [key: string]: DestinationObject;}
// Individual destination objectexport interface DestinationObject { type: string; // Example: "browser" data: DestinationData;}
// Data for each destination objectexport interface DestinationData { url_data: { url: string; vanity: string; }; media_id?: string; // Present in case of browser_with_docked_media type}
// Media entities mapping media IDs to media detailsexport interface MediaEntities { [key: string]: CardMediaEntity;}
// Represents a media entityexport interface CardMediaEntity { id: number; id_str: string; media_url_https: string; type: "photo" | "video" | (string & {}); // Example: "photo" or "video" original_info: { width: number; height: number; focus_rects: Array<FocusRect>; }; sizes: MediaSizes;}
// Focus rectangles for mediaexport interface FocusRect { x: number; y: number; w: number; h: number;}
// Different size variants of mediaexport interface MediaSizes { small: MediaSize; medium: MediaSize; large: MediaSize; thumb: MediaSize;}
// Represents a single media sizeexport interface MediaSize { w: number; h: number; resize: string; // Example: "fit" or "crop"}